signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class HtmlWriter { /** * Generates HTML Output for a { @ link DefinitionList } . */ private static String definitionListToHtml ( DefinitionList dl ) { } }
if ( dl == null ) { return "null" ; } StringBuilder result = new StringBuilder ( ) ; result . append ( "<table class=\"DefinitionList\">\n" + "<tr><th class=\"DefinitionList\">DefinitionList</th></tr>\n" + "<tr><td class=\"DefinitionList\">" ) ; if ( dl . getDefinedTerm ( ) != null ) { result . append ( contentElementT...
public class PickList { /** * Prohibits client - side manipulation of disabled entries , when CSS style - class ui - state - disabled is removed . See * < a href = " https : / / github . com / primefaces / primefaces / issues / 2127 " > https : / / github . com / primefaces / primefaces / issues / 2127 < / a > * @ ...
if ( ! isValid ( ) ) { return ; } Map < String , Object > requestMap = facesContext . getExternalContext ( ) . getRequestMap ( ) ; String varName = getVar ( ) ; String clientId = getClientId ( facesContext ) ; Object originalItem = requestMap . get ( varName ) ; for ( int i = 0 ; i < newEntries . size ( ) ; i ++ ) { Ob...
public class HmlWriter { /** * Write the specified HML to the specified writer . * @ param data HML to write , must not be null * @ param writer writer to write to , must not be null * @ throws IOException if an I / O error occurs */ public static void write ( final Hml data , final Writer writer ) throws IOExcep...
checkNotNull ( data ) ; checkNotNull ( writer ) ; try { JAXBContext context = JAXBContext . newInstance ( Hml . class ) ; Marshaller marshaller = context . createMarshaller ( ) ; SchemaFactory schemaFactory = SchemaFactory . newInstance ( XMLConstants . W3C_XML_SCHEMA_NS_URI ) ; URL schemaURL = HmlReader . class . getR...
public class GVRCameraRig { /** * Sets the rotation and angular velocity data for the camera rig . This * should only be done in response to * { @ link OvrRotationSensorListener # onRotationSensor ( long , float , float , float , float , float , float , float ) * OvrRotationSensorListener . onRotationSensor ( ) }...
NativeCameraRig . setRotationSensorData ( getNative ( ) , timeStamp , w , x , y , z , gyroX , gyroY , gyroZ ) ;
public class GVRRigidBody { /** * Sets an linear factor [ X , Y , Z ] that influences forces acting on this { @ linkplain GVRRigidBody rigid body } * @ param x factor on the ' X ' axis . * @ param y factor on the ' Y ' axis . * @ param z factor on the ' Z ' axis . */ public void setLinearFactor ( float x , float ...
Native3DRigidBody . setLinearFactor ( getNative ( ) , x , y , z ) ;
public class RectifyImageOps { /** * Creates an { @ link ImageDistort } for rectifying an image given its rectification matrix . * Lens distortion is assumed to have been previously removed . * @ param rectify Transform for rectifying the image . * @ param imageType Type of single band image the transform is to b...
boolean skip = borderType == BorderType . SKIP ; if ( skip ) { borderType = BorderType . EXTENDED ; } InterpolatePixelS < T > interp = FactoryInterpolation . bilinearPixelS ( imageType , borderType ) ; FMatrixRMaj rectifyInv = new FMatrixRMaj ( 3 , 3 ) ; CommonOps_FDRM . invert ( rectify , rectifyInv ) ; PointTransform...
public class BlockHouseHolder_DDRB { /** * Computes the inner product of row vector ' rowA ' against row vector ' rowB ' while taking account leading zeros and one . < br > * < br > * ret = a < sup > T < / sup > * b * Row A is assumed to be a householder vector . Element at ' colStartA ' is one and previous eleme...
int offset = rowA + zeroOffset ; if ( offset + B . col0 >= B . col1 ) return 0 ; // take in account the one in ' A ' double total = B . get ( rowB , offset ) ; total += VectorOps_DDRB . dot_row ( blockLength , A , rowA , B , rowB , offset + 1 , A . col1 - A . col0 ) ; return total ;
public class TypedPropertyDescriptor { /** * this class maintains its own copy of propertyType . */ public void setReadMethod ( Method getter ) throws IntrospectionException { } }
super . setReadMethod ( getter ) ; if ( _propertyClass == null ) { _propertyClass = super . getPropertyType ( ) ; }
public class ProducerSequenceFactory { /** * bitmap prepare producer - > inputProducer */ private synchronized Producer < CloseableReference < CloseableImage > > getBitmapPrepareSequence ( Producer < CloseableReference < CloseableImage > > inputProducer ) { } }
Producer < CloseableReference < CloseableImage > > bitmapPrepareProducer = mBitmapPrepareSequences . get ( inputProducer ) ; if ( bitmapPrepareProducer == null ) { bitmapPrepareProducer = mProducerFactory . newBitmapPrepareProducer ( inputProducer ) ; mBitmapPrepareSequences . put ( inputProducer , bitmapPrepareProduce...
public class DefaultHttp2LocalFlowController { /** * The window update ratio is used to determine when a window update must be sent . If the ratio * of bytes processed since the last update has meet or exceeded this ratio then a window update will * be sent . This window update ratio will only be applied to { @ cod...
assert ctx != null && ctx . executor ( ) . inEventLoop ( ) ; checkValidRatio ( ratio ) ; FlowState state = state ( stream ) ; state . windowUpdateRatio ( ratio ) ; state . writeWindowUpdateIfNeeded ( ) ;
public class XmlUtils { /** * Builds a prettier exception message . * @ param ex the SAXParseException * @ return an easier to read exception message */ public static String getPrettyParseExceptionInfo ( SAXParseException ex ) { } }
final StringBuilder sb = new StringBuilder ( ) ; if ( ex . getSystemId ( ) != null ) { sb . append ( "systemId=" ) . append ( ex . getSystemId ( ) ) . append ( ", " ) ; } if ( ex . getPublicId ( ) != null ) { sb . append ( "publicId=" ) . append ( ex . getPublicId ( ) ) . append ( ", " ) ; } if ( ex . getLineNumber ( )...
public class SeaGlassTextFieldUI { /** * DOCUMENT ME ! * @ param context DOCUMENT ME ! * @ return DOCUMENT ME ! */ protected TextFieldBorder createTextFieldBorder ( SeaGlassContext context ) { } }
if ( textFieldBorder == null ) { textFieldBorder = new TextFieldBorder ( this , context . getStyle ( ) . getInsets ( context , null ) ) ; } return textFieldBorder ;
public class KProgram { /** * Create a new { @ link KProcess } * @ param context * context linked to the program * @ return a new program . */ public KProcess newProcess ( Object context ) { } }
KProcess process = new KProcess ( this , context ) ; this . init ( process ) ; return process ;
public class ThrowUnchecked { /** * Throws the given exception if it is unchecked or an instance of any of * the given declared types . Otherwise , it is thrown as an * UndeclaredThrowableException . This method only returns normally if the * exception is null . * @ param t exception to throw * @ param declar...
if ( t != null ) { if ( declaredTypes != null ) { for ( Class declaredType : declaredTypes ) { if ( declaredType . isInstance ( t ) ) { fire ( t ) ; } } } if ( t instanceof RuntimeException ) { throw ( RuntimeException ) t ; } if ( t instanceof Error ) { throw ( Error ) t ; } throw new UndeclaredThrowableException ( t ...
public class Pattern { /** * Appends a new group pattern to the existing one . The new pattern enforces non - strict * temporal contiguity . This means that a matching event of this pattern and the * preceding matching event might be interleaved with other events which are ignored . * @ param group the pattern to...
return new GroupPattern < > ( this , group , ConsumingStrategy . SKIP_TILL_ANY , afterMatchSkipStrategy ) ;
public class MinioClient { /** * Removes a bucket . * NOTE : - * All objects ( including all object versions and delete markers ) in the bucket * must be deleted prior , this API will not recursively delete objects * < / p > < b > Example : < / b > < br > * < pre > { @ code minioClient . removeBucket ( " my -...
executeDelete ( bucketName , null , null ) ;
public class StringCropper { /** * Return the rest of the string that is cropped the number of chars from * the beginning * @ param srcStr * @ param charCount * @ return */ public String removeHead ( String srcStr , int charCount ) { } }
return getRightOf ( srcStr , srcStr . length ( ) - charCount ) ;
public class ReactionManipulator { /** * Returns a new Reaction object which is the reverse of the given * Reaction . * @ param reaction the reaction being considered * @ return the reverse reaction */ public static IReaction reverse ( IReaction reaction ) { } }
IReaction reversedReaction = reaction . getBuilder ( ) . newInstance ( IReaction . class ) ; if ( reaction . getDirection ( ) == IReaction . Direction . BIDIRECTIONAL ) { reversedReaction . setDirection ( IReaction . Direction . BIDIRECTIONAL ) ; } else if ( reaction . getDirection ( ) == IReaction . Direction . FORWAR...
public class MetaClassImpl { /** * Create a CallSite */ public CallSite createPogoCallSite ( CallSite site , Object [ ] args ) { } }
if ( ! GroovyCategorySupport . hasCategoryInCurrentThread ( ) && ! ( this instanceof AdaptingMetaClass ) ) { Class [ ] params = MetaClassHelper . convertToTypeArray ( args ) ; CallSite tempSite = site ; if ( site . getName ( ) . equals ( "call" ) && GeneratedClosure . class . isAssignableFrom ( theClass ) ) { // here ,...
public class ChannelUtils { /** * This method will compare the new configuration against a previous configuration * and handle changes between the two . Deleted objects will be removed from * runtime and updates will stop and restart those specific chains . New chains * will be handled as normal . * This is sam...
if ( null == oldconfig ) { // if no old config , then assume this is not a restart situation . If " true " is passed for restart , then // other logic that throws an exception while trying to " unload " started chains needs to be modify not to throw // those exceptions , since sometimes the chains won ' t be loaded in ...
public class ActionDefinition { /** * syntactic sugar */ public Attachment addSupportingEvidence ( ) { } }
Attachment t = new Attachment ( ) ; if ( this . supportingEvidence == null ) this . supportingEvidence = new ArrayList < Attachment > ( ) ; this . supportingEvidence . add ( t ) ; return t ;
public class KerasLoss { /** * Get layer output type . * @ param inputType Array of InputTypes * @ return output type as InputType * @ throws InvalidKerasConfigurationException Invalid Keras config */ @ Override public InputType getOutputType ( InputType ... inputType ) throws InvalidKerasConfigurationException ,...
if ( inputType . length > 1 ) throw new InvalidKerasConfigurationException ( "Keras Loss layer accepts only one input (received " + inputType . length + ")" ) ; return this . getLossLayer ( inputType [ 0 ] ) . getOutputType ( - 1 , inputType [ 0 ] ) ;
public class AnnotationAnalyzer { /** * Returns the text information for a given field of a class . * @ param field * Field to inspect . * @ param locale * Locale to use . * @ param annotationClasz * Type of annotation to find . * @ return Label information - May be < code > null < / code > in case the an...
Contract . requireArgNotNull ( "field" , field ) ; Contract . requireArgNotNull ( "locale" , locale ) ; Contract . requireArgNotNull ( "annotationClasz" , annotationClasz ) ; final Annotation annotation = field . getAnnotation ( annotationClasz ) ; if ( annotation == null ) { return null ; } try { final ResourceBundle ...
public class OAuth1 { /** * Sends a request to the server and returns a token * @ param url the URL to send the request to * @ param method the HTTP request method * @ param token a token used for authorization ( may be null if the * app is not authorized yet ) * @ param additionalAuthParams additional parame...
Response r = requestInternal ( url , method , token , additionalAuthParams , null ) ; InputStream is = r . getInputStream ( ) ; String response = CSLUtils . readStreamToString ( is , UTF8 ) ; // create token for temporary credentials Map < String , String > sr = splitResponse ( response ) ; return responseToToken ( sr ...
public class ProvFactory { /** * A factory method to create an instance of a usage { @ link Used } from another * @ param u an instance of a usage * @ return an instance of { @ link Used } equal ( in the sense of @ see Object . equals ( ) ) to the input */ public Used newUsed ( Used u ) { } }
Used u1 = newUsed ( u . getId ( ) , u . getActivity ( ) , u . getEntity ( ) ) ; u1 . setTime ( u . getTime ( ) ) ; u1 . getType ( ) . addAll ( u . getType ( ) ) ; u1 . getLabel ( ) . addAll ( u . getLabel ( ) ) ; u1 . getRole ( ) . addAll ( u . getRole ( ) ) ; u1 . getLocation ( ) . addAll ( u . getLocation ( ) ) ; u1 ...
public class Radar { /** * Defines the position of the center of the radar by the * given coordinates as latitude and longitude * @ param LON * @ param LAT */ public void setMyLocation ( final double LON , final double LAT ) { } }
this . MY_LOCATION . setLocation ( LON , LAT ) ; checkForBlips ( ) ; init ( getInnerBounds ( ) . width , getInnerBounds ( ) . height ) ; repaint ( ) ;
public class ExtensionsInner { /** * Gets the status of Operations Management Suite ( OMS ) on the HDInsight cluster . * @ param resourceGroupName The name of the resource group . * @ param clusterName The name of the cluster . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ ret...
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( cluster...
public class EldaRouterRestletSupport { /** * Add the baseFilePath to the FileManager singleton . Only do it * once , otherwise the instance will get larger on each config load * ( at least that won ' t be once per query , though ) . Just possibly * there may be multiple servlet contexts so we add a new only only...
FileManager fm = EldaFileManager . get ( ) ; for ( Iterator < Locator > il = fm . locators ( ) ; il . hasNext ( ) ; ) { Locator l = il . next ( ) ; if ( l instanceof LocatorFile ) if ( ( ( LocatorFile ) l ) . getName ( ) . equals ( baseFilePath ) ) return ; } log . info ( "adding locator for " + baseFilePath ) ; EldaFi...
public class AmazonConfigClient { /** * Returns the resource counts across accounts and regions that are present in your AWS Config aggregator . You can * request the resource counts by providing filters and GroupByKey . * For example , if the input contains accountID 12345678910 and region us - east - 1 in filters...
request = beforeClientExecution ( request ) ; return executeGetAggregateDiscoveredResourceCounts ( request ) ;
public class JenkinsBuildPropertyType { /** * Depends on the nature of the entity . Allowed to the ones who can create the associated entity . */ @ Override public boolean canEdit ( ProjectEntity entity , SecurityService securityService ) { } }
switch ( entity . getProjectEntityType ( ) ) { case BUILD : return securityService . isProjectFunctionGranted ( entity , BuildCreate . class ) ; case PROMOTION_RUN : return securityService . isProjectFunctionGranted ( entity , PromotionRunCreate . class ) ; case VALIDATION_RUN : return securityService . isProjectFuncti...
public class Boxing { /** * Transforms any array into an array of { @ code char } . * @ param src source array * @ param srcPos start position * @ param len length * @ return char array */ public static char [ ] unboxCharacters ( Object src , int srcPos , int len ) { } }
return unboxCharacters ( array ( src ) , srcPos , len ) ;
public class AbstractViewQuery { /** * Click this view will trigger a CocoTask * @ param task * @ return */ public T clicked ( final CocoTask < ? > task ) { } }
return clicked ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { query . task ( task ) ; } } ) ;
public class Auth { /** * Sets up Authenticator and Authorizer . */ public static void setup ( ) { } }
if ( DatabaseDescriptor . getAuthenticator ( ) instanceof AllowAllAuthenticator ) return ; setupAuthKeyspace ( ) ; setupTable ( USERS_CF , USERS_CF_SCHEMA ) ; DatabaseDescriptor . getAuthenticator ( ) . setup ( ) ; DatabaseDescriptor . getAuthorizer ( ) . setup ( ) ; // register a custom MigrationListener for permissio...
public class FrustumIntersection { /** * Determine whether the given axis - aligned box is partly or completely within or outside of the frustum defined by < code > this < / code > frustum culler * and , if the box is not inside this frustum , return the index of the plane that culled it . * The box is specified vi...
/* * This is an implementation of the first algorithm in " 2.5 Plane masking and coherency " of the mentioned site . * In addition to the algorithm in the paper , this method also returns the index of the first plane that culled the box . */ int plane = PLANE_NX ; boolean inside = true ; if ( ( mask & PLANE_MASK_NX )...
public class SimpleLog { /** * Log an error with fatal log level . */ public final void fatal ( Object message , Throwable t ) { } }
if ( isLevelEnabled ( SimpleLog . LOG_LEVEL_FATAL ) ) { log ( SimpleLog . LOG_LEVEL_FATAL , message , t ) ; }
public class DeleteAssessmentRunRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteAssessmentRunRequest deleteAssessmentRunRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteAssessmentRunRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteAssessmentRunRequest . getAssessmentRunArn ( ) , ASSESSMENTRUNARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marsha...
public class ModuleInfo { /** * Add annotations found in a module descriptor classfile . * @ param moduleAnnotations * the module annotations */ void addAnnotations ( final AnnotationInfoList moduleAnnotations ) { } }
// Currently only class annotations are used in the module - info . class file if ( moduleAnnotations != null && ! moduleAnnotations . isEmpty ( ) ) { if ( this . annotationInfo == null ) { this . annotationInfo = new AnnotationInfoList ( moduleAnnotations ) ; } else { this . annotationInfo . addAll ( moduleAnnotations...
public class DatasetUtils { public static String getSelect ( final SQLiteDataset dataset ) { } }
final Class < ? > klass = dataset . getClass ( ) ; try { return getSelect ( klass ) ; } catch ( final Exception e ) { Logger . ex ( e ) ; return "" ; }
public class BoxApiCollaboration { /** * A request to delete a collaboration with given collaboration id . * @ param collaborationId id of the collaboration to delete * @ return request to delete a collaboration */ public BoxRequestsShare . DeleteCollaboration getDeleteRequest ( String collaborationId ) { } }
BoxRequestsShare . DeleteCollaboration collab = new BoxRequestsShare . DeleteCollaboration ( collaborationId , getCollaborationInfoUrl ( collaborationId ) , mSession ) ; return collab ;
public class FilesImpl { /** * Returns the content of the specified compute node file . * @ param poolId The ID of the pool that contains the compute node . * @ param nodeId The ID of the compute node that contains the file . * @ param filePath The path to the compute node file that you want to get the content of...
return ServiceFuture . fromHeaderResponse ( getFromComputeNodeWithServiceResponseAsync ( poolId , nodeId , filePath ) , serviceCallback ) ;
public class LocalisationManager { /** * Method reallocateTransmissionStreams * @ param ignoredStream */ public void reallocateTransmissionStreams ( PtoPXmitMsgsItemStream ignoredStream ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reallocateTransmissionStreams" , ignoredStream ) ; if ( _xmitQueuePoints != null ) { LockManager lockManager = _baseDestinationHandler . getReallocationLockManager ( ) ; lockManager . lockExclusive ( ) ; try { if ( _xmitQue...
public class Property_Builder { /** * Resets the state of this builder . * @ return this { @ code Builder } object */ public org . inferred . freebuilder . processor . property . Property . Builder clear ( ) { } }
Property_Builder defaults = new org . inferred . freebuilder . processor . property . Property . Builder ( ) ; type = defaults . type ; boxedType = defaults . boxedType ; name = defaults . name ; capitalizedName = defaults . capitalizedName ; allCapsName = defaults . allCapsName ; usingBeanConvention = defaults . using...
public class TypeCheck { /** * Visits a CALL node . * @ param t The node traversal object that supplies context , such as the * scope chain to use in name lookups as well as error reporting . * @ param n The node being visited . */ private void visitCall ( NodeTraversal t , Node n ) { } }
checkCallConventions ( t , n ) ; Node child = n . getFirstChild ( ) ; JSType childType = getJSType ( child ) . restrictByNotNullOrUndefined ( ) ; if ( ! childType . canBeCalled ( ) ) { report ( n , NOT_CALLABLE , childType . toString ( ) ) ; ensureTyped ( n ) ; return ; } // A couple of types can be called as if they w...
public class CmsXmlCategoryValue { /** * Creates the String value for this category value element . < p > * @ param cms the cms context * @ return the String value for this category value element */ private String createStringValue ( CmsObject cms ) { } }
Attribute enabled = m_element . attribute ( CmsXmlPage . ATTRIBUTE_ENABLED ) ; String content = "" ; if ( ( enabled == null ) || Boolean . valueOf ( enabled . getText ( ) ) . booleanValue ( ) ) { List < CmsLink > links = getLinks ( cms ) ; int i = 0 ; for ( CmsLink link : links ) { if ( link != null ) { String uri = ""...
public class AdGroupCriterion { /** * Gets the labels value for this AdGroupCriterion . * @ return labels * Labels that are attached to the AdGroupCriterion . To associate * an existing { @ link Label } to an * existing { @ link AdGroupCriterion } , use { @ link AdGroupCriterionService # mutateLabel } * with AD...
return labels ;
public class CmsFlexBucketConfiguration { /** * Gets the bucket bit index for the given bucket name . < p > * @ param bucketName a bucket name * @ return the bit index for the bucket */ int getBucketIndex ( String bucketName ) { } }
if ( bucketName . equals ( BUCKET_OTHER ) ) { return 0 ; } for ( int i = 0 ; i < m_bucketNames . size ( ) ; i ++ ) { if ( m_bucketNames . get ( i ) . equals ( bucketName ) ) { return 1 + i ; } } return - 1 ;
public class AWSCognitoIdentityProviderClient { /** * Deletes the specified Amazon Cognito user pool . * @ param deleteUserPoolRequest * Represents the request to delete a user pool . * @ return Result of the DeleteUserPool operation returned by the service . * @ throws ResourceNotFoundException * This except...
request = beforeClientExecution ( request ) ; return executeDeleteUserPool ( request ) ;
public class ProcyonDecompiler { /** * Decompiles the given . class file and creates the specified output source file . * @ param classFilePath the . class file to be decompiled . * @ param outputDir The directory where decompiled . java files will be placed . */ @ Override public DecompilationResult decompileClass...
Checks . checkDirectoryToBeRead ( rootDir . toFile ( ) , "Classes root dir" ) ; File classFile = classFilePath . toFile ( ) ; Checks . checkFileToBeRead ( classFile , "Class file" ) ; Checks . checkDirectoryToBeFilled ( outputDir . toFile ( ) , "Output directory" ) ; log . info ( "Decompiling .class '" + classFilePath ...
public class Configuration { /** * Saves the configuration to { @ code configFile } * @ param configFile The file to save the configuration to . * @ throws IOException if an I / O error occurs */ private void save ( OneOrOther < File , Path > configFile ) throws IOException { } }
if ( configFile . isOne ( ) ) { File config = configFile . getOne ( ) ; this . saveToWriter ( getFileWriter ( config ) ) ; } else { Path config = configFile . getOther ( ) ; this . saveToWriter ( getPathWriter ( config ) ) ; }
public class KubernetesResponseComposer { /** * This is a reimplementation of Java 8 ' s String . join . */ private static String join ( String sep , Collection < String > collection ) { } }
StringBuilder builder = new StringBuilder ( ) ; boolean first = true ; for ( String element : collection ) { if ( first ) { first = false ; } else { builder . append ( sep ) ; } builder . append ( element ) ; } return builder . toString ( ) ;
public class AbstractUserAgentStringParser { /** * Examines the user agent string whether it is a browser . * @ param userAgent * String of an user agent * @ param builder * Builder for an user agent information */ private static void examineAsBrowser ( final UserAgent . Builder builder , final Data data ) { } ...
Matcher matcher ; VersionNumber version = VersionNumber . UNKNOWN ; for ( final Entry < BrowserPattern , Browser > entry : data . getPatternToBrowserMap ( ) . entrySet ( ) ) { matcher = entry . getKey ( ) . getPattern ( ) . matcher ( builder . getUserAgentString ( ) ) ; if ( matcher . find ( ) ) { entry . getValue ( ) ...
public class JsonToken { /** * Get the whole slice as a string . * @ return Slice decoded as UTF _ 8 string . */ public String decodeJsonLiteral ( ) { } }
// This decodes the string from UTF _ 8 bytes . StringBuilder out = new StringBuilder ( len ) ; boolean esc = false ; final int end = off + len - 1 ; for ( int i = off + 1 ; i < end ; ++ i ) { char ch = fb [ i ] ; if ( esc ) { esc = false ; switch ( ch ) { case 'b' : out . append ( '\b' ) ; break ; case 'f' : out . app...
public class FreemarkerCall { /** * Render the template to a String * @ return */ @ Override public String process ( ) { } }
final StringWriter sw = new StringWriter ( ) ; process ( sw ) ; return sw . toString ( ) ;
public class JdbcWriter { /** * Flushes JdbcWriterCommands and commit . * { @ inheritDoc } * @ see org . apache . gobblin . writer . DataWriter # commit ( ) */ @ Override public void commit ( ) throws IOException { } }
try { LOG . info ( "Flushing pending insert." ) ; this . commands . flush ( ) ; LOG . info ( "Commiting transaction." ) ; this . conn . commit ( ) ; } catch ( Exception e ) { this . failed = true ; throw new RuntimeException ( e ) ; }
public class DiagnosticsInner { /** * List Site Detector Responses . * List Site Detector Responses . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList ...
return listSiteDetectorResponsesSlotNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < DetectorResponseInner > > , Page < DetectorResponseInner > > ( ) { @ Override public Page < DetectorResponseInner > call ( ServiceResponse < Page < DetectorResponseInner > > response ) { return...
public class AwsClientBuilder { /** * Get the current value of an advanced config option . * @ param key Key of value to get . * @ param < T > Type of value to get . * @ return Value if set , otherwise null . */ protected final < T > T getAdvancedConfig ( AdvancedConfig . Key < T > key ) { } }
return advancedConfig . get ( key ) ;
public class InternalService { /** * Send ' user is typing ' . * @ param conversationId ID of a conversation . * @ return Observable to send event . */ public Observable < ComapiResult < Void > > isTyping ( @ NonNull final String conversationId ) { } }
final String token = getToken ( ) ; if ( sessionController . isCreatingSession ( ) || TextUtils . isEmpty ( token ) ) { return Observable . error ( getSessionStateErrorDescription ( ) ) ; } else { return doIsTyping ( token , conversationId , true ) ; }
public class HuberLoss { /** * Computes the HuberLoss loss * @ param pred the predicted value * @ param y the true value * @ param c the threshold value * @ return the HuberLoss loss */ public static double loss ( double pred , double y , double c ) { } }
final double x = y - pred ; if ( Math . abs ( x ) <= c ) return x * x * 0.5 ; else return c * ( Math . abs ( x ) - c / 2 ) ;
public class FormatUtilities { /** * Returns the given time formatted as a number of days , hours and minutes . * @ param dt The time to be parsed * @ return The given time formatted as a number of days , hours and minutes */ static public String getLongFormattedDays ( long dt ) { } }
StringBuffer ret = new StringBuffer ( ) ; long days = dt / 86400000L ; long millis = dt - ( days * 86400000L ) ; if ( days > 0 ) { ret . append ( Long . toString ( days ) ) ; ret . append ( " day" ) ; if ( days > 1 ) ret . append ( "s" ) ; } long hours = millis / 3600000L ; millis = millis - ( hours * 3600000L ) ; if (...
public class OutputStreamInterceptingFilter { /** * Handles a single " blob " instruction , decoding its base64 data , * sending that data to the associated OutputStream , and ultimately * dropping the " blob " instruction such that the client never receives * it . If no OutputStream is associated with the stream...
// Verify all required arguments are present List < String > args = instruction . getArgs ( ) ; if ( args . size ( ) < 2 ) return instruction ; // Pull associated stream String index = args . get ( 0 ) ; InterceptedStream < OutputStream > stream = getInterceptedStream ( index ) ; if ( stream == null ) return instructio...
public class IndexScanPlanNode { /** * / or at a particular key , possibly compound . */ private String explainSearchKeys ( String [ ] asIndexed , int nCovered ) { } }
// By default , indexing starts at the start of the index . if ( m_searchkeyExpressions . isEmpty ( ) ) { return "start" ; } String conjunction = "" ; String result = "(" ; int prefixSize = nCovered - 1 ; for ( int ii = 0 ; ii < prefixSize ; ++ ii ) { result += conjunction + asIndexed [ ii ] + ( m_compareNotDistinct . ...
public class CoordinatesUtils { /** * Returns the 3D length of the geometry * @ param geom * @ return */ public static double length3D ( Geometry geom ) { } }
double sum = 0 ; for ( int i = 0 ; i < geom . getNumGeometries ( ) ; i ++ ) { Geometry subGeom = geom . getGeometryN ( i ) ; if ( subGeom instanceof Polygon ) { sum += length3D ( ( Polygon ) subGeom ) ; } else if ( subGeom instanceof LineString ) { sum += length3D ( ( LineString ) subGeom ) ; } } return sum ;
public class MemoryManager { /** * Releases all memory segments for the given owner . * @ param owner The owner memory segments are to be released . */ public void releaseAll ( Object owner ) { } }
if ( owner == null ) { return ; } // - - - - - BEGIN CRITICAL SECTION - - - - - synchronized ( lock ) { if ( isShutDown ) { throw new IllegalStateException ( "Memory manager has been shut down." ) ; } // get all segments final Set < MemorySegment > segments = allocatedSegments . remove ( owner ) ; // all segments may h...
public class AbstractCommandLineRunner { /** * Creates JS source code inputs from a list of files . */ @ GwtIncompatible ( "Unnecessary" ) private List < SourceFile > createSourceInputs ( List < JsModuleSpec > jsModuleSpecs , List < FlagEntry < JsSourceType > > files , List < JsonFileSpec > jsonFiles , List < String > ...
if ( isInTestMode ( ) ) { return inputsSupplierForTesting != null ? inputsSupplierForTesting . get ( ) : null ; } if ( files . isEmpty ( ) && jsonFiles == null ) { // Request to read from stdin . files = ImmutableList . of ( new FlagEntry < JsSourceType > ( JsSourceType . JS , "-" ) ) ; } for ( JSError error : deduplic...
public class JolokiaHttpHandler { /** * Used for checking origin or referer is an origin policy is enabled */ private String extractOriginOrReferer ( HttpExchange pExchange ) { } }
Headers headers = pExchange . getRequestHeaders ( ) ; String origin = headers . getFirst ( "Origin" ) ; if ( origin == null ) { origin = headers . getFirst ( "Referer" ) ; } return origin != null ? origin . replaceAll ( "[\\n\\r]*" , "" ) : null ;
public class FieldDescriptor { /** * @ see XmlCapable # toXML ( ) */ public String toXML ( ) { } }
RepositoryTags tags = RepositoryTags . getInstance ( ) ; String eol = SystemUtils . LINE_SEPARATOR ; // opening tag + attributes StringBuffer result = new StringBuffer ( 1024 ) ; result . append ( " " ) ; result . append ( tags . getOpeningTagNonClosingById ( FIELD_DESCRIPTOR ) ) ; result . append ( " " ) ; result...
public class MultiMetaDataRequest { /** * Append any specified parameters to the provided WebTarget . * @ param webTarget a web target used by the Jersey Client API , not null * @ return the WebTarget with any path and query parameters appended , not null */ public WebTarget appendPathAndQueryParameters ( final Web...
ArgumentChecker . notNull ( webTarget , "webTarget" ) ; WebTarget resultTarget = webTarget ; resultTarget = resultTarget . path ( MULTI_SET_NAME + EXTENSION ) ; resultTarget = resultTarget . queryParam ( COLUMNS_PARAM , buildCodeList ( _quandlCodes ) ) ; // This is a hack that stops Quandl from returning all the data a...
public class PApplicationException { /** * The application exception type . * @ return Optional of the < code > id < / code > field value . */ @ javax . annotation . Nonnull public java . util . Optional < net . morimekta . providence . PApplicationExceptionType > optionalId ( ) { } }
return java . util . Optional . ofNullable ( mId ) ;
public class DataTableCore { /** * Optional parameter defining which rows are selected when the datatable is initially rendered . If this attribute is an integer , it ' s the row index . If it ' s a string , it ' s a jQuery expression . If it ' s another object , it ' s compared to the loop var . Automatically sets sel...
return ( java . lang . Object ) getStateHelper ( ) . eval ( PropertyKeys . selectedRow ) ;
public class WorkerConfigurationUtils { /** * 10 percent of Xmx */ public Pair < Integer , Integer > getMinSizeAndSizeOfInBuffer ( int executionThreadsCount ) { } }
// 20 % percent of executionThreadsCount , but bigger than 1 int defaultMinInBufferSize = Math . max ( 1 , executionThreadsCount / 5 ) ; int minInBufferSizeLocal = getInteger ( WORKER_INBUFFER_MIN_SIZE , defaultMinInBufferSize ) ; int minInBufferSize = ( minInBufferSizeLocal > 0 ) ? minInBufferSizeLocal : defaultMinInB...
public class ExportImportHelper { public void exportBySql ( String name , List < ? extends Map < String , Object > > rows ) { } }
dataSets . put ( name , rows ) ; logger . info ( "Exported: name=[{}] count=[{}]" , name , rows . size ( ) ) ;
public class CommonDatabaseMetaData { /** * Retrieves a description of the stored procedures available in the given catalog . * Only procedure descriptions matching the schema and procedure name criteria are returned . They are ordered by * < code > PROCEDURE _ CAT < / code > , < code > PROCEDURE _ SCHEM < / code >...
log . info ( "getting empty result set, procedures" ) ; return getEmptyResultSet ( ) ;
public class RecurlyClient { /** * Lookup a transaction * @ param transactionId recurly transaction id * @ return the transaction if found , null otherwise */ public Transaction getTransaction ( final String transactionId ) { } }
if ( transactionId == null || transactionId . isEmpty ( ) ) throw new RuntimeException ( "transactionId cannot be empty!" ) ; return doGET ( Transactions . TRANSACTIONS_RESOURCE + "/" + transactionId , Transaction . class ) ;
public class ErrorFactory { /** * Creates a DecodingException object . * @ param errorId * reference to the error identifier * @ param message * additional message * @ return DecodingException */ public static DecodingException createDecodingException ( final ErrorKeys errorId , final String message ) { } }
return new DecodingException ( errorId . toString ( ) + ":\r\n" + message ) ;
public class WeakSet { /** * Puts the specified value in the set . * @ param value * the value . * @ return the value of any previous put or { @ code null } if there was no such value . */ public T put ( final T value ) { } }
expungeStaleEntries ( ) ; final int hash = value . hashCode ( ) ; int index = ( hash & 0x7FFFFFFF ) % elementData . length ; Entry < T > entry = elementData [ index ] ; while ( entry != null && ! eq ( value , entry . get ( ) ) ) { entry = entry . nextInSlot ; } if ( entry == null ) { if ( ++ elementCount > threshold ) ...
public class CodeGenerator { /** * Loads all CLDR data and invokes the code generators for each data type . Output * is a series of Java classes under the outputDir . */ public static void generate ( Path outputDir ) throws IOException { } }
DataReader reader = DataReader . get ( ) ; CalendarCodeGenerator datetimeGenerator = new CalendarCodeGenerator ( ) ; Map < LocaleID , ClassName > dateClasses = datetimeGenerator . generate ( outputDir , reader ) ; PluralCodeGenerator pluralGenerator = new PluralCodeGenerator ( ) ; pluralGenerator . generate ( outputDir...
public class HeapDisk { /** * Frees the last { @ code count } blocks from the given file . */ public synchronized void free ( RegularFile file , int count ) { } }
int remainingCacheSpace = maxCachedBlockCount - blockCache . blockCount ( ) ; if ( remainingCacheSpace > 0 ) { file . copyBlocksTo ( blockCache , Math . min ( count , remainingCacheSpace ) ) ; } file . truncateBlocks ( file . blockCount ( ) - count ) ; allocatedBlockCount -= count ;
public class DefaultGrailsDomainClassInjector { /** * Tests whether the ClassNode implements the specified method name * @ param classNode The ClassNode * @ param methodName The method name * @ param argTypes * @ return True if it implements the method */ private static boolean implementsMethod ( ClassNode clas...
List methods = classNode . getMethods ( ) ; if ( argTypes == null || argTypes . length == 0 ) { for ( Iterator i = methods . iterator ( ) ; i . hasNext ( ) ; ) { MethodNode mn = ( MethodNode ) i . next ( ) ; boolean methodMatch = mn . getName ( ) . equals ( methodName ) ; if ( methodMatch ) return true ; // TODO Implem...
public class DocumentAndOp { /** * Set the instance to be an update operation . * @ param doc * @ param term */ public void setUpdate ( Document doc , Term term ) { } }
this . op = Op . UPDATE ; this . doc = doc ; this . term = term ;
public class AmazonIdentityManagementClient { /** * Updates the password policy settings for the AWS account . * < note > * < ul > * < li > * This operation does not support partial updates . No parameters are required , but if you do not specify a * parameter , that parameter ' s value reverts to its default...
request = beforeClientExecution ( request ) ; return executeUpdateAccountPasswordPolicy ( request ) ;
public class MkCoPTree { /** * Creates a new directory entry representing the specified node . * @ param node the node to be represented by the new entry * @ param routingObjectID the id of the routing object of the node * @ param parentDistance the distance from the routing object of the node to * the routing ...
return new MkCoPDirectoryEntry ( routingObjectID , parentDistance , node . getPageID ( ) , node . coveringRadiusFromEntries ( routingObjectID , this ) , null ) ; // node . conservativeKnnDistanceApproximation ( k _ max ) ) ;
public class PooledService { /** * Helper method to ensure a minimum number of endpoints is enabled . */ private void ensureMinimum ( ) { } }
int belowMin = minEndpoints - endpoints . size ( ) ; if ( belowMin > 0 ) { LOGGER . debug ( logIdent ( hostname , this ) + "Service is {} below minimum, filling up." , belowMin ) ; synchronized ( epMutex ) { for ( int i = 0 ; i < belowMin ; i ++ ) { Endpoint endpoint = endpointFactory . create ( hostname , bucket , use...
public class ApacheHttpTransport { /** * Returns a new instance of the default HTTP parameters we use . */ static HttpParams newDefaultHttpParams ( ) { } }
HttpParams params = new BasicHttpParams ( ) ; // Turn off stale checking . Our connections break all the time anyway , // and it ' s not worth it to pay the penalty of checking every time . HttpConnectionParams . setStaleCheckingEnabled ( params , false ) ; HttpConnectionParams . setSocketBufferSize ( params , 8192 ) ;...
public class BlogPreProcessor { /** * Given a blog file , read through each line and extract the content and * updated date , printing these as one line to the result file . */ public void processFile ( File blogFile ) throws IOException { } }
BufferedReader br = new BufferedReader ( new FileReader ( blogFile ) ) ; String line = null ; String date = null ; String id = null ; StringBuilder content = new StringBuilder ( ) ; boolean needMoreContent = false ; while ( ( line = br . readLine ( ) ) != null ) { if ( line . contains ( "<id>" ) ) { int startIndex = li...
public class Scene { /** * Iterates over the list of { @ link Layer } and draws them all . */ @ Override public final Scene draw ( ) { } }
final NFastArrayList < Layer > layers = getChildNodes ( ) ; if ( null != layers ) { final int size = layers . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { final Layer layer = layers . get ( i ) ; if ( null != layer ) { layer . draw ( ) ; } } } return this ;
public class ExceptionDestinationHandlerImpl { /** * Wrapper method for handleUndeliverableMessage . This version will be called * from an external component via the * com . ibm . ws . sib . processor . ExceptionDestinationHandler interface . E . g . we * need to access this routine from the MQLink in the comms c...
// F001333-14610 // Delegate down onto the new method passing a null // subscription ID . return handleUndeliverableMessage ( msg , alternateUser , tran , exceptionReason , exceptionStrings , null ) ;
public class ConfigurationContext { /** * Register bundles resolved by lookup mechanism . { @ link GuiceyBundleLookup } used as context . * @ param bundles bundles resolved by lookup mechanism * @ see GuiceyBundleLookup */ public void registerLookupBundles ( final List < GuiceyBundle > bundles ) { } }
setScope ( ConfigScope . BundleLookup . getType ( ) ) ; for ( GuiceyBundle bundle : bundles ) { register ( ConfigItem . Bundle , bundle ) ; } closeScope ( ) ; lifecycle ( ) . bundlesFromLookupResolved ( bundles ) ; lifecycle ( ) . bundlesResolved ( getEnabledBundles ( ) , getDisabledBundles ( ) ) ;
public class ZipUtils { /** * Replace the file denoted by the zipFile with the provided data . The zipFile specifies * both the zip and the file inside the zip using ' ! ' as separator . * @ param zipFile The zip - file to process * @ param data The string - data to replace * @ param encoding The encoding that ...
if ( ! isFileInZip ( zipFile ) ) { throw new IOException ( "Parameter should specify a file inside a ZIP file, but had: " + zipFile ) ; } File zip = new File ( zipFile . substring ( 0 , zipFile . indexOf ( ZIP_DELIMITER ) ) ) ; String zipOut = zipFile . substring ( zipFile . indexOf ( ZIP_DELIMITER ) + 1 ) ; logger . i...
public class RequireJavaVersion { /** * ( non - Javadoc ) * @ see org . apache . maven . enforcer . rule . api . EnforcerRule # execute ( org . apache . maven . enforcer . rule . api . EnforcerRuleHelper ) */ public void execute ( EnforcerRuleHelper helper ) throws EnforcerRuleException { } }
String javaVersion = SystemUtils . JAVA_VERSION_TRIMMED ; Log log = helper . getLog ( ) ; log . debug ( "Detected Java String: " + javaVersion ) ; javaVersion = normalizeJDKVersion ( javaVersion ) ; log . debug ( "Normalized Java String: " + javaVersion ) ; ArtifactVersion detectedJdkVersion = new DefaultArtifactVersio...
public class YggdrasilAuthenticator { /** * Creates a < code > YggdrasilAuthenticator < / code > with a customized * { @ link AuthenticationService } and the given client token , and initializes * it with password . * @ param service the customized { @ link AuthenticationService } * @ param passwordProvider the...
Objects . requireNonNull ( service ) ; Objects . requireNonNull ( passwordProvider ) ; Objects . requireNonNull ( clientToken ) ; YggdrasilAuthenticator auth = new YggdrasilAuthenticator ( service ) ; auth . refreshWithPassword ( passwordProvider ) ; return auth ;
public class HttpDirectoryService { /** * Checks if the first pattern can be included in the second one and resolves directive conflicts if needed * @ param patterns * @ param specificPattern * @ param generalPattern */ private void checkPatternMatching ( Map < String , PatternCacheControl > patterns , String spe...
if ( PatternMatcherUtils . caseInsensitiveMatch ( specificPattern , generalPattern ) ) { PatternCacheControl specificPatternDirective = patterns . get ( specificPattern ) ; PatternCacheControl generalPatternDirective = patterns . get ( generalPattern ) ; generalPatternDirective . incrementMatchingPatternCount ( ) ; Con...
public class D6CrudHelperBase { /** * Returns Set of columName of model class * @ return */ final Set < String > getAllColumnNames ( ) { } }
final Set < String > columnNameSet = mColumnNameFieldInfoMap . keySet ( ) ; // Returns clone of columnNameSet because { @ see D6Inex } directly // manipulats ( almost delete ) columnNameSet , so it effects // mColumnNameFieldInfoMap . // So , prevent original columnNameSet from getting edit . return new LinkedHashSet <...
public class ClassPathBuilder { /** * Scan given codebase in order to * < ul > * < li > check the codebase for nested archives ( adding any found to the * worklist ) * < li > build a list of class resources found in the codebase * < / ul > * @ param workList * the worklist * @ param discoveredCodeBase ...
if ( DEBUG ) { System . out . println ( "Scanning " + discoveredCodeBase . getCodeBase ( ) . getCodeBaseLocator ( ) ) ; } IScannableCodeBase codeBase = ( IScannableCodeBase ) discoveredCodeBase . getCodeBase ( ) ; ICodeBaseIterator i = codeBase . iterator ( ) ; while ( i . hasNext ( ) ) { ICodeBaseEntry entry = i . nex...
public class PoolManager { /** * Can we take slots from this pool when preempting tasks ? */ public boolean canBePreempted ( String pool ) { } }
Boolean result = canBePreempted . get ( pool ) ; return result == null ? true : result ; // Default is true
public class ProfilePoint { /** * Return last visible point data for a profile points list . * < p > For the profile the min and max angles of " sight " are * calculated . The min azimuth angle represents the " upper " * line of sight , as thoght from the zenith . * < p > The max azimuth angle represents the " ...
if ( profile . size ( ) < 2 ) { throw new IllegalArgumentException ( "A profile needs to have at least 2 points." ) ; } ProfilePoint first = profile . get ( 0 ) ; double baseElev = first . getElevation ( ) ; Coordinate baseCoord = new Coordinate ( 0 , 0 ) ; double minAzimuthAngle = Double . POSITIVE_INFINITY ; double m...
public class GVRKUms { /** * Gibt alle Transaktionsdatensätze in einer " flachen " Struktur zurück . * D . h . nicht in einzelne Buchungstage unterteilt , sondern in einer Liste * analog zu einem " normalen " Kontoauszug . * @ return Liste mit Transaktionsdaten ( { @ link GVRKUms . UmsLine } ) */ public List < ...
verifyMT94xParsing ( "getFlatData()" ) ; List < UmsLine > result = new ArrayList < UmsLine > ( ) ; for ( Iterator < BTag > i = tageMT940 . iterator ( ) ; i . hasNext ( ) ; ) { BTag tag = i . next ( ) ; result . addAll ( tag . lines ) ; } return result ;
public class HttpGetRequester { /** * Gets rest api response as object . * @ param < T > the type parameter * @ param uri the uri * @ param typeReference the type reference * @ return the rest api response as object */ public static < T > T getRestApiResponseAsObject ( String uri , TypeReference < T > typeRefer...
return JMJson . withJsonResource ( getResponseAsString ( uri ) , typeReference ) ;
public class ModelsImpl { /** * Get one entity role for a given entity . * @ param appId The application ID . * @ param versionId The version ID . * @ param cEntityId The composite entity extractor ID . * @ param roleId entity role ID . * @ throws IllegalArgumentException thrown if parameters fail the validat...
return getCompositeEntityRoleWithServiceResponseAsync ( appId , versionId , cEntityId , roleId ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ArgumentsBuilder { /** * Converts profile options into corresponding arguments ( - - profiles ) . * @ param profiles profile options * @ return converted Pax Runner collection of arguments */ private static String extractArguments ( final ProfileOption [ ] profiles ) { } }
final StringBuilder argument = new StringBuilder ( ) ; if ( profiles != null && profiles . length > 0 ) { for ( ProfileOption profile : profiles ) { if ( profile != null && profile . getProfile ( ) != null && profile . getProfile ( ) . length ( ) > 0 ) { if ( argument . length ( ) == 0 ) { argument . append ( "--profil...
public class LeaderBoardItem { /** * * * * * * Resizing * * * * * */ private void resize ( ) { } }
width = getWidth ( ) - getInsets ( ) . getLeft ( ) - getInsets ( ) . getRight ( ) ; height = getHeight ( ) - getInsets ( ) . getTop ( ) - getInsets ( ) . getBottom ( ) ; size = parentWidth < parentHeight ? parentWidth : parentHeight ; if ( ASPECT_RATIO * width > height ) { width = 1 / ( ASPECT_RATIO / height ) ; } else...