signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class PyExpressionGenerator { /** * Generate the given object . * @ param varDeclaration the variable declaration . * @ param it the target for the generated content . * @ param context the context . * @ return the statement . */ protected XExpression _generate ( XVariableDeclaration varDeclaration , IAp...
final String name = it . declareUniqueNameVariable ( varDeclaration , varDeclaration . getName ( ) ) ; it . append ( name ) ; it . append ( " = " ) ; // $ NON - NLS - 1 $ if ( varDeclaration . getRight ( ) != null ) { generate ( varDeclaration . getRight ( ) , it , context ) ; } else if ( varDeclaration . getType ( ) !...
public class CharBuffer { /** * Appends the contents of < code > cb < / code > to the end of this CharBuffer . * @ param cb the CharBuffer to append or null */ public void append ( final CharBuffer cb ) { } }
if ( cb == null ) { return ; } provideCapacity ( length + cb . length ) ; System . arraycopy ( cb . c , 0 , c , length , cb . length ) ; length += cb . length ;
public class PortableUtils { /** * Calculates and reads the position of the Portable object stored in a Portable array under the given index . * @ param in data input stream * @ param streamPosition streamPosition to begin the reading from * @ param cellIndex index of the cell * @ return the position of the giv...
return in . readInt ( streamPosition + cellIndex * Bits . INT_SIZE_IN_BYTES ) ;
public class DashboardService { /** * Returns the batch for the given ID . * @ param dashboardId The ID of the dashboard to retrieve . * @ return The dashboard . * @ throws IOException If the server cannot be reached . * @ throws TokenExpiredException If the token sent along with the request has expired */ publ...
String requestUrl = RESOURCE + "/" + dashboardId . toString ( ) ; ArgusResponse response = getClient ( ) . executeHttpRequest ( ArgusHttpClient . RequestType . GET , requestUrl , null ) ; assertValidResponse ( response , requestUrl ) ; return fromJson ( response . getResult ( ) , Dashboard . class ) ;
public class CountedCompleter { /** * If this task has not completed , attempts to process at most the given number of other * unprocessed tasks for which this task is on the completion path , if any are known to exist . * @ param maxTasks the maximum number of tasks to process . If less than or equal to zero , the...
Thread t ; ForkJoinWorkerThread wt ; if ( maxTasks > 0 && status >= 0 ) { if ( ( t = Thread . currentThread ( ) ) instanceof ForkJoinWorkerThread ) ( wt = ( ForkJoinWorkerThread ) t ) . pool . helpComplete ( wt . workQueue , this , maxTasks ) ; else ForkJoinPool . common . externalHelpComplete ( this , maxTasks ) ; }
public class DateIntervalMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DateInterval dateInterval , ProtocolMarshaller protocolMarshaller ) { } }
if ( dateInterval == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( dateInterval . getStart ( ) , START_BINDING ) ; protocolMarshaller . marshall ( dateInterval . getEnd ( ) , END_BINDING ) ; } catch ( Exception e ) { throw new SdkClientExc...
public class XMLCtor { /** * # / string _ id _ map # */ @ Override protected void initPrototypeId ( int id ) { } }
String s ; int arity ; switch ( id ) { case Id_defaultSettings : arity = 0 ; s = "defaultSettings" ; break ; case Id_settings : arity = 0 ; s = "settings" ; break ; case Id_setSettings : arity = 1 ; s = "setSettings" ; break ; default : throw new IllegalArgumentException ( String . valueOf ( id ) ) ; } initPrototypeMet...
public class AutoMlClient { /** * Lists column specs in a table spec . * < p > Sample code : * < pre > < code > * try ( AutoMlClient autoMlClient = AutoMlClient . create ( ) ) { * TableSpecName parent = TableSpecName . of ( " [ PROJECT ] " , " [ LOCATION ] " , " [ DATASET ] " , " [ TABLE _ SPEC ] " ) ; * for ...
ListColumnSpecsRequest request = ListColumnSpecsRequest . newBuilder ( ) . setParent ( parent ) . build ( ) ; return listColumnSpecs ( request ) ;
public class GVRBone { /** * Pretty - print the object . */ @ Override public void prettyPrint ( StringBuffer sb , int indent ) { } }
sb . append ( Log . getSpaces ( indent ) ) ; sb . append ( GVRBone . class . getSimpleName ( ) ) ; sb . append ( " [name=" + getName ( ) + ", boneId=" + getBoneId ( ) + ", offsetMatrix=" + getOffsetMatrix ( ) + ", finalTransformMatrix=" + getFinalTransformMatrix ( ) // crashes debugger + "]" ) ; sb . append ( System . ...
public class StatementServiceImp { /** * / * ( non - Javadoc ) * @ see com . popbill . api . StatementService # getInfo ( java . lang . String , java . number . Integer , java . lang . String , java . lang . String ) */ @ Override public StatementInfo getInfo ( String CorpNum , int ItemCode , String MgtKey ) throws P...
if ( MgtKey == null || MgtKey . isEmpty ( ) ) throw new PopbillException ( - 99999999 , "관리번호가 입력되지 않았습니다." ) ; return httpget ( "/Statement/" + ItemCode + "/" + MgtKey , CorpNum , null , StatementInfo . class ) ;
public class AmazonDynamoDBClient { /** * Updates the provisioned throughput for the given table . * Setting the throughput for a table helps you manage performance and is * part of the Provisioned Throughput feature of Amazon DynamoDB . * @ param updateTableRequest Container for the necessary parameters to * e...
ExecutionContext executionContext = createExecutionContext ( updateTableRequest ) ; AWSRequestMetrics awsRequestMetrics = executionContext . getAwsRequestMetrics ( ) ; Request < UpdateTableRequest > request = marshall ( updateTableRequest , new UpdateTableRequestMarshaller ( ) , executionContext . getAwsRequestMetrics ...
public class BigQuerySnippets { /** * [ VARIABLE " field " ] */ public TableResult listTableDataSchema ( String datasetName , String tableName , Schema schema , String field ) { } }
// [ START ] TableResult tableData = bigquery . listTableData ( datasetName , tableName , schema ) ; for ( FieldValueList row : tableData . iterateAll ( ) ) { row . get ( field ) ; } // [ END ] return tableData ;
public class SmartHandle { /** * Drop an argument from the handle at the given index , returning a new * SmartHandle . * @ param index index before which the dropped argument goes * @ param newName name of the argument * @ param type type of the argument * @ return a new SmartHandle with the additional argume...
return new SmartHandle ( signature . insertArg ( index , newName , type ) , MethodHandles . dropArguments ( handle , index , type ) ) ;
public class ExamplesImpl { /** * Adds a labeled example to the application . * @ param appId The application ID . * @ param versionId The version ID . * @ param exampleLabelObject An example label with the expected intent and entities . * @ throws IllegalArgumentException thrown if parameters fail the validati...
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgu...
public class HelpCommand { /** * / * package */ static void printUsage ( PrintStream out ) { } }
out . printf ( usage ( "<COMMAND> [...]%n%n" ) ) ; out . printf ( "Available commands:%n%n" ) ; for ( CliCommand handler : sortedHandlers ( ) ) { CmdLineParser parser = new CmdLineParser ( handler ) ; out . print ( handler . getName ( ) ) ; parser . printSingleLineUsage ( out ) ; out . printf ( "%n\t%s%n" , handler . g...
public class CaptureSearchResult { /** * { @ code true } if HTTP response code is { @ code 2xx } . * @ return */ public boolean isHttpSuccess ( ) { } }
if ( isRevisitDigest ( ) && ( getDuplicatePayload ( ) != null ) ) { return getDuplicatePayload ( ) . isHttpSuccess ( ) ; } String httpCode = getHttpCode ( ) ; return ( httpCode . startsWith ( "2" ) ) ;
public class CheckUtil { /** * Check first . mmul ( second ) using Apache commons math mmul . Float / double matrices only . < br > * Returns true if OK , false otherwise . < br > * Checks each element according to relative error ( | a - b | / ( | a | + | b | ) ; however absolute error | a - b | must * also excee...
if ( first . size ( 1 ) != second . size ( 0 ) ) throw new IllegalArgumentException ( "first.columns != second.rows" ) ; RealMatrix rmFirst = convertToApacheMatrix ( first ) ; RealMatrix rmSecond = convertToApacheMatrix ( second ) ; INDArray result = first . mmul ( second ) ; RealMatrix rmResult = rmFirst . multiply ( ...
public class MultiFieldDocument { /** * Returns the L2 norm factor of this vector ' s values . */ private void normalizeL2 ( double [ ] scores ) { } }
double square_sum = 0.0 ; for ( int i = 0 ; i < scores . length ; i ++ ) { square_sum += ( scores [ i ] * scores [ i ] ) ; } double norm = Math . sqrt ( square_sum ) ; if ( norm != 0 ) for ( int i = 0 ; i < scores . length ; i ++ ) { scores [ i ] = scores [ i ] / norm ; }
public class CommerceDiscountRelPersistenceImpl { /** * Returns the first commerce discount rel in the ordered set where commerceDiscountId = & # 63 ; and classNameId = & # 63 ; . * @ param commerceDiscountId the commerce discount ID * @ param classNameId the class name ID * @ param orderByComparator the comparat...
List < CommerceDiscountRel > list = findByCD_CN ( commerceDiscountId , classNameId , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class PrcRefreshItemsInList { /** * < p > Update ItemInList for Item Price . < / p > * @ param < T > item price type * @ param < I > item type * @ param pReqVars additional param * @ param pItemPrice Item Price * @ param pItemType EShopItemType * @ throws Exception - an exception */ public final < T ...
String whereStr = "where ITSTYPE=" + pItemType . ordinal ( ) + " and ITEMID=" + pItemPrice . getItem ( ) . getItsId ( ) ; ItemInList itemInList = getSrvOrm ( ) . retrieveEntityWithConditions ( pReqVars , ItemInList . class , whereStr ) ; if ( itemInList == null ) { itemInList = createItemInList ( pReqVars , pItemPrice ...
public class RadioGroup { /** * ( non - Javadoc ) * @ see * qc . automation . framework . widget . IEditableField # setValue ( java . lang . String ) */ @ Override public void setValue ( Object value ) throws WidgetException { } }
try { if ( value instanceof String ) { boolean selected = false ; List < WebElement > elements = findElements ( ) ; for ( WebElement we : elements ) { if ( we . getAttribute ( "value" ) . equals ( value ) ) { we . click ( ) ; selected = true ; break ; } } if ( ! selected ) throw new WidgetException ( "Could not find de...
public class LTernaryOperatorBuilder { /** * Builds the functional interface implementation and if previously provided calls the consumer . */ @ Nonnull public final LTernaryOperator < T > build ( ) { } }
final LTernaryOperator < T > eventuallyFinal = this . eventually ; LTernaryOperator < T > retval ; final Case < LTriPredicate < T , T , T > , LTernaryOperator < T > > [ ] casesArray = cases . toArray ( new Case [ cases . size ( ) ] ) ; retval = LTernaryOperator . < T > ternaryOp ( ( a1 , a2 , a3 ) -> { try { for ( Case...
public class Resources { /** * Returns a { @ code URL } pointing to { @ code resourceName } if the resource is found using the * { @ linkplain Thread # getContextClassLoader ( ) context class loader } . In simple environments , the * context class loader will find resources from the class path . In environments whe...
final ClassLoader contextClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; final ClassLoader loader = contextClassLoader == null ? Resources . class . getClassLoader ( ) : contextClassLoader ; final URL url = loader . getResource ( resourceName ) ; if ( url == null ) { throw new IllegalArgumentExce...
public class Services { /** * Run the dependency graph for the services . * @ param roots filled with the services that have no dependency . * @ param infraServices filled with the infrastructure services . * @ param freeServices filled with the services that are executed before / after all the dependent services...
final boolean async = accessors . isAsyncStateWaitingEnabled ( ) ; final Set < Class < ? extends Service > > executed = new TreeSet < > ( Comparators . CLASS_COMPARATOR ) ; accessors . runInfrastructureServicesBefore ( infraServices ) ; accessors . runFreeServicesBefore ( freeServices ) ; while ( ! roots . isEmpty ( ) ...
public class SSLEngineImpl { /** * Wraps a buffer . Does a variety of checks before grabbing * the wrapLock , which blocks multiple wraps from occuring . */ public SSLEngineResult wrap ( ByteBuffer [ ] appData , int offset , int length , ByteBuffer netData ) throws SSLException { } }
EngineArgs ea = new EngineArgs ( appData , offset , length , netData ) ; /* * We can be smarter about using smaller buffer sizes later . * For now , force it to be large enough to handle any * valid SSL / TLS record . */ if ( netData . remaining ( ) < outputRecord . maxRecordSize ) { return new SSLEngineResult ( St...
public class JQMPage { /** * Logical add operation . If you do this you are responsible for adding it * to the DOM yourself . * @ param child * the child widget to be added */ protected void addLogical ( Widget child ) { } }
// Detach new child . child . removeFromParent ( ) ; // Logical attach . getChildren ( ) . add ( child ) ; // Adopt . adopt ( child ) ;
public class TransitionManager { /** * Convenience method to simply change to the given scene using * the given transition . * < p > Passing in < code > null < / code > for the transition parameter will * result in the scene changing without any transition running , and is * equivalent to calling { @ link Scene...
changeScene ( scene , transition ) ;
public class RendererUtils { /** * Invokes getConvertedUISelectManyValue ( ) with considerValueType = false , thus * implementing the standard behavior of the spec ( valueType comes from Tomahawk ) . * @ param facesContext * @ param selectMany * @ param submittedValue * @ return * @ throws ConverterExceptio...
// do not consider the valueType attribute return getConvertedUISelectManyValue ( facesContext , selectMany , submittedValue , false ) ;
public class CPDefinitionInventoryLocalServiceBaseImpl { /** * Adds the cp definition inventory to the database . Also notifies the appropriate model listeners . * @ param cpDefinitionInventory the cp definition inventory * @ return the cp definition inventory that was added */ @ Indexable ( type = IndexableType . ...
cpDefinitionInventory . setNew ( true ) ; return cpDefinitionInventoryPersistence . update ( cpDefinitionInventory ) ;
public class CodeReviewEvaluatorLegacy { /** * Return an empty response in error situation * @ param repoItem the repo item * @ param scmBranch the scrm branch * @ param scmUrl the scm url * @ return code review audit response */ protected CodeReviewAuditResponse getErrorResponse ( CollectorItem repoItem , Stri...
CodeReviewAuditResponse noPRsCodeReviewAuditResponse = new CodeReviewAuditResponse ( ) ; noPRsCodeReviewAuditResponse . addAuditStatus ( COLLECTOR_ITEM_ERROR ) ; noPRsCodeReviewAuditResponse . setLastUpdated ( repoItem . getLastUpdated ( ) ) ; noPRsCodeReviewAuditResponse . setScmBranch ( scmBranch ) ; noPRsCodeReviewA...
public class FileMovingUtil { /** * Create a temporary File object . Prefix the name of the base file with an * underscore . */ private static File createTempFile ( File baseFile ) { } }
File parentDirectory = baseFile . getParentFile ( ) ; String filename = baseFile . getName ( ) ; return new File ( parentDirectory , '_' + filename ) ;
public class Coordinate { /** * Tests if another coordinate has the same values for the X and Y ordinates . The Z ordinate is * ignored . * @ param c * a < code > Coordinate < / code > with which to do the 2D comparison . * @ param tolerance * margin of error * @ return true if < code > other < / code > is ...
if ( ! equalsWithTolerance ( this . getX ( ) , c . getX ( ) , tolerance ) ) { return false ; } if ( ! equalsWithTolerance ( this . getY ( ) , c . getY ( ) , tolerance ) ) { return false ; } return true ;
public class CharInfo { /** * Factory that reads in a resource file that describes the mapping of * characters to entity references . * Resource files must be encoded in UTF - 8 and have a format like : * < pre > * # First char # is a comment * Entity numericValue * quot 34 * amp 38 * < / pre > * ( No...
CharInfo charInfo = ( CharInfo ) m_getCharInfoCache . get ( entitiesFileName ) ; if ( charInfo != null ) { return mutableCopyOf ( charInfo ) ; } // try to load it internally - cache try { charInfo = getCharInfoBasedOnPrivilege ( entitiesFileName , method , true ) ; // Put the common copy of charInfo in the cache , but ...
public class DocServiceBuilder { /** * Adds the { @ link DocServiceFilter } that checks whether a method will be < b > excluded < / b > while building * { @ link DocService } . The { @ link DocServiceFilter } will be invoked with the plugin , service and * method name . The rule is as follows : * < ul > * < li ...
requireNonNull ( filter , "filter" ) ; if ( excludeFilter == NO_SERVICE ) { excludeFilter = filter ; } else { excludeFilter = excludeFilter . or ( filter ) ; } return this ;
public class StreamEx { /** * Returns a stream consisting of the results of applying the given function * to the every adjacent pair of elements of this stream . * This is a < a href = " package - summary . html # StreamOps " > quasi - intermediate < / a > * operation . * The output stream will contain one elem...
PSOfRef < T , R > spliterator = new PairSpliterator . PSOfRef < > ( mapper , spliterator ( ) ) ; return new StreamEx < > ( spliterator , context ) ;
public class UIViewRoot { /** * null checks . */ private void notifyAfter ( FacesContext context , PhaseId phaseId ) { } }
if ( getAfterPhaseListener ( ) != null || phaseListenerIterator != null ) { notifyPhaseListeners ( context , phaseId , false ) ; }
public class DateUtils { /** * Checks the hour , minute and second are equal . */ @ SuppressWarnings ( "deprecation" ) public static boolean timeEquals ( java . util . Date d1 , java . util . Date d2 ) { } }
if ( d1 == null || d2 == null ) { return false ; } return d1 . getHours ( ) == d2 . getHours ( ) && d1 . getMinutes ( ) == d2 . getMinutes ( ) && d1 . getSeconds ( ) == d2 . getSeconds ( ) ;
public class PipelineApi { /** * Get a list of the project pipeline _ schedules for the specified project . * < pre > < code > GET / projects / : id / pipeline _ schedules < / code > < / pre > * @ param projectIdOrPath projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project insta...
return ( getPipelineSchedules ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ;
public class VCProjectHolder { /** * Return a { @ link List } of { @ link VCProject } beans for a given platform / configuration pair . Each { @ link VCProject } * bean holds properties for a parsed Visual C + + project . * @ param platform the platform to use for parsing ( for example , { @ code Win32 } , { @ code...
String key = platform + "-" + configuration ; List < VCProject > vcProjects = parsedVCProjects . get ( key ) ; if ( vcProjects == null ) { if ( isSolution ) { vcProjects = parseVCSolution ( inputFile , platform , configuration ) ; } else { vcProjects = Arrays . asList ( parseStandaloneVCProject ( inputFile , platform ,...
public class TypeContainer { /** * Check if a StampedValue already exists for the type , if it does , return it , * otherwise create a new one and add it * @ param type * @ return */ public StampedValue asType ( final Type type ) { } }
StampedValue cachedValue = null ; // looping around a list is probably quicker than having a map since there are probably only one or two different // types in use at any one time for ( StampedValue value : typeCache ) { if ( value . getType ( ) . equals ( type ) ) { cachedValue = value ; break ; } } if ( cachedValue =...
public class JsonReader { /** * remap field name in custom classes * @ param fromJson * field name in json * @ param toJava * field name in Java * @ since 2.1.1 */ public < T > void remapField ( Class < T > type , String fromJson , String toJava ) { } }
JsonReaderI < T > map = this . getMapper ( type ) ; if ( ! ( map instanceof MapperRemapped ) ) { map = new MapperRemapped < T > ( map ) ; registerReader ( type , map ) ; } ( ( MapperRemapped < T > ) map ) . renameField ( fromJson , toJava ) ;
public class Matrix3d { /** * Set this matrix to be a simple scale matrix , which scales all axes uniformly by the given factor . * The resulting matrix can be multiplied against another transformation * matrix to obtain an additional scaling . * In order to post - multiply a scaling transformation directly to a ...
m00 = factor ; m01 = 0.0 ; m02 = 0.0 ; m10 = 0.0 ; m11 = factor ; m12 = 0.0 ; m20 = 0.0 ; m21 = 0.0 ; m22 = factor ; return this ;
public class CoverageDataTiffImage { /** * Get the pixel at the coordinate * @ param x * x coordinate * @ param y * y coordinate * @ return pixel value */ public float getPixel ( int x , int y ) { } }
float pixel = - 1 ; if ( rasters == null ) { readPixels ( ) ; } if ( rasters != null ) { pixel = rasters . getFirstPixelSample ( x , y ) . floatValue ( ) ; } else { throw new GeoPackageException ( "Could not retrieve pixel value" ) ; } return pixel ;
public class JCurand { /** * < pre > * Generate uniformly distributed floats . * Use generator to generate num float results into the device memory at * outputPtr . The device memory must have been previously allocated and be * large enough to hold all the results . Launches are done with the stream * set usi...
return checkResult ( curandGenerateUniformNative ( generator , outputPtr , num ) ) ;
public class DenseTensorBuilder { /** * Gets a { @ code TensorFactory } which creates { @ code DenseTensorBuilder } s . * @ return */ public static TensorFactory getFactory ( ) { } }
return new TensorFactory ( ) { @ Override public TensorBuilder getBuilder ( int [ ] dimNums , int [ ] dimSizes ) { return new DenseTensorBuilder ( dimNums , dimSizes ) ; } } ;
public class MeterValue { /** * Return the underlying value of the SLA in form suitable to apply to the given meter * type . * @ param meterType the meter type * @ return the value or { @ code null } if the value cannot be applied */ public Long getValue ( Meter . Type meterType ) { } }
if ( meterType == Meter . Type . DISTRIBUTION_SUMMARY ) { return getDistributionSummaryValue ( ) ; } if ( meterType == Meter . Type . TIMER ) { return getTimerValue ( ) ; } return null ;
public class Modal { /** * Add a modal component in the RootPaneContainer . * @ param rootPane * the RootPaneContainer * @ param component * the component for modal * @ param listener * the listener for modal * @ param modalDepth * the depth for modal */ private static void addModal_ ( RootPaneContainer...
synchronized ( modals ) { if ( isModal ( component ) == false ) { getModal ( rootPane ) . addModal ( component , listener , modalDepth ) ; } }
public class ThrottledApiHandler { /** * Get a listing of leagues for the specified teams * @ param teamIds The ids of the team * @ return A mapping of team ids to lists of leagues * @ see < a href = https : / / developer . riotgames . com / api / methods # ! / 593/1860 > Official API documentation < / a > */ pub...
return new ApiFuture < > ( ( ) -> handler . getLeagues ( teamIds ) ) ;
public class ClassFileImporter { /** * Imports packages via { @ link Locations # ofPackage ( String ) } * < br > < br > * For information about the impact of the imported classes on the evaluation of rules , * as well as configuration and details , refer to { @ link ClassFileImporter } . */ @ PublicAPI ( usage = ...
Set < Location > locations = new HashSet < > ( ) ; for ( String pkg : packages ) { locations . addAll ( Locations . ofPackage ( pkg ) ) ; } return importLocations ( locations ) ;
public class StaticTypeCheckingSupport { /** * Given a receiver and a method node , parameterize the method arguments using * available generic type information . * @ param receiver the class * @ param m the method * @ return the parameterized arguments */ public static Parameter [ ] parameterizeArguments ( fin...
Map < GenericsTypeName , GenericsType > genericFromReceiver = GenericsUtils . extractPlaceholders ( receiver ) ; Map < GenericsTypeName , GenericsType > contextPlaceholders = extractGenericsParameterMapOfThis ( m ) ; Parameter [ ] methodParameters = m . getParameters ( ) ; Parameter [ ] params = new Parameter [ methodP...
public class ClassCache { /** * Returns the logger in use . * @ returnthe logger */ public synchronized Logger getLogger ( ) { } }
if ( m_Logger == null ) { m_Logger = Logger . getLogger ( getClass ( ) . getName ( ) ) ; m_Logger . setLevel ( LoggingHelper . getLevel ( getClass ( ) ) ) ; } return m_Logger ;
public class appflowaction { /** * Use this API to update appflowaction . */ public static base_response update ( nitro_service client , appflowaction resource ) throws Exception { } }
appflowaction updateresource = new appflowaction ( ) ; updateresource . name = resource . name ; updateresource . collectors = resource . collectors ; updateresource . comment = resource . comment ; return updateresource . update_resource ( client ) ;
public class LoggedInUserManager { /** * Manually log out the specified user * @ param sUserID * The user ID to log out * @ return { @ link EChange } if something changed */ @ Nonnull public EChange logoutUser ( @ Nullable final String sUserID ) { } }
LoginInfo aInfo ; m_aRWLock . writeLock ( ) . lock ( ) ; try { aInfo = m_aLoggedInUsers . remove ( sUserID ) ; if ( aInfo == null ) { AuditHelper . onAuditExecuteSuccess ( "logout" , sUserID , "user-not-logged-in" ) ; return EChange . UNCHANGED ; } // Ensure that the SessionUser is empty . This is only relevant if user...
public class ImageCache { /** * Enables / disables a layer for caching . * @ param layerName * name of the WMS layer * @ param enabled * is true if want to cache */ public void setEnabled ( String layerName , boolean enabled ) { } }
synchronized ( this ) { if ( enabled ) layers . add ( layerName ) ; else layers . remove ( layerName ) ; }
public class RestartStrategyFactory { /** * Creates a { @ link RestartStrategy } instance from the given { @ link org . apache . flink . api . common . restartstrategy . RestartStrategies . RestartStrategyConfiguration } . * @ param restartStrategyConfiguration Restart strategy configuration which specifies which *...
if ( restartStrategyConfiguration instanceof RestartStrategies . NoRestartStrategyConfiguration ) { return new NoRestartStrategy ( ) ; } else if ( restartStrategyConfiguration instanceof RestartStrategies . FixedDelayRestartStrategyConfiguration ) { RestartStrategies . FixedDelayRestartStrategyConfiguration fixedDelayC...
public class CompositeTypeSerializerUtil { /** * Delegates compatibility checks to a { @ link CompositeTypeSerializerSnapshot } instance . * This can be used by legacy snapshot classes , which have a newer implementation * implemented as a { @ link CompositeTypeSerializerSnapshot } . * @ param newSerializer the n...
checkArgument ( legacyNestedSnapshots . length > 0 ) ; return newCompositeSnapshot . internalResolveSchemaCompatibility ( newSerializer , legacyNestedSnapshots ) ;
public class HelloWorld { /** * Creates a ClassFile which defines a simple interactive HelloWorld class . * @ param className name given to class */ private static RuntimeClassFile createClassFile ( ) { } }
// Create a ClassFile with the super class of Object . RuntimeClassFile cf = new RuntimeClassFile ( ) ; // Default constructor works only if super class has an accessible // no - arg constructor . cf . addDefaultConstructor ( ) ; // Add the main method , and construct a CodeBuilder for defining the // bytecode . TypeDe...
public class OPFChecks { /** * Checks is a service has been described in the AndroidManifest . xml file . * @ param context The instance of { @ link android . content . Context } . * @ param service The checked service . */ @ SuppressWarnings ( "PMD.PreserveStackTrace" ) public static void checkService ( @ NonNull ...
final PackageManager packageManager = context . getPackageManager ( ) ; try { packageManager . getServiceInfo ( service , 0 ) ; } catch ( PackageManager . NameNotFoundException e ) { throw new IllegalStateException ( "Service " + service . getClassName ( ) + " hasn't been declared in AndroidManifest.xml" ) ; }
public class ODocumentModel { /** * Get { @ link ORID } of a stored { @ link ODocument } * @ return identifactor { @ link ORID } */ public ORID getIdentity ( ) { } }
if ( orid != null ) return orid ; ODocument doc = getObject ( ) ; return doc != null ? doc . getIdentity ( ) : null ;
public class Functions { /** * Fluent integer concat operation using primitive types * e . g . * < pre > * { @ code * import static cyclops . ReactiveSeq . concatDoubles ; * ReactiveSeq . ofDoubles ( 1d , 2d , 3d ) * . to ( concatDoubles ( ReactiveSeq . ofDoubles ( 5,6,7,8,9 ) ) ) ; * / / [ 1d , 2d , 3d ,...
return a -> ReactiveSeq . fromSpliterator ( DoubleStream . concat ( a . mapToDouble ( i -> i ) , b . mapToDouble ( i -> i ) ) . spliterator ( ) ) ;
public class Basic1DMatrix { /** * Decodes { @ link Basic1DMatrix } from the given byte { @ code array } . * @ param array the byte array representing a matrix * @ return a decoded matrix */ public static Basic1DMatrix fromBinary ( byte [ ] array ) { } }
ByteBuffer buffer = ByteBuffer . wrap ( array ) ; if ( buffer . get ( ) != MATRIX_TAG ) { throw new IllegalArgumentException ( "Can not decode Basic1DMatrix from the given byte array." ) ; } int rows = buffer . getInt ( ) ; int columns = buffer . getInt ( ) ; int capacity = rows * columns ; double [ ] values = new doub...
public class ParsingModelIo { /** * Saves the model into another file . * @ param targetFile the target file ( may not exist ) * @ param relationsFile the relations file * @ param writeComments true to write comments * @ param lineSeparator the line separator ( if null , the OS ' one is used ) * @ throws IOEx...
String s = writeConfigurationFile ( relationsFile , writeComments , lineSeparator ) ; Utils . copyStream ( new ByteArrayInputStream ( s . getBytes ( StandardCharsets . UTF_8 ) ) , targetFile ) ;
public class Logging { /** * For each device , save its current logging Level then set it to OFF */ public void stop_logging ( ) { } }
Vector dl = Util . instance ( ) . get_device_list ( "*" ) ; for ( Object aDl : dl ) { ( ( DeviceImpl ) aDl ) . stop_logging ( ) ; }
public class WorkflowExecutionSignaledEventAttributesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( WorkflowExecutionSignaledEventAttributes workflowExecutionSignaledEventAttributes , ProtocolMarshaller protocolMarshaller ) { } }
if ( workflowExecutionSignaledEventAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( workflowExecutionSignaledEventAttributes . getSignalName ( ) , SIGNALNAME_BINDING ) ; protocolMarshaller . marshall ( workflowExecutionSignaledE...
public class AbstractConsistencyFixer { /** * Decide on the specific key - value to write everywhere . * @ param nodeValues * @ return The subset of entries from nodeValues that need to be repaired . */ private List < NodeValue < ByteArray , byte [ ] > > resolveReadConflicts ( final List < NodeValue < ByteArray , b...
if ( logger . isTraceEnabled ( ) ) { logger . trace ( "NodeValues passed into resolveReadConflicts." ) ; if ( nodeValues . size ( ) == 0 ) { logger . trace ( "Empty nodeValues passed to resolveReadConflicts" ) ; } for ( NodeValue < ByteArray , byte [ ] > nodeValue : nodeValues ) { logger . trace ( "\t" + nodeValue . ge...
public class DBCPPoolAdapter { /** * { @ inheritDoc } */ @ Override protected boolean isAcquireTimeoutException ( Exception e ) { } }
return e . getMessage ( ) != null && Pattern . matches ( ACQUIRE_TIMEOUT_MESSAGE , e . getMessage ( ) ) ;
public class L3ToSBGNPDConverter { /** * Gets the members of the Complex that needs to be displayed in a flattened view . * @ param cx to get members * @ return members to display */ private Set < PhysicalEntity > getFlattenedMembers ( Complex cx ) { } }
Set < PhysicalEntity > set = new HashSet < PhysicalEntity > ( ) ; for ( PhysicalEntity mem : cx . getComponent ( ) ) { if ( mem instanceof Complex ) { if ( ! hasNonComplexMember ( ( Complex ) mem ) ) { set . add ( mem ) ; } else { set . addAll ( getFlattenedMembers ( ( Complex ) mem ) ) ; } } else set . add ( mem ) ; }...
public class IO { /** * Copy input to output and close the output stream before returning */ public static int copyAndCloseOutput ( Reader input , Writer output ) throws IOException { } }
try { return copy ( input , output ) ; } finally { output . close ( ) ; }
public class HttpChannelConfig { /** * Check the configuration to see if the remoteIp element has been configured * to consider forwarding header values in the NCSA Access Log * @ param props */ private void parseRemoteIp ( Map < Object , Object > props ) { } }
Object value = props . get ( HttpConfigConstants . PROPNAME_REMOTE_IP ) ; if ( null != value ) { this . useForwardingHeaders = convertBoolean ( value ) ; if ( this . useForwardingHeaders && ( TraceComponent . isAnyTracingEnabled ( ) ) && ( tc . isEventEnabled ( ) ) ) { Tr . event ( tc , "HTTP Channel Config: remoteIp h...
public class BlurBuilder { /** * / * GETTER METHODS * * * * * */ public JobDescription into ( final ImageView imageView ) { } }
if ( data . placeholder != Dali . NO_RESID ) { imageView . setImageResource ( data . placeholder ) ; } return start ( new BlurWorker . BlurWorkerListener ( ) { @ Override public void onResult ( final BlurWorker . Result result ) { // run on ui thread because we need to modify ui uiThreadHandler . post ( new Runnable ( ...
public class cudaError { /** * Returns the String identifying the given cudaError * @ param error The cudaError * @ return The String identifying the given cudaError */ public static String stringFor ( int error ) { } }
switch ( error ) { case cudaSuccess : return "cudaSuccess" ; case cudaErrorMissingConfiguration : return "cudaErrorMissingConfiguration" ; case cudaErrorMemoryAllocation : return "cudaErrorMemoryAllocation" ; case cudaErrorInitializationError : return "cudaErrorInitializationError" ; case cudaErrorLaunchFailure : retur...
public class Strands { /** * Disables the current strand for scheduling purposes unless the * permit is available . * If the permit is available then it is consumed and the call returns * immediately ; otherwise * the current strand becomes disabled for scheduling * purposes and lies dormant until one of thre...
try { Strand . park ( blocker ) ; } catch ( SuspendExecution e ) { throw RuntimeSuspendExecution . of ( e ) ; }
public class GraphPath { /** * Remove the path ' s elements before the * specified one which is starting * at the specified point . The specified element will * not be removed . * < p > This function removes until the < i > first occurence < / i > * of the given object . * @ param obj is the segment to remo...
return removeUntil ( indexOf ( obj , pt ) , false ) ;
public class SshConnector { /** * See { @ link connect ( SshTransport , String ) } for full details . This method * optionally allows you to specify a context to use . Normally you would * reused an { @ link SshConnector } instead of calling this method directly . * @ param transport * SshTransport * @ param ...
return connect ( transport , username , false , context ) ;
public class GreenPepperXmlRpcClient { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) public Set < Reference > getReferences ( Specification specification , String identifier ) throws GreenPepperServerException { } }
Vector params = CollectionUtil . toVector ( specification . marshallize ( ) ) ; log . debug ( "Retrieving Specification " + specification . getName ( ) + " References" ) ; Vector < Object > referencesParams = ( Vector < Object > ) execute ( XmlRpcMethodName . getSpecificationReferences , params , identifier ) ; return ...
public class VpnSitesInner { /** * Deletes a VpnSite . * @ param resourceGroupName The resource group name of the VpnSite . * @ param vpnSiteName The name of the VpnSite being deleted . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ErrorException thrown if the request i...
beginDeleteWithServiceResponseAsync ( resourceGroupName , vpnSiteName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class KeyProvider { /** * Gets a asymmetric encryption private key from the key store * @ param alias key alias * @ param password key password * @ return the private key */ public PrivateKey getPrivateKey ( String alias , String password ) { } }
Key key = getKey ( alias , password ) ; if ( key instanceof PrivateKey ) { return ( PrivateKey ) key ; } else { throw new IllegalStateException ( format ( "Key with alias '%s' was not a private key, but was: %s" , alias , key . getClass ( ) . getSimpleName ( ) ) ) ; }
public class AbstractXCodeMojo { /** * Calls a shell script in order to zip a folder . We have to call a shell script as Java cannot * zip symbolic links . * @ param rootDir * the directory where the zip command shall be executed * @ param zipSubFolder * the subfolder to be zipped * @ param zipFileName * ...
int resultCode = 0 ; try { File scriptDirectory = new File ( project . getBuild ( ) . getDirectory ( ) , "scripts" ) . getCanonicalFile ( ) ; scriptDirectory . deleteOnExit ( ) ; if ( archiveFolder != null ) { resultCode = ScriptRunner . copyAndExecuteScript ( System . out , "/com/sap/prd/mobile/ios/mios/zip-subfolder....
public class MultiLineLabel { /** * Called when the label has changed in some meaningful way and we ' d accordingly like to * re - layout the label , update our component ' s size , and repaint everything to suit . */ protected void layoutLabel ( ) { } }
Graphics2D gfx = ( Graphics2D ) getGraphics ( ) ; if ( gfx != null ) { // re - layout the label _label . layout ( gfx ) ; gfx . dispose ( ) ; // note that we ' re no longer dirty _dirty = false ; }
public class Clock { /** * Adds the given TimeSection to the list of areas . * Areas in the Medusa library usually are more eye - catching * than Sections . * @ param AREA */ public void addArea ( final TimeSection AREA ) { } }
if ( null == AREA ) return ; areas . add ( AREA ) ; Collections . sort ( areas , new TimeSectionComparator ( ) ) ; fireUpdateEvent ( SECTION_EVENT ) ;
public class ExpressionReader { /** * Increments the mark over white spaces */ public void skipWhitespaces ( ) { } }
for ( int i = mark ; i < chars . length ; i ++ ) { if ( Character . isWhitespace ( chars [ i ] ) ) { mark ++ ; } else { break ; } }
public class ParentsArray { /** * Whether the directed graph ( including an implicit wall node ) denoted by this parents array is * fully connected . If a singly - headed directed graph is connected it must also be acyclic . */ public static boolean isConnectedAndAcyclic ( int [ ] parents ) { } }
int numVisited = 0 ; // 1 - indexed array indicating whether each node ( including the wall at position 0 ) has been visited . boolean [ ] visited = new boolean [ parents . length + 1 ] ; Arrays . fill ( visited , false ) ; // Visit the nodes reachable from the wall in a pre - order traversal . IntStack stack = new Int...
public class MaybeLens { /** * Given a lens and a default < code > S < / code > , lift < code > S < / code > into { @ link Maybe } . * Note that this lens is NOT lawful , since " putting back what you got changes nothing " fails for any value * < code > B < / code > where < code > S < / code > is { @ link Maybe # n...
return lens . mapS ( m -> m . orElse ( defaultS ) ) ;
public class ValueAnimator { /** * The type evaluator to be used when calculating the animated values of this animation . * The system will automatically assign a float or int evaluator based on the type * of < code > startValue < / code > and < code > endValue < / code > in the constructor . But if these values ...
if ( value != null && mValues != null && mValues . length > 0 ) { mValues [ 0 ] . setEvaluator ( value ) ; }
public class QueryLimitOverride { /** * Iterates over the list of overrides and return the first that matches or * the default if no match is found . * NOTE : The set of expressions is not sorted so if more than one regex * matches the string , the result is indeterministic . * If the metric is null or empty , ...
if ( metric == null || metric . isEmpty ( ) ) { return default_byte_limit ; } for ( final QueryLimitOverrideItem item : overrides . values ( ) ) { if ( item . matches ( metric ) ) { return item . getByteLimit ( ) ; } } return default_byte_limit ;
public class HerokuAPI { /** * List all apps for a team . * @ param team The name or id of the team . * @ return a list of apps */ public Range < Invoice > listTeamInvoices ( String team ) { } }
return connection . execute ( new TeamInvoiceList ( team ) , apiKey ) ;
public class AbstractRegionPainter { /** * Get the paint to use for a focus ring . * @ param s the shape to paint . * @ param focusType the focus type . * @ param useToolBarFocus whether we should use the colors for a toolbar control . * @ return the paint to use to paint the focus ring . */ public Paint getFoc...
if ( focusType == FocusType . OUTER_FOCUS ) { return useToolBarFocus ? outerToolBarFocus : outerFocus ; } else { return useToolBarFocus ? innerToolBarFocus : innerFocus ; }
public class GraknConsole { /** * Invocation from bash script ' . / grakn console ' */ public static void main ( String [ ] args ) { } }
try { GraknConsole console = new GraknConsole ( Arrays . copyOfRange ( args , 1 , args . length ) , System . out , System . err ) ; console . run ( ) ; System . exit ( 0 ) ; } catch ( GraknConsoleException e ) { System . err . println ( e . getMessage ( ) ) ; System . err . println ( "Cause: " + e . getCause ( ) . getC...
public class UpdateInstanceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateInstanceRequest updateInstanceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateInstanceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateInstanceRequest . getInstanceId ( ) , INSTANCEID_BINDING ) ; protocolMarshaller . marshall ( updateInstanceRequest . getLayerIds ( ) , LAYERIDS_BINDING ) ; p...
public class FluentCloseableIterable { /** * Returns a fluent iterable that applies { @ code function } to each element of this * fluent iterable . * < p > The returned fluent iterable ' s iterator supports { @ code remove ( ) } if this iterable ' s * iterator does . After a successful { @ code remove ( ) } call ...
return from ( CloseableIterables . transform ( this , function ) ) ;
public class HypergraphSorter { /** * Turns a bit vector into a 3 - hyperedge . * @ param bv a bit vector . * @ param seed the seed for the hash function . * @ param numVertices the number of vertices in the underlying hypergraph . * @ param e an array to store the resulting edge . * @ see # bitVectorToEdge (...
bitVectorToEdge ( bv , seed , numVertices , ( int ) ( numVertices * 0xAAAAAAABL >>> 33 ) , e ) ; // Fast division by 3
public class AdminLinkProviderForUserRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AdminLinkProviderForUserRequest adminLinkProviderForUserRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( adminLinkProviderForUserRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( adminLinkProviderForUserRequest . getUserPoolId ( ) , USERPOOLID_BINDING ) ; protocolMarshaller . marshall ( adminLinkProviderForUserRequest . getDestina...
public class InfluxUtil { /** * Validation function , to check if an iterable is sorted with ascending * timestamps . * @ param tscIterable An iterable type . * @ return True iff the iterable is sorted , false otherwise . */ static boolean isSorted ( Iterable < ? extends TimeSeriesCollection > tscIterable ) { } }
final Iterator < ? extends TimeSeriesCollection > iter = tscIterable . iterator ( ) ; if ( ! iter . hasNext ( ) ) return true ; // Empty collection is ordered . DateTime timestamp = iter . next ( ) . getTimestamp ( ) ; while ( iter . hasNext ( ) ) { final DateTime nextTimestamp = iter . next ( ) . getTimestamp ( ) ; if...
public class RecycleManager { /** * Get all recycled widgets */ public List < Widget > getRecycledWidgets ( ) { } }
List < Widget > widgets = new ArrayList < > ( ) ; for ( Integer recycledIndex : recycledWidgets . keySet ( ) ) { widgets . addAll ( recycledWidgets . get ( recycledIndex ) ) ; } return widgets ;
public class ToStream { /** * If this method is called , the serializer is used as a * DTDHandler , which changes behavior how the serializer * handles document entities . * @ see org . xml . sax . DTDHandler # notationDecl ( java . lang . String , java . lang . String , java . lang . String ) */ public void nota...
// TODO Auto - generated method stub try { DTDprolog ( ) ; m_writer . write ( "<!NOTATION " ) ; m_writer . write ( name ) ; if ( pubID != null ) { m_writer . write ( " PUBLIC \"" ) ; m_writer . write ( pubID ) ; } else { m_writer . write ( " SYSTEM \"" ) ; m_writer . write ( sysID ) ; } m_writer . write ( "\" >" ) ; m_...
public class Quaternion { /** * Performs a great circle interpolation between this quaternion * and the quaternion parameter and places the result into this * quaternion . * @ param q1 the other quaternion * @ param alpha the alpha interpolation parameter */ public final void interpolate ( Quaternion q1 , doubl...
// From " Advanced Animation and Rendering Techniques " // by Watt and Watt pg . 364 , function as implemented appeared to be // incorrect . Fails to choose the same quaternion for the double // covering . Resulting in change of direction for rotations . // Fixed function to negate the first quaternion in the case that...
public class BatchUnparsedResponse { /** * Reads an HTTP response line ( ISO - 8859-1 encoding ) . * @ return The line that was read , including CRLF . */ private String readRawLine ( ) throws IOException { } }
int b = inputStream . read ( ) ; if ( b == - 1 ) { return null ; } else { StringBuilder buffer = new StringBuilder ( ) ; for ( ; b != - 1 ; b = inputStream . read ( ) ) { buffer . append ( ( char ) b ) ; if ( b == '\n' ) { break ; } } return buffer . toString ( ) ; }
public class JdbcTemplateTool { /** * 获取总行数 * get count * @ param sql * @ param params * @ return */ public int count ( String sql , Object [ ] params ) { } }
int rowCount = 0 ; try { Map < String , Object > resultMap = null ; if ( params == null || params . length == 0 ) { resultMap = getProxy ( ) . queryForMap ( sql ) ; } else { resultMap = getProxy ( ) . queryForMap ( sql , params ) ; } Iterator < Map . Entry < String , Object > > it = resultMap . entrySet ( ) . iterator ...
public class Years { /** * / * [ deutsch ] * < p > Interpretiert das kanonische ISO - 8601 - Format & quot ; PnY & quot ; mit optionalem vorangehenden Minus - Zeichen . < / p > * @ param period the formatted string to be parsed * @ return parsed instance * @ throws ParseException if given argument cannot be par...
int amount = SingleUnitTimeSpan . parsePeriod ( period , 'Y' ) ; return Years . ofGregorian ( amount ) ;
public class ManagedBeanOBase { /** * Creates the bean instance using either the ManagedObjectFactory or constructor . */ private void createInstance ( ) throws InvocationTargetException { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createInstance" ) ; ManagedObjectFactory < ? > ejbManagedObjectFactory = home . beanMetaData . ivEnterpriseBeanFactory ; if ( ejbManagedObjectFactory != null ) { createInstanceUsingMOF ( e...