signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class MaxSATSolver { /** * Solves the formula on the solver and returns the result .
* @ param handler a MaxSAT handler
* @ return the result ( SAT , UNSAT , Optimum found , or UNDEF if canceled by the handler ) */
public MaxSAT . MaxSATResult solve ( final MaxSATHandler handler ) { } } | if ( this . result != UNDEF ) return this . result ; if ( this . solver . currentWeight ( ) == 1 ) this . solver . setProblemType ( MaxSAT . ProblemType . UNWEIGHTED ) ; else this . solver . setProblemType ( MaxSAT . ProblemType . WEIGHTED ) ; this . result = this . solver . search ( handler ) ; return this . result ; |
public class Record { /** * Copy all the fields from one record to another .
* @ param recSource
* @ param resource
* @ param bDisplayOption
* @ param iMoveMode
* @ param bAllowFieldChange
* @ param bOnlyModifiedFields
* @ param bMoveModifiedState
* @ param syncSelection TODO
* @ return true if succes... | boolean bFieldsMoved = false ; for ( int iFieldSeq = 0 ; iFieldSeq < this . getFieldCount ( ) ; iFieldSeq ++ ) { BaseField fldDest = this . getField ( iFieldSeq ) ; BaseField fldSource = null ; try { if ( resource == Record . MOVE_BY_NAME ) { String strSourceField = fldDest . getFieldName ( ) ; fldSource = recSource . ... |
public class ActionRow { /** * { @ inheritDoc } */
@ Override public List < Example > actionCells ( Example row ) { } } | return ExampleUtil . asList ( row . firstChild ( ) ) ; |
public class GVRInputManager { /** * Dispatch a { @ link MotionEvent } to the { @ link GVRInputManager } .
* @ param event The { @ link MotionEvent } to be processed .
* @ return < code > true < / code > if the { @ link MotionEvent } is handled by the
* { @ link GVRInputManager } , < code > false < / code > other... | GVRCursorController controller = getUniqueControllerId ( event . getDeviceId ( ) ) ; if ( ( controller != null ) && controller . isEnabled ( ) ) { return controller . dispatchMotionEvent ( event ) ; } return false ; |
public class ResourceGroovyMethods { /** * Filters the lines of a File and creates a Writable in return to
* stream the filtered lines .
* @ param self a File
* @ param closure a closure which returns a boolean indicating to filter
* the line or not
* @ return a Writable closure
* @ throws IOException if < ... | return IOGroovyMethods . filterLine ( newReader ( self ) , closure ) ; |
public class SQLDroidStatement { /** * Close the result set ( if open ) and null the rs variable . */
public void closeResultSet ( ) throws SQLException { } } | if ( rs != null ) { if ( ! rs . isClosed ( ) ) { rs . close ( ) ; } rs = null ; } |
public class CredentialsServiceImpl { /** * { @ inheritDoc } */
@ Override public void setCredentials ( Subject subject ) throws CredentialException { } } | // Step through the list of registered providers
Iterator < CredentialProvider > itr = credentialProviders . getServices ( ) ; while ( itr . hasNext ( ) ) { CredentialProvider provider = itr . next ( ) ; provider . setCredential ( subject ) ; } |
public class SibRaEngineComponent { /** * Returns < code > true < / code > if the given messaging engine is reloading ,
* otherwise < code > false < / code > .
* @ param meUuid
* the messaging engine UUID
* @ return < code > true < / code > if the messaging engine is reloading ,
* otherwise < code > false < /... | final String methodName = "isMessagingEngineReloading" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( TRACE , methodName , meUuid ) ; } final boolean reloading = RELOADING_MESSAGING_ENGINES . contains ( meUuid ) ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , methodName , Boolean . valueOf ( reloadi... |
public class ApiOvhMe { /** * Delete this object
* REST : DELETE / me / identity / group / { group }
* @ param group [ required ] Group ' s name */
public void identity_group_group_DELETE ( String group ) throws IOException { } } | String qPath = "/me/identity/group/{group}" ; StringBuilder sb = path ( qPath , group ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ; |
public class RemoteBundleContextClient { /** * { @ inheritDoc } */
public long installBundle ( final String bundleUrl ) { } } | try { return getRemoteBundleContext ( ) . installBundle ( bundleUrl ) ; } catch ( RemoteException e ) { throw new TestContainerException ( "Remote exception" , e ) ; } catch ( BundleException e ) { throw new TestContainerException ( "Bundle cannot be installed" , e ) ; } |
public class DefaultPropertyExtractor { /** * getText .
* @ param key a { @ link java . lang . String } object .
* @ param defaultVal a { @ link java . lang . String } object .
* @ return a { @ link java . lang . String } object . */
protected String getText ( String key , String defaultVal ) { } } | return textResource . getText ( key , defaultVal ) ; |
public class RippleComponent { /** * Starts a ripple enter animation .
* @ param fast whether the ripple should enter quickly */
public final void enter ( boolean fast ) { } } | cancel ( ) ; mSoftwareAnimator = createSoftwareEnter ( fast ) ; if ( mSoftwareAnimator != null ) { mSoftwareAnimator . start ( ) ; } |
public class SqlHelper { /** * 判断自动 = = null的条件结构
* @ param column
* @ param contents
* @ param empty
* @ return */
public static String getIfIsNull ( EntityColumn column , String contents , boolean empty ) { } } | return getIfIsNull ( null , column , contents , empty ) ; |
public class AbstractScriptProvider { /** * 找出脚本类
* @ param clazzs
* @ return
* @ throws InstantiationException
* @ throws IllegalAccessException */
@ SuppressWarnings ( "unchecked" ) private Set < Class < ? extends T > > findScriptClass ( Set < Class < ? > > clazzs ) throws InstantiationException , IllegalAcce... | Set < Class < ? extends T > > scriptClazzs = new HashSet < Class < ? extends T > > ( ) ; for ( Class < ? > clazz : clazzs ) { Class < T > scriptClazz = null ; try { scriptClazz = ( Class < T > ) clazz ; } catch ( Throwable e ) { } if ( scriptClazz == null ) { continue ; } if ( acceptClass ( scriptClazz ) ) { scriptClaz... |
public class Base64EncodedCiphererImpl { /** * Encrypts or decrypts a message . The encryption / decryption mode depends on
* the configuration of the mode parameter .
* @ param key a base64 encoded version of the symmetric key
* @ param initializationVector a base64 encoded version of the
* initialization vect... | try { IvParameterSpec initializationVectorSpec = new IvParameterSpec ( Base64 . decodeBase64 ( initializationVector ) ) ; final SecretKeySpec keySpec = new SecretKeySpec ( Base64 . decodeBase64 ( key ) , keyAlgorithm ) ; final Cipher cipher = ( ( ( provider == null ) || ( provider . length ( ) == 0 ) ) ? Cipher . getIn... |
public class DatabaseTaskStore { /** * { @ inheritDoc } */
@ Override public TaskRecord getTrigger ( long taskId ) throws Exception { } } | String find = "SELECT t.OWNR,t.STATES,t.TRIG FROM Task t WHERE t.ID=:i" ; final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "getTrigger" , taskId , find ) ; List < Object [ ] > resultList ; EntityManager em = getPersistenceServiceUnit ( ) .... |
public class JAXBMarshallerHelper { /** * Set the Sun specific namespace prefix mapper . Value must implement either
* < code > com . sun . xml . bind . marshaller . NamespacePrefixMapper < / code > or
* < code > com . sun . xml . internal . bind . marshaller . NamespacePrefixMapper < / code >
* depending on the ... | final String sPropertyName = SUN_PREFIX_MAPPER ; _setProperty ( aMarshaller , sPropertyName , aNamespacePrefixMapper ) ; |
public class ChineseEnglishWordMap { /** * Returns a reversed map of the current map .
* @ return A reversed map of the current map . */
public Map < String , Set < String > > getReverseMap ( ) { } } | Set < Map . Entry < String , Set < String > > > entries = map . entrySet ( ) ; Map < String , Set < String > > rMap = new HashMap < String , Set < String > > ( entries . size ( ) ) ; for ( Map . Entry < String , Set < String > > me : entries ) { String k = me . getKey ( ) ; Set < String > transList = me . getValue ( ) ... |
public class FieldPosition { /** * Return true if the receiver wants a < code > Format . Field < / code > value and
* < code > attribute < / code > is equal to it . */
private boolean matchesField ( Format . Field attribute ) { } } | if ( this . attribute != null ) { return this . attribute . equals ( attribute ) ; } return false ; |
public class Hex { /** * Converts an array of characters representing hexidecimal values into an
* array of bytes of those same values . The returned array will be half the
* length of the passed array , as it takes two characters to represent any
* given byte . An exception is thrown if the passed char array has... | int len = data . length ; if ( ( len & 0x01 ) != 0 ) { throw new DecoderException ( "Odd number of characters." ) ; } byte [ ] out = new byte [ len >> 1 ] ; // two characters form the hex value .
for ( int i = 0 , j = 0 ; j < len ; i ++ ) { int f = toDigit ( data [ j ] , j ) << 4 ; j ++ ; f = f | toDigit ( data [ j ] ,... |
public class TriggerBuilder { /** * Set the identity of the Job which should be fired by the produced Trigger ,
* by extracting the JobKey from the given job .
* @ param jobDetail
* the Job to fire .
* @ return the updated TriggerBuilder
* @ see ITrigger # getJobKey ( ) */
@ Nonnull public TriggerBuilder < T ... | final JobKey k = jobDetail . getKey ( ) ; if ( k . getName ( ) == null ) throw new IllegalArgumentException ( "The given job has not yet had a name assigned to it." ) ; m_aJobKey = k ; return this ; |
public class MarkdownRenderer { /** * ( non - Javadoc )
* @ see net . roboconf . doc . generator . internal . AbstractStructuredRenderer
* # endSection ( java . lang . String , java . lang . StringBuilder ) */
@ Override protected StringBuilder endSection ( String sectionName , StringBuilder sb ) { } } | sb . append ( "<br />\n" ) ; return sb ; |
public class CmsADEConfigData { /** * Returns the formatter change sets for this and all parent sitemaps , ordered by increasing folder depth of the sitemap . < p >
* @ return the formatter change sets for all ancestor sitemaps */
public List < CmsFormatterChangeSet > getFormatterChangeSets ( ) { } } | CmsADEConfigData currentConfig = this ; List < CmsFormatterChangeSet > result = Lists . newArrayList ( ) ; while ( currentConfig != null ) { CmsFormatterChangeSet changes = currentConfig . getOwnFormatterChangeSet ( ) ; if ( changes != null ) { result . add ( changes ) ; } currentConfig = currentConfig . parent ( ) ; }... |
public class Timestamp { /** * Returns the result of dividing x by y rounded using floor . */
private static long floorDiv ( long x , long y ) { } } | return BigDecimal . valueOf ( x ) . divide ( BigDecimal . valueOf ( y ) , 0 , RoundingMode . FLOOR ) . longValue ( ) ; |
public class LSrtToCharFunctionBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static LSrtToCharFunction srtToCharFunctionFrom ( Consumer < LSrtToCharFunctionBuilder > buildingFunction ) { } } | LSrtToCharFunctionBuilder builder = new LSrtToCharFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class JdbcUtil { /** * Imports the data from < code > DataSet < / code > to database .
* @ param dataset
* @ param selectColumnNames
* @ param stmt the column order in the sql must be consistent with the column order in the DataSet .
* @ return
* @ throws UncheckedSQLException */
public static int impo... | return importData ( dataset , selectColumnNames , 0 , dataset . size ( ) , stmt ) ; |
public class ConfigurationRegistry { /** * Reloads a specific dynamic configuration option .
* @ param key the key of the configuration option */
public void reload ( String key ) { } } | if ( configurationOptionsByKey . containsKey ( key ) ) { configurationOptionsByKey . get ( key ) . reload ( false ) ; } |
public class RequestEvents { /** * Publish finish events for each of the specified query types
* < pre >
* { @ code
* RequestEvents . start ( " get " , 1l , bus , " typeA " , " custom " ) ;
* try {
* return " ok " ;
* } finally {
* RequestEvents . finish ( " get " , 1l , bus , " typeA " , " custom " ) ;
... | for ( String type : types ) { RemoveQuery < T > next = finish ( query , correlationId , type ) ; bus . post ( next ) ; } |
public class LogFetcher { /** * Downloads the logs to a local temp folder .
* @ param applicationId
* @ return
* @ throws URISyntaxException
* @ throws StorageException
* @ throws IOException */
private File downloadToTempFolder ( final String applicationId ) throws URISyntaxException , StorageException , IOE... | final File outputFolder = Files . createTempDirectory ( "reeflogs-" + applicationId ) . toFile ( ) ; if ( ! outputFolder . exists ( ) && ! outputFolder . mkdirs ( ) ) { LOG . log ( Level . WARNING , "Failed to create [{0}]" , outputFolder . getAbsolutePath ( ) ) ; } final CloudBlobDirectory logFolder = this . container... |
public class Httpserver { /** * LogHandler */
public void start ( ) { } } | int numHandler = 3 ; InetSocketAddress socketAddr = new InetSocketAddress ( port ) ; Executor executor = Executors . newFixedThreadPool ( numHandler ) ; try { hs = HttpServer . create ( socketAddr , 0 ) ; hs . createContext ( HttpserverUtils . HTTPSERVER_CONTEXT_PATH_LOGVIEW , new LogHandler ( conf ) ) ; hs . setExecut... |
import java . util . * ; public class Main { public static void main ( String [ ] args ) { System . out . println ( filterOutEvenNumbers ( Arrays . asList ( 1 , 3 , 5 , 2 ) ) ) ; // [1 , 3 , 5]
System . out . println ( filterOutEvenNumbers ( Arrays . asList ( 5 , 6 , 7 ) ) ) ; // [5 , 7]
System . out . println ( filter... | List < Integer > outputList = new ArrayList < > ( ) ; for ( Integer i : inputList ) { if ( i % 2 != 0 ) { outputList . add ( i ) ; } } return outputList ; |
public class PrivacyListManager { /** * Client declines the use of active lists .
* @ throws XMPPErrorException
* @ throws NoResponseException
* @ throws NotConnectedException
* @ throws InterruptedException */
public void declineActiveList ( ) throws NoResponseException , XMPPErrorException , NotConnectedExcep... | // The request of the list is an privacy message with an empty list
Privacy request = new Privacy ( ) ; request . setDeclineActiveList ( true ) ; // Send the package to the server
setRequest ( request ) ; |
public class BezierCurve { /** * Creates Bezier function for fixed control points .
* @ param controlPoints
* @ return */
public ParameterizedOperator operator ( Point2D . Double ... controlPoints ) { } } | if ( controlPoints . length != length ) { throw new IllegalArgumentException ( "control-points length not " + length ) ; } double [ ] cp = convert ( controlPoints ) ; return operator ( cp ) ; |
public class CmsAliasBulkEditHelper { /** * Message accessor .
* @ param locale the locale for messages
* @ return the message string */
private String messageDuplicateAliasPath ( Locale locale ) { } } | return Messages . get ( ) . getBundle ( locale ) . key ( Messages . ERR_ALIAS_DUPLICATE_ALIAS_PATH_0 ) ; |
public class AbstractStreamParameters { /** * Add a location to the filter
* Does not replace any existing locations in the filter .
* @ param west the longitude of the western side of the location ' s bounding box .
* @ param south the latitude of the southern side of the location ' s bounding box .
* @ param ... | if ( locations . length ( ) > 0 ) { locations . append ( ',' ) ; } locations . append ( west ) . append ( ',' ) . append ( south ) . append ( ',' ) ; locations . append ( east ) . append ( ',' ) . append ( north ) . append ( ',' ) ; return this ; |
public class HealthCheckClient { /** * Returns the specified HealthCheck resource . Gets a list of available health checks by making a
* list ( ) request .
* < p > Sample code :
* < pre > < code >
* try ( HealthCheckClient healthCheckClient = HealthCheckClient . create ( ) ) {
* ProjectGlobalHealthCheckName h... | GetHealthCheckHttpRequest request = GetHealthCheckHttpRequest . newBuilder ( ) . setHealthCheck ( healthCheck == null ? null : healthCheck . toString ( ) ) . build ( ) ; return getHealthCheck ( request ) ; |
public class TileBoundingBoxUtils { /** * Get the tolerance distance in meters for the zoom level and pixels length
* @ param zoom
* zoom level
* @ param pixelWidth
* pixel width
* @ param pixelHeight
* pixel height
* @ return tolerance distance in meters
* @ since 2.0.0 */
public static double toleranc... | return toleranceDistance ( zoom , Math . max ( pixelWidth , pixelHeight ) ) ; |
public class Util { /** * Creates a filtered sublist . */
@ Nonnull public static < T > List < T > filter ( @ Nonnull List < ? > base , @ Nonnull Class < T > type ) { } } | return filter ( ( Iterable ) base , type ) ; |
public class SimpleCallStateMachine { /** * Since traffic can come in any order due to the fact that we can merge
* multiple pcaps etc we may miss the initial traffic ( perhaps we didn ' t
* even captured it ) so when initializing the state we can really jump into
* the state machine anywhere . Hence , this metho... | if ( msg . isRequest ( ) ) { if ( msg . isInvite ( ) && msg . isInitial ( ) ) { transition ( CallState . INITIAL , msg ) ; } else if ( msg . isAck ( ) ) { // TODO : need to figure out whether this is an ACK to a 200 or
// a error response since we would transition differently
// but not sure how we could if the initial... |
public class Closeables { /** * Creates a closeable spliterator that when closed will close the underlying stream as well
* @ param stream The stream to change into a closeable spliterator
* @ param < R > The type of the stream
* @ return A spliterator that when closed will also close the underlying stream */
pub... | Spliterator < R > spliterator = stream . spliterator ( ) ; if ( spliterator instanceof CloseableSpliterator ) { return ( CloseableSpliterator < R > ) spliterator ; } return new StreamToCloseableSpliterator < > ( stream , spliterator ) ; |
public class LooseArtifactNotifier { /** * { @ inheritDoc } */
@ Override public synchronized boolean removeListener ( ArtifactListener listenerToRemove ) { } } | ArtifactListenerSelector listenerSelectorToRemove = new ArtifactListenerSelector ( listenerToRemove ) ; List < Registration > rToRemove = new ArrayList < Registration > ( ) ; for ( Registration r : listeners ) { if ( r . listener . equals ( listenerSelectorToRemove ) ) { rToRemove . add ( r ) ; } } listeners . removeAl... |
public class Settings { /** * Loads a property of the type URL from the Properties object
* @ param propertyKey
* the property name
* @ return the value */
@ SuppressWarnings ( "unused" ) private URL loadURLProperty ( String propertyKey ) { } } | String urlPropValue = prop . getProperty ( propertyKey ) ; if ( urlPropValue == null || urlPropValue . isEmpty ( ) ) { return null ; } else { try { return new URL ( urlPropValue . trim ( ) ) ; } catch ( MalformedURLException e ) { LOGGER . error ( "'" + propertyKey + "' contains malformed url." , e ) ; return null ; } ... |
public class Input { /** * Returns a boolean stating whether there are more properties
* @ return boolean < code > true < / code > if there are more properties to read ,
* < code > false < / code > otherwise */
public boolean hasMoreProperties ( ) { } } | if ( buf . remaining ( ) >= 3 ) { byte [ ] threeBytes = new byte [ 3 ] ; int pos = buf . position ( ) ; buf . get ( threeBytes ) ; if ( Arrays . equals ( AMF . END_OF_OBJECT_SEQUENCE , threeBytes ) ) { log . trace ( "End of object" ) ; return false ; } buf . position ( pos ) ; return true ; } // an end - of - object ma... |
public class ApacheLogSplitFunction { /** * ログ情報マップを基にApacheLogエンティティを生成する 。
* @ param logInfoMap ログ情報マップ
* @ return ApacheLogエンティティ
* @ throws ParseException パース失敗時 */
protected ApacheLog createEntity ( Map < String , String > logInfoMap ) throws ParseException { } } | String serverName = logInfoMap . get ( "hostname" ) ; String sizeStr = logInfoMap . get ( "size" ) ; String timeStr = logInfoMap . get ( "reqtime_microsec" ) ; String recordedTimeStr = logInfoMap . get ( "time" ) ; long size = 0 ; long time = 0 ; Date recordedTime = null ; if ( sizeStr != null && StringUtils . equals (... |
public class TargetStreamManager { /** * Send a request to flush a stream . The originator of the stream ,
* and the ID for the stream must be known . This method is public
* because it ' s not clear who ' s going to call this yet .
* @ param source The originator of the stream ( may be multiple hops
* away ) .... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "requestFlushAtSource" , new Object [ ] { source , stream } ) ; // Synchronize here to avoid races ( not that we expect any )
synchronized ( flushMap ) { if ( flushMap . containsKey ( stream ) ) { // Already a request... |
public class GeniaCorpusCollectionReader { /** * Recursive , since annotations can overlap */
private static String annotatateContent ( JCas jcas , Object contentObj , int start ) { } } | LOG . trace ( "annotate: " + reflectionToString ( contentObj ) ) ; int end = start ; StringBuilder internalSb = new StringBuilder ( ) ; if ( contentObj instanceof String ) { String c = ( String ) contentObj ; internalSb . append ( c ) ; end += c . length ( ) ; } else if ( contentObj instanceof Cons ) { Cons cons = ( Co... |
public class MapMessage { /** * Adds an item to the data Map .
* @ param key The name of the data item .
* @ param value The value of the data item . */
public void put ( final String key , final String value ) { } } | if ( value == null ) { throw new IllegalArgumentException ( "No value provided for key " + key ) ; } validate ( key , value ) ; data . putValue ( key , value ) ; |
public class FrameworkManager { /** * Delayed registration of the platform MBeanServerPipeline in the OSGi registry .
* @ param systemContext The framework system bundle context */
private void preRegisterMBeanServerPipelineService ( final BundleContext systemContext ) { } } | PlatformMBeanServerBuilder . addPlatformMBeanServerBuilderListener ( new PlatformMBeanServerBuilderListener ( ) { @ Override @ FFDCIgnore ( IllegalStateException . class ) public void platformMBeanServerCreated ( final MBeanServerPipeline pipeline ) { if ( pipeline != null ) { final Hashtable < String , String > svcPro... |
public class RandomVMPlacement { /** * Check if a VM can stay on its current node .
* @ param rp the reconfiguration problem .
* @ param vm the VM
* @ return { @ code true } iff the VM can stay */
public int canStay ( ReconfigurationProblem rp , VM vm ) { } } | Mapping m = rp . getSourceModel ( ) . getMapping ( ) ; if ( m . isRunning ( vm ) ) { Node n = m . getVMLocation ( vm ) ; int curPos = nodeMap [ n . id ( ) ] ; if ( actionMap [ vm . id ( ) ] . getDSlice ( ) . getHoster ( ) . contains ( curPos ) ) { return curPos ; } } return - 1 ; |
public class ArrayMatrix { /** * { @ inheritDoc } */
public double [ ] getRow ( int row ) { } } | checkIndices ( row , 0 ) ; double [ ] rowArr = new double [ cols ] ; int index = getIndex ( row , 0 ) ; for ( int i = 0 ; i < cols ; ++ i ) rowArr [ i ] = matrix [ index ++ ] ; return rowArr ; |
public class SwimMembershipProtocol { /** * Gossips this node ' s pending updates with the given peer .
* @ param member the peer with which to gossip this node ' s updates
* @ param updates the updated members to gossip */
private void gossip ( SwimMember member , Collection < ImmutableMember > updates ) { } } | LOGGER . trace ( "{} - Gossipping updates {} to {}" , localMember . id ( ) , updates , member ) ; bootstrapService . getUnicastService ( ) . unicast ( member . address ( ) , MEMBERSHIP_GOSSIP , SERIALIZER . encode ( updates ) ) ; |
public class ArrowConverter { /** * Provide a value look up dictionary based on the
* given set of input { @ link FieldVector } s for
* reading and writing to arrow streams
* @ param vectors the vectors to use as a lookup
* @ return the associated { @ link DictionaryProvider } for the given
* input { @ link F... | Dictionary [ ] dictionaries = new Dictionary [ vectors . size ( ) ] ; for ( int i = 0 ; i < vectors . size ( ) ; i ++ ) { DictionaryEncoding dictionary = fields . get ( i ) . getDictionary ( ) ; if ( dictionary == null ) { dictionary = new DictionaryEncoding ( i , true , null ) ; } dictionaries [ i ] = new Dictionary (... |
public class ArrayTypes { /** * / * @ Nullable */
public ArrayTypeReference tryConvertToArray ( ParameterizedTypeReference typeReference ) { } } | ArrayTypeReference result = doTryConvertToArray ( typeReference ) ; if ( result != null ) { return result ; } else { JvmType type = typeReference . getType ( ) ; if ( type . eClass ( ) == TypesPackage . Literals . JVM_TYPE_PARAMETER ) { return doTryConvertToArray ( typeReference , new RecursionGuard < JvmTypeParameter ... |
public class ControlServerHandler { /** * will send no message after the FINISHED */
private void writeEvent ( final ChannelHandlerContext ctx , final Object message ) { } } | if ( isFinishedSent ) return ; if ( message instanceof FinishedMessage ) isFinishedSent = true ; Channels . write ( ctx , Channels . future ( null ) , message ) ; |
public class SqlREPL { /** * HELPメッセージの表示
* @ param terminal Terminal */
private void showHelp ( final Terminal terminal ) { } } | showMessage ( terminal , "/message.txt" ) ; commands . stream ( ) . filter ( c -> ! c . isHidden ( ) ) . forEach ( c -> c . showHelp ( terminal ) ) ; |
public class RestoreAgent { /** * Get the txnId of the snapshot the cluster is restoring from from ZK .
* NOTE that the barrier for this is now completely contained
* in run ( ) in the restorePlanner thread ; nobody gets out of there until
* someone wins the leader election and successfully writes the VoltZK . re... | try { byte [ ] data = m_zk . getData ( VoltZK . restore_snapshot_id , false , null ) ; String jsonData = new String ( data , Constants . UTF8ENCODING ) ; if ( ! jsonData . equals ( "{}" ) ) { m_hasRestored = true ; JSONObject jo = new JSONObject ( jsonData ) ; SnapshotInfo info = new SnapshotInfo ( jo ) ; m_replayAgent... |
public class Value { /** * Performing a dynamic type conversion . This method is usually specialized by subclasses that know how to convert
* themselves to other types . If they fail , they delegate the conversion up to this superclass method which deals
* with the special cases : unions , type parameters , optiona... | if ( Settings . dynamictypechecks ) { // In VDM + + and VDM - RT , we do not want to do thread swaps half way
// through a DTC check ( which can include calculating an invariant ) ,
// so we set the atomic flag around the conversion . This also stops
// VDM - RT from performing " time step " calculations .
Value conver... |
public class ListBackupVaultsResult { /** * An array of backup vault list members containing vault metadata , including Amazon Resource Name ( ARN ) , display
* name , creation date , number of saved recovery points , and encryption information if the resources saved in the
* backup vault are encrypted .
* < b > ... | if ( this . backupVaultList == null ) { setBackupVaultList ( new java . util . ArrayList < BackupVaultListMember > ( backupVaultList . length ) ) ; } for ( BackupVaultListMember ele : backupVaultList ) { this . backupVaultList . add ( ele ) ; } return this ; |
public class VerticalViewPager { /** * Fake drag by an offset in pixels . You must have called { @ link # beginFakeDrag ( ) } first .
* @ param yOffset Offset in pixels to drag by .
* @ see # beginFakeDrag ( )
* @ see # endFakeDrag ( ) */
public void fakeDragBy ( float yOffset ) { } } | if ( ! mFakeDragging ) { throw new IllegalStateException ( "No fake drag in progress. Call beginFakeDrag first." ) ; } mLastMotionY += yOffset ; float oldScrollY = getScrollY ( ) ; float scrollY = oldScrollY - yOffset ; final int height = getClientHeight ( ) ; float topBound = height * mFirstOffset ; float bottomBound ... |
public class clusternodegroup { /** * Use this API to update clusternodegroup . */
public static base_response update ( nitro_service client , clusternodegroup resource ) throws Exception { } } | clusternodegroup updateresource = new clusternodegroup ( ) ; updateresource . name = resource . name ; updateresource . strict = resource . strict ; return updateresource . update_resource ( client ) ; |
public class ValidatingDocumentBuilder { /** * Parses the given File and validates the resulting DOM . */
public Document parse ( File file ) throws SAXException , IOException { } } | return verify ( _WrappedBuilder . parse ( file ) ) ; |
public class InfixParser { /** * Count how many time needle appears in haystack
* @ param haystack
* @ param needle
* @ return */
private int countOccurrences ( String haystack , char needle ) { } } | int count = 0 ; for ( int i = 0 ; i < haystack . length ( ) ; i ++ ) { if ( haystack . charAt ( i ) == needle ) count ++ ; } return count ; |
public class Compiler { /** * Runs custom passes that are designated to run at a particular time . */
private void runCustomPasses ( CustomPassExecutionTime executionTime ) { } } | if ( options . customPasses != null ) { Tracer t = newTracer ( "runCustomPasses" ) ; try { for ( CompilerPass p : options . customPasses . get ( executionTime ) ) { process ( p ) ; } } finally { stopTracer ( t , "runCustomPasses" ) ; } } |
public class TagContextUtils { /** * Add a { @ code Tag } of any type to a builder .
* @ param tag tag containing the key and value to set .
* @ param builder the builder to update . */
static void addTagToBuilder ( Tag tag , TagMapBuilderImpl builder ) { } } | builder . put ( tag . getKey ( ) , tag . getValue ( ) , tag . getTagMetadata ( ) ) ; |
public class AudioNormalizationSettingsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AudioNormalizationSettings audioNormalizationSettings , ProtocolMarshaller protocolMarshaller ) { } } | if ( audioNormalizationSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( audioNormalizationSettings . getAlgorithm ( ) , ALGORITHM_BINDING ) ; protocolMarshaller . marshall ( audioNormalizationSettings . getAlgorithmControl ( ) , A... |
public class AbatisService { /** * 指定したSQLIDにparameterをmappingして 、 クエリする 。 結果mapをリストで返却 。
* mappingの時 、 parameterが足りない場合はnullを返す 。
* @ param sqlId
* SQLID
* @ param bindParams
* sql parameter
* @ return List < Map < String , Object > > result */
public List < Map < String , Object > > executeForMapList ( ... | String sql = context . getResources ( ) . getString ( sqlId ) ; return executeForMapList ( sql , bindParams ) ; |
public class LayerControlPanelPresenterImpl { @ Override public void toggleLayerVisibility ( ) { } } | log . log ( Level . INFO , "toggleLayerVisibility()" ) ; layer . setMarkedAsVisible ( ! layer . isMarkedAsVisible ( ) ) ; |
public class StreamScanner { /** * Note : does not check for number of colons , amongst other things .
* Main idea is to skip through what superficially seems like a valid
* id , nothing more . This is only done when really skipping through
* something we do not care about at all : not even whether names / ids
... | if ( ! isNameStartChar ( c ) ) { -- mInputPtr ; return 0 ; } /* After which there may be zero or more name chars
* we have to consider */
int count = 1 ; while ( true ) { c = ( mInputPtr < mInputEnd ) ? mInputBuffer [ mInputPtr ++ ] : getNextChar ( SUFFIX_EOF_EXP_NAME ) ; if ( c != ':' && ! isNameChar ( c ) ) { break... |
public class TaskClient { /** * Removes a task from a taskType queue
* @ param taskType the taskType to identify the queue
* @ param taskId the id of the task to be removed */
public void removeTaskFromQueue ( String taskType , String taskId ) { } } | Preconditions . checkArgument ( StringUtils . isNotBlank ( taskType ) , "Task type cannot be blank" ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( taskId ) , "Task id cannot be blank" ) ; delete ( "tasks/queue/{taskType}/{taskId}" , taskType , taskId ) ; |
public class Rechnungsmonat { /** * Hiermit kann der Rechnungsmonats im gewuenschten Format ausgegeben
* werden . Als Parameter sind die gleichen Patterns wie beim
* { @ link DateTimeFormatter # ofPattern ( String , Locale ) } bzw .
* { @ link java . text . SimpleDateFormat } moeglich .
* @ param pattern z . B ... | DateTimeFormatter formatter = DateTimeFormatter . ofPattern ( pattern , locale ) ; return asLocalDate ( ) . format ( formatter ) ; |
public class CommonOps_DDF4 { /** * < p > Performs an element by element multiplication operation : < br >
* < br >
* c < sub > ij < / sub > = a < sub > ij < / sub > * b < sub > ij < / sub > < br >
* @ param a The left matrix in the multiplication operation . Not modified .
* @ param b The right matrix in the m... | c . a11 = a . a11 * b . a11 ; c . a12 = a . a12 * b . a12 ; c . a13 = a . a13 * b . a13 ; c . a14 = a . a14 * b . a14 ; c . a21 = a . a21 * b . a21 ; c . a22 = a . a22 * b . a22 ; c . a23 = a . a23 * b . a23 ; c . a24 = a . a24 * b . a24 ; c . a31 = a . a31 * b . a31 ; c . a32 = a . a32 * b . a32 ; c . a33 = a . a33 * ... |
public class Sudoku { /** * ( non - Javadoc )
* @ see org . kie . examples . sudoku . swing . SudokuGridModel # setCellValues ( java . lang . Integer [ ] [ ] ) */
public void setCellValues ( Integer [ ] [ ] cellValues ) { } } | if ( session != null ) { session . removeEventListener ( workingMemoryListener ) ; session . dispose ( ) ; steppingFactHandle = null ; } this . session = kc . newKieSession ( "SudokuKS" ) ; session . setGlobal ( "explain" , explain ) ; session . addEventListener ( workingMemoryListener ) ; Setting s000 = new Setting ( ... |
public class ParentsRenderer { /** * This method is public for testing purposes only . Do not try to call it
* outside of the context of the rendering engine .
* @ param builder Buffer for holding the rendition
* @ param pad Minimum number spaces for padding each line of the output
* @ param father Father */
pu... | renderParent ( builder , pad , father , "Father" ) ; |
public class GlobalForwardingRuleClient { /** * Deletes the specified GlobalForwardingRule resource .
* < p > Sample code :
* < pre > < code >
* try ( GlobalForwardingRuleClient globalForwardingRuleClient = GlobalForwardingRuleClient . create ( ) ) {
* ProjectGlobalForwardingRuleName forwardingRule = ProjectGlo... | DeleteGlobalForwardingRuleHttpRequest request = DeleteGlobalForwardingRuleHttpRequest . newBuilder ( ) . setForwardingRule ( forwardingRule == null ? null : forwardingRule . toString ( ) ) . build ( ) ; return deleteGlobalForwardingRule ( request ) ; |
public class SaneSession { /** * Establishes a connection to the SANE daemon running on the given host on the default SANE port
* with the given connection timeout . */
public static SaneSession withRemoteSane ( InetAddress saneAddress , long timeout , TimeUnit timeUnit ) throws IOException { } } | return withRemoteSane ( saneAddress , DEFAULT_PORT , timeout , timeUnit , 0 , TimeUnit . MILLISECONDS ) ; |
public class InjectorImpl { /** * Create a provider based on registered auto - binders . */
private < T > Provider < T > autoProvider ( Key < T > key ) { } } | for ( InjectAutoBind autoBind : _autoBind ) { Provider < T > provider = autoBind . provider ( this , key ) ; if ( provider != null ) { return provider ; } } return providerDefault ( key ) ; |
public class CryptoUtil { /** * 使用AES加密原始字符串 .
* @ param input 原始输入字符数组
* @ param key 符合AES要求的密钥
* @ param iv 初始向量 */
public static byte [ ] aesEncrypt ( byte [ ] input , byte [ ] key , byte [ ] iv ) { } } | return aes ( input , key , iv , Cipher . ENCRYPT_MODE ) ; |
public class TextProcessorChain { /** * Process the text
* @ param source the sourcetext
* @ return the result of text processing
* @ see TextProcessor # process ( CharSequence ) */
public CharSequence process ( CharSequence source ) { } } | CharSequence target = source ; for ( TextProcessor processor : processors ) { target = processor . process ( target ) ; } return target ; |
public class StandardResponsesApi { /** * Get the details of a Standard Response .
* @ param id id of the Standard Response ( required )
* @ param getStandardResponseData ( required )
* @ return ApiSuccessResponse
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the r... | ApiResponse < ApiSuccessResponse > resp = getStandardResponseWithHttpInfo ( id , getStandardResponseData ) ; return resp . getData ( ) ; |
public class ArrayUtils { /** * Divides the given object - array using the boundaries in < code > cuts < / code > .
* < br >
* Cuts are interpreted in an inclusive way , which means that a single cut
* at position i divides the given array in 0 . . . i - 1 + i . . . n < br >
* This method deals with both cut po... | return divideArray ( arr , cuts ) ; |
public class SQLExpressions { /** * divides an ordered data set into a number of buckets indicated by expr and assigns the
* appropriate bucket number to each row
* @ param num bucket size
* @ return ntile ( num ) */
@ SuppressWarnings ( "unchecked" ) public static < T extends Number & Comparable > WindowOver < T... | return new WindowOver < T > ( ( Class < T > ) num . getClass ( ) , SQLOps . NTILE , ConstantImpl . create ( num ) ) ; |
public class JirmUrlEncodedUtils { /** * Returns a String that is suitable for use as an < code > application / x - www - form - urlencoded < / code >
* list of parameters in an HTTP PUT or HTTP POST .
* @ param parameters The parameters to include .
* @ param encoding The encoding to use . */
public static Strin... | final StringBuilder result = new StringBuilder ( ) ; for ( final NameValuePair parameter : parameters ) { final String encodedName = encode ( parameter . getName ( ) , encoding ) ; final String value = parameter . getValue ( ) ; final String encodedValue = value != null ? encode ( value , encoding ) : "" ; if ( result ... |
public class ForestDBStore { /** * TODO return value from long to Status */
@ Override public long setInfo ( String key , String info ) { } } | final String k = key ; final String i = info ; try { Status status = inTransaction ( new Task ( ) { @ Override public Status run ( ) { try { forest . rawPut ( "info" , k , null , i == null ? null : i . getBytes ( ) ) ; return new Status ( Status . OK ) ; } catch ( ForestException e ) { Log . e ( TAG , "Error in KeyStor... |
public class Router { /** * Specify a middleware that will be called for a matching HTTP PUT
* @ param pattern The simple pattern
* @ param handlers The middleware to call */
public Router put ( @ NotNull final String pattern , @ NotNull final IMiddleware ... handlers ) { } } | addPattern ( "PUT" , pattern , handlers , putBindings ) ; return this ; |
public class DirectPDPClient { /** * ( non - Javadoc )
* @ see org . fcrepo . server . security . xacml . pep . PEPClient # evaluate ( java . lang . String ) */
@ Override public String evaluate ( String request ) throws PEPException { } } | if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Resolving String request:\n" + request ) ; } String response = null ; try { response = this . client . evaluate ( request ) ; } catch ( Exception e ) { logger . error ( "Error evaluating request." , e ) ; throw new PEPException ( "Error evaluating request" , e ) ; ... |
public class TCPInputPoller { /** * Immediately stop waiting for messages , and close the SocketServer . */
public void stopServer ( ) { } } | Log ( Level . INFO , "Attempting to stop SocketServer" ) ; keepRunning = false ; // Thread will be blocked waiting for input - unblock it by closing the socket underneath it :
if ( this . serverSocket != null ) { try { this . serverSocket . close ( ) ; } catch ( IOException e ) { Log ( Level . WARNING , "Something happ... |
public class ConfigurationCredentialsPolicy { /** * Adds the required headers to authenticate a request to Azure Application Configuration service .
* @ param context The request context
* @ param next The next HTTP pipeline policy to process the { @ code context ' s } request after this policy completes .
* @ re... | final Flux < ByteBuf > contents = context . httpRequest ( ) . body ( ) == null ? Flux . just ( getEmptyBuffer ( ) ) : context . httpRequest ( ) . body ( ) ; return contents . defaultIfEmpty ( getEmptyBuffer ( ) ) . collect ( ( ) -> { try { return MessageDigest . getInstance ( "SHA-256" ) ; } catch ( NoSuchAlgorithmExce... |
public class SoundStore { /** * Find a free sound source
* @ return The index of the free sound source */
private int findFreeSource ( ) { } } | for ( int i = 1 ; i < sourceCount - 1 ; i ++ ) { int state = AL10 . alGetSourcei ( sources . get ( i ) , AL10 . AL_SOURCE_STATE ) ; if ( ( state != AL10 . AL_PLAYING ) && ( state != AL10 . AL_PAUSED ) ) { return i ; } } return - 1 ; |
public class LineSearchFletcher86 { /** * Use either quadratic of cubic interpolation to guess the minimum . */
protected double interpolate ( double boundA , double boundB ) { } } | double alphaNew ; // interpolate minimum for rapid convergence
if ( Double . isNaN ( gp ) ) { alphaNew = SearchInterpolate . quadratic ( fprev , gprev , stprev , fp , stp ) ; } else { alphaNew = SearchInterpolate . cubic2 ( fprev , gprev , stprev , fp , gp , stp ) ; if ( Double . isNaN ( alphaNew ) ) alphaNew = SearchI... |
public class JsSrcMain { /** * Generates JS source code given a Soy parse tree , an options object , and an optional bundle of
* translated messages .
* @ param soyTree The Soy parse tree to generate JS source code for .
* @ param templateRegistry The template registry that contains all the template information .... | // VeLogInstrumentationVisitor add html attributes for { velog } commands and also run desugaring
// pass since code generator does not understand html nodes ( yet ) .
new VeLogInstrumentationVisitor ( templateRegistry ) . exec ( soyTree ) ; BidiGlobalDir bidiGlobalDir = SoyBidiUtils . decodeBidiGlobalDirFromJsOptions ... |
public class InitialRequestDispatcher { /** * Dispatch a request inside the container based on the information returned by the AR
* @ param sipProvider the sip Provider on which the request has been received
* @ param applicationRouterInfo information returned by the AR
* @ param sipServletRequest the request to ... | if ( logger . isDebugEnabled ( ) ) { logger . debug ( "dispatchInsideContainer - sipProvider=" + sipProvider + ", applicationRouterInfo=" + applicationRouterInfo + ", joinReplacesSipSession=" + joinReplacesSipSession + ", sipServletRequest=" + sipServletRequest + ", sipFactoryImpl=" + sipFactoryImpl + ", encodeURISipAp... |
public class RSAKeySecret { /** * Creates a private key from the PKCS # 8 - encoded value of the given bytes .
* @ param privateKey The PKCS # 8 - encoded private key bytes .
* @ return The private key . */
public static PrivateKey createPrivateKey ( byte [ ] privateKey ) { } } | if ( privateKey == null ) { return null ; } try { KeyFactory fac = KeyFactory . getInstance ( "RSA" ) ; EncodedKeySpec spec = new PKCS8EncodedKeySpec ( privateKey ) ; return fac . generatePrivate ( spec ) ; } catch ( NoSuchAlgorithmException e ) { throw new IllegalStateException ( e ) ; } catch ( InvalidKeySpecExceptio... |
public class ApiOvhIp { /** * Release the ip from anti - spam system
* REST : POST / ip / { ip } / spam / { ipSpamming } / unblock
* @ param ip [ required ]
* @ param ipSpamming [ required ] IP address which is sending spam */
public OvhSpamIp ip_spam_ipSpamming_unblock_POST ( String ip , String ipSpamming ) thro... | String qPath = "/ip/{ip}/spam/{ipSpamming}/unblock" ; StringBuilder sb = path ( qPath , ip , ipSpamming ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhSpamIp . class ) ; |
public class Context { /** * control flow */
public void bootstrap ( String className , Closure rootSpec ) { } } | assertNonNull ( "className" , className ) ; assertNonNull ( "rootSpec" , rootSpec ) ; changeStatus ( NOT_STARTED , RUNNING ) ; enterRootSpec ( className ) ; processSpec ( rootSpec ) ; exitSpec ( ) ; changeStatus ( RUNNING , FINISHED ) ; |
public class KnowledgePackageImpl { /** * Rule flows can be removed by ID . */
public void removeRuleFlow ( String id ) { } } | ProcessPackage rtp = ( ProcessPackage ) getResourceTypePackages ( ) . get ( ResourceType . BPMN2 ) ; if ( rtp == null || rtp . lookup ( id ) == null ) { throw new IllegalArgumentException ( "The rule flow with id [" + id + "] is not part of this package." ) ; } rtp . remove ( id ) ; |
public class XMLUpdateShredder { /** * Process start tag .
* @ param paramElem
* { @ link StartElement } currently parsed .
* @ throws XMLStreamException
* In case of any StAX parsing error .
* @ throws IOException
* In case of any I / O error .
* @ throws TTException
* In case of any Treetank error . *... | assert paramElem != null ; // Initialize variables .
initializeVars ( ) ; // Main algorithm to determine if same , insert or a delete has to be
// made .
algorithm ( paramElem ) ; if ( mFound && mIsRightSibling ) { mDelete = EDelete . ATSTARTMIDDLE ; deleteNode ( ) ; } else if ( ! mFound ) { // Increment levels .
mLeve... |
public class JobInProgress { /** * A taskid assigned to this JobInProgress has reported in successfully . */
public synchronized boolean completedTask ( TaskInProgress tip , TaskStatus status ) { } } | TaskAttemptID taskid = status . getTaskID ( ) ; int oldNumAttempts = tip . getActiveTasks ( ) . size ( ) ; final JobTrackerInstrumentation metrics = jobtracker . getInstrumentation ( ) ; // Metering
meterTaskAttempt ( tip , status ) ; // Sanity check : is the TIP already complete ?
// It _ is _ safe to not decrement ru... |
public class MessageAPI { /** * 获取设置的行业信息
* @ param access _ token access _ token
* @ return GetIndustryResult
* @ since 2.6.1 */
public static GetIndustryResult templateGet_industry ( String access_token ) { } } | HttpUriRequest httpUriRequest = RequestBuilder . post ( ) . setUri ( BASE_URI + "/cgi-bin/template/get_industry" ) . addParameter ( PARAM_ACCESS_TOKEN , API . accessToken ( access_token ) ) . build ( ) ; return LocalHttpClient . executeJsonResult ( httpUriRequest , GetIndustryResult . class ) ; |
public class Page { /** * 判断当前Page的Http响应头的Content - Type是否符合正则
* @ param contentTypeRegex
* @ return */
public boolean matchContentType ( String contentTypeRegex ) { } } | if ( contentTypeRegex == null ) { return contentType ( ) == null ; } return Pattern . matches ( contentTypeRegex , contentType ( ) ) ; |
public class StorePackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getPrimitiveDefinition ( ) { } } | if ( primitiveDefinitionEClass == null ) { primitiveDefinitionEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 69 ) ; } return primitiveDefinitionEClass ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.