signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class JsApiHdrsImpl { /** * Set the value of the ReplyTimeToLive field in the message header .
* Javadoc description supplied by SIBusMessage interface . */
@ Override public final void setReplyTimeToLive ( long value ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setReplyTimeToLive" , Long . valueOf ( value ) ) ; if ( ( value >= MfpConstants . MIN_TIME_TO_LIVE ) && ( value <= MfpConstants . MAX_TIME_TO_LIVE ) ) { getApi ( ) . setLongField ( JsApiAccess . REPLYTIMETOLIVE_VALUE , value ) ; } else { IllegalArgumentException e = new IllegalArgumentException ( Long . toString ( value ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setReplyTimeToLive" , e ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setReplyTimeToLive" ) ; |
public class NativeIO { /** * Get system file descriptor ( int ) from FileDescriptor object .
* @ param descriptor - FileDescriptor object to get fd from
* @ return file descriptor , - 1 or error */
public static int getfd ( FileDescriptor descriptor ) { } } | try { return field . getInt ( descriptor ) ; } catch ( IllegalArgumentException | IllegalAccessException e ) { log . warn ( "Unable to read fd field from java.io.FileDescriptor" ) ; } return - 1 ; |
public class AbstractScmMojo { /** * Load username password from settings . */
private void loadInfosFromSettings ( ScmProviderRepositoryWithHost repo ) { } } | if ( username == null || password == null ) { String host = repo . getHost ( ) ; int port = repo . getPort ( ) ; if ( port > 0 ) { host += ":" + port ; } Server server = this . settings . getServer ( host ) ; if ( server != null ) { setPasswordIfNotEmpty ( repo , decrypt ( server . getPassword ( ) , host ) ) ; setUserIfNotEmpty ( repo , server . getUsername ( ) ) ; } } |
public class SimulatorTaskTracker { /** * Records that a task attempt has completed . Ignores the event for tasks
* that got killed after the creation of the completion event .
* @ param event the TaskAttemptCompletionEvent the tracker sent to itself
* @ return the list of response events , empty */
private List < SimulatorEvent > processTaskAttemptCompletionEvent ( TaskAttemptCompletionEvent event ) { } } | if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Processing task attempt completion event" + event ) ; } long now = event . getTimeStamp ( ) ; TaskStatus finalStatus = event . getStatus ( ) ; TaskAttemptID taskID = finalStatus . getTaskID ( ) ; boolean killedEarlier = orphanTaskCompletions . remove ( taskID ) ; if ( ! killedEarlier ) { finishRunningTask ( finalStatus , now ) ; } return SimulatorEngine . EMPTY_EVENTS ; |
public class FtpMessage { /** * Check if reply code is set on this message .
* @ return */
public boolean hasReplyCode ( ) { } } | return getHeader ( FtpMessageHeaders . FTP_REPLY_CODE ) != null || Optional . ofNullable ( commandResult ) . map ( result -> StringUtils . hasText ( result . getReplyCode ( ) ) ) . orElse ( false ) ; |
public class Stream { /** * Drops elements while the { @ code IndexedPredicate } is true , then returns the rest .
* < p > This is an intermediate operation .
* < p > Example :
* < pre >
* predicate : ( index , value ) - & gt ; ( index + value ) & lt ; 5
* stream : [ 1 , 2 , 3 , 4 , 0 , 1 , 2]
* index : [ 0 , 1 , 2 , 3 , 4 , 5 , 6]
* sum : [ 1 , 3 , 5 , 7 , 4 , 6 , 8]
* result : [ 3 , 4 , 0 , 1 , 2]
* < / pre >
* @ param predicate the { @ code IndexedPredicate } used to drop elements
* @ return the new stream
* @ since 1.1.6 */
@ NotNull public Stream < T > dropWhileIndexed ( @ NotNull IndexedPredicate < ? super T > predicate ) { } } | return dropWhileIndexed ( 0 , 1 , predicate ) ; |
public class X509CertImpl { /** * Get issuer name as X500Principal . Overrides implementation in
* X509Certificate with a slightly more efficient version that is
* also aware of X509CertImpl mutability . */
public X500Principal getIssuerX500Principal ( ) { } } | if ( info == null ) { return null ; } try { X500Principal issuer = ( X500Principal ) info . get ( X509CertInfo . ISSUER + DOT + "x500principal" ) ; return issuer ; } catch ( Exception e ) { return null ; } |
public class RepositoryConfiguration { /** * Read the supplied JSON file and parse into a { @ link RepositoryConfiguration } .
* @ param file the file ; may not be null
* @ return the parsed repository configuration ; never null
* @ throws ParsingException if the content could not be parsed as a valid JSON document
* @ throws FileNotFoundException if the file could not be found */
public static RepositoryConfiguration read ( File file ) throws ParsingException , FileNotFoundException { } } | CheckArg . isNotNull ( file , "file" ) ; Document doc = Json . read ( new FileInputStream ( file ) ) ; return new RepositoryConfiguration ( doc , withoutExtension ( file . getName ( ) ) ) ; |
public class TxXATerminator { /** * / * ( non - Javadoc )
* @ see javax . resource . spi . XATerminator # rollback ( javax . transaction . xa . Xid ) */
public void rollback ( Xid xid ) throws XAException { } } | if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "rollback" , xid ) ; final JCATranWrapper txWrapper ; try { validateXid ( xid ) ; // Get the wrapper adding an association in the process
txWrapper = getTxWrapper ( xid , true ) ; } catch ( XAException e ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "rollback" , "caught XAException: " + XAReturnCodeHelper . convertXACode ( e . errorCode ) ) ; throw e ; } try { txWrapper . rollback ( ) ; } catch ( XAException e ) { TxExecutionContextHandler . removeAssociation ( txWrapper ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "rollback" , "rethrowing XAException: " + XAReturnCodeHelper . convertXACode ( e . errorCode ) ) ; throw e ; } TxExecutionContextHandler . removeAssociation ( txWrapper ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "rollback" ) ; |
public class CPDefinitionOptionValueRelModelImpl { /** * Converts the soap model instances into normal model instances .
* @ param soapModels the soap model instances to convert
* @ return the normal model instances */
public static List < CPDefinitionOptionValueRel > toModels ( CPDefinitionOptionValueRelSoap [ ] soapModels ) { } } | if ( soapModels == null ) { return null ; } List < CPDefinitionOptionValueRel > models = new ArrayList < CPDefinitionOptionValueRel > ( soapModels . length ) ; for ( CPDefinitionOptionValueRelSoap soapModel : soapModels ) { models . add ( toModel ( soapModel ) ) ; } return models ; |
public class NodeDispatchStepExecutor { /** * Return the DispatcherResult from a StepExecutionResult created by this class .
* @ param result step result
* @ return dispatcher result */
public static DispatcherResult extractDispatcherResult ( final StepExecutionResult result ) { } } | Optional < NodeDispatchStepExecutorResult > extracted = extractNodeDispatchStepExecutorResult ( result ) ; if ( ! extracted . isPresent ( ) ) { throw new IllegalArgumentException ( "Cannot extract result: unexpected type: " + result ) ; } return extracted . get ( ) . getDispatcherResult ( ) ; |
public class StringUtil { /** * Checks whether a { @ link String } seams to be an expression or not
* @ param text the text to check
* @ return true if the text seams to be an expression false otherwise */
public static boolean isExpression ( String text ) { } } | if ( text == null ) { return false ; } text = text . trim ( ) ; return text . startsWith ( "${" ) || text . startsWith ( "#{" ) ; |
public class JDBCIdentityValidator { /** * Creates the appropriate jdbc client .
* @ param context
* @ param config */
private IJdbcClient createClient ( IPolicyContext context , JDBCIdentitySource config ) throws Throwable { } } | IJdbcComponent jdbcComponent = context . getComponent ( IJdbcComponent . class ) ; if ( config . getType ( ) == JDBCType . datasource || config . getType ( ) == null ) { DataSource ds = lookupDatasource ( config ) ; return jdbcComponent . create ( ds ) ; } if ( config . getType ( ) == JDBCType . url ) { JdbcOptionsBean options = new JdbcOptionsBean ( ) ; options . setJdbcUrl ( config . getJdbcUrl ( ) ) ; options . setUsername ( config . getUsername ( ) ) ; options . setPassword ( config . getPassword ( ) ) ; options . setAutoCommit ( true ) ; return jdbcComponent . createStandalone ( options ) ; } throw new Exception ( "Unknown JDBC options." ) ; // $ NON - NLS - 1 $ |
public class ExpressionTree { /** * Gets all of the expressions contained in this tree and
* its subtrees .
* @ param accumulator */
public void getAllExpressionNodes ( Collection < ExpressionNode > accumulator ) { } } | accumulator . add ( getExpressionNode ( ) ) ; for ( int i = 0 ; i < substitutions . size ( ) ; i ++ ) { substitutions . get ( i ) . getAllExpressionNodes ( accumulator ) ; } for ( int i = 0 ; i < lefts . size ( ) ; i ++ ) { lefts . get ( i ) . getAllExpressionNodes ( accumulator ) ; rights . get ( i ) . getAllExpressionNodes ( accumulator ) ; } |
public class GlobalAjaxInvoker { /** * Set the global invoker to be used . This can be changed during the runtime
* of the application and is independent of the registry state . Use this to
* e . g . increase the debug logging or tracing of the invocations .
* @ param aInvoker
* The invoker to be used . May not be < code > null < / code > . */
@ Nonnull public void setInvoker ( @ Nonnull final IAjaxInvoker aInvoker ) { } } | ValueEnforcer . notNull ( aInvoker , "Invoker" ) ; m_aRWLock . writeLocked ( ( ) -> m_aInvoker = aInvoker ) ; |
public class ViewHandler { /** * Main dispatch method for a query parse cycle .
* @ param last if the given content chunk is the last one . */
private void parseQueryResponse ( boolean last ) { } } | if ( viewParsingState == QUERY_STATE_INITIAL ) { parseViewInitial ( ) ; } if ( viewParsingState == QUERY_STATE_INFO ) { parseViewInfo ( ) ; } if ( viewParsingState == QUERY_STATE_ROWS ) { parseViewRows ( last ) ; } if ( viewParsingState == QUERY_STATE_ERROR ) { parseViewError ( last ) ; } if ( viewParsingState == QUERY_STATE_DONE ) { cleanupViewStates ( ) ; } |
public class EndpointLocationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( EndpointLocation endpointLocation , ProtocolMarshaller protocolMarshaller ) { } } | if ( endpointLocation == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( endpointLocation . getCity ( ) , CITY_BINDING ) ; protocolMarshaller . marshall ( endpointLocation . getCountry ( ) , COUNTRY_BINDING ) ; protocolMarshaller . marshall ( endpointLocation . getLatitude ( ) , LATITUDE_BINDING ) ; protocolMarshaller . marshall ( endpointLocation . getLongitude ( ) , LONGITUDE_BINDING ) ; protocolMarshaller . marshall ( endpointLocation . getPostalCode ( ) , POSTALCODE_BINDING ) ; protocolMarshaller . marshall ( endpointLocation . getRegion ( ) , REGION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class SimpleDateFormatCLA { /** * { @ inheritDoc } */
@ Override protected void exportCommandLineData ( final StringBuilder out , final int occ ) { } } | uncompileQuoter ( out , getValue ( occ ) . pattern ) ; |
public class LocalTrustGraph { /** * add bidirectioanl trust graph links between two nodes .
* @ param a node that will form a trust link with ' b '
* @ param b node that will form a trust link with ' a ' */
public void addRoute ( final LocalTrustGraphNode a , final LocalTrustGraphNode b ) { } } | addDirectedRoute ( a , b ) ; addDirectedRoute ( b , a ) ; |
public class FunctionAnnotation { /** * Reads the annotations of a user defined function with two inputs and returns semantic properties according to the forwarded fields annotated .
* @ param udfClass The user defined function , represented by its class .
* @ returnThe DualInputSemanticProperties containing the forwarded fields . */
@ Internal public static Set < Annotation > readDualForwardAnnotations ( Class < ? > udfClass ) { } } | // get readSet annotation from stub
ForwardedFieldsFirst forwardedFields1 = udfClass . getAnnotation ( ForwardedFieldsFirst . class ) ; ForwardedFieldsSecond forwardedFields2 = udfClass . getAnnotation ( ForwardedFieldsSecond . class ) ; // get readSet annotation from stub
NonForwardedFieldsFirst nonForwardedFields1 = udfClass . getAnnotation ( NonForwardedFieldsFirst . class ) ; NonForwardedFieldsSecond nonForwardedFields2 = udfClass . getAnnotation ( NonForwardedFieldsSecond . class ) ; ReadFieldsFirst readSet1 = udfClass . getAnnotation ( ReadFieldsFirst . class ) ; ReadFieldsSecond readSet2 = udfClass . getAnnotation ( ReadFieldsSecond . class ) ; Set < Annotation > annotations = new HashSet < Annotation > ( ) ; if ( nonForwardedFields1 != null && forwardedFields1 != null ) { throw new InvalidProgramException ( "Either " + ForwardedFieldsFirst . class . getSimpleName ( ) + " or " + NonForwardedFieldsFirst . class . getSimpleName ( ) + " can be annotated to a function, not both." ) ; } else if ( forwardedFields1 != null ) { annotations . add ( forwardedFields1 ) ; } else if ( nonForwardedFields1 != null ) { annotations . add ( nonForwardedFields1 ) ; } if ( forwardedFields2 != null && nonForwardedFields2 != null ) { throw new InvalidProgramException ( "Either " + ForwardedFieldsSecond . class . getSimpleName ( ) + " or " + NonForwardedFieldsSecond . class . getSimpleName ( ) + " can be annotated to a function, not both." ) ; } else if ( forwardedFields2 != null ) { annotations . add ( forwardedFields2 ) ; } else if ( nonForwardedFields2 != null ) { annotations . add ( nonForwardedFields2 ) ; } if ( readSet1 != null ) { annotations . add ( readSet1 ) ; } if ( readSet2 != null ) { annotations . add ( readSet2 ) ; } return ! annotations . isEmpty ( ) ? annotations : null ; |
public class KernelDeviceProfile { /** * Elapsed time for a single event only and for the last thread that finished executing a kernel ,
* i . e . single event only - since the previous stage rather than from the start .
* @ param stage the event stage */
public double getElapsedTimeLastThread ( int stage ) { } } | if ( stage == ProfilingEvent . START . ordinal ( ) ) { return 0 ; } Accumulator acc = lastAccumulator . get ( ) ; return acc == null ? Double . NaN : ( acc . currentTimes [ stage ] - acc . currentTimes [ stage - 1 ] ) / MILLION ; |
public class RecycleManager { /** * Will recycle the provided widgets ( @ link widgets } with provided { @ link RecyclePosition } */
public void recycle ( RecyclePosition position ) { } } | stubCount = determineStubCount ( ) ; switch ( position ) { case BOTTOM : if ( hasRecycledWidgets ( ) ) { // Will remove the current recycled widgets
remove ( getRecycledWidgets ( ) . stream ( ) . skip ( 0 ) . limit ( ( parent . getLimit ( ) * ( currentIndex + 1 ) ) - stubCount ) . collect ( Collectors . toList ( ) ) ) ; currentIndex ++ ; // Will determine if the current index is greater than the load index then we need to recycle the next
// set of recycled widgets
if ( currentIndex < loadIndex ) { add ( getRecycledWidgets ( currentIndex ) ) ; } } break ; case TOP : if ( currentIndex > 0 ) { // Will remove the current recycled widgets
remove ( getRecycledWidgets ( currentIndex ) ) ; // Will add the previous recycled widgets
int skip = ( ( parent . getLimit ( ) * currentIndex ) - parent . getLimit ( ) ) - stubCount ; insert ( getRecycledWidgets ( ) . stream ( ) . skip ( skip < 0 ? 0 : skip ) . limit ( parent . getLimit ( ) ) . collect ( Collectors . toList ( ) ) ) ; currentIndex -- ; } break ; } |
public class ComponentListViewFxmlController { /** * You should not need to care about this method . In the unlikely case where you actually want all the cells of your
* ListView to actually be the same one , it is left protected and not private so you can override it and avoid the
* warnings being spouted at you .
* Else , the idea is that a set of cells is created and they share the elements one after another during scrolling
* and JavaFX might generate more of them later so we should just not make any assumption and expect all of them to
* be different and not singletons . */
protected void findBadlyScopedComponents ( ) { } } | synchronized ( HAS_CHECKED_BEAN_DEFINITIONS ) { if ( HAS_CHECKED_BEAN_DEFINITIONS . get ( ) ) { return ; } final ConfigurableListableBeanFactory beanFactory = applicationContext . getBeanFactory ( ) ; Stream . of ( ComponentCellFxmlController . class , ComponentListCell . class ) . map ( beanFactory :: getBeanNamesForType ) . flatMap ( Arrays :: stream ) . filter ( beanName -> { final String effectiveScope = beanFactory . getBeanDefinition ( beanName ) . getScope ( ) ; return ! ConfigurableBeanFactory . SCOPE_PROTOTYPE . equals ( effectiveScope ) ; } ) . forEach ( BADLY_SCOPED_BEANS :: add ) ; HAS_CHECKED_BEAN_DEFINITIONS . set ( true ) ; if ( BADLY_SCOPED_BEANS . isEmpty ( ) ) { return ; } final String faulties = String . join ( "," , BADLY_SCOPED_BEANS ) ; LOG . warn ( "Custom ListView cells wrappers and controllers " + "should be prototype-scoped bean. " + "See @Scope annotation.\n" + "Faulty beans were : [{}]" , faulties ) ; } |
public class DoubleMomentStatistics { /** * Combine two { @ code DoubleMoments } statistic objects .
* @ param other the other { @ code DoubleMoments } statistics to combine with
* { @ code this } one .
* @ return { @ code this } statistics object
* @ throws java . lang . NullPointerException if the other statistical summary
* is { @ code null } . */
public DoubleMomentStatistics combine ( final DoubleMomentStatistics other ) { } } | super . combine ( other ) ; _min = Math . min ( _min , other . _min ) ; _max = Math . max ( _max , other . _max ) ; _sum . add ( other . _sum ) ; return this ; |
public class Humanize { /** * Matches a pace ( value and interval ) with a logical time frame . Very
* useful for slow paces .
* @ param value
* The number of occurrences within the specified interval
* @ param params
* The pace format parameterization
* @ return an human readable textual representation of the pace */
public static String paceFormat ( final Number value , final PaceParameters params ) { } } | params . checkArguments ( ) ; Pace args = pace ( value , params . interval ) ; ResourceBundle bundle = context . get ( ) . getBundle ( ) ; String accuracy = bundle . getString ( args . getAccuracy ( ) ) ; String timeUnit = bundle . getString ( args . getTimeUnit ( ) ) ; params . exts ( accuracy , timeUnit ) ; return capitalize ( pluralize ( args . getValue ( ) , params . plural ) ) ; |
public class PackageSummaryBuilder { /** * Build the summary for the enums in this package .
* @ param node the XML element that specifies which components to document
* @ param summaryContentTree the summary tree to which the enum summary will
* be added */
public void buildEnumSummary ( XMLNode node , Content summaryContentTree ) { } } | String enumTableSummary = configuration . getText ( "doclet.Member_Table_Summary" , configuration . getText ( "doclet.Enum_Summary" ) , configuration . getText ( "doclet.enums" ) ) ; List < String > enumTableHeader = Arrays . asList ( configuration . getText ( "doclet.Enum" ) , configuration . getText ( "doclet.Description" ) ) ; SortedSet < TypeElement > elist = utils . isSpecified ( packageElement ) ? utils . getTypeElementsAsSortedSet ( utils . getEnums ( packageElement ) ) : configuration . typeElementCatalog . enums ( packageElement ) ; SortedSet < TypeElement > enums = utils . filterOutPrivateClasses ( elist , configuration . javafx ) ; if ( ! enums . isEmpty ( ) ) { packageWriter . addClassesSummary ( enums , configuration . getText ( "doclet.Enum_Summary" ) , enumTableSummary , enumTableHeader , summaryContentTree ) ; } |
public class NonBlockingByteArrayOutputStream { /** * Reads the given { @ link InputStream } completely into the buffer .
* @ param aIS
* the InputStream to read from . May not be < code > null < / code > . Is not
* closed internally .
* @ throws IOException
* If reading fails */
public void readFrom ( @ Nonnull @ WillNotClose final InputStream aIS ) throws IOException { } } | while ( true ) { if ( m_nCount == m_aBuf . length ) { // reallocate
m_aBuf = _enlarge ( m_aBuf , m_aBuf . length << 1 ) ; } final int nBytesRead = aIS . read ( m_aBuf , m_nCount , m_aBuf . length - m_nCount ) ; if ( nBytesRead < 0 ) return ; m_nCount += nBytesRead ; } |
public class HashedArrayTree { /** * Adds the specified element at the position just before the specified
* index .
* @ param index The index just before which to insert .
* @ param elem The value to insert
* @ throws IndexOutOfBoundsException if the index is invalid . */
@ Override public void add ( int index , T elem ) { } } | /* Confirm the validity of the index . */
if ( index < 0 || index >= size ( ) ) throw new IndexOutOfBoundsException ( "Index " + index + ", size " + size ( ) ) ; /* Add a dummy element to ensure that everything resizes correctly .
* There ' s no reason to repeat the logic . */
add ( null ) ; /* Next , we need to shuffle down every element that appears after
* the inserted element . We ' ll do this using our own public interface . */
for ( int i = size ( ) ; i > index ; ++ i ) set ( i , get ( i - 1 ) ) ; /* Finally , write the element . */
set ( index , elem ) ; |
public class Configurator { /** * The configuration string has a number of entries , separated by a ' : ' ( colon ) .
* Each entry consists of the name of the protocol , followed by an optional configuration
* of that protocol . The configuration is enclosed in parentheses , and contains entries
* which are name / value pairs connected with an assignment sign ( = ) and separated by
* a semicolon .
* < pre > UDP ( in _ port = 5555 ; out _ port = 4445 ) : FRAG ( frag _ size = 1024 ) < / pre > < p >
* The < em > first < / em > entry defines the < em > bottommost < / em > layer , the string is parsed
* left to right and the protocol stack constructed bottom up . Example : the string
* " UDP ( in _ port = 5555 ) : FRAG ( frag _ size = 32000 ) : DEBUG " results is the following stack : < pre >
* | DEBUG |
* | FRAG frag _ size = 32000 |
* | UDP in _ port = 32000 |
* < / pre > */
public static Protocol setupProtocolStack ( List < ProtocolConfiguration > protocol_configs , ProtocolStack st ) throws Exception { } } | List < Protocol > protocols = createProtocols ( protocol_configs , st ) ; if ( protocols == null ) return null ; // check InetAddress related features of stack
Map < String , Map < String , InetAddressInfo > > inetAddressMap = createInetAddressMap ( protocol_configs , protocols ) ; Collection < InetAddress > addrs = getAddresses ( inetAddressMap ) ; StackType ip_version = Util . getIpStackType ( ) ; if ( ! addrs . isEmpty ( ) ) { // check that all user - supplied InetAddresses have a consistent version :
// 1 . If an addr is IPv6 and we have an IPv4 stack * only * - - > FAIL
for ( InetAddress addr : addrs ) { if ( addr instanceof Inet6Address && ip_version == StackType . IPv4 && ! Util . isIpv6StackAvailable ( ) ) throw new IllegalArgumentException ( "found IPv6 address " + addr + " in an IPv4-only stack" ) ; // if ( addr instanceof Inet4Address & & addr . isMulticastAddress ( ) & & ip _ version = = StackType . IPv6)
// throw new Exception ( " found IPv4 multicast address " + addr + " in an IPv6 stack " ) ;
} } // process default values
setDefaultValues ( protocol_configs , protocols , ip_version ) ; ensureValidBindAddresses ( protocols ) ; // Fixes NPE with concurrent channel creation when using a shared stack ( https : / / issues . jboss . org / browse / JGRP - 1488)
Protocol top_protocol = protocols . get ( protocols . size ( ) - 1 ) ; top_protocol . setUpProtocol ( st ) ; return connectProtocols ( protocols ) ; |
public class EclipseProductLocation { /** * Uninstalls lombok from this location .
* It ' s a no - op if lombok wasn ' t there in the first place ,
* and it will remove a half - succeeded lombok installation as well .
* @ throws UninstallException
* If there ' s an obvious I / O problem that is preventing
* installation . bugs in the uninstall code will probably throw
* other exceptions ; this is intentional . */
@ Override public void uninstall ( ) throws UninstallException { } } | final List < File > lombokJarsForWhichCantDeleteSelf = new ArrayList < File > ( ) ; StringBuilder newContents = new StringBuilder ( ) ; if ( eclipseIniPath . exists ( ) ) { try { FileInputStream fis = new FileInputStream ( eclipseIniPath ) ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( fis ) ) ; String line ; while ( ( line = br . readLine ( ) ) != null ) { if ( JAVA_AGENT_LINE_MATCHER . matcher ( line ) . matches ( ) ) continue ; Matcher m = BOOTCLASSPATH_LINE_MATCHER . matcher ( line ) ; if ( m . matches ( ) ) { StringBuilder elemBuilder = new StringBuilder ( ) ; elemBuilder . append ( "-Xbootclasspath/a:" ) ; boolean first = true ; for ( String elem : m . group ( 1 ) . split ( Pattern . quote ( File . pathSeparator ) ) ) { if ( elem . toLowerCase ( ) . endsWith ( "lombok.jar" ) ) continue ; /* legacy code - see previous comment that starts with ' legacy ' */
{ if ( elem . toLowerCase ( ) . endsWith ( "lombok.eclipse.agent.jar" ) ) continue ; } if ( first ) first = false ; else elemBuilder . append ( File . pathSeparator ) ; elemBuilder . append ( elem ) ; } if ( ! first ) newContents . append ( elemBuilder . toString ( ) ) . append ( OS_NEWLINE ) ; continue ; } newContents . append ( line ) . append ( OS_NEWLINE ) ; } br . close ( ) ; } finally { fis . close ( ) ; } FileOutputStream fos = new FileOutputStream ( eclipseIniPath ) ; try { fos . write ( newContents . toString ( ) . getBytes ( ) ) ; } finally { fos . close ( ) ; } } catch ( IOException e ) { throw new UninstallException ( "Cannot uninstall lombok from " + name + generateWriteErrorMessage ( ) , e ) ; } } for ( File dir : getUninstallDirs ( ) ) { File lombokJar = new File ( dir , "lombok.jar" ) ; if ( lombokJar . exists ( ) ) { if ( ! lombokJar . delete ( ) ) { if ( OsUtils . getOS ( ) == OsUtils . OS . WINDOWS && Installer . isSelf ( lombokJar . getAbsolutePath ( ) ) ) { lombokJarsForWhichCantDeleteSelf . add ( lombokJar ) ; } else { throw new UninstallException ( "Can't delete " + lombokJar . getAbsolutePath ( ) + generateWriteErrorMessage ( ) , null ) ; } } } /* legacy code - lombok at one point used to have a separate jar for the eclipse agent .
* Leave this code in to delete it for those upgrading from an old version . */
{ File agentJar = new File ( dir , "lombok.eclipse.agent.jar" ) ; if ( agentJar . exists ( ) ) { agentJar . delete ( ) ; } } } if ( ! lombokJarsForWhichCantDeleteSelf . isEmpty ( ) ) { throw new UninstallException ( true , String . format ( "lombok.jar cannot delete itself on windows.\nHowever, lombok has been uncoupled from your %s.\n" + "You can safely delete this jar file. You can find it at:\n%s" , descriptor . getProductName ( ) , lombokJarsForWhichCantDeleteSelf . get ( 0 ) . getAbsolutePath ( ) ) , null ) ; } |
public class MeshHeading { /** * setter for descriptorName - sets see MeSH
* @ generated
* @ param v value to set into the feature */
public void setDescriptorName ( String v ) { } } | if ( MeshHeading_Type . featOkTst && ( ( MeshHeading_Type ) jcasType ) . casFeat_descriptorName == null ) jcasType . jcas . throwFeatMissing ( "descriptorName" , "de.julielab.jules.types.MeshHeading" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( MeshHeading_Type ) jcasType ) . casFeatCode_descriptorName , v ) ; |
public class SetMultimap { /** * Creates a new instance backed by a { @ link ConcurrentHashMap } and synchronized { @ link HashSet } . */
public static < K , V > SetMultimap < K , V > newConcurrentSetMultimap ( Supplier < Set < V > > valueSupplier ) { } } | return new SetMultimap < K , V > ( ConcurrentHashMap :: new , valueSupplier , null ) ; |
public class ModbusRequest { /** * Updates the response with the header information to match the request
* @ param response Response to update
* @ param ignoreFunctionCode True if the function code should stay unmolested
* @ return Updated response */
ModbusResponse updateResponseWithHeader ( ModbusResponse response , boolean ignoreFunctionCode ) { } } | // transfer header data
response . setHeadless ( isHeadless ( ) ) ; if ( ! isHeadless ( ) ) { response . setTransactionID ( getTransactionID ( ) ) ; response . setProtocolID ( getProtocolID ( ) ) ; } else { response . setHeadless ( ) ; } response . setUnitID ( getUnitID ( ) ) ; if ( ! ignoreFunctionCode ) { response . setFunctionCode ( getFunctionCode ( ) ) ; } return response ; |
public class JaspiServiceImpl { /** * Some comment why we ' re doing this */
private AuthConfigProvider getAuthConfigProvider ( String appContext ) { } } | AuthConfigProvider provider = null ; AuthConfigFactory providerFactory = getAuthConfigFactory ( ) ; if ( providerFactory != null ) { if ( providerConfigModified && providerFactory instanceof ProviderRegistry ) { ( ( ProviderRegistry ) providerFactory ) . setProvider ( jaspiProviderServiceRef . getService ( ) ) ; providerConfigModified = false ; } provider = providerFactory . getConfigProvider ( "HttpServlet" , appContext , ( RegistrationListener ) null ) ; } return provider ; |
public class DescribeMovingAddressesRequest { /** * One or more Elastic IP addresses .
* @ param publicIps
* One or more Elastic IP addresses . */
public void setPublicIps ( java . util . Collection < String > publicIps ) { } } | if ( publicIps == null ) { this . publicIps = null ; return ; } this . publicIps = new com . amazonaws . internal . SdkInternalList < String > ( publicIps ) ; |
public class EvolvingImages { /** * GEN - LAST : event _ saveButtonActionPerformed */
private void onNewResult ( final EvolutionResult < PolygonGene , Double > current , final EvolutionResult < PolygonGene , Double > best ) { } } | invokeLater ( ( ) -> { final Genotype < PolygonGene > gt = best . getBestPhenotype ( ) . getGenotype ( ) ; bestEvolutionResultPanel . update ( best ) ; currentevolutionResultPanel . update ( current ) ; _polygonPanel . setChromosome ( ( PolygonChromosome ) gt . getChromosome ( ) ) ; _polygonPanel . repaint ( ) ; } ) ; |
public class BTreeBalancePolicy { /** * Is invoked on the leaf deletion only .
* @ param left left page .
* @ param right right page .
* @ return true if the left page ought to be merged with the right one . */
public boolean needMerge ( @ NotNull final BasePage left , @ NotNull final BasePage right ) { } } | final int leftSize = left . getSize ( ) ; final int rightSize = right . getSize ( ) ; return leftSize == 0 || rightSize == 0 || leftSize + rightSize <= ( ( ( isDupTree ( left ) ? getDupPageMaxSize ( ) : getPageMaxSize ( ) ) * 7 ) >> 3 ) ; |
public class SPX { /** * / * [ deutsch ]
* < p > Implementierungsmethode des Interface { @ link Externalizable } . < / p >
* @ param in input stream
* @ throws IOException in any case of IO - failures
* @ throws ClassNotFoundException if class loading fails */
@ Override public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } } | byte header = in . readByte ( ) ; switch ( header ) { case FRENCH_REV : this . obj = this . readFrenchRev ( in ) ; break ; default : throw new InvalidObjectException ( "Unknown calendar type." ) ; } |
public class JoynrRuntimeImpl { /** * Registers a provider in the joynr framework by JEE
* @ param domain
* The domain the provider should be registered for . Has to be identical at the client to be able to find
* the provider .
* @ param provider
* Instance of the provider implementation ( has to extend a generated . . . AbstractProvider ) .
* @ param providerQos
* the provider ' s quality of service settings
* @ param awaitGlobalRegistration
* If true , wait for global registration to complete or timeout , if required .
* @ param interfaceClass
* The interface class of the provider .
* @ return Returns a Future which can be used to check the registration status . */
@ Override public Future < Void > registerProvider ( String domain , Object provider , ProviderQos providerQos , boolean awaitGlobalRegistration , final Class < ? > interfaceClass ) { } } | if ( interfaceClass == null ) { throw new IllegalArgumentException ( "Cannot registerProvider: interfaceClass may not be NULL" ) ; } registerInterfaceClassTypes ( interfaceClass , "Cannot registerProvider" ) ; return capabilitiesRegistrar . registerProvider ( domain , provider , providerQos , awaitGlobalRegistration ) ; |
public class UpdatableResultSet { /** * { inheritDoc } . */
public void updateShort ( int columnIndex , short value ) throws SQLException { } } | checkUpdatable ( columnIndex ) ; parameterHolders [ columnIndex - 1 ] = new ShortParameter ( value ) ; |
public class MultiMap { /** * Add value to multi valued entry . If the entry is single valued , it is
* converted to the first value of a multi valued entry .
* @ param name The entry key .
* @ param value The entry value . */
public void add ( String name , V value ) { } } | List < V > lo = get ( name ) ; if ( lo == null ) { lo = new ArrayList < > ( ) ; } lo . add ( value ) ; super . put ( name , lo ) ; |
public class ProfilingTimer { /** * Writes one profiling line of information to the log */
private static void writeToLog ( int level , long totalNanos , long count , ProfilingTimerNode parent , String taskName , Log log , String logAppendMessage ) { } } | if ( log == null ) { return ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < level ; i ++ ) { sb . append ( '\t' ) ; } String durationText = String . format ( "%s%s" , formatElapsed ( totalNanos ) , count == 1 ? "" : String . format ( " across %d invocations, average: %s" , count , formatElapsed ( totalNanos / count ) ) ) ; String text = parent == null ? String . format ( "total time %s" , durationText ) : String . format ( "[%s] took %s" , taskName , durationText ) ; sb . append ( text ) ; sb . append ( logAppendMessage ) ; log . info ( sb . toString ( ) ) ; |
public class RDBMSLinkDatabase { /** * = = = = = DATABASE TYPES */
private static DatabaseType getDatabaseType ( String dbtype ) { } } | if ( dbtype . equals ( "h2" ) ) return DatabaseType . H2 ; else if ( dbtype . equals ( "oracle" ) ) return DatabaseType . ORACLE ; else if ( dbtype . equals ( "mysql" ) ) return DatabaseType . MYSQL ; else throw new DukeConfigException ( "Unknown database type: '" + dbtype + "'" ) ; |
public class AT_Context { /** * Sets the left and right frame margin character .
* @ param frameLeft character
* @ param frameRight character
* @ return this to allow chaining */
public AT_Context setFrameLeftRightChar ( Character frameLeft , Character frameRight ) { } } | if ( frameLeft != null && frameRight != null ) { this . frameLeftChar = frameLeft ; this . frameRightChar = frameRight ; } return this ; |
public class ProxyQueueConversationGroupImpl { /** * begin D179183 */
public void closeNotification ( ) throws SIResourceException , SIConnectionLostException , SIErrorException , SIConnectionDroppedException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "closeNotification" ) ; // Determine if we need to actually perform the close ( we might already be closed ) .
// This needs to be synchronized to avoid a race condition into close .
LinkedList < ProxyQueue > closeList = null ; synchronized ( this ) { if ( ! closed ) { // Mark ourself as closed .
closed = true ; // Make a copy of the map ' s values to avoid a concurrent modification
// exception later . Then clear the map .
closeList = new LinkedList < ProxyQueue > ( ) ; closeList . addAll ( idToProxyQueueMap . values ( ) ) ; } } // If we actually carried out a close operation then closeList will
// be non - null .
if ( closeList != null ) { // Close each proxy queue in turn . This is not synchronized with this
// objects monitor to avoid the deadlock described above .
SIException caughtException = null ; Iterator iterator = closeList . iterator ( ) ; while ( iterator . hasNext ( ) ) { ProxyQueue queue = ( ProxyQueue ) iterator . next ( ) ; try { if ( queue . getDestinationSessionProxy ( ) instanceof ConsumerSessionProxy ) ( ( ConsumerSessionProxy ) queue . getDestinationSessionProxy ( ) ) . close ( true ) ; else queue . getDestinationSessionProxy ( ) . close ( ) ; } catch ( SIException e ) { // No FFDC code needed .
caughtException = e ; } } // If we caught an exception when closing one of the proxy queues , report it
// by throwing an exception of our own , linking one of the exceptions we caught .
if ( caughtException != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "exception caught when closing queues" ) ; SIConnectionLostException closeException = new SIConnectionLostException ( nls . getFormattedMessage ( "ERROR_CLOSING_PROXYQUEUE_GROUP_SICO1025" , new Object [ ] { caughtException } , null ) // d192293
) ; closeException . initCause ( caughtException ) ; throw closeException ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "closeNotification" ) ; |
public class VfsTreeAction { /** * It transforms FileObject into JsTreeNodeData .
* @ param file the file whose information will be encapsulated in the node data structure .
* @ returnThe node data structure which presents the file .
* @ throws FileSystemException */
protected JsTreeNodeData populateTreeNodeData ( FileObject file , boolean noChild , String relativePath ) throws FileSystemException { } } | JsTreeNodeData node = new JsTreeNodeData ( ) ; String baseName = file . getName ( ) . getBaseName ( ) ; FileContent content = file . getContent ( ) ; FileType type = file . getType ( ) ; node . setData ( baseName ) ; Map < String , Object > attr = new HashMap < String , Object > ( ) ; node . setAttr ( attr ) ; attr . put ( "id" , relativePath ) ; attr . put ( "rel" , type . getName ( ) ) ; attr . put ( "fileType" , type . getName ( ) ) ; if ( content != null ) { long fileLastModifiedTime = file . getContent ( ) . getLastModifiedTime ( ) ; attr . put ( "fileLastModifiedTime" , fileLastModifiedTime ) ; attr . put ( "fileLastModifiedTimeForDisplay" , DateFormat . getDateTimeInstance ( ) . format ( new Date ( fileLastModifiedTime ) ) ) ; if ( file . getType ( ) != FileType . FOLDER ) { attr . put ( "fileSize" , content . getSize ( ) ) ; attr . put ( "fileSizeForDisplay" , FileUtils . byteCountToDisplaySize ( content . getSize ( ) ) ) ; } } // these fields should not appear in JSON for leaf nodes
if ( ! noChild ) { node . setState ( JsTreeNodeData . STATE_CLOSED ) ; } return node ; |
public class Validate { /** * < p > Validate that the specified argument character sequence is
* neither { @ code null } , a length of zero ( no characters ) , empty
* nor whitespace ; otherwise throwing an exception with the specified
* message .
* < pre > Validate . notBlank ( myString , " The string must not be blank " ) ; < / pre >
* @ param < T > the character sequence type
* @ param chars the character sequence to check , validated not null by this method
* @ param message the { @ link String # format ( String , Object . . . ) } exception message if invalid , not null
* @ param values the optional values for the formatted exception message , null array not recommended
* @ return the validated character sequence ( never { @ code null } method for chaining )
* @ throws NullPointerException if the character sequence is { @ code null }
* @ throws IllegalArgumentException if the character sequence is blank
* @ see # notBlank ( CharSequence )
* @ since 3.0 */
public static < T extends CharSequence > T notBlank ( final T chars , final String message , final Object ... values ) { } } | if ( chars == null ) { throw new NullPointerException ( StringUtils . simpleFormat ( message , values ) ) ; } if ( StringUtils . isBlank ( chars ) ) { throw new IllegalArgumentException ( StringUtils . simpleFormat ( message , values ) ) ; } return chars ; |
public class RtfProperty { /** * Toggle the value of the property identified by the < code > RtfCtrlWordData . specialHandler < / code > parameter .
* Toggle values are assumed to be integer values per the RTF spec with a value of 0 = off or 1 = on .
* @ param ctrlWordData The property name to set
* @ return < code > true < / code > for handled or < code > false < / code > if < code > propertyName < / code > is < code > null < / code > or < i > blank < / i > */
public boolean toggleProperty ( RtfCtrlWordData ctrlWordData ) { } } | // String propertyName ) {
String propertyName = ctrlWordData . specialHandler ; if ( propertyName == null || propertyName . length ( ) == 0 ) return false ; Object propertyValue = getProperty ( propertyName ) ; if ( propertyValue == null ) { propertyValue = Integer . valueOf ( RtfProperty . ON ) ; } else { if ( propertyValue instanceof Integer ) { int value = ( ( Integer ) propertyValue ) . intValue ( ) ; if ( value != 0 ) { removeProperty ( propertyName ) ; } return true ; } else { if ( propertyValue instanceof Long ) { long value = ( ( Long ) propertyValue ) . intValue ( ) ; if ( value != 0 ) { removeProperty ( propertyName ) ; } return true ; } } } setProperty ( propertyName , propertyValue ) ; return true ; |
public class AbstractConversionFilter { /** * A standard implementation of the filter process . First of all , all suitable
* representations are found . Then ( if { @ link # prepareStart } returns true ) ,
* the data is processed read - only in a first pass .
* In the main pass , each object is then filtered using
* { @ link # filterSingleObject } .
* @ param objects Objects to filter
* @ return Filtered bundle */
@ Override public MultipleObjectsBundle filter ( MultipleObjectsBundle objects ) { } } | if ( objects . dataLength ( ) == 0 ) { return objects ; } MultipleObjectsBundle bundle = new MultipleObjectsBundle ( ) ; final Logging logger = getLogger ( ) ; for ( int r = 0 ; r < objects . metaLength ( ) ; r ++ ) { @ SuppressWarnings ( "unchecked" ) SimpleTypeInformation < Object > type = ( SimpleTypeInformation < Object > ) objects . meta ( r ) ; @ SuppressWarnings ( "unchecked" ) final List < Object > column = ( List < Object > ) objects . getColumn ( r ) ; if ( ! getInputTypeRestriction ( ) . isAssignableFromType ( type ) ) { bundle . appendColumn ( type , column ) ; continue ; } // Get the replacement type information
@ SuppressWarnings ( "unchecked" ) final SimpleTypeInformation < I > castType = ( SimpleTypeInformation < I > ) type ; // When necessary , perform an initialization scan
if ( prepareStart ( castType ) ) { FiniteProgress pprog = logger . isVerbose ( ) ? new FiniteProgress ( "Preparing normalization" , objects . dataLength ( ) , logger ) : null ; for ( Object o : column ) { @ SuppressWarnings ( "unchecked" ) final I obj = ( I ) o ; prepareProcessInstance ( obj ) ; logger . incrementProcessed ( pprog ) ; } logger . ensureCompleted ( pprog ) ; prepareComplete ( ) ; } @ SuppressWarnings ( "unchecked" ) final List < O > castColumn = ( List < O > ) column ; bundle . appendColumn ( convertedType ( castType ) , castColumn ) ; // Normalization scan
FiniteProgress nprog = logger . isVerbose ( ) ? new FiniteProgress ( "Data normalization" , objects . dataLength ( ) , logger ) : null ; for ( int i = 0 ; i < objects . dataLength ( ) ; i ++ ) { @ SuppressWarnings ( "unchecked" ) final I obj = ( I ) column . get ( i ) ; final O normalizedObj = filterSingleObject ( obj ) ; castColumn . set ( i , normalizedObj ) ; logger . incrementProcessed ( nprog ) ; } logger . ensureCompleted ( nprog ) ; } return bundle ; |
public class DefinitionsDocument { /** * Apply extension context to all DefinitionsContentExtension
* @ param context context */
private void applyDefinitionsDocumentExtension ( Context context ) { } } | extensionRegistry . getDefinitionsDocumentExtensions ( ) . forEach ( extension -> extension . apply ( context ) ) ; |
public class Driver { /** * Retrieves a resource from the provider application and transforms it using the Renderer passed as a parameter .
* @ param relUrl
* the relative URL to the resource
* @ param incomingRequest
* the request
* @ param renderers
* the renderers to use to transform the output
* @ return The resulting response .
* @ throws IOException
* If an IOException occurs while writing to the response
* @ throws HttpErrorPage
* If the page contains incorrect tags */
public CloseableHttpResponse proxy ( String relUrl , IncomingRequest incomingRequest , Renderer ... renderers ) throws IOException , HttpErrorPage { } } | DriverRequest driverRequest = new DriverRequest ( incomingRequest , this , relUrl ) ; driverRequest . setCharacterEncoding ( this . config . getUriEncoding ( ) ) ; // This is used to ensure EVENT _ PROXY _ POST is called once and only once .
// there are 3 different cases
// - Success - > the main code
// - Error page - > the HttpErrorPage exception
// - Unexpected error - > Other Exceptions
boolean postProxyPerformed = false ; // Create Proxy event
ProxyEvent e = new ProxyEvent ( incomingRequest ) ; // Event pre - proxy
this . eventManager . fire ( EventManager . EVENT_PROXY_PRE , e ) ; // Return immediately if exit is requested by extension
if ( e . isExit ( ) ) { return e . getResponse ( ) ; } logAction ( "proxy" , relUrl , renderers ) ; String url = ResourceUtils . getHttpUrlWithQueryString ( relUrl , driverRequest , true ) ; OutgoingRequest outgoingRequest = requestExecutor . createOutgoingRequest ( driverRequest , url , true ) ; headerManager . copyHeaders ( driverRequest , outgoingRequest ) ; try { CloseableHttpResponse response = requestExecutor . execute ( outgoingRequest ) ; response = headerManager . copyHeaders ( outgoingRequest , incomingRequest , response ) ; e . setResponse ( response ) ; // Perform rendering
e . setResponse ( performRendering ( relUrl , driverRequest , e . getResponse ( ) , renderers ) ) ; // Event post - proxy
// This must be done before calling sendResponse to ensure response
// can still be changed .
postProxyPerformed = true ; this . eventManager . fire ( EventManager . EVENT_PROXY_POST , e ) ; // Send request to the client .
return e . getResponse ( ) ; } catch ( HttpErrorPage errorPage ) { e . setErrorPage ( errorPage ) ; // On error returned by the proxy request , perform rendering on the
// error page .
CloseableHttpResponse response = e . getErrorPage ( ) . getHttpResponse ( ) ; response = headerManager . copyHeaders ( outgoingRequest , incomingRequest , response ) ; e . setErrorPage ( new HttpErrorPage ( performRendering ( relUrl , driverRequest , response , renderers ) ) ) ; // Event post - proxy
// This must be done before throwing exception to ensure response
// can still be changed .
postProxyPerformed = true ; this . eventManager . fire ( EventManager . EVENT_PROXY_POST , e ) ; throw e . getErrorPage ( ) ; } finally { if ( ! postProxyPerformed ) { this . eventManager . fire ( EventManager . EVENT_PROXY_POST , e ) ; } } |
public class RSortable { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > sort the output in descending order < / i > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > e . g . RETURN . element ( n ) . < b > ORDER _ BY _ DESC ( " age " ) < / b > < / i > < / div >
* < br / > */
public RSortable ORDER_BY_DESC ( String propertyName ) { } } | Order o = new Order ( ) ; o . setPropertyName ( propertyName ) ; o . setDescending ( true ) ; getReturnExpression ( ) . addOrder ( o ) ; return this ; |
public class CreateLocationEfsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateLocationEfsRequest createLocationEfsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createLocationEfsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createLocationEfsRequest . getSubdirectory ( ) , SUBDIRECTORY_BINDING ) ; protocolMarshaller . marshall ( createLocationEfsRequest . getEfsFilesystemArn ( ) , EFSFILESYSTEMARN_BINDING ) ; protocolMarshaller . marshall ( createLocationEfsRequest . getEc2Config ( ) , EC2CONFIG_BINDING ) ; protocolMarshaller . marshall ( createLocationEfsRequest . getTags ( ) , TAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class InternalPartitionServiceImpl { /** * Sets the initial partition table and state version . If any partition has a replica , the partition state manager is
* set to initialized , otherwise { @ link # partitionStateManager # isInitialized ( ) } stays uninitialized but the current state
* will be updated nevertheless .
* This method acquires the partition service lock .
* @ param partitionTable the initial partition table
* @ throws IllegalStateException if the partition manager has already been initialized */
public void setInitialState ( PartitionTableView partitionTable ) { } } | lock . lock ( ) ; try { partitionStateManager . setInitialState ( partitionTable ) ; } finally { lock . unlock ( ) ; } |
public class CFIImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } } | switch ( featureID ) { case AfplibPackage . CFI__FIXED_LENGTH_RG : return ( ( InternalEList < ? > ) getFixedLengthRG ( ) ) . basicRemove ( otherEnd , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ; |
public class Configuration { /** * Writes properties and their attributes ( final and resource )
* to the given { @ link Writer } .
* < li >
* When propertyName is not empty , and the property exists
* in the configuration , the format of the output would be ,
* < pre >
* " property " : {
* " key " : " key1 " ,
* " value " : " value1 " ,
* " isFinal " : " key1 . isFinal " ,
* " resource " : " key1 . resource "
* < / pre >
* < / li >
* < li >
* When propertyName is null or empty , it behaves same as
* { @ link # dumpConfiguration ( Configuration , Writer ) } , the
* output would be ,
* < pre >
* { " properties " :
* [ { key : " key1 " ,
* value : " value1 " ,
* isFinal : " key1 . isFinal " ,
* resource : " key1 . resource " } ,
* { key : " key2 " ,
* value : " value2 " ,
* isFinal : " ke2 . isFinal " ,
* resource : " key2 . resource " }
* < / pre >
* < / li >
* < li >
* When propertyName is not empty , and the property is not
* found in the configuration , this method will throw an
* { @ link IllegalArgumentException } .
* < / li >
* @ param config the configuration
* @ param propertyName property name
* @ param out the Writer to write to
* @ throws IOException
* @ throws IllegalArgumentException when property name is not
* empty and the property is not found in configuration */
public static void dumpConfiguration ( Configuration config , String propertyName , Writer out ) throws IOException { } } | if ( Strings . isNullOrEmpty ( propertyName ) ) { dumpConfiguration ( config , out ) ; } else if ( Strings . isNullOrEmpty ( config . get ( propertyName ) ) ) { throw new IllegalArgumentException ( "Property " + propertyName + " not found" ) ; } else { JsonFactory dumpFactory = new JsonFactory ( ) ; JsonGenerator dumpGenerator = dumpFactory . createGenerator ( out ) ; dumpGenerator . writeStartObject ( ) ; dumpGenerator . writeFieldName ( "property" ) ; appendJSONProperty ( dumpGenerator , config , propertyName , new ConfigRedactor ( config ) ) ; dumpGenerator . writeEndObject ( ) ; dumpGenerator . flush ( ) ; } |
public class DB { /** * Commit changes in the current transaction .
* @ param callInfo Call info . */
void commit ( CallInfo callInfo ) { } } | access ( callInfo , ( ) -> { logSetup ( callInfo ) ; clearSavePointIfSet ( ) ; connection . commit ( ) ; return 0 ; } ) ; |
public class PersistentExecutorImpl { /** * Utility method to compute the owner that should be used for isolation of tasks ( typically between applications ) .
* If component metadata exists on the thread , the application name is used .
* Otherwise , if a thread context class loader is present , the application name from the class loader identifier is used .
* Otherwise , null is returned .
* @ return name of the task owner . */
@ Trivial private final String getOwner ( ) { } } | ComponentMetaData cData = ComponentMetaDataAccessorImpl . getComponentMetaDataAccessor ( ) . getComponentMetaData ( ) ; String name = cData == null ? null : cData . getJ2EEName ( ) . getApplication ( ) ; if ( name == null ) { ClassLoader threadContextClassLoader = InvokerTask . priv . getContextClassLoader ( ) ; String identifier = classloaderIdSvc . getClassLoaderIdentifier ( threadContextClassLoader ) ; // Parse the app name from the identifier . For example , from WebModule : app # module # component
if ( identifier != null ) { int start = identifier . indexOf ( ':' ) ; if ( start > 0 ) { int end = identifier . indexOf ( '#' , ++ start ) ; if ( end > 0 ) name = identifier . substring ( start , end ) ; } } } return name ; |
public class RedisStateMachine { /** * Attempt to decode a redis response and return a flag indicating whether a complete response was read .
* @ param buffer Buffer containing data from the server .
* @ param command the command itself
* @ param output Current command output .
* @ return true if a complete response was read . */
public boolean decode ( ByteBuf buffer , RedisCommand < ? , ? , ? > command , CommandOutput < ? , ? , ? > output ) { } } | int length , end ; ByteBuffer bytes ; if ( debugEnabled ) { logger . debug ( "Decode {}" , command ) ; } if ( isEmpty ( stack ) ) { add ( stack , new State ( ) ) ; } if ( output == null ) { return isEmpty ( stack ) ; } loop : while ( ! isEmpty ( stack ) ) { State state = peek ( stack ) ; if ( state . type == null ) { if ( ! buffer . isReadable ( ) ) { break ; } state . type = readReplyType ( buffer ) ; buffer . markReaderIndex ( ) ; } switch ( state . type ) { case SINGLE : if ( ( bytes = readLine ( buffer ) ) == null ) { break loop ; } if ( ! QUEUED . equals ( bytes ) ) { safeSetSingle ( output , bytes , command ) ; } break ; case ERROR : if ( ( bytes = readLine ( buffer ) ) == null ) { break loop ; } safeSetError ( output , bytes , command ) ; break ; case INTEGER : if ( ( end = findLineEnd ( buffer ) ) == - 1 ) { break loop ; } long integer = readLong ( buffer , buffer . readerIndex ( ) , end ) ; safeSet ( output , integer , command ) ; break ; case BULK : if ( ( end = findLineEnd ( buffer ) ) == - 1 ) { break loop ; } length = ( int ) readLong ( buffer , buffer . readerIndex ( ) , end ) ; if ( length == - 1 ) { safeSet ( output , null , command ) ; } else { state . type = BYTES ; state . count = length + 2 ; buffer . markReaderIndex ( ) ; continue loop ; } break ; case MULTI : if ( state . count == - 1 ) { if ( ( end = findLineEnd ( buffer ) ) == - 1 ) { break loop ; } length = ( int ) readLong ( buffer , buffer . readerIndex ( ) , end ) ; state . count = length ; buffer . markReaderIndex ( ) ; safeMulti ( output , state . count , command ) ; } if ( state . count <= 0 ) { break ; } state . count -- ; addFirst ( stack , new State ( ) ) ; continue loop ; case BYTES : if ( ( bytes = readBytes ( buffer , state . count ) ) == null ) { break loop ; } safeSet ( output , bytes , command ) ; break ; default : throw new IllegalStateException ( "State " + state . type + " not supported" ) ; } buffer . markReaderIndex ( ) ; remove ( stack ) ; output . complete ( size ( stack ) ) ; } if ( debugEnabled ) { logger . debug ( "Decoded {}, empty stack: {}" , command , isEmpty ( stack ) ) ; } return isEmpty ( stack ) ; |
public class FontUtil { /** * Applies a Typeface onto an overflow or popup menu
* @ param menu The menu to typefacesize */
public static void applyTypeface ( @ NonNull Menu menu , final @ NonNull Typeface typeface ) { } } | for ( int i = 0 ; i < menu . size ( ) ; i ++ ) { MenuItem item = menu . getItem ( i ) ; item . setTitle ( applyTypeface ( item . getTitle ( ) . toString ( ) , typeface ) ) ; } |
public class StaxParser { /** * parse XML stream :
* @ param xmlInput - java . io . InputStream = input file
* @ exception XMLStreamException javax . xml . stream . XMLStreamException */
public void parse ( InputStream xmlInput ) throws XMLStreamException { } } | InputStream input = isoControlCharsAwareParser ? new ISOControlCharAwareInputStream ( xmlInput ) : xmlInput ; parse ( inf . rootElementCursor ( input ) ) ; |
public class SimpleQuery { /** * Add cache key parts that are common to query data and query count .
* @ param builder */
private void addCommonCacheKeyParts ( StringBuilder builder ) { } } | builder . append ( "kind=" ) . append ( getKind ( ) ) ; List < FilterPredicate > predicates = query . getFilterPredicates ( ) ; if ( predicates . size ( ) > 0 ) { builder . append ( ",pred=" ) . append ( predicates ) ; } |
public class ProviderImpl { /** * JBWS - 3973 : Disable schema cache to workaround the intermittent failure */
private void setDisableCacheSchema ( Bus bus ) { } } | if ( bus . getExtension ( WSDLManager . class ) instanceof WSDLManagerImpl ) { WSDLManagerImpl wsdlManangerImpl = ( WSDLManagerImpl ) bus . getExtension ( WSDLManager . class ) ; wsdlManangerImpl . setDisableSchemaCache ( SecurityActions . getBoolean ( JBWS_CXF_DISABLE_SCHEMA_CACHE , true ) ) ; } |
public class SingleDateValueExpression { /** * / * ( non - Javadoc )
* @ see com . github . mkolisnyk . aerial . expressions . ValueExpression # validate ( ) */
@ Override public void validate ( ) throws Exception { } } | super . validate ( ) ; new SimpleDateFormat ( this . getInput ( ) . getValue ( ) ) ; Assert . assertFalse ( "Unique attribute isn't applicable for fixed value" , this . getInput ( ) . isUnique ( ) ) ; |
public class FingerprintsRetinaApiImpl { /** * { @ inheritDoc } */
@ Override public Fingerprint getFingerprint ( String fingerprintId ) throws ApiException { } } | return api . getFingerprint ( retinaName , fingerprintId ) ; |
public class MenuAPI { /** * 测试个性化菜单
* @ param userId 可以是粉丝的OpenID , 也可以是粉丝的微信号
* @ return 该用户可以看到的菜单
* @ since 1.3.7 */
public GetMenuResponse tryMatchMenu ( String userId ) { } } | BeanUtil . requireNonNull ( userId , "userId is null" ) ; LOG . debug ( "测试个性化菜单....." ) ; GetMenuResponse response ; String url = BASE_API_URL + "cgi-bin/menu/trymatch?access_token=#" ; Map < String , String > params = new HashMap < String , String > ( ) ; params . put ( "user_id" , userId ) ; BaseResponse r = executePost ( url , JSONUtil . toJson ( params ) ) ; // String resultJson = isSuccess ( r . getErrcode ( ) ) ? r . getErrmsg ( ) : r . toJsonString ( ) ;
// response = JSONUtil . toBean ( resultJson , GetMenuResponse . class ) ;
if ( isSuccess ( r . getErrcode ( ) ) ) { JSONObject jsonObject = JSONUtil . getJSONFromString ( r . getErrmsg ( ) ) ; // 通过jsonpath不断修改type的值 , 才能正常解析 - -
List buttonList = ( List ) JSONPath . eval ( jsonObject , "$.menu.button" ) ; if ( CollectionUtil . isNotEmpty ( buttonList ) ) { for ( Object button : buttonList ) { List subList = ( List ) JSONPath . eval ( button , "$.sub_button" ) ; if ( CollectionUtil . isNotEmpty ( subList ) ) { for ( Object sub : subList ) { Object type = JSONPath . eval ( sub , "$.type" ) ; JSONPath . set ( sub , "$.type" , type . toString ( ) . toUpperCase ( ) ) ; } } else { Object type = JSONPath . eval ( button , "$.type" ) ; JSONPath . set ( button , "$.type" , type . toString ( ) . toUpperCase ( ) ) ; } } } response = JSONUtil . toBean ( jsonObject . toJSONString ( ) , GetMenuResponse . class ) ; } else { response = JSONUtil . toBean ( r . toJsonString ( ) , GetMenuResponse . class ) ; } return response ; |
public class DiscoverPackagesCommand { /** * Find all paths within the given file ( or folder ) . */
private static Collection < String > findPaths ( Path path ) { } } | List < String > paths = findPaths ( path , false ) ; Collections . sort ( paths ) ; return paths ; |
public class AbstractRouter { /** * Removes a controller from the chache
* @ param controller controller to be removed
* @ param < C > controller type */
public < C extends AbstractComponentController < ? , ? , ? > > void removeFromCache ( C controller ) { } } | ControllerFactory . get ( ) . removeFromCache ( controller ) ; controller . setCached ( false ) ; |
public class UniverseApi { /** * Get region information Get information on a region - - - This route expires
* daily at 11:05
* @ param regionId
* region _ id integer ( required )
* @ param acceptLanguage
* Language to use in the response ( optional , default to en - us )
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param ifNoneMatch
* ETag from a previous request . A 304 will be returned if this
* matches the current ETag ( optional )
* @ param language
* Language to use in the response , takes precedence over
* Accept - Language ( optional , default to en - us )
* @ return ApiResponse & lt ; RegionResponse & gt ;
* @ throws ApiException
* If fail to call the API , e . g . server error or cannot
* deserialize the response body */
public ApiResponse < RegionResponse > getUniverseRegionsRegionIdWithHttpInfo ( Integer regionId , String acceptLanguage , String datasource , String ifNoneMatch , String language ) throws ApiException { } } | com . squareup . okhttp . Call call = getUniverseRegionsRegionIdValidateBeforeCall ( regionId , acceptLanguage , datasource , ifNoneMatch , language , null ) ; Type localVarReturnType = new TypeToken < RegionResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class SwitchPreference { /** * Initializes the preference .
* @ param attributeSet
* The attribute set , the attributes should be obtained from , as an instance of the type
* { @ link AttributeSet } or null , if no attributes should be obtained
* @ param defaultStyle
* The default style to apply to this preference . If 0 , no style will be applied ( beyond
* what is included in the theme ) . This may either be an attribute resource , whose value
* will be retrieved from the current theme , or an explicit style resource
* @ param defaultStyleResource
* A resource identifier of a style resource that supplies default values for the
* preference , used only if the default style is 0 or can not be found in the theme . Can
* be 0 to not look for defaults */
private void initialize ( @ Nullable final AttributeSet attributeSet , @ AttrRes final int defaultStyle , @ StyleRes final int defaultStyleResource ) { } } | setWidgetLayoutResource ( R . layout . switch_widget ) ; obtainStyledAttributes ( attributeSet , defaultStyle , defaultStyleResource ) ; |
public class Logic { /** * Creates a composite OR predicate from the given predicates .
* @ param < T1 > the former element type parameter
* @ param < T2 > the latter element type parameter
* @ param first
* @ param second
* @ param third
* @ return the composite predicate */
public static < T1 , T2 > BiPredicate < T1 , T2 > or ( BiPredicate < T1 , T2 > first , BiPredicate < T1 , T2 > second , BiPredicate < T1 , T2 > third ) { } } | dbc . precondition ( first != null , "first predicate is null" ) ; dbc . precondition ( second != null , "second predicate is null" ) ; dbc . precondition ( third != null , "third predicate is null" ) ; return Logic . Binary . or ( Iterations . iterable ( first , second , third ) ) ; |
public class NetworkInterfaceIPConfigurationsInner { /** * Gets the specified network interface ip configuration .
* @ param resourceGroupName The name of the resource group .
* @ param networkInterfaceName The name of the network interface .
* @ param ipConfigurationName The name of the ip configuration name .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the NetworkInterfaceIPConfigurationInner object if successful . */
public NetworkInterfaceIPConfigurationInner get ( String resourceGroupName , String networkInterfaceName , String ipConfigurationName ) { } } | return getWithServiceResponseAsync ( resourceGroupName , networkInterfaceName , ipConfigurationName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class SortedCellTable { /** * Adds a column to the table and sets its sortable state
* @ param column
* @ param headerName
* @ param sortable */
public void addColumn ( Column < T , ? > column , String headerName , boolean sortable ) { } } | addColumn ( column , headerName ) ; column . setSortable ( sortable ) ; if ( sortable ) { defaultSortOrderMap . put ( column , true ) ; } |
public class ScriptAction { /** * Run a CLI script from a File .
* @ param script The script file . */
protected void runScript ( File script ) { } } | if ( ! script . exists ( ) ) { JOptionPane . showMessageDialog ( cliGuiCtx . getMainPanel ( ) , script . getAbsolutePath ( ) + " does not exist." , "Unable to run script." , JOptionPane . ERROR_MESSAGE ) ; return ; } int choice = JOptionPane . showConfirmDialog ( cliGuiCtx . getMainPanel ( ) , "Run CLI script " + script . getName ( ) + "?" , "Confirm run script" , JOptionPane . YES_NO_OPTION ) ; if ( choice != JOptionPane . YES_OPTION ) return ; menu . addScript ( script ) ; cliGuiCtx . getTabs ( ) . setSelectedIndex ( 1 ) ; // set to Output tab to view the output
output . post ( "\n" ) ; SwingWorker scriptRunner = new ScriptRunner ( script ) ; scriptRunner . execute ( ) ; |
public class CheckAbundance { /** * Determine if a given number is abundant . A number is considered abundant if the sum of its divisors
* is greater than the number itself .
* Examples :
* check _ abundance ( 12 ) - > True
* check _ abundance ( 13 ) - > False
* check _ abundance ( 9 ) - > False
* @ param number : The number to check for abundance .
* @ return : Returns True if the number is abundant , otherwise False . */
public static Boolean checkAbundance ( int number ) { } } | int sumOfDivisors = 0 ; for ( int divisor = 1 ; divisor < number ; divisor ++ ) { if ( number % divisor == 0 ) { sumOfDivisors += divisor ; } } return sumOfDivisors > number ; |
public class BaseMenuPresenter { /** * Create a new item view that can be re - bound to other item data later .
* @ return The new item view */
public MenuView . ItemView createItemView ( ViewGroup parent ) { } } | return ( MenuView . ItemView ) mSystemInflater . inflate ( mItemLayoutRes , parent , false ) ; |
public class AgiRequestImpl { /** * Builds a map containing variable names as key ( with the " agi _ " or " ogi _ "
* prefix stripped ) and the corresponding values .
* Syntactically invalid and empty variables are skipped .
* @ param lines the environment to transform .
* @ return a map with the variables set corresponding to the given
* environment .
* @ throws IllegalArgumentException if lines is < code > null < / code > */
private static Map < String , String > buildMap ( final Collection < String > lines ) throws IllegalArgumentException { } } | final Map < String , String > map ; if ( lines == null ) { throw new IllegalArgumentException ( "Environment must not be null." ) ; } map = new HashMap < > ( ) ; for ( String line : lines ) { int colonPosition ; String key ; String value ; colonPosition = line . indexOf ( ':' ) ; // no colon on the line ?
if ( colonPosition < 0 ) { continue ; } // key doesn ' t start with agi _ or ogi _ ?
if ( ! line . startsWith ( "agi_" ) && ! line . startsWith ( "ogi_" ) ) { continue ; } // first colon in line is last character - > no value present ?
if ( line . length ( ) < colonPosition + 2 ) { continue ; } key = line . substring ( 4 , colonPosition ) . toLowerCase ( Locale . ENGLISH ) ; value = line . substring ( colonPosition + 2 ) ; if ( value . length ( ) != 0 ) { map . put ( key , value ) ; } } return map ; |
public class MetaStore { /** * Loads the current cluster configuration .
* @ return The current cluster configuration . */
public synchronized Configuration loadConfiguration ( ) { } } | if ( configurationBuffer . position ( 0 ) . readByte ( ) == 1 ) { int bytesLength = configurationBuffer . readInt ( ) ; if ( bytesLength == 0 ) { return null ; } return serializer . decode ( configurationBuffer . readBytes ( bytesLength ) ) ; } return null ; |
public class BEValue { /** * Returns this BEValue as a String , interpreted with the specified
* encoding .
* @ param encoding The encoding to interpret the bytes as when converting
* them into a { @ link String } .
* @ throws InvalidBEncodingException If the value is not a byte [ ] . */
public String getString ( String encoding ) throws InvalidBEncodingException { } } | try { return new String ( this . getBytes ( ) , encoding ) ; } catch ( ClassCastException cce ) { throw new InvalidBEncodingException ( cce . toString ( ) ) ; } catch ( UnsupportedEncodingException uee ) { throw new InternalError ( uee . toString ( ) ) ; } |
public class RequestFactory { /** * Create new Check policies request .
* @ param orgToken WhiteSource organization token .
* @ param projects Projects status statement to check .
* @ param product Name or WhiteSource service token of the product whose policies to check .
* @ param productVersion Version of the product whose policies to check .
* @ param forceCheckAllDependencies boolean check that all / added dependencies sent to WhiteSource
* @ param userKey user key uniquely identifying the account at white source .
* @ param requesterEmail Email of the WhiteSource user that requests to update WhiteSource .
* @ param aggregateModules to combine all pom modules into a single WhiteSource project with an aggregated dependency flat list ( no hierarchy ) .
* @ param preserveModuleStructure combine all pom modules to be dependencies of single project , each module will be represented as a parent of its dependencies .
* @ param aggregateProjectName aggregate project name identifier .
* @ param aggregateProjectToken aggregate project token identifier .
* @ return Newly created request to check policies application . */
@ Deprecated public CheckPolicyComplianceRequest newCheckPolicyComplianceRequest ( String orgToken , String product , String productVersion , Collection < AgentProjectInfo > projects , boolean forceCheckAllDependencies , String userKey , String requesterEmail , boolean aggregateModules , boolean preserveModuleStructure , String aggregateProjectName , String aggregateProjectToken ) { } } | return ( CheckPolicyComplianceRequest ) prepareRequest ( new CheckPolicyComplianceRequest ( projects , forceCheckAllDependencies ) , orgToken , requesterEmail , product , productVersion , userKey , aggregateModules , preserveModuleStructure , aggregateProjectName , aggregateProjectToken , null , null , null , null ) ; |
public class BugInstance { /** * Add a class annotation for the class that the visitor is currently
* visiting .
* @ param visitor
* the BetterVisitor
* @ return this object */
@ Nonnull public BugInstance addClass ( PreorderVisitor visitor ) { } } | String className = visitor . getDottedClassName ( ) ; addClass ( className ) ; return this ; |
public class TimestampExtractor { /** * This method is a default implementation that uses java serialization and it is discouraged .
* All implementation should provide a more specific set of properties . */
@ Override public Map < String , String > toProperties ( ) { } } | Map < String , String > properties = new HashMap < > ( ) ; properties . put ( Rowtime . ROWTIME_TIMESTAMPS_TYPE , Rowtime . ROWTIME_TIMESTAMPS_TYPE_VALUE_CUSTOM ) ; properties . put ( Rowtime . ROWTIME_TIMESTAMPS_CLASS , this . getClass ( ) . getName ( ) ) ; properties . put ( Rowtime . ROWTIME_TIMESTAMPS_SERIALIZED , EncodingUtils . encodeObjectToString ( this ) ) ; return properties ; |
public class CmsMemoryStatus { /** * Updates this memory status with the current memory information . < p > */
public void update ( ) { } } | m_maxMemory = Runtime . getRuntime ( ) . maxMemory ( ) / 1048576 ; m_totalMemory = Runtime . getRuntime ( ) . totalMemory ( ) / 1048576 ; m_usedMemory = ( Runtime . getRuntime ( ) . totalMemory ( ) - Runtime . getRuntime ( ) . freeMemory ( ) ) / 1048576 ; m_freeMemory = m_maxMemory - m_usedMemory ; m_usage = ( m_usedMemory * 100 ) / m_maxMemory ; |
public class DescribeServerRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeServerRequest describeServerRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeServerRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeServerRequest . getServerId ( ) , SERVERID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ENAMEX { /** * getter for typeOfNE - gets the type of the entity ( e . g . , ORGANIZATION , PERSON )
* @ generated
* @ return value of the feature */
public String getTypeOfNE ( ) { } } | if ( ENAMEX_Type . featOkTst && ( ( ENAMEX_Type ) jcasType ) . casFeat_typeOfNE == null ) jcasType . jcas . throwFeatMissing ( "typeOfNE" , "de.julielab.jules.types.muc7.ENAMEX" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( ENAMEX_Type ) jcasType ) . casFeatCode_typeOfNE ) ; |
public class InferenceSpecification { /** * The supported MIME types for the output data .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSupportedResponseMIMETypes ( java . util . Collection ) } or
* { @ link # withSupportedResponseMIMETypes ( java . util . Collection ) } if you want to override the existing values .
* @ param supportedResponseMIMETypes
* The supported MIME types for the output data .
* @ return Returns a reference to this object so that method calls can be chained together . */
public InferenceSpecification withSupportedResponseMIMETypes ( String ... supportedResponseMIMETypes ) { } } | if ( this . supportedResponseMIMETypes == null ) { setSupportedResponseMIMETypes ( new java . util . ArrayList < String > ( supportedResponseMIMETypes . length ) ) ; } for ( String ele : supportedResponseMIMETypes ) { this . supportedResponseMIMETypes . add ( ele ) ; } return this ; |
public class SarlEventImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case SarlPackage . SARL_EVENT__EXTENDS : return extends_ != null ; } return super . eIsSet ( featureID ) ; |
public class RpcUtil { /** * Take an { @ code RpcCallback < Message > } and convert it to an
* { @ code RpcCallback } accepting a specific message type . This is always
* type - safe ( parameter type contravariance ) . */
@ SuppressWarnings ( "unchecked" ) public static < Type extends Message > RpcCallback < Type > specializeCallback ( final RpcCallback < Message > originalCallback ) { } } | return ( RpcCallback < Type > ) originalCallback ; // The above cast works , but only due to technical details of the Java
// implementation . A more theoretically correct - - but less efficient - -
// implementation would be as follows :
// return new RpcCallback < Type > ( ) {
// public void run ( Type parameter ) {
// originalCallback . run ( parameter ) ; |
public class WsByteBufferPoolManagerImpl { /** * Duplicate a WsByteBuffer . This will mainly consist of
* 1 . Creating a new WsByteBuffer
* 2 . wrapping into this WsByteBuffer the ByteBuffer returned on
* the duplicate ( ) method of the ByteBuffer wrapped by the passed
* WsByteBuffer
* 3 . Updating variables of the new WsByteBuffer
* @ param buffer to duplicate
* @ return WsByteBuffer duplicated buffer */
@ Override public WsByteBuffer duplicate ( WsByteBuffer buffer ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "duplicate" ) ; } // see if we should look for leaks
if ( trackingBuffers ( ) ) { lookForLeaks ( false ) ; } WsByteBufferImpl newBuffer = new WsByteBufferImpl ( ) ; WsByteBufferImpl srcBuffer = ( WsByteBufferImpl ) buffer ; // update the new object with pool manager specific data
newBuffer . setPoolManagerRef ( this ) ; PooledWsByteBufferImpl bRoot = srcBuffer . getWsBBRoot ( ) ; if ( bRoot != null ) { newBuffer . setWsBBRoot ( bRoot ) ; synchronized ( bRoot ) { bRoot . intReferenceCount ++ ; } } else { RefCountWsByteBufferImpl rRoot = srcBuffer . getWsBBRefRoot ( ) ; if ( rRoot != null ) { newBuffer . setWsBBRefRoot ( rRoot ) ; synchronized ( rRoot ) { rRoot . intReferenceCount ++ ; } } } // have the old object update the new object with object specific data
srcBuffer . updateDuplicate ( newBuffer ) ; if ( ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) || ( trackingBuffers ( ) ) ) { Throwable t = new Throwable ( ) ; StackTraceElement [ ] ste = t . getStackTrace ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) && ste . length >= 3 ) { if ( ( srcBuffer . getWsBBRoot ( ) == null ) || ( srcBuffer . getWsBBRoot ( ) . pool == null ) ) { Tr . debug ( tc , "BUFFER OBTAINED: Duplicate: Calling Element: " + ste [ 2 ] + " Main ID: none" ) ; } else { Tr . debug ( tc , "BUFFER OBTAINED: Duplicate: Calling Element: " + ste [ 2 ] + " Main ID: " + srcBuffer . getWsBBRoot ( ) . getID ( ) ) ; } } if ( trackingBuffers ( ) ) { String sEntry = fillOutStackTrace ( " (Duplicate) " , ste ) ; newBuffer . setOwnerID ( sEntry ) ; } if ( ( newBuffer . getWsBBRoot ( ) != null ) && ( newBuffer . getWsBBRoot ( ) . pool != null ) ) { if ( trackingBuffers ( ) ) { newBuffer . getWsBBRoot ( ) . addWsByteBuffer ( newBuffer ) ; newBuffer . getWsBBRoot ( ) . owners . put ( newBuffer . getOwnerID ( ) , newBuffer . getOwnerID ( ) ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "duplicate" ) ; } return newBuffer ; |
public class ReplicatedRepository { /** * Repairs replicated storables by synchronizing the replica repository
* against the master repository .
* @ param type type of storable to re - sync
* @ param listener optional listener which gets notified as storables are re - sync ' d
* @ param desiredSpeed throttling parameter - 1.0 = full speed , 0.5 = half
* speed , 0.1 = one - tenth speed , etc
* @ param filter optional query filter to limit which objects get re - sync ' ed
* @ param filterValues filter values for optional filter
* @ since 1.2 */
public < S extends Storable > void resync ( Class < S > type , ResyncCapability . Listener < ? super S > listener , double desiredSpeed , String filter , Object ... filterValues ) throws RepositoryException { } } | ReplicationTrigger < S > replicationTrigger ; if ( storageFor ( type ) instanceof ReplicatedStorage ) { replicationTrigger = ( ( ReplicatedStorage ) storageFor ( type ) ) . getReplicationTrigger ( ) ; } else { throw new UnsupportedTypeException ( "Storable type is not replicated" , type ) ; } Storage < S > replicaStorage , masterStorage ; replicaStorage = mReplicaRepository . storageFor ( type ) ; masterStorage = mMasterRepository . storageFor ( type ) ; Query < S > replicaQuery , masterQuery ; if ( filter == null ) { replicaQuery = replicaStorage . query ( ) ; masterQuery = masterStorage . query ( ) ; } else { replicaQuery = replicaStorage . query ( filter ) . withValues ( filterValues ) ; masterQuery = masterStorage . query ( filter ) . withValues ( filterValues ) ; } // Order both queries the same so that they can be run in parallel .
// Favor natural order of replica , since cursors may be opened and
// re - opened on it .
String [ ] orderBy = selectNaturalOrder ( mReplicaRepository , type , replicaQuery . getFilter ( ) ) ; if ( orderBy == null ) { orderBy = selectNaturalOrder ( mMasterRepository , type , masterQuery . getFilter ( ) ) ; if ( orderBy == null ) { Set < String > pkSet = StorableIntrospector . examine ( type ) . getPrimaryKeyProperties ( ) . keySet ( ) ; orderBy = pkSet . toArray ( new String [ pkSet . size ( ) ] ) ; } } Comparator comparator = SortedCursor . createComparator ( type , orderBy ) ; replicaQuery = replicaQuery . orderBy ( orderBy ) ; masterQuery = masterQuery . orderBy ( orderBy ) ; Throttle throttle ; if ( desiredSpeed >= 1.0 ) { throttle = null ; } else { if ( desiredSpeed < 0.0 ) { desiredSpeed = 0.0 ; } // 50 samples
throttle = new Throttle ( 50 ) ; } Transaction replicaTxn = mReplicaRepository . enterTransaction ( ) ; try { replicaTxn . setForUpdate ( true ) ; resync ( replicationTrigger , replicaStorage , replicaQuery , masterStorage , masterQuery , listener , throttle , desiredSpeed , comparator , replicaTxn ) ; replicaTxn . commit ( ) ; } finally { replicaTxn . exit ( ) ; } |
public class RunnableProcess { /** * Cancels the running process if it is running . */
public void cancel ( ) { } } | this . stateLock . lock ( ) ; try { if ( this . state == RunnableProcessState . RUNNING ) { this . process . destroy ( ) ; if ( ! this . doneCond . await ( DESTROY_WAIT_TIME , TimeUnit . MILLISECONDS ) ) { LOG . log ( Level . FINE , "{0} milliseconds elapsed" , DESTROY_WAIT_TIME ) ; } } if ( this . state == RunnableProcessState . RUNNING ) { LOG . log ( Level . WARNING , "The child process survived Process.destroy()" ) ; if ( OSUtils . isUnix ( ) || OSUtils . isWindows ( ) ) { LOG . log ( Level . WARNING , "Attempting to kill the process via the kill command line" ) ; try { final long pid = readPID ( ) ; OSUtils . kill ( pid ) ; } catch ( final IOException | InterruptedException | NumberFormatException e ) { LOG . log ( Level . SEVERE , "Unable to kill the process." , e ) ; } } } } catch ( final InterruptedException ex ) { LOG . log ( Level . SEVERE , "Interrupted while waiting for the process \"{0}\" to complete. Exception: {1}" , new Object [ ] { this . id , ex } ) ; } finally { this . stateLock . unlock ( ) ; } |
public class ServerSocketJni { /** * Creates the SSL ServerSocket . */
public static ServerSocketBar create ( InetAddress host , int port , int listenBacklog , boolean isEnableJni ) throws IOException { } } | return currentFactory ( ) . create ( host , port , listenBacklog , isEnableJni ) ; |
public class ArgumentSimplifiedTokenBIOAnnotator { /** * Annotations are re - created from existing { @ code BIOSimplifiedSentenceArgumentAnnotation }
* @ param aJCas jcas
* @ throws AnalysisEngineProcessException */
protected void processFromBIOSimplifiedSentenceArgumentAnnotation ( JCas aJCas ) throws AnalysisEngineProcessException { } } | Collection < BIOSimplifiedSentenceArgumentAnnotation > sentenceArgumentAnnotations = JCasUtil . select ( aJCas , BIOSimplifiedSentenceArgumentAnnotation . class ) ; Collection < Sentence > sentences = JCasUtil . select ( aJCas , Sentence . class ) ; // BIOSimplifiedSentenceArgumentAnnotation must match with sentences
if ( sentences . size ( ) != sentenceArgumentAnnotations . size ( ) ) { throw new AnalysisEngineProcessException ( new IllegalArgumentException ( sentences . size ( ) + " BIOSimplifiedSentenceArgumentAnnotation annotations expected, but " + sentenceArgumentAnnotations . size ( ) + " found" ) ) ; } // iterate over sentence - level annotations
for ( BIOSimplifiedSentenceArgumentAnnotation sentenceArgumentAnnotation : sentenceArgumentAnnotations ) { List < Token > tokens = JCasUtil . selectCovered ( aJCas , Token . class , sentenceArgumentAnnotation ) ; // get the tag
String sentenceTag = sentenceArgumentAnnotation . getTag ( ) ; String sentenceTagWithoutSuffix = sentenceArgumentAnnotation . getTag ( ) . split ( "-" ) [ 0 ] ; boolean firstTokenIsBegin = sentenceTag . endsWith ( B_SUFFIX ) ; // iterate over tokens and create appropriate BIOSimplifiedTokenArgumentAnnotation
for ( int i = 0 ; i < tokens . size ( ) ; i ++ ) { Token token = tokens . get ( i ) ; BIOSimplifiedTokenArgumentAnnotation label = new BIOSimplifiedTokenArgumentAnnotation ( aJCas ) ; label . setBegin ( token . getBegin ( ) ) ; label . setEnd ( token . getEnd ( ) ) ; label . addToIndexes ( ) ; // the output label
if ( O_TAG . equals ( sentenceTag ) ) { label . setTag ( O_TAG ) ; } else if ( BIO . equals ( this . codingGranularity ) && ( i == 0 ) && firstTokenIsBegin ) { label . setTag ( sentenceTagWithoutSuffix + B_SUFFIX ) ; } else { label . setTag ( sentenceTagWithoutSuffix + I_SUFFIX ) ; } } } |
public class AbstractBatcher { /** * { @ inheritDoc } */
@ Override public final boolean add ( T item , long timeout , TimeUnit unit ) throws InterruptedException { } } | requireNonNull ( item ) ; requireNonNull ( unit ) ; checkState ( ! isClosed , "The batcher has been closed" ) ; return backingQueue . offer ( item , timeout , unit ) ; |
public class DelegatingFlashMessagesConfiguration { /** * ( non - Javadoc )
* @ see es . sandbox . ui . messages . spring . MessagesConfigurationSupport # configureMessageResolverStrategy ( ) */
@ Override protected MessageResolverStrategy configureMessageResolverStrategy ( ) { } } | final MessageResolverStrategy candidate = configuredMessageResolverStrategy ( ) ; return candidate == null ? super . configureMessageResolverStrategy ( ) : candidate ; |
public class Filters { /** * Return an estimated selectivity for bitmaps for the dimension values given by dimValueIndexes .
* @ param bitmapIndex bitmap index
* @ param bitmaps bitmaps to extract , by index
* @ param totalNumRows number of rows in the column associated with this bitmap index
* @ return estimated selectivity */
public static double estimateSelectivity ( final BitmapIndex bitmapIndex , final IntList bitmaps , final long totalNumRows ) { } } | long numMatchedRows = 0 ; for ( int i = 0 ; i < bitmaps . size ( ) ; i ++ ) { final ImmutableBitmap bitmap = bitmapIndex . getBitmap ( bitmaps . getInt ( i ) ) ; numMatchedRows += bitmap . size ( ) ; } return Math . min ( 1. , ( double ) numMatchedRows / totalNumRows ) ; |
public class IMatrix { /** * Creates a vector with the content of a column from this matrix */
public IVector getVectorFromColumn ( int index ) { } } | IVector result = new IVector ( rows ) ; for ( int i = 0 ; i < rows ; i ++ ) { result . realvector [ i ] = realmatrix [ i ] [ index ] ; result . imagvector [ i ] = imagmatrix [ i ] [ index ] ; } return result ; |
public class TomcatResourceServlet { /** * Finds a matching welcome file for the supplied { @ link Resource } . This
* will be the first entry in the list of configured { @ link # _ welcomes
* welcome files } that existing within the directory referenced by the
* < code > Resource < / code > . If the resource is not a directory , or no matching
* file is found , then it may look for a valid servlet mapping . If there is
* none , then < code > null < / code > is returned . The list of welcome files is
* read from the { @ link ContextHandler } for this servlet , or
* < code > " index . jsp " , " index . html " < / code > if that is < code > null < / code > .
* @ param resource
* @ return The path of the matching welcome file in context or null .
* @ throws IOException
* @ throws MalformedURLException */
private String getWelcomeFile ( String pathInContext ) throws MalformedURLException , IOException { } } | if ( welcomes == null ) { return null ; } if ( ! pathInContext . endsWith ( "/" ) ) { pathInContext = pathInContext + "/" ; } if ( ! "default" . equals ( name ) && pathInContext . startsWith ( name ) ) { // in Tomcat , welcome - files registered in HttpService directly , with non - default resource servlet
} for ( int i = 0 ; i < welcomes . length ; i ++ ) { if ( httpContext . getResource ( pathInContext + welcomes [ i ] ) != null ) { return pathInContext + welcomes [ i ] ; } } return null ; |
public class DescribeMatchmakingConfigurationsResult { /** * Collection of requested matchmaking configuration objects .
* @ param configurations
* Collection of requested matchmaking configuration objects . */
public void setConfigurations ( java . util . Collection < MatchmakingConfiguration > configurations ) { } } | if ( configurations == null ) { this . configurations = null ; return ; } this . configurations = new java . util . ArrayList < MatchmakingConfiguration > ( configurations ) ; |
public class CmsProperty { /** * Returns the single String value representation for the given value list . < p >
* @ param valueList the value list to create the single String value for
* @ return the single String value representation for the given value list */
private String createValueFromList ( List < String > valueList ) { } } | if ( valueList == null ) { return null ; } StringBuffer result = new StringBuffer ( valueList . size ( ) * 32 ) ; Iterator < String > i = valueList . iterator ( ) ; while ( i . hasNext ( ) ) { result . append ( replaceDelimiter ( i . next ( ) . toString ( ) , VALUE_LIST_DELIMITER , VALUE_LIST_DELIMITER_REPLACEMENT ) ) ; if ( i . hasNext ( ) ) { result . append ( VALUE_LIST_DELIMITER ) ; } } return result . toString ( ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.