signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class WsByteBufferUtils { /** * Expand an existing list of buffers to include one new buffer , if that
* buffer
* is null then the list is returned as - is .
* @ param list
* @ param buffer
* @ return WsByteBuffer [ ] */
public static WsByteBuffer [ ] expandBufferArray ( WsByteBuffer [ ] list , WsByteB... | if ( null == buffer ) return list ; int len = ( null != list ? list . length : 0 ) ; WsByteBuffer [ ] bb = new WsByteBuffer [ len + 1 ] ; if ( 0 < len ) { System . arraycopy ( list , 0 , bb , 0 , len ) ; } bb [ len ] = buffer ; return bb ; |
public class KeyVaultClientBaseImpl { /** * Unwraps a symmetric key using the specified key that was initially used for wrapping that key .
* The UNWRAP operation supports decryption of a symmetric key using the target key encryption key . This operation is the reverse of the WRAP operation . The UNWRAP operation app... | return ServiceFuture . fromResponse ( unwrapKeyWithServiceResponseAsync ( vaultBaseUrl , keyName , keyVersion , algorithm , value ) , serviceCallback ) ; |
public class ContainerInstance { /** * For CPU and memory resource types , this parameter describes the remaining CPU and memory that has not already
* been allocated to tasks and is therefore available for new tasks . For port resource types , this parameter
* describes the ports that were reserved by the Amazon E... | if ( remainingResources == null ) { remainingResources = new com . amazonaws . internal . SdkInternalList < Resource > ( ) ; } return remainingResources ; |
public class RestAction { /** * Schedules a call to { @ link # queue ( java . util . function . Consumer ) } to be executed after the specified { @ code delay } .
* < br > This is an < b > asynchronous < / b > operation that will return a
* { @ link java . util . concurrent . ScheduledFuture ScheduledFuture } repre... | return queueAfter ( delay , unit , success , null , executor ) ; |
public class StringEscapeUtils { /** * Unescapes any Java literals found in the < code > String < / code > .
* For example , it will turn a sequence of < code > ' \ ' < / code > and
* < code > ' n ' < / code > into a newline character , unless the < code > ' \ ' < / code >
* is preceded by another < code > ' \ ' ... | if ( str == null ) { return null ; } try { Writer writer = new StringBuilderWriter ( str . length ( ) ) ; unescapeJava ( writer , str ) ; return writer . toString ( ) ; } catch ( IOException ioe ) { // this should never ever happen while writing to a StringBuilderWriter
throw new RuntimeException ( ioe ) ; } |
public class StatementPartitioning { /** * Sometimes when we fail to plan a statement , we try again with different inputs
* using the same StatementPartitioning object . In this case , it ' s incumbent on
* callers to reset the cached analysis state set by calling this method .
* TODO : one could imagine separat... | m_countOfIndependentlyPartitionedTables = - 1 ; m_countOfPartitionedTables = - 1 ; m_fullColumnName = null ; m_inferredExpression . clear ( ) ; m_inferredParameterIndex = - 1 ; m_inferredValue = null ; m_isDML = false ; setJoinValid ( true ) ; setJoinInvalidReason ( null ) ; m_partitionColForDML = null ; |
public class SarlCapacityUsesImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EList < JvmParameterizedTypeReference > getCapacities ( ) { } } | if ( capacities == null ) { capacities = new EObjectContainmentEList < JvmParameterizedTypeReference > ( JvmParameterizedTypeReference . class , this , SarlPackage . SARL_CAPACITY_USES__CAPACITIES ) ; } return capacities ; |
public class ProjectTaskPredecessor { /** * Get the table name . */
public String getTableNames ( boolean bAddQuotes ) { } } | return ( m_tableName == null ) ? Record . formatTableNames ( PROJECT_TASK_PREDECESSOR_FILE , bAddQuotes ) : super . getTableNames ( bAddQuotes ) ; |
public class JQMSlider { /** * Sets the new min range for the slider
* @ param min the new min range */
public void setMin ( Double min ) { } } | String minStr = doubleToNiceStr ( min ) ; JQMCommon . setAttribute ( input , "min" , minStr ) ; refreshMin ( input . getElement ( ) . getId ( ) , minStr ) ; validateValue ( ) ; |
public class ImageColorConvertHelper { /** * 这个转灰度图像为RGB , 利用公式 r = gray , g = gray , b = gray 来做的转换
* @ param src
* @ return */
public static PlanarImage convertGray2RGB ( PlanarImage src ) { } } | ColorSpace srcCS = src . getColorModel ( ) . getColorSpace ( ) ; if ( srcCS . getType ( ) == ColorSpace . TYPE_GRAY ) { int x = 3 ; int y = src . getSampleModel ( ) . getNumBands ( ) + 1 ; double [ ] [ ] matrix = new double [ x ] [ y ] ; for ( int i = 0 ; i < x ; i ++ ) { for ( int j = 0 ; j < y ; j ++ ) { if ( j == 0 ... |
public class UnitPatterns { /** * < p > Yields a unit pattern which optionally contains a placeholder
* of the form & quot ; { 0 } & quot ; standing for the count of units in the
* past . < / p >
* @ param category plural category
* @ param abbreviated using short form or not
* @ param unit associated iso uni... | checkNull ( category ) ; if ( abbreviated ) { return this . shortPast . get ( unit ) . get ( category ) ; } else { return this . past . get ( unit ) . get ( category ) ; } |
public class FramedGraph { /** * Get a { @ link Vertex } given its unique identifier .
* @ param < V > Framing class annotated with { @ link peapod . annotations . Vertex }
* @ param id The unique identifier of the linked vertex to locate
* @ return the framed vertex or { @ code null } when not found */
@ Suppres... | Iterator < Vertex > it = graph . vertices ( id ) ; return it . hasNext ( ) ? frame ( it . next ( ) ) : null ; |
public class Scheduler { public static Collection < TimeSlot > calculateTimeSots ( Day day , int intervalSeconds , Time startTime , Time endTime ) { } } | if ( intervalSeconds < 1 ) { throw new IllegalArgumentException ( "interval seconds cannot be less than one" ) ; } int count = 1 * 60 * 60 * 24 / intervalSeconds ; ArrayList < TimeSlot > slots = new ArrayList < TimeSlot > ( count ) ; TimeSlot startSlot = TimeSlot . firstSlot ( day , startTime , intervalSeconds ) ; Time... |
public class Resources { /** * Retrieve a long from bundle .
* @ param key the key of resource
* @ return the resource long
* @ throws MissingResourceException if the requested key is unknown */
public long getLong ( String key ) throws MissingResourceException { } } | ResourceBundle bundle = getBundle ( ) ; String value = bundle . getString ( key ) ; try { return Long . parseLong ( value ) ; } catch ( NumberFormatException nfe ) { throw new MissingResourceException ( "Expecting a long value but got " + value , "java.lang.String" , key ) ; } |
public class DomUtil { /** * Filter a { @ link NodeList } retaining all elements with a specific type
* @ param nodeList the { @ link NodeList } to filter
* @ param modelInstance the model instance
* @ param type the type class to filter for
* @ return the list of all Elements which match the filter */
public s... | return filterNodeList ( nodeList , new ElementByTypeListFilter ( type , modelInstance ) ) ; |
public class PlayerStatsService { /** * Retrieve a player ' s stats
* @ param id The id of the player
* @ param gameMode The game mode to check
* @ param season The season to check
* @ return Stats */
public AggregatedStats getAggregatedStats ( long id , GameMode gameMode , Season season ) { } } | return client . sendRpcAndWait ( SERVICE , "getAggregatedStats" , id , gameMode , season . numeric ) ; |
public class MPXJBaseFormat { /** * Allows the AM / PM text to be set .
* @ param am AM text
* @ param pm PM text */
public void setAmPmText ( String am , String pm ) { } } | for ( SimpleDateFormat format : m_formats ) { DateFormatSymbols symbols = format . getDateFormatSymbols ( ) ; symbols . setAmPmStrings ( new String [ ] { am , pm } ) ; format . setDateFormatSymbols ( symbols ) ; } |
public class ApplicationExtensions { /** * Gets the resource stream from the given parameters .
* @ param file
* the file
* @ param contentType
* the content type
* @ return the resource stream
* @ throws IOException
* Signals that an I / O exception has occurred . */
public static IResourceStream getReso... | return new ByteArrayResourceStreamWriter ( ) { private static final long serialVersionUID = 1L ; @ Override public String getContentType ( ) { return contentType ; } @ Override protected byte [ ] load ( ) throws IOException { final byte [ ] data = Files . readBytes ( file ) ; return data ; } } ; |
public class ManagedObject { /** * Get the length of the serialized bytes representing this ManagedObject .
* @ return long number of bytes currently representing this ManagedObject .
* @ throws ObjectManagerException */
protected long getSerializedBytesLength ( ) throws ObjectManagerException { } } | final String methodName = "getSerializedBytesLength" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName ) ; // Mimic the action of getSerializedBytes but don ' t actuallly create the bytes .
// Used to esimate the length of future attempts to serialize th... |
public class Layout { /** * Reconstructs the storable type defined by this layout by returning an
* auto - generated class . The reconstructed storable type will not contain
* everything in the original , but rather the minimum required to decode
* persisted instances .
* @ param loader optional ClassLoader to ... | Class < ? extends Storable > reconstructed = reconstruct ( this , loader ) ; mLayoutFactory . registerReconstructed ( reconstructed , this ) ; return reconstructed ; |
public class Asn1Utils { /** * Decode an ASN . 1 BIT STRING .
* @ param buf
* the buffer containing the DER - encoded BIT STRING .
* @ return the bits in the BIT STRING */
public static BitSet decodeBitString ( ByteBuffer buf ) { } } | DerId id = DerId . decode ( buf ) ; if ( ! id . matches ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . PRIMITIVE , ASN1_BIT_STRING_TAG_NUM ) && ! id . matches ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . CONSTRUCTED , ASN1_BIT_STRING_TAG_NUM ) ) { throw new IllegalArgumentException ( "Expected BIT S... |
public class CreateDiskFromSnapshotRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateDiskFromSnapshotRequest createDiskFromSnapshotRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createDiskFromSnapshotRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createDiskFromSnapshotRequest . getDiskName ( ) , DISKNAME_BINDING ) ; protocolMarshaller . marshall ( createDiskFromSnapshotRequest . getDiskSnapshotName ... |
public class StageActivityBehavior { /** * re - activation / / / / / */
public void onReactivation ( CmmnActivityExecution execution ) { } } | String id = execution . getId ( ) ; if ( execution . isActive ( ) ) { throw LOG . alreadyActiveException ( "reactivate" , id ) ; } if ( execution . isCaseInstanceExecution ( ) ) { if ( execution . isClosed ( ) ) { throw LOG . alreadyClosedCaseException ( "reactivate" , id ) ; } } else { ensureTransitionAllowed ( execut... |
public class SampleBinary { /** * Example how to use FlatBuffers to create and read binary buffers . */
public static void main ( String [ ] args ) { } } | FlatBufferBuilder builder = new FlatBufferBuilder ( 0 ) ; // Create some weapons for our Monster ( ' Sword ' and ' Axe ' ) .
int weaponOneName = builder . createString ( "Sword" ) ; short weaponOneDamage = 3 ; int weaponTwoName = builder . createString ( "Axe" ) ; short weaponTwoDamage = 5 ; // Use the ` createWeapon (... |
public class QuickSort { /** * Sort the elements in the specified List according to their natural order . */
public static < T extends Comparable < ? super T > > void sort ( List < T > a ) { } } | sort ( a , new Comparator < T > ( ) { public int compare ( T o1 , T o2 ) { if ( o1 == o2 ) { // catches null = = null
return 0 ; } else if ( o1 == null ) { return 1 ; } else if ( o2 == null ) { return - 1 ; } return o1 . compareTo ( o2 ) ; // null - free
} } ) ; |
public class Dispatching { /** * Adapts a runnable to a supplier .
* @ param adaptee the runnable to be adapted
* @ return the adapted supplier */
public static Supplier < Void > supplier ( Runnable adaptee ) { } } | dbc . precondition ( adaptee != null , "cannot adapt a null runnable" ) ; return ( ) -> { adaptee . run ( ) ; return null ; } ; |
public class TGuardPrincipal { /** * TODO Need to figure out what Organizations TGuard entities should be part of . */
public String getName ( ) { } } | if ( name == null ) { String temp = get ( "iv-user" ) ; if ( temp == null ) return null ; StringBuilder sb = new StringBuilder ( ) ; int at = temp . indexOf ( '@' ) ; if ( at < 0 ) { sb . append ( temp ) ; } else { sb . append ( temp . substring ( 0 , at ) ) ; } if ( temp . endsWith ( "@uverse.com" ) ) sb . append ( "@... |
public class Implementor { /** * prueft , ob uebergebene Klasse < code > assignable < / code > von aktueller Klasse ist . */
public < X > X cast ( final Class < X > iface ) { } } | if ( iface == null ) { throw new IllegalArgumentException ( "Parameter 'cls' muss angegeben werden" ) ; } if ( iface . isAssignableFrom ( this . getClass ( ) ) ) { return iface . cast ( this ) ; } throw new ClassCastException ( "Klasse " + this . getClass ( ) + " kann nicht nach " + iface + " gewandelt werden" ) ; |
public class RaftServiceManager { /** * Applies a close session entry to the state machine . */
private void applyCloseSession ( Indexed < CloseSessionEntry > entry ) { } } | RaftSession session = raft . getSessions ( ) . getSession ( entry . entry ( ) . session ( ) ) ; // If the server session is null , the session either never existed or already expired .
if ( session == null ) { throw new RaftException . UnknownSession ( "Unknown session: " + entry . entry ( ) . session ( ) ) ; } RaftSer... |
public class CodeVisitor { /** * Returns true for a simple branch , i . e . a branch with a simple target . */
public boolean isBranch ( ) { } } | switch ( getOpcode ( ) ) { case IFNULL : case IFNONNULL : case IFNE : case IFEQ : case IFLT : case IFGE : case IFGT : case IFLE : case IF_ICMPEQ : case IF_ICMPNE : case IF_ICMPLT : case IF_ICMPGE : case IF_ICMPGT : case IF_ICMPLE : case IF_ACMPEQ : case IF_ACMPNE : case JSR : case JSR_W : case GOTO : case GOTO_W : retu... |
public class ImageStatistics { /** * Returns the mean pixel intensity value .
* @ param img Input image . Not modified .
* @ return Mean pixel intensity value */
public static float mean ( InterleavedF32 img ) { } } | return sum ( img ) / ( float ) ( img . width * img . height * img . numBands ) ; |
public class CommandHelper { /** * Convert the value according the type of DeviceData .
* @ param deviceDataArgout
* the DeviceData attribute to read
* @ return DevState , the result in Short format
* @ throws DevFailed */
public static DevState extractToDevState ( final DeviceData deviceDataArgout ) throws Dev... | final Object value = CommandHelper . extract ( deviceDataArgout ) ; DevState argout = null ; if ( value instanceof Short ) { try { argout = DevState . from_int ( ( ( Short ) value ) . intValue ( ) ) ; } catch ( final Exception e ) { argout = DevState . UNKNOWN ; } } else if ( value instanceof String ) { argout = StateU... |
public class TileSet { /** * Returns prepared versions of the images that would be used for each of the tiles . Because
* tilesets are often used simply to provide access to a collection of uniform images , this
* method is provided to bypass the creation of a { @ link Tile } objects when all that is
* desired is... | Mirage [ ] mirages = new Mirage [ getTileCount ( ) ] ; for ( int ii = 0 ; ii < mirages . length ; ii ++ ) { mirages [ ii ] = getTileMirage ( ii ) ; } return mirages ; |
public class ArchiveExtractor { /** * Extract zip or tar . gz archives to a target folder
* @ param sourceURL url of the archive to extract
* @ param targetFolder where to extract to
* @ throws IOException on I / O error */
public static void extract ( URL sourceURL , File targetFolder ) throws IOException { } } | if ( sourceURL . getProtocol ( ) . equals ( "file" ) ) { if ( sourceURL . getFile ( ) . indexOf ( ".zip" ) > 0 ) { extractZipDistribution ( sourceURL , targetFolder ) ; } else if ( sourceURL . getFile ( ) . indexOf ( ".tar.gz" ) > 0 ) { extractTarGzDistribution ( sourceURL , targetFolder ) ; } else { throw new IllegalS... |
public class MockResponse { /** * Removes all headers named { @ code name } . */
public MockResponse removeHeader ( String name ) { } } | name += ":" ; for ( Iterator < String > i = headers . iterator ( ) ; i . hasNext ( ) ; ) { String header = i . next ( ) ; if ( name . regionMatches ( true , 0 , header , 0 , name . length ( ) ) ) { i . remove ( ) ; } } return this ; |
public class ElementDefinitionDt { /** * Adds a given new value for < b > mapping < / b > ( )
* < b > Definition : < / b >
* Identifies a concept from an external specification that roughly corresponds to this element
* @ param theValue The mapping to add ( must not be < code > null < / code > ) */
public Element... | if ( theValue == null ) { throw new NullPointerException ( "theValue must not be null" ) ; } getMapping ( ) . add ( theValue ) ; return this ; |
public class IfcMechanicalSteelMaterialPropertiesImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) public EList < IfcRelaxation > getRelaxations ( ) { } } | return ( EList < IfcRelaxation > ) eGet ( Ifc2x3tc1Package . Literals . IFC_MECHANICAL_STEEL_MATERIAL_PROPERTIES__RELAXATIONS , true ) ; |
public class AbstractTriangle3F { /** * Replies the squared distance from the triangle to the segment .
* @ param tx1 x coordinate of the first point of the triangle .
* @ param ty1 y coordinate of the first point of the triangle .
* @ param tz1 z coordinate of the first point of the triangle .
* @ param tx2 x ... | double t = getTriangleSegmentIntersectionFactorWithJimenezAlgorithm ( tx1 , ty1 , tz1 , tx2 , ty2 , tz2 , tx3 , ty3 , tz3 , sx1 , sy1 , sz1 , sx2 , sy2 , sz2 ) ; if ( Double . isInfinite ( t ) || ( ! Double . isNaN ( t ) && t >= 0. && t <= 1. ) ) { return 0. ; } double d1 = AbstractSegment3F . distanceSquaredSegmentSeg... |
public class ErrorStatsServiceClient { /** * Lists the specified groups .
* < p > Sample code :
* < pre > < code >
* try ( ErrorStatsServiceClient errorStatsServiceClient = ErrorStatsServiceClient . create ( ) ) {
* ProjectName projectName = ProjectName . of ( " [ PROJECT ] " ) ;
* QueryTimeRange timeRange = ... | ListGroupStatsRequest request = ListGroupStatsRequest . newBuilder ( ) . setProjectName ( projectName == null ? null : projectName . toString ( ) ) . setTimeRange ( timeRange ) . build ( ) ; return listGroupStats ( request ) ; |
public class BaseFileSystem { /** * { @ inheritDoc } */
public FileEntry put ( DirectoryEntry parent , String name , InputStream content ) throws IOException { } } | throw new UnsupportedOperationException ( ) ; |
public class MainApplication { /** * Set this property in the user ' s property area .
* @ return The user name . */
public String getUserName ( ) { } } | String strUserName = null ; Record recUserInfo = ( Record ) this . getUserInfo ( ) ; if ( recUserInfo != null ) strUserName = recUserInfo . getField ( UserInfoModel . USER_NAME ) . toString ( ) ; if ( ( strUserName == null ) || ( strUserName . length ( ) == 0 ) ) strUserName = super . getUserName ( ) ; return strUserNa... |
public class ScriptRuntime { /** * Implement " SameValueZero " from ECMA 7.2.9 */
public static boolean sameZero ( Object x , Object y ) { } } | if ( ! typeof ( x ) . equals ( typeof ( y ) ) ) { return false ; } if ( x instanceof Number ) { if ( isNaN ( x ) && isNaN ( y ) ) { return true ; } final double dx = ( ( Number ) x ) . doubleValue ( ) ; if ( y instanceof Number ) { final double dy = ( ( Number ) y ) . doubleValue ( ) ; if ( ( ( dx == negativeZero ) && ... |
public class ValidateMatchmakingRuleSetRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ValidateMatchmakingRuleSetRequest validateMatchmakingRuleSetRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( validateMatchmakingRuleSetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( validateMatchmakingRuleSetRequest . getRuleSetBody ( ) , RULESETBODY_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to ma... |
public class EnvironmentsInner { /** * Resets the user password on an environment This operation can take a while to complete .
* @ param resourceGroupName The name of the resource group .
* @ param labAccountName The name of the lab Account .
* @ param labName The name of the lab .
* @ param environmentSetting... | resetPasswordWithServiceResponseAsync ( resourceGroupName , labAccountName , labName , environmentSettingName , environmentName , resetPasswordPayload ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class GetFolderResult { /** * The list of submodules that exist in the specified folder , if any .
* @ param subModules
* The list of submodules that exist in the specified folder , if any . */
public void setSubModules ( java . util . Collection < SubModule > subModules ) { } } | if ( subModules == null ) { this . subModules = null ; return ; } this . subModules = new java . util . ArrayList < SubModule > ( subModules ) ; |
public class ResourceAlreadyExistsException { /** * The ARN of the resource that caused the exception .
* @ param resourceArn
* The ARN of the resource that caused the exception . */
@ com . fasterxml . jackson . annotation . JsonProperty ( "resourceArn" ) public void setResourceArn ( String resourceArn ) { } } | this . resourceArn = resourceArn ; |
public class PermissionUtil { /** * Checks whether the specified { @ link net . dv8tion . jda . core . entities . Emote Emote } can be used by the provided
* { @ link net . dv8tion . jda . core . entities . User User } in the { @ link net . dv8tion . jda . core . entities . MessageChannel MessageChannel } .
* @ par... | return canInteract ( issuer , emote , channel , true ) ; |
public class ExperimentalInterceptor { /** * { @ inheritDoc } */
@ Override public Object invoke ( MethodInvocation invocation ) throws Throwable { } } | Method m = invocation . getMethod ( ) ; if ( m . isAnnotationPresent ( Experimental . class ) ) { Experimental experimentalAnnotation = m . getAnnotation ( Experimental . class ) ; logger . warn ( "CAUTION: You use a experimental generic step named [{}]." , experimentalAnnotation . name ( ) ) ; } logger . debug ( "NORA... |
public class DescribeTableStatisticsResult { /** * The table statistics .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setTableStatistics ( java . util . Collection ) } or { @ link # withTableStatistics ( java . util . Collection ) } if you
* want to ove... | if ( this . tableStatistics == null ) { setTableStatistics ( new java . util . ArrayList < TableStatistics > ( tableStatistics . length ) ) ; } for ( TableStatistics ele : tableStatistics ) { this . tableStatistics . add ( ele ) ; } return this ; |
public class JaxbUtils { /** * Convert the contents of a Source to an object of a given class .
* @ param cl Type of object
* @ param s Source to be used
* @ return Object of the given type */
public static < T > T unmarshal ( Class < T > cl , Source s ) throws JAXBException { } } | JAXBContext ctx = JAXBContext . newInstance ( cl ) ; Unmarshaller u = ctx . createUnmarshaller ( ) ; return u . unmarshal ( s , cl ) . getValue ( ) ; |
public class WireTcpHandler { /** * write and exceptions and rolls back if no data was written */
protected void writeData ( @ NotNull Bytes inBytes , @ NotNull WriteMarshallable c ) { } } | outWire . writeDocument ( false , out -> { final long readPosition = inBytes . readPosition ( ) ; final long position = outWire . bytes ( ) . writePosition ( ) ; try { c . writeMarshallable ( outWire ) ; } catch ( Throwable t ) { inBytes . readPosition ( readPosition ) ; if ( LOG . isInfoEnabled ( ) ) LOG . info ( "Whi... |
public class TangoEventsAdapter { public void addTangoDataReadyListener ( ITangoDataReadyListener listener , String attrName , String [ ] filters , boolean stateless ) throws DevFailed { } } | TangoDataReady tangoDataReady ; String key = deviceName + "/" + attrName ; if ( ( tangoDataReady = tango_data_ready_source . get ( key ) ) == null ) { tangoDataReady = new TangoDataReady ( deviceProxy , attrName , filters ) ; tango_data_ready_source . put ( key , tangoDataReady ) ; } synchronized ( moni ) { tangoDataRe... |
public class SparseVector { /** * get the value of that named property */
@ Override public Object getMember ( String name ) { } } | switch ( name ) { case "values" : return F_values ; case "indices" : return F_indices ; } return super . getMember ( name ) ; |
public class CreateFileSystemRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateFileSystemRequest createFileSystemRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createFileSystemRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createFileSystemRequest . getCreationToken ( ) , CREATIONTOKEN_BINDING ) ; protocolMarshaller . marshall ( createFileSystemRequest . getPerformanceMode ( ) , PER... |
public class FloatingActionButton { /** * Set the line state of LineMorphingDrawable that is used as this button ' s icon .
* @ param state The line state .
* @ param animation Indicate should show animation when switch line state or not . */
public void setLineMorphingState ( int state , boolean animation ) { } } | if ( mIcon != null && mIcon instanceof LineMorphingDrawable ) ( ( LineMorphingDrawable ) mIcon ) . switchLineState ( state , animation ) ; |
public class RemoteTaskRunner { /** * We allow workers to change their own capacities and versions . They cannot change their own hosts or ips without
* dropping themselves and re - announcing . */
private void updateWorker ( final Worker worker ) { } } | final ZkWorker zkWorker = zkWorkers . get ( worker . getHost ( ) ) ; if ( zkWorker != null ) { log . info ( "Worker[%s] updated its announcement from[%s] to[%s]." , worker . getHost ( ) , zkWorker . getWorker ( ) , worker ) ; zkWorker . setWorker ( worker ) ; } else { log . warn ( "WTF, worker[%s] updated its announcem... |
public class AbstrStrMatcher { /** * Search delegate string to find the first index of any string in
* the given string list , starting at the specified index
* @ param fromIndex
* @ param indexWith
* @ return */
public int indexs ( final Integer fromIndex , String ... indexWith ) { } } | int index = INDEX_NONE_EXISTS ; final String target = ignoreCase ? delegate . get ( ) . toLowerCase ( ) : delegate . get ( ) ; for ( String input : indexWith ) { String target2 = ignoreCase ? input . toLowerCase ( ) : input ; if ( ( index = target . indexOf ( target2 , fromIndex ) ) >= 0 ) { return index ; } } return i... |
public class ConfigurableEmitter { /** * Set the position of this particle source
* @ param x
* The x coodinate of that this emitter should spawn at
* @ param y
* The y coodinate of that this emitter should spawn at
* @ param moveParticles
* True if particles should be moved with the emitter */
public void ... | if ( moveParticles ) { adjust = true ; adjustx -= this . x - x ; adjusty -= this . y - y ; } this . x = x ; this . y = y ; |
public class DataStoreStash { /** * Lists the names of all tables present in Stash . This is a convenience wrapper around { @ link # listStashTables ( ) }
* that returns the result of calling { @ link StashTable # getTableName ( ) } on each record returned . */
public Iterable < String > listStashTableNames ( ) throw... | return Iterables . transform ( listStashTables ( ) , new Function < StashTable , String > ( ) { @ Override public String apply ( StashTable stashTable ) { return stashTable . getTableName ( ) ; } } ) ; |
public class SubmitterDocumentRepositoryMongoImpl { /** * { @ inheritDoc } */
@ Override public String newId ( final RootDocument rootDocument ) { } } | return newId ( mongoTemplate , SubmitterDocumentMongo . class , rootDocument . getFilename ( ) , "SUB" ) ; |
public class Client { /** * Deletes a range of datapoints for a Series specified by key .
* @ param series The series
* @ param interval The start / end datetime interval to delete .
* @ return Void
* @ since 1.0.0 */
public Result < Void > deleteDataPoints ( Series series , Interval interval ) { } } | checkNotNull ( series ) ; checkNotNull ( interval ) ; URI uri = null ; try { URIBuilder builder = new URIBuilder ( String . format ( "/%s/series/key/%s/data/" , API_VERSION , urlencode ( series . getKey ( ) ) ) ) ; addIntervalToURI ( builder , interval ) ; uri = builder . build ( ) ; } catch ( URISyntaxException e ) { ... |
public class AbstractConfiguration { /** * Gets the value of the configuration property identified by name as a value of the specified Class type .
* The defaultPropertyValue parameter effectively overrides the required attribute indicating that the property
* is not required to be declared or defined .
* @ param... | try { return ObjectUtils . defaultIfNull ( convert ( getPropertyValue ( propertyName , NOT_REQUIRED ) , type ) , defaultPropertyValue ) ; } catch ( ConversionException ignore ) { return defaultPropertyValue ; } |
public class LineStringExpression { /** * Returns the specified Point N in this LineString .
* @ param idx one - based index of element
* @ return matched element */
public PointExpression < Point > pointN ( int idx ) { } } | return GeometryExpressions . pointOperation ( SpatialOps . POINTN , mixin , ConstantImpl . create ( idx ) ) ; |
public class LazyLinkingResource { /** * Marks the given proxy as unresolvable . Further attempts to resolve it by means of { @ link # getEObject ( String ) }
* will yield < code > null < / code > .
* @ since 2.4 */
public void markUnresolvable ( EObject referenced ) { } } | if ( ! referenced . eIsProxy ( ) ) { throw new IllegalArgumentException ( "Cannot mark an instance as unresolvable if it is already resolved" ) ; } URI proxyURI = ( ( InternalEObject ) referenced ) . eProxyURI ( ) ; getUnresolvableURIFragments ( ) . add ( proxyURI . fragment ( ) ) ; |
public class HeartbeatServices { /** * Creates a heartbeat manager which actively sends heartbeats to monitoring targets .
* @ param resourceId Resource Id which identifies the owner of the heartbeat manager
* @ param heartbeatListener Listener which will be notified upon heartbeat timeouts for registered
* targe... | return new HeartbeatManagerSenderImpl < > ( heartbeatInterval , heartbeatTimeout , resourceId , heartbeatListener , scheduledExecutor , scheduledExecutor , log ) ; |
public class StringUtils { /** * Parse a CSV string using { @ link # csvSplit ( List , String , int , int ) }
* @ param s The string to parse
* @ return An array of parsed values . */
public static String [ ] csvSplit ( String s ) { } } | if ( s == null ) return null ; return csvSplit ( s , 0 , s . length ( ) ) ; |
public class BindUploader { /** * Convert bind map to a list of values for each column
* Perform necessary type casts and invariant checks
* @ param bindValues the bind map to convert
* @ return list of values for each column
* @ throws BindException if bind map is improperly formed */
private List < ColumnType... | List < ColumnTypeDataPair > columns = new ArrayList < > ( bindValues . size ( ) ) ; for ( int i = 1 ; i <= bindValues . size ( ) ; i ++ ) { // bindValues should have n entries with string keys 1 . . . n and list values
String key = Integer . toString ( i ) ; if ( ! bindValues . containsKey ( key ) ) { throw new BindExc... |
public class MESubscription { /** * Is Marked indicates if this object is still marked .
* If it is , then it can be removed .
* @ return iMarked true if this Subscription is still marked . */
boolean isMarked ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isMarked" ) ; SibTr . exit ( tc , "isMarked" , new Boolean ( _marked ) ) ; } return _marked ; |
public class MultipleSelect { /** * Specifies how the selection is displayed with a multiple select . < br >
* < br >
* Defaults to { @ link SelectedTextFormat # VALUES } .
* @ param format
* @ see SelectedTextFormat */
public void setSelectedTextFormat ( final SelectedTextFormat format ) { } } | if ( format != null ) attrMixin . setAttribute ( SELECTED_TEXT_FORMAT , format . getFormat ( ) ) ; else attrMixin . removeAttribute ( SELECTED_TEXT_FORMAT ) ; |
public class ContentCryptoMaterial { /** * Parses instruction data retrieved from S3 and returns a JSON string
* representing the instruction . Made for testing purposes . */
static String parseInstructionFile ( S3Object instructionFile ) { } } | try { return convertStreamToString ( instructionFile . getObjectContent ( ) ) ; } catch ( Exception e ) { throw failure ( e , "Error parsing JSON instruction file" ) ; } |
public class MCFRGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . MCFRG__RG_LENGTH : return getRGLength ( ) ; case AfplibPackage . MCFRG__TRIPLETS : return getTriplets ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class LibertyJaxWsMonitor { /** * Called by Declarative Services to activate service */
@ SuppressWarnings ( { } } | "unchecked" , "rawtypes" } ) protected void activate ( ComponentContext cc ) { BundleContext bundleContext = cc . getBundleContext ( ) ; monitorServiceTracker = new ServiceTracker ( bundleContext , "com.ibm.websphere.monitor.MonitorManager" , new ServiceTrackerCustomizer ( ) { @ Override public Object addingService ( S... |
public class CentralDogmaBeanFactory { /** * Returns a newly - created bean instance with some or all of its settings overridden .
* @ param defaultValue a Java bean annotated with { @ link CentralDogmaBean } . The default value is used before
* initialization .
* @ param beanType the type of { @ code bean }
* ... | try { return get ( defaultValue , beanType , overrides , 0L , TimeUnit . SECONDS ) ; } catch ( InterruptedException | TimeoutException e ) { // when initialValueTimeoutMillis set to zero , this exception never happens in practice .
throw new RuntimeException ( "Error: unexpected exception caught" , e ) ; } |
public class PHPJavaClassCreator { /** * { @ inheritDoc } */
public Object createNewObject ( String id ) { } } | if ( this . clazz == null || this . constructor == null ) { LOGGER . error ( "Unable to get class or constructor" ) ; return null ; } try { Object o = constructor . newInstance ( id ) ; return o ; } catch ( Exception e ) { LOGGER . error ( "Unable to create object " + e . getMessage ( ) , e ) ; } return null ; |
public class CmsEditor { /** * Builds the html String for the element language selector . < p >
* @ param attributes optional attributes for the & lt ; select & gt ; tag
* @ param resourceName the name of the resource to edit
* @ param selectedLocale the currently selected Locale
* @ return the html for the ele... | // get locale names based on properties and global settings
List < Locale > locales = OpenCms . getLocaleManager ( ) . getAvailableLocales ( getCms ( ) , resourceName ) ; List < String > options = new ArrayList < String > ( locales . size ( ) ) ; List < String > selectList = new ArrayList < String > ( locales . size ( ... |
public class ProxyingInstantiator { /** * Will generate the bytes for a class extending the type passed in parameter . This class will
* only have an empty default constructor
* @ param type type to extend
* @ return the byte for the class
* @ throws ObjenesisException is something goes wrong */
private static ... | String parentClazz = ClassUtils . classNameToInternalClassName ( type . getName ( ) ) ; String clazz = parentClazz + SUFFIX ; ByteArrayOutputStream bIn = new ByteArrayOutputStream ( 1000 ) ; // 1000 should be large enough to fit the entire class
try ( DataOutputStream in = new DataOutputStream ( bIn ) ) { in . write ( ... |
public class FromXml { /** * Private from xml methods */
private Object fromClass ( final Class cl ) throws Throwable { } } | if ( cl == null ) { error ( "Must supply a class or have type attribute" ) ; return null ; } return cl . newInstance ( ) ; |
public class Ordering { /** * Returns an < b > immutable < / b > list containing { @ code elements } sorted by this
* ordering . The input is not modified .
* < p > Unlike { @ link Sets # newTreeSet ( Iterable ) } , this method does not discard
* elements that are duplicates according to the comparator . The sort... | @ SuppressWarnings ( "unchecked" ) // we ' ll only ever have E ' s in here
E [ ] array = ( E [ ] ) Iterables . toArray ( elements ) ; for ( E e : array ) { checkNotNull ( e ) ; } Arrays . sort ( array , this ) ; return ImmutableList . asImmutableList ( array ) ; |
public class Predicates { /** * < pre >
* { @ code
* import static cyclops2 . function . Predicates . valuePresent ;
* Seq . of ( Maybe . ofNullable ( null ) , Maybe . just ( 1 ) , null )
* . filter ( valuePresent ( ) ) ;
* / / Seq [ Maybe [ 1 ] ]
* < / pre >
* @ return A Predicate that checks if it ' s i... | return t -> t instanceof Value ? ( ( Value ) t ) . toMaybe ( ) . isPresent ( ) : false ; |
public class Tree { /** * Associates the specified Set container with the specified path . If the
* structure previously contained a mapping for the path , the old value is
* replaced . Set similar to List , but contains no duplicate elements . Sample
* code : < br >
* < br >
* Tree node = new Tree ( ) ; < br... | return putObjectInternal ( path , new LinkedHashSet < Object > ( ) , putIfAbsent ) ; |
public class AWSDeviceFarmClient { /** * Returns information about a network profile .
* @ param getNetworkProfileRequest
* @ return Result of the GetNetworkProfile operation returned by the service .
* @ throws ArgumentException
* An invalid argument was specified .
* @ throws NotFoundException
* The speci... | request = beforeClientExecution ( request ) ; return executeGetNetworkProfile ( request ) ; |
public class IfcTypeObjectImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcRelDefinesByType > getTypes ( ) { } } | return ( EList < IfcRelDefinesByType > ) eGet ( Ifc4Package . Literals . IFC_TYPE_OBJECT__TYPES , true ) ; |
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc )
* @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createINF ( int cic ) */
public InformationMessage createINF ( ) { } } | InformationMessage msg = new InformationMessageImpl ( _INF_HOLDER . mandatoryCodes , _INF_HOLDER . mandatoryVariableCodes , _INF_HOLDER . optionalCodes , _INF_HOLDER . mandatoryCodeToIndex , _INF_HOLDER . mandatoryVariableCodeToIndex , _INF_HOLDER . optionalCodeToIndex ) ; return msg ; |
public class SignSupportServiceImpl { /** * Predicate that tells if the supplied URI is a URI indicating sign message display .
* @ param uri
* the URI to test
* @ return { @ code true } if the supplied URI is for sign message , and { @ code false } otherwise */
protected boolean isSignMessageURI ( String uri ) {... | LoaEnum loa = LoaEnum . parse ( uri ) ; return ( loa != null && loa . isSignatureMessageUri ( ) ) ; |
public class GDDImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . GDD__GOC_ADES : setGOCAdes ( GOC_ADES_EDEFAULT ) ; return ; case AfplibPackage . GDD__COMMANDS : getCommands ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ; |
public class MedicationDispense { /** * syntactic sugar */
public MedicationDispense addReceiver ( Reference t ) { } } | if ( t == null ) return this ; if ( this . receiver == null ) this . receiver = new ArrayList < Reference > ( ) ; this . receiver . add ( t ) ; return this ; |
public class LineColumnReader { /** * Reads characters into a portion of an array .
* @ param chars Destination array of char
* @ param startOffset Offset at which to start storing characters
* @ param length Maximum number of characters to read
* @ return an exception if an error occurs */
@ Override public in... | for ( int i = startOffset ; i <= startOffset + length ; i ++ ) { int readInt = read ( ) ; if ( readInt == - 1 ) return i - startOffset ; chars [ i ] = ( char ) readInt ; } return length ; |
public class ListV2LoggingLevelsResult { /** * The logging configuration for a target .
* @ param logTargetConfigurations
* The logging configuration for a target . */
public void setLogTargetConfigurations ( java . util . Collection < LogTargetConfiguration > logTargetConfigurations ) { } } | if ( logTargetConfigurations == null ) { this . logTargetConfigurations = null ; return ; } this . logTargetConfigurations = new java . util . ArrayList < LogTargetConfiguration > ( logTargetConfigurations ) ; |
public class SessionDriver { /** * For test purposes . Abort a sessiondriver without sending a sessionEnd ( )
* call to the CM . This allows testing for abnormal session termination */
public void abort ( ) { } } | LOG . info ( "Aborting session driver" ) ; running = false ; cmNotifier . clearCalls ( ) ; cmNotifier . doShutdown ( ) ; server . stop ( ) ; incomingCallExecutor . interrupt ( ) ; |
public class KDTreeNodeSplitter { /** * Checks whether an object of this class has been correctly
* initialized . Performs checks to see if all the necessary
* things ( master index array , training instances , distance
* function ) have been supplied or not .
* @ throws Exception If the object has not been cor... | if ( m_Instances == null ) throw new Exception ( "No instances supplied." ) ; else if ( m_InstList == null ) throw new Exception ( "No instance list supplied." ) ; else if ( m_EuclideanDistance == null ) throw new Exception ( "No Euclidean distance function supplied." ) ; else if ( m_Instances . numInstances ( ) != m_I... |
public class JDBCStorableGenerator { /** * Generates code to branch if a property is dirty .
* @ param propNumber property number from all properties map
* @ param target branch target
* @ param when true , branch if dirty ; when false , branch when not dirty */
private void branchIfDirty ( CodeBuilder b , int pr... | String stateFieldName = StorableGenerator . PROPERTY_STATE_FIELD_NAME + ( propNumber >> 4 ) ; b . loadThis ( ) ; b . loadField ( stateFieldName , TypeDesc . INT ) ; int shift = ( propNumber & 0xf ) * 2 ; b . loadConstant ( StorableGenerator . PROPERTY_STATE_MASK << shift ) ; b . math ( Opcode . IAND ) ; b . loadConstan... |
public class TangoUtil { /** * Splits an entity name into full device name and attribute name . Aliases will be resolved against tango db first .
* @ param entityName the entity name to split . It can contain aliases for device or attribute
* @ return a Map . Entry containing the full device name as key and the att... | Entry < String , String > result = null ; final Matcher matcher = ENTITY_SPLIT_PATTERN . matcher ( entityName . trim ( ) ) ; if ( matcher . matches ( ) ) { String device = null ; String entity = null ; final String prefixGroup = matcher . group ( PREFIX_INDEX ) ; final boolean noDb = matcher . group ( NO_DB_INDEX ) != ... |
public class ConsistencyCheck { /** * Repairs detected errors during the consistency check .
* @ param ignoreFailure if < code > true < / code > repair failures are ignored ,
* the repair continues without throwing an exception . If
* < code > false < / code > the repair procedure is aborted on the first
* repa... | if ( errors . size ( ) == 0 ) { log . info ( "No errors found." ) ; return ; } int notRepairable = 0 ; for ( Iterator < ConsistencyCheckError > it = errors . iterator ( ) ; it . hasNext ( ) ; ) { final ConsistencyCheckError error = it . next ( ) ; try { if ( error . repairable ( ) ) { // running in privileged mode
erro... |
public class MaterialButtonLayout { /** * Initialize the view */
private void init ( ) { } } | MAX_BUTTON_WIDTH = TypedValue . applyDimension ( TypedValue . COMPLEX_UNIT_DIP , 124f , getResources ( ) . getDisplayMetrics ( ) ) ; MIN_BUTTON_WIDTH = TypedValue . applyDimension ( TypedValue . COMPLEX_UNIT_DIP , 88f , getResources ( ) . getDisplayMetrics ( ) ) ; |
public class HttpChannelConfig { /** * Check the input configuration for the buffer size to use when reading
* the incoming body .
* @ param props */
private void parseIncomingBodyBufferSize ( Map < Object , Object > props ) { } } | Object value = props . get ( HttpConfigConstants . PROPNAME_INCOMING_BODY_BUFFSIZE ) ; if ( null != value ) { try { this . incomingBodyBuffSize = rangeLimit ( convertInteger ( value ) , HttpConfigConstants . MIN_BUFFER_SIZE , HttpConfigConstants . MAX_BUFFER_SIZE ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc ... |
public class ControllerUtils { /** * Obtain override ID
* @ param overrideIdentifier can be the override ID or class name
* @ return
* @ throws Exception */
public static Integer convertOverrideIdentifier ( String overrideIdentifier ) throws Exception { } } | Integer overrideId = - 1 ; try { // there is an issue with parseInt where it does not parse negative values correctly
boolean isNegative = false ; if ( overrideIdentifier . startsWith ( "-" ) ) { isNegative = true ; overrideIdentifier = overrideIdentifier . substring ( 1 ) ; } overrideId = Integer . parseInt ( override... |
public class ColumnNameHelper { /** * return the min column
* note that comparator should not be of CompositeType !
* @ param b1 lhs
* @ param b2 rhs
* @ param comparator the comparator to use
* @ return the smallest column according to comparator */
private static ByteBuffer min ( ByteBuffer b1 , ByteBuffer ... | if ( b1 == null ) return b2 ; if ( b2 == null ) return b1 ; if ( comparator . compare ( b1 , b2 ) >= 0 ) return b2 ; return b1 ; |
public class EDIImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . EDI__INDX_NAME : return getIndxName ( ) ; case AfplibPackage . EDI__TRIPLETS : return getTriplets ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class ObjectUtils { /** * < p > Returns the first value in the array which is not { @ code null } .
* If all the values are { @ code null } or the array is { @ code null }
* or empty then { @ code null } is returned . < / p >
* < pre >
* ObjectUtils . firstNonNull ( null , null ) = null
* ObjectUtils .... | if ( values != null ) { for ( final T val : values ) { if ( val != null ) { return val ; } } } return null ; |
public class CmsInlineEntityWidget { /** * Sets the visibility of the reference element highlighting border . < p >
* @ param visible < code > true < / code > to show the highlighting */
public void setContentHighlightingVisible ( boolean visible ) { } } | if ( visible ) { if ( m_highlighting == null ) { m_highlighting = new CmsHighlightingBorder ( CmsPositionBean . getBoundingClientRect ( m_referenceElement ) , CmsHighlightingBorder . BorderColor . red ) ; RootPanel . get ( ) . add ( m_highlighting ) ; } else { m_highlighting . setPosition ( CmsPositionBean . getBoundin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.