signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class QueryString { /** * A value suitable for constructinng URIs with . This means that if there * are no parameters , null will be returned . * @ return If the map is empty , null , otherwise an escaped query string . */ public String toQueryString ( ) { } }
String result = null ; List < String > parameters = new ArrayList < > ( ) ; for ( Map . Entry < String , String > entry : entrySet ( ) ) { // We don ' t encode the key because it could legitimately contain // things like underscores , e . g . " _ escaped _ fragment _ " would become : // " % 5Fescaped % 5Ffragment % 5F " String key = entry . getKey ( ) ; String value ; try { value = URLEncoder . encode ( entry . getValue ( ) , StandardCharsets . UTF_8 . name ( ) ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalArgumentException ( "Error encoding URL" , e ) ; } // Jetty class * appears * to need Java 8 // String value = UrlEncoded . encodeString ( entry . getValue ( ) ) ; parameters . add ( key + "=" + value ) ; } if ( parameters . size ( ) > 0 ) { result = StringUtils . join ( parameters , '&' ) ; } return result ;
public class dnspolicy { /** * Use this API to add dnspolicy . */ public static base_response add ( nitro_service client , dnspolicy resource ) throws Exception { } }
dnspolicy addresource = new dnspolicy ( ) ; addresource . name = resource . name ; addresource . rule = resource . rule ; addresource . viewname = resource . viewname ; addresource . preferredlocation = resource . preferredlocation ; addresource . preferredloclist = resource . preferredloclist ; addresource . drop = resource . drop ; addresource . cachebypass = resource . cachebypass ; addresource . actionname = resource . actionname ; return addresource . add_resource ( client ) ;
public class PrimitiveTransformation { /** * < code > . google . privacy . dlp . v2 . BucketingConfig bucketing _ config = 6 ; < / code > */ public com . google . privacy . dlp . v2 . BucketingConfig getBucketingConfig ( ) { } }
if ( transformationCase_ == 6 ) { return ( com . google . privacy . dlp . v2 . BucketingConfig ) transformation_ ; } return com . google . privacy . dlp . v2 . BucketingConfig . getDefaultInstance ( ) ;
public class RepairDoubleSolutionAtBounds { /** * Checks if the value is between its bounds ; if not , the lower or upper bound is returned * @ param value The value to be checked * @ param lowerBound * @ param upperBound * @ return The same value if it is in the limits or a repaired value otherwise */ public double repairSolutionVariableValue ( double value , double lowerBound , double upperBound ) { } }
if ( lowerBound > upperBound ) { throw new JMetalException ( "The lower bound (" + lowerBound + ") is greater than the " + "upper bound (" + upperBound + ")" ) ; } double result = value ; if ( value < lowerBound ) { result = lowerBound ; } if ( value > upperBound ) { result = upperBound ; } return result ;
public class WebMvcLinkBuilder { /** * @ see org . springframework . hateoas . MethodLinkBuilderFactory # linkTo ( Class < ? > , Method , Object . . . ) */ public static WebMvcLinkBuilder linkTo ( Class < ? > controller , Method method , Object ... parameters ) { } }
Assert . notNull ( controller , "Controller type must not be null!" ) ; Assert . notNull ( method , "Method must not be null!" ) ; String mapping = DISCOVERER . getMapping ( controller , method ) ; UriTemplate template = UriTemplateFactory . templateFor ( mapping ) ; URI uri = template . expand ( parameters ) ; return new WebMvcLinkBuilder ( UriComponentsBuilderFactory . getBuilder ( ) ) . slash ( uri ) ;
public class HttpMessageSecurity { /** * Unprotects response if needed . Replaces its body with unencrypted version . * @ param response * server response . * @ return new response with unencrypted body if supported or existing response . * @ throws IOException throws IOException */ public Response unprotectResponse ( Response response ) throws IOException { } }
try { if ( ! supportsProtection ( ) || ! HttpHeaders . hasBody ( response ) ) { return response ; } if ( ! response . header ( "content-type" ) . toLowerCase ( ) . contains ( "application/jose+json" ) ) { return response ; } JWSObject jwsObject = JWSObject . deserialize ( response . body ( ) . string ( ) ) ; JWSHeader jwsHeader = jwsObject . jwsHeader ( ) ; if ( ! jwsHeader . kid ( ) . equals ( serverSignatureKey . kid ( ) ) || ! jwsHeader . alg ( ) . equals ( "RS256" ) ) { throw new IOException ( "Invalid protected response" ) ; } byte [ ] data = ( jwsObject . originalProtected ( ) + "." + jwsObject . payload ( ) ) . getBytes ( MESSAGE_ENCODING ) ; byte [ ] signature = MessageSecurityHelper . base64UrltoByteArray ( jwsObject . signature ( ) ) ; RsaKey serverSignatureRsaKey = new RsaKey ( serverSignatureKey . kid ( ) , serverSignatureKey . toRSA ( false ) ) ; boolean signed = serverSignatureRsaKey . verifyAsync ( getSha256 ( data ) , signature , "RS256" ) . get ( ) ; if ( ! signed ) { throw new IOException ( "Wrong signature." ) ; } String decrypted = unprotectPayload ( jwsObject . payload ( ) ) ; MediaType contentType = response . body ( ) . contentType ( ) ; ResponseBody body = ResponseBody . create ( contentType , decrypted ) ; return response . newBuilder ( ) . body ( body ) . build ( ) ; } catch ( ExecutionException e ) { // unexpected ; return null ; } catch ( InterruptedException e ) { // unexpected ; return null ; } catch ( NoSuchAlgorithmException e ) { // unexpected ; return null ; }
public class ProvisioningParameterMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ProvisioningParameter provisioningParameter , ProtocolMarshaller protocolMarshaller ) { } }
if ( provisioningParameter == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( provisioningParameter . getKey ( ) , KEY_BINDING ) ; protocolMarshaller . marshall ( provisioningParameter . getValue ( ) , VALUE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ExceptionSoftener { /** * Soften a CheckedBiPredicate that can throw Checked Exceptions to a standard BiPredicate that can also throw Checked Exceptions ( without declaring them ) * e . g . * < pre > * { @ code * boolean loaded = ExceptionSoftener . softenBiPredicate ( this : : exists ) . test ( id , " db " ) ; * public boolean exists ( int id , String context ) throws IOException * < / pre > * @ param fn CheckedBiPredicate to be converted to a standard BiPredicate * @ return BiPredicate that can throw checked Exceptions */ public static < T1 , T2 > BiPredicate < T1 , T2 > softenBiPredicate ( final CheckedBiPredicate < T1 , T2 > fn ) { } }
return ( t1 , t2 ) -> { try { return fn . test ( t1 , t2 ) ; } catch ( final Throwable e ) { throw throwSoftenedException ( e ) ; } } ;
public class DescribeHsmConfigurationsRequest { /** * A tag key or keys for which you want to return all matching HSM configurations that are associated with the * specified key or keys . For example , suppose that you have HSM configurations that are tagged with keys called * < code > owner < / code > and < code > environment < / code > . If you specify both of these tag keys in the request , Amazon * Redshift returns a response with the HSM configurations that have either or both of these tag keys associated * with them . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setTagKeys ( java . util . Collection ) } or { @ link # withTagKeys ( java . util . Collection ) } if you want to override * the existing values . * @ param tagKeys * A tag key or keys for which you want to return all matching HSM configurations that are associated with * the specified key or keys . For example , suppose that you have HSM configurations that are tagged with keys * called < code > owner < / code > and < code > environment < / code > . If you specify both of these tag keys in the * request , Amazon Redshift returns a response with the HSM configurations that have either or both of these * tag keys associated with them . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeHsmConfigurationsRequest withTagKeys ( String ... tagKeys ) { } }
if ( this . tagKeys == null ) { setTagKeys ( new com . amazonaws . internal . SdkInternalList < String > ( tagKeys . length ) ) ; } for ( String ele : tagKeys ) { this . tagKeys . add ( ele ) ; } return this ;
public class ExternalEventHandlerBase { /** * This method is used to create a document from external messages . The document reference * returned can be sent as parameters to start or inform processes . * @ param docType this should be variable type if the document reference is to be bound * to variables . * @ param document The document object itself , such as an XML bean document ( subclass of XmlObject ) * @ param ownerType this should be OwnerType . LISTENER _ REQUEST if the message * is received from external system and OwnerType . LISTENER _ RESPONSE * if the message is to be sent as response back to the external systems . * Application - created documents can be set to other types . * @ param ownerId It is set to * event handler ID for LISTENER _ REQUEST and the request document ID for LISTENER _ RESPONSE . * For application ' s usage , you should set the ID corresponding to the owner type . * @ param processInstanceId this is the ID of the process instance the message is going to * be delivered to . If that information is not available , pass new Long ( 0 ) to it . * You can update the information using updateDocumentInfo later on . * @ param searchKey1 user defined search key . Pass null if you do not need custom search key * @ param searchKey2 another custom search key . Pass null if you do not need it . * @ return document reference that refers to the newly created document . * @ throws EventHandlerException */ protected DocumentReference createDocument ( String docType , Object document , String ownerType , Long ownerId , Long processInstanceId , String searchKey1 , String searchKey2 ) throws EventHandlerException { } }
ListenerHelper helper = new ListenerHelper ( ) ; return helper . createDocument ( docType , document , getPackage ( ) , ownerType , ownerId ) ;
public class BlockAwareJsonParser { /** * If this parser is reading tokens from an object or an array that is nested below its original * nesting level , it will consume and skip all tokens until it reaches the end of the block that * it was created on . The underlying parser will be left on the END _ X token for the block . */ public void exitBlock ( ) { } }
if ( open == 0 ) { return ; } if ( open < 0 ) { throw new IllegalStateException ( "Parser is no longer nested in any blocks at the level in which it was " + "created. You must create a new block aware parser to track the levels above this one." ) ; } while ( open > 0 ) { Token t = delegate . nextToken ( ) ; if ( t == null ) { // handle EOF ? return ; } updateLevelBasedOn ( t ) ; }
public class Dates { /** * Instantiate a new datelist with the same type , timezone and utc settings * as the origList . * @ param origList * @ return a new empty list . */ public static DateList getDateListInstance ( final DateList origList ) { } }
final DateList list = new DateList ( origList . getType ( ) ) ; if ( origList . isUtc ( ) ) { list . setUtc ( true ) ; } else { list . setTimeZone ( origList . getTimeZone ( ) ) ; } return list ;
public class CrosstabBuilder { /** * To use main report datasource . There should be nothing else in the detail band * @ param preSorted * @ return */ public CrosstabBuilder useMainReportDatasource ( boolean preSorted ) { } }
DJDataSource datasource = new DJDataSource ( "ds" , DJConstants . DATA_SOURCE_ORIGIN_REPORT_DATASOURCE , DJConstants . DATA_SOURCE_TYPE_JRDATASOURCE ) ; datasource . setPreSorted ( preSorted ) ; crosstab . setDatasource ( datasource ) ; return this ;
public class BaseBot { /** * Form a Queue with all the methods responsible for a particular conversation . * @ param queue * @ param methodName * @ return */ private Queue < MethodWrapper > formConversationQueue ( Queue < MethodWrapper > queue , String methodName ) { } }
MethodWrapper methodWrapper = methodNameMap . get ( methodName ) ; queue . add ( methodWrapper ) ; if ( StringUtils . isEmpty ( methodName ) ) { return queue ; } else { return formConversationQueue ( queue , methodWrapper . getNext ( ) ) ; }
public class SqlValidatorImpl { /** * Validates a VALUES clause . * @ param node Values clause * @ param targetRowType Row type which expression must conform to * @ param scope Scope within which clause occurs */ protected void validateValues ( SqlCall node , RelDataType targetRowType , final SqlValidatorScope scope ) { } }
assert node . getKind ( ) == SqlKind . VALUES ; final List < SqlNode > operands = node . getOperandList ( ) ; for ( SqlNode operand : operands ) { if ( ! ( operand . getKind ( ) == SqlKind . ROW ) ) { throw Util . needToImplement ( "Values function where operands are scalars" ) ; } SqlCall rowConstructor = ( SqlCall ) operand ; if ( conformance . isInsertSubsetColumnsAllowed ( ) && targetRowType . isStruct ( ) && rowConstructor . operandCount ( ) < targetRowType . getFieldCount ( ) ) { targetRowType = typeFactory . createStructType ( targetRowType . getFieldList ( ) . subList ( 0 , rowConstructor . operandCount ( ) ) ) ; } else if ( targetRowType . isStruct ( ) && rowConstructor . operandCount ( ) != targetRowType . getFieldCount ( ) ) { return ; } inferUnknownTypes ( targetRowType , scope , rowConstructor ) ; if ( targetRowType . isStruct ( ) ) { for ( Pair < SqlNode , RelDataTypeField > pair : Pair . zip ( rowConstructor . getOperandList ( ) , targetRowType . getFieldList ( ) ) ) { if ( ! pair . right . getType ( ) . isNullable ( ) && SqlUtil . isNullLiteral ( pair . left , false ) ) { throw newValidationError ( node , RESOURCE . columnNotNullable ( pair . right . getName ( ) ) ) ; } } } } for ( SqlNode operand : operands ) { operand . validate ( this , scope ) ; } // validate that all row types have the same number of columns // and that expressions in each column are compatible . // A values expression is turned into something that looks like // ROW ( type00 , type01 , . . . ) , ROW ( type11 , . . . ) , . . . final int rowCount = operands . size ( ) ; if ( rowCount >= 2 ) { SqlCall firstRow = ( SqlCall ) operands . get ( 0 ) ; final int columnCount = firstRow . operandCount ( ) ; // 1 . check that all rows have the same cols length for ( SqlNode operand : operands ) { SqlCall thisRow = ( SqlCall ) operand ; if ( columnCount != thisRow . operandCount ( ) ) { throw newValidationError ( node , RESOURCE . incompatibleValueType ( SqlStdOperatorTable . VALUES . getName ( ) ) ) ; } } // 2 . check if types at i : th position in each row are compatible for ( int col = 0 ; col < columnCount ; col ++ ) { final int c = col ; final RelDataType type = typeFactory . leastRestrictive ( new AbstractList < RelDataType > ( ) { public RelDataType get ( int row ) { SqlCall thisRow = ( SqlCall ) operands . get ( row ) ; return deriveType ( scope , thisRow . operand ( c ) ) ; } public int size ( ) { return rowCount ; } } ) ; if ( null == type ) { throw newValidationError ( node , RESOURCE . incompatibleValueType ( SqlStdOperatorTable . VALUES . getName ( ) ) ) ; } } }
public class CircuitBreakingServiceLocator { /** * Do the given block with the given service looked up . * This is invoked by { @ link # doWithService ( String , Descriptor . Call , Function ) } , after wrapping the passed in block * in a circuit breaker if configured to do so . * The default implementation just delegates to the { @ link # locate ( String , Descriptor . Call ) } method , but this method * can be overridden if the service locator wants to inject other behaviour after the service call is complete . * @ param name The service name . * @ param serviceCall The service call that needs the service lookup . * @ param block A block of code that will use the looked up service , typically , to make a call on that service . * @ return A future of the result of the block , if the service lookup was successful . */ protected < T > CompletionStage < Optional < T > > doWithServiceImpl ( String name , Descriptor . Call < ? , ? > serviceCall , Function < URI , CompletionStage < T > > block ) { } }
return locate ( name , serviceCall ) . thenCompose ( uri -> { return uri . map ( u -> block . apply ( u ) . thenApply ( Optional :: of ) ) . orElseGet ( ( ) -> CompletableFuture . completedFuture ( Optional . empty ( ) ) ) ; } ) ;
public class Ecc25519Helper { /** * / * package */ static MessageDigest getSha256Digest ( ) { } }
try { MessageDigest digest = MessageDigest . getInstance ( "SHA-256" ) ; digest . reset ( ) ; return digest ; } catch ( NoSuchAlgorithmException e ) { // ignore , won ' t happen throw new IllegalStateException ( e ) ; }
public class BackendRegistrySrv { /** * 记录节点上下线日志 */ private void addLog ( NotifyEvent event , List < Node > nodes ) { } }
List < NodeOnOfflineLog > logs = new ArrayList < NodeOnOfflineLog > ( nodes . size ( ) ) ; for ( Node node : nodes ) { NodeOnOfflineLog log = new NodeOnOfflineLog ( ) ; log . setLogTime ( new Date ( ) ) ; log . setEvent ( event == NotifyEvent . ADD ? "ONLINE" : "OFFLINE" ) ; log . setClusterName ( node . getClusterName ( ) ) ; log . setCreateTime ( node . getCreateTime ( ) ) ; log . setGroup ( node . getGroup ( ) ) ; log . setHostName ( node . getHostName ( ) ) ; log . setIdentity ( node . getIdentity ( ) ) ; log . setIp ( node . getIp ( ) ) ; log . setPort ( node . getPort ( ) ) ; log . setThreads ( node . getThreads ( ) ) ; log . setNodeType ( node . getNodeType ( ) ) ; log . setHttpCmdPort ( node . getHttpCmdPort ( ) ) ; logs . add ( log ) ; } appContext . getBackendNodeOnOfflineLogAccess ( ) . insert ( logs ) ;
public class DirectoryServiceInMemoryClient { /** * private ProvidedServiceInstance toProvidedInstance ( ModelServiceInstance mInstance ) { * return new ProvidedServiceInstance ( mInstance . getServiceName ( ) , mInstance . getAddress ( ) , * mInstance . getUri ( ) , mInstance . getStatus ( ) , * mInstance . getMetadata ( ) ) ; */ private static String objHashStr ( Object o ) { } }
return o . getClass ( ) . getSimpleName ( ) + "@" + Integer . toHexString ( o . hashCode ( ) ) ;
public class SingularityClient { /** * Retrieve the list of logs stored in S3 for a specific deploy if a singularity request * @ param requestId * The request ID to search for * @ param deployId * The deploy ID ( within the specified request ) to search for * @ return * A collection of { @ link SingularityS3Log } */ public Collection < SingularityS3Log > getDeployLogs ( String requestId , String deployId ) { } }
final Function < String , String > requestUri = ( host ) -> String . format ( S3_LOG_GET_DEPLOY_LOGS , getApiBase ( host ) , requestId , deployId ) ; final String type = String . format ( "S3 logs for deploy %s of request %s" , deployId , requestId ) ; return getCollection ( requestUri , type , S3_LOG_COLLECTION ) ;
public class S3Uploader { /** * Generate the path to a file in s3 given a prefix , topologyName , and filename * @ param pathPrefixParent designates any parent folders that should be prefixed to the resulting path * @ param topologyName the name of the topology that we are uploaded * @ param filename the name of the resulting file that is going to be uploaded * @ return the full path of the package under the bucket . The bucket is not included in this path as it is a separate * argument that is passed to the putObject call in the s3 sdk . */ private String generateS3Path ( String pathPrefixParent , String topologyName , String filename ) { } }
List < String > pathParts = new ArrayList < > ( Arrays . asList ( pathPrefixParent . split ( "/" ) ) ) ; pathParts . add ( topologyName ) ; pathParts . add ( filename ) ; return String . join ( "/" , pathParts ) ;
public class Element { /** * ( non - Javadoc ) * @ see * qc . automation . framework . widget . IElement # isElementPresent ( java . lang . Boolean */ @ Override public boolean isElementPresent ( boolean isJavaXPath ) throws WidgetException { } }
try { final boolean isPotentiallyXpathWithLocator = ( locator instanceof EByFirstMatching ) || ( locator instanceof EByXpath ) ; if ( isJavaXPath && isPotentiallyXpathWithLocator ) { return isElementPresentJavaXPath ( ) ; } else { findElement ( ) ; return true ; } } catch ( NoSuchElementException e ) { return false ; } catch ( Exception e ) { return false ; }
public class RsPrettyJson { /** * Make a response . * @ return Response just made * @ throws IOException If fails */ private Response make ( ) throws IOException { } }
if ( this . transformed . isEmpty ( ) ) { this . transformed . add ( new RsWithBody ( this . origin , RsPrettyJson . transform ( this . origin . body ( ) ) ) ) ; } return this . transformed . get ( 0 ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcElectricConductanceMeasure ( ) { } }
if ( ifcElectricConductanceMeasureEClass == null ) { ifcElectricConductanceMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 801 ) ; } return ifcElectricConductanceMeasureEClass ;
public class SecureASTCustomizer { /** * An alternative way of setting { @ link # setReceiversBlackList ( java . util . List ) receiver classes } . * @ param receiversBlacklist a list of classes . */ public void setReceiversClassesBlackList ( final List < Class > receiversBlacklist ) { } }
List < String > values = new LinkedList < String > ( ) ; for ( Class aClass : receiversBlacklist ) { values . add ( aClass . getName ( ) ) ; } setReceiversBlackList ( values ) ;
public class Filter { /** * { @ inheritDoc } */ @ Override public boolean matches ( String name , Metric metric ) { } }
// TODO Auto - generated method stub Matcher m = p . matcher ( name ) ; return m . matches ( ) ;
public class CommerceUserSegmentCriterionPersistenceImpl { /** * Returns the commerce user segment criterion with the primary key or returns < code > null < / code > if it could not be found . * @ param primaryKey the primary key of the commerce user segment criterion * @ return the commerce user segment criterion , or < code > null < / code > if a commerce user segment criterion with the primary key could not be found */ @ Override public CommerceUserSegmentCriterion fetchByPrimaryKey ( Serializable primaryKey ) { } }
Serializable serializable = entityCache . getResult ( CommerceUserSegmentCriterionModelImpl . ENTITY_CACHE_ENABLED , CommerceUserSegmentCriterionImpl . class , primaryKey ) ; if ( serializable == nullModel ) { return null ; } CommerceUserSegmentCriterion commerceUserSegmentCriterion = ( CommerceUserSegmentCriterion ) serializable ; if ( commerceUserSegmentCriterion == null ) { Session session = null ; try { session = openSession ( ) ; commerceUserSegmentCriterion = ( CommerceUserSegmentCriterion ) session . get ( CommerceUserSegmentCriterionImpl . class , primaryKey ) ; if ( commerceUserSegmentCriterion != null ) { cacheResult ( commerceUserSegmentCriterion ) ; } else { entityCache . putResult ( CommerceUserSegmentCriterionModelImpl . ENTITY_CACHE_ENABLED , CommerceUserSegmentCriterionImpl . class , primaryKey , nullModel ) ; } } catch ( Exception e ) { entityCache . removeResult ( CommerceUserSegmentCriterionModelImpl . ENTITY_CACHE_ENABLED , CommerceUserSegmentCriterionImpl . class , primaryKey ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } return commerceUserSegmentCriterion ;
public class LayoutRefiner { /** * Check if two bonds are crossing . * @ param beg1 first atom of first bond * @ param end1 second atom of first bond * @ param beg2 first atom of second bond * @ param end2 first atom of second bond * @ return bond is crossing */ private boolean isCrossed ( Point2d beg1 , Point2d end1 , Point2d beg2 , Point2d end2 ) { } }
return Line2D . linesIntersect ( beg1 . x , beg1 . y , end1 . x , end1 . y , beg2 . x , beg2 . y , end2 . x , end2 . y ) ;
public class GeoHash { /** * Create a direction and parity map for use in adjacent hash calculations . * @ return map */ private static Map < Direction , Map < Parity , String > > createDirectionParityMap ( ) { } }
Map < Direction , Map < Parity , String > > m = newHashMap ( ) ; m . put ( Direction . BOTTOM , GeoHash . < Parity , String > newHashMap ( ) ) ; m . put ( Direction . TOP , GeoHash . < Parity , String > newHashMap ( ) ) ; m . put ( Direction . LEFT , GeoHash . < Parity , String > newHashMap ( ) ) ; m . put ( Direction . RIGHT , GeoHash . < Parity , String > newHashMap ( ) ) ; return m ;
public class TypeLord { /** * List < Foo > ArrayList < Foo > List */ public static IType findParameterizedType ( IType sourceType , IType rawGenericType ) { } }
return findParameterizedType ( sourceType , rawGenericType , false ) ;
public class FunctionExtensions { /** * Returns a composed { @ code Procedure1 } that performs , in sequence , the { @ code before } * operation followed by the { @ code after } operation . If performing either * operation throws an exception , it is relayed to the caller of the * composed operation . If performing the { @ code before } operation throws an exception , * the { @ code after } operation will not be performed . * @ param < T > the type of input for the { @ code before } operation * @ param before the operation to perform first * @ param after the operation to perform afterwards * @ return a composed { @ code Procedure1 } that performs in sequence the { @ code before } * operation followed by the { @ code after } operation * @ throws NullPointerException if { @ code before } or { @ code after } is null * @ since 2.9 */ public static < T > Procedure1 < T > andThen ( final Procedure1 < ? super T > before , final Procedure1 < ? super T > after ) { } }
if ( after == null ) throw new NullPointerException ( "after" ) ; if ( before == null ) throw new NullPointerException ( "before" ) ; return new Procedures . Procedure1 < T > ( ) { @ Override public void apply ( T p ) { before . apply ( p ) ; after . apply ( p ) ; } } ;
public class MuteDirector { /** * Mute or unmute the specified user . */ public void setMuted ( Name username , boolean mute ) { } }
boolean changed = mute ? _mutelist . add ( username ) : _mutelist . remove ( username ) ; String feedback ; if ( mute ) { feedback = "m.muted" ; } else { feedback = changed ? "m.unmuted" : "m.notmuted" ; } // always give some feedback to the user _chatdir . displayFeedback ( null , MessageBundle . tcompose ( feedback , username ) ) ; // if the mutelist actually changed , notify observers if ( changed ) { notifyObservers ( username , mute ) ; }
public class Abbreviations { /** * Convenience method to add an abbreviation from a SMILES string . * @ param line the smiles to add with a title ( the label ) * @ return the abbreviation was added , will be false if no title supplied * @ throws InvalidSmilesException the SMILES was not valid */ public boolean add ( String line ) throws InvalidSmilesException { } }
return add ( smipar . parseSmiles ( line ) , getSmilesSuffix ( line ) ) ;
public class GeometryEngine { /** * Imports the MapGeometry from its JSON representation . M and Z values are * not imported from JSON representation . * See OperatorImportFromJson . * @ param json * The JSON representation of the geometry ( with spatial * reference ) . * @ return The MapGeometry instance containing the imported geometry and its * spatial reference . */ public static MapGeometry geoJsonToGeometry ( String json , int importFlags , Geometry . Type type ) { } }
MapGeometry geom = OperatorImportFromGeoJson . local ( ) . execute ( importFlags , type , json , null ) ; return geom ;
public class PowerMock { /** * Reset a list of class mocks . */ public static synchronized void reset ( Class < ? > ... classMocks ) { } }
for ( Class < ? > type : classMocks ) { final MethodInvocationControl invocationHandler = MockRepository . getStaticMethodInvocationControl ( type ) ; if ( invocationHandler != null ) { invocationHandler . reset ( ) ; } NewInvocationControl < ? > newInvocationControl = MockRepository . getNewInstanceControl ( type ) ; if ( newInvocationControl != null ) { try { newInvocationControl . reset ( ) ; } catch ( AssertionError e ) { NewInvocationControlAssertionError . throwAssertionErrorForNewSubstitutionFailure ( e , type ) ; } } }
public class Redisson { /** * Create Reactive Redisson instance with provided config * @ param config for Redisson * @ return Redisson instance */ public static RedissonRxClient createRx ( Config config ) { } }
RedissonRx react = new RedissonRx ( config ) ; if ( config . isReferenceEnabled ( ) ) { react . enableRedissonReferenceSupport ( ) ; } return react ;
public class HtmlDoctype { /** * < p > Set the value of the < code > system < / code > property . < / p > */ public void setSystem ( java . lang . String system ) { } }
getStateHelper ( ) . put ( PropertyKeys . system , system ) ; handleAttribute ( "system" , system ) ;
public class ReflectionHelper { /** * Find all declared fields of a class . Fields which are hidden by a child class are not included . * @ param clazz class to find fields for * @ return list of fields */ List < Field > getFields ( Class < ? > clazz ) { } }
List < Field > result = new ArrayList < > ( ) ; Set < String > fieldNames = new HashSet < > ( ) ; Class < ? > searchType = clazz ; while ( ! Object . class . equals ( searchType ) && searchType != null ) { Field [ ] fields = searchType . getDeclaredFields ( ) ; for ( Field field : fields ) { if ( ! fieldNames . contains ( field . getName ( ) ) ) { fieldNames . add ( field . getName ( ) ) ; makeAccessible ( field ) ; result . add ( field ) ; } } searchType = searchType . getSuperclass ( ) ; } return result ;
public class ModelsImpl { /** * Gets information about the intent model . * @ param appId The application ID . * @ param versionId The version ID . * @ param intentId The intent classifier ID . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ErrorResponseException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the IntentClassifier object if successful . */ public IntentClassifier getIntent ( UUID appId , String versionId , UUID intentId ) { } }
return getIntentWithServiceResponseAsync ( appId , versionId , intentId ) . toBlocking ( ) . single ( ) . body ( ) ;
public class WorkflowInstanceDetailsController { /** * Aborts , suspends or resumes a workflow instance or retries the last failed operation * on the instance . < br > * Returns a redirect for a GET - after - POST . */ @ PreAuthorize ( "hasRole('ROLE_TWE_ADMIN')" ) @ RequestMapping ( method = RequestMethod . POST , value = "/workflow/instances/{woinRefNum}" ) public String performActionOnInstance ( RedirectAttributes model , @ PathVariable long woinRefNum , @ RequestParam ( ) String action ) { } }
if ( "abort" . equals ( action ) || "suspend" . equals ( action ) || "resume" . equals ( action ) || "retry" . equals ( action ) ) { try { if ( "abort" . equals ( action ) ) { facade . abortWorkflowInstance ( woinRefNum ) ; model . addFlashAttribute ( "successMessage" , "workflow.instance.action.abort.success" ) ; } else if ( "suspend" . equals ( action ) ) { facade . suspendWorkflowInstance ( woinRefNum ) ; model . addFlashAttribute ( "successMessage" , "workflow.instance.action.suspend.success" ) ; } else if ( "resume" . equals ( action ) ) { facade . resumeWorkflowInstance ( woinRefNum ) ; model . addFlashAttribute ( "successMessage" , "workflow.instance.action.resume.success" ) ; } else if ( "retry" . equals ( action ) ) { facade . retryWorkflowInstance ( woinRefNum ) ; model . addFlashAttribute ( "successMessage" , "workflow.instance.action.retry.success" ) ; } } catch ( UnexpectedStatusException e ) { model . addFlashAttribute ( "errorMessage" , "workflow.instance.action.error.unexpectedstatus" ) ; } } else { model . addFlashAttribute ( "unknownAction" , action ) ; model . addFlashAttribute ( "errorMessage" , "workflow.instance.action.error.unknownaction" ) ; } return "redirect:" + configuration . getConsoleMappingPrefix ( ) + "/console/workflow/instances/" + woinRefNum ;
public class Nd4jBase64 { /** * Convert an { @ link INDArray } * to numpy byte array using * { @ link Nd4j # toNpyByteArray ( INDArray ) } * @ param arr the input array * @ return the base 64ed binary * @ throws IOException */ public static String base64StringNumpy ( INDArray arr ) throws IOException { } }
byte [ ] bytes = Nd4j . toNpyByteArray ( arr ) ; return Base64 . encodeBase64String ( bytes ) ;
public class EllipseClustersIntoGrid { /** * Finds the node with the index of ' value ' */ public static int indexOf ( List < Node > list , int value ) { } }
for ( int i = 0 ; i < list . size ( ) ; i ++ ) { if ( list . get ( i ) . which == value ) return i ; } return - 1 ;
public class TimerTrace { /** * Turn profiling on or off . * @ param active */ public static void setActive ( boolean active ) { } }
if ( active ) System . setProperty ( ACTIVATE_PROPERTY , "true" ) ; else System . clearProperty ( ACTIVATE_PROPERTY ) ; TimerTrace . active = active ;
public class StandardDdlParser { /** * Parses DDL CREATE statement based on SQL 92 specifications . * @ param tokens the { @ link DdlTokenStream } representing the tokenized DDL content ; may not be null * @ param parentNode the parent { @ link AstNode } node ; may not be null * @ return the parsed CREATE { @ link AstNode } * @ throws ParsingException */ protected AstNode parseCreateStatement ( DdlTokenStream tokens , AstNode parentNode ) throws ParsingException { } }
assert tokens != null ; assert parentNode != null ; AstNode stmtNode = null ; // DEFAULT DOES NOTHING // Subclasses can implement additional parsing // System . out . println ( " > > > FOUND [ CREATE ] STATEMENT : TOKEN = " + tokens . consume ( ) + " " + tokens . consume ( ) + " " + // tokens . consume ( ) ) ; // SQL 92 CREATE OPTIONS : // CREATE SCHEMA // CREATE DOMAIN // CREATE [ { GLOBAL | LOCAL } TEMPORARY ] TABLE // CREATE VIEW // CREATE ASSERTION // CREATE CHARACTER SET // CREATE COLLATION // CREATE TRANSLATION if ( tokens . matches ( STMT_CREATE_SCHEMA ) ) { stmtNode = parseCreateSchemaStatement ( tokens , parentNode ) ; } else if ( tokens . matches ( STMT_CREATE_TABLE ) || tokens . matches ( STMT_CREATE_GLOBAL_TEMPORARY_TABLE ) || tokens . matches ( STMT_CREATE_LOCAL_TEMPORARY_TABLE ) ) { stmtNode = parseCreateTableStatement ( tokens , parentNode ) ; } else if ( tokens . matches ( STMT_CREATE_VIEW ) || tokens . matches ( STMT_CREATE_OR_REPLACE_VIEW ) ) { stmtNode = parseCreateViewStatement ( tokens , parentNode ) ; } else if ( tokens . matches ( STMT_CREATE_ASSERTION ) ) { stmtNode = parseCreateAssertionStatement ( tokens , parentNode ) ; } else if ( tokens . matches ( STMT_CREATE_CHARACTER_SET ) ) { stmtNode = parseCreateCharacterSetStatement ( tokens , parentNode ) ; } else if ( tokens . matches ( STMT_CREATE_COLLATION ) ) { stmtNode = parseCreateCollationStatement ( tokens , parentNode ) ; } else if ( tokens . matches ( STMT_CREATE_TRANSLATION ) ) { stmtNode = parseCreateTranslationStatement ( tokens , parentNode ) ; } else if ( tokens . matches ( STMT_CREATE_DOMAIN ) ) { stmtNode = parseCreateDomainStatement ( tokens , parentNode ) ; } else { markStartOfStatement ( tokens ) ; stmtNode = parseIgnorableStatement ( tokens , "CREATE UNKNOWN" , parentNode ) ; Position position = getCurrentMarkedPosition ( ) ; String msg = DdlSequencerI18n . unknownCreateStatement . text ( position . getLine ( ) , position . getColumn ( ) ) ; DdlParserProblem problem = new DdlParserProblem ( DdlConstants . Problems . WARNING , position , msg ) ; stmtNode . setProperty ( DDL_PROBLEM , problem . toString ( ) ) ; markEndOfStatement ( tokens , stmtNode ) ; } return stmtNode ;
public class SpringFutureUtils { /** * * * * * * Converting to ListenableFuture * * * * * */ public static < T > ListenableFuture < T > createListenableFuture ( ValueSourceFuture < T > valueSource ) { } }
if ( valueSource instanceof ListenableFutureBackedValueSourceFuture ) { return ( ( ListenableFutureBackedValueSourceFuture < T > ) valueSource ) . getWrappedFuture ( ) ; } else { return new ValueSourceFutureBackedListenableFuture < > ( valueSource ) ; }
public class Clock { /** * Defines if alarm markers should be drawn . * @ param VISIBLE */ public void setAlarmsVisible ( final boolean VISIBLE ) { } }
if ( null == alarmsVisible ) { _alarmsVisible = VISIBLE ; fireUpdateEvent ( REDRAW_EVENT ) ; } else { alarmsVisible . set ( VISIBLE ) ; }
public class XmlReportAbstract { /** * Transform time into ISO 8601 string . */ protected static String fromTime ( final long time ) { } }
Date date = new Date ( time ) ; // Waiting for Java 7 : SimpleDateFormat ( " yyyy - MM - dd ' T ' HH : mm : ssXXX " ) ; String formatted = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ssZ" ) . format ( date ) ; return formatted . substring ( 0 , 22 ) + ":" + formatted . substring ( 22 ) ;
public class CommerceDiscountRuleUtil { /** * Returns the first commerce discount rule in the ordered set where commerceDiscountId = & # 63 ; . * @ param commerceDiscountId the commerce discount ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce discount rule , or < code > null < / code > if a matching commerce discount rule could not be found */ public static CommerceDiscountRule fetchByCommerceDiscountId_First ( long commerceDiscountId , OrderByComparator < CommerceDiscountRule > orderByComparator ) { } }
return getPersistence ( ) . fetchByCommerceDiscountId_First ( commerceDiscountId , orderByComparator ) ;
public class Bytes { /** * Returns an Observable stream of byte arrays from the given * { @ link InputStream } between 1 and { @ code size } bytes . * @ param is * input stream of bytes * @ param size * max emitted byte array size * @ return a stream of byte arrays */ public static Observable < byte [ ] > from ( InputStream is , int size ) { } }
return Observable . create ( new OnSubscribeInputStream ( is , size ) ) ;
public class ConfigArgP { /** * Attempts to decode the passed dot delimited as a system property , and if not found , attempts a decode as an * environmental variable , replacing the dots with underscores . e . g . for the key : < b > < code > buffer . size . max < / code > < / b > , * a system property named < b > < code > buffer . size . max < / code > < / b > will be looked up , and then an environmental variable * named < b > < code > buffer . size . max < / code > < / b > will be looked up . * @ param key The dot delimited key to decode * @ param defaultValue The default value returned if neither source can decode the key * @ return the decoded value or the default value if neither source can decode the key */ public static String decodeToken ( String key , String defaultValue ) { } }
String value = System . getProperty ( key , System . getenv ( key . replace ( '.' , '_' ) ) ) ; return value != null ? value : defaultValue ;
public class CharsetEncoder { /** * Tells whether or not this encoder can encode the given character . * < p > This method returns < tt > false < / tt > if the given character is a * surrogate character ; such characters can be interpreted only when they * are members of a pair consisting of a high surrogate followed by a low * surrogate . The { @ link # canEncode ( java . lang . CharSequence ) * canEncode ( CharSequence ) } method may be used to test whether or not a * character sequence can be encoded . * < p > This method may modify this encoder ' s state ; it should therefore not * be invoked if an < a href = " # steps " > encoding operation < / a > is already in * progress . * < p > The default implementation of this method is not very efficient ; it * should generally be overridden to improve performance . < / p > * @ return < tt > true < / tt > if , and only if , this encoder can encode * the given character * @ throws IllegalStateException * If an encoding operation is already in progress */ public boolean canEncode ( char c ) { } }
CharBuffer cb = CharBuffer . allocate ( 1 ) ; cb . put ( c ) ; cb . flip ( ) ; return canEncode ( cb ) ;
public class FuncString { /** * Execute the function . The function must return * a valid object . * @ param xctxt The current execution context . * @ return A valid XObject . * @ throws javax . xml . transform . TransformerException */ public XObject execute ( XPathContext xctxt ) throws javax . xml . transform . TransformerException { } }
return ( XString ) getArg0AsString ( xctxt ) ;
public class Base32 { /** * Encodes the given bytes into a base - 32 string . * @ param in * an array containing the bytes to encode . * @ param off * the start offset of the data within { @ code in } . * @ param len * the number of bytes to encode . * @ return The base - 32 string . */ public static String encode ( byte [ ] in , int off , int len ) { } }
return inst . encode ( in , off , len , null , 0 ) . toString ( ) ;
public class MetadataLocationUnmarshaller { /** * { @ inheritDoc } */ @ Override protected void processChildElement ( XMLObject parentSAMLObject , XMLObject childSAMLObject ) throws UnmarshallingException { } }
MetadataLocation mdl = ( MetadataLocation ) parentSAMLObject ; if ( childSAMLObject instanceof Endpoint ) { mdl . getEndpoints ( ) . add ( ( Endpoint ) childSAMLObject ) ; } else if ( childSAMLObject instanceof KeyInfo ) { mdl . setKeyInfo ( ( KeyInfo ) childSAMLObject ) ; } else { super . processChildElement ( parentSAMLObject , childSAMLObject ) ; }
public class CmsHtmlImport { /** * Builds a map with all parents of the destination directory to the real file system . < p > * So links to resources of outside the import folder can be found . < p > */ private void buildParentPath ( ) { } }
String destFolder = m_destinationDir ; String inputDir = m_inputDir . replace ( '\\' , '/' ) ; if ( ! inputDir . endsWith ( "/" ) ) { inputDir += "/" ; } int pos = inputDir . lastIndexOf ( "/" ) ; while ( ( pos > 0 ) && ( destFolder != null ) ) { inputDir = inputDir . substring ( 0 , pos ) ; m_parents . put ( inputDir + "/" , destFolder ) ; pos = inputDir . lastIndexOf ( "/" , pos - 1 ) ; destFolder = CmsResource . getParentFolder ( destFolder ) ; }
public class BallColorFolderIcon { /** * Calculates the color of the status ball for the owner based on its descendants . * < br > * Kanged from Branch API ( original author Stephen Connolly ) . * @ return the color of the status ball for the owner . */ @ Nonnull private BallColor calculateBallColor ( ) { } }
if ( owner instanceof TemplateDrivenMultiBranchProject && ( ( TemplateDrivenMultiBranchProject ) owner ) . isDisabled ( ) ) { return BallColor . DISABLED ; } BallColor c = BallColor . DISABLED ; boolean animated = false ; for ( Job job : owner . getAllJobs ( ) ) { BallColor d = job . getIconColor ( ) ; animated |= d . isAnimated ( ) ; d = d . noAnime ( ) ; if ( d . compareTo ( c ) < 0 ) { c = d ; } } if ( animated ) { c = c . anime ( ) ; } return c ;
public class LocalSession { /** * / * ( non - Javadoc ) * @ see javax . jms . Session # unsubscribe ( java . lang . String ) */ @ Override public void unsubscribe ( String subscriptionName ) throws JMSException { } }
externalAccessLock . readLock ( ) . lock ( ) ; try { checkNotClosed ( ) ; if ( StringTools . isEmpty ( subscriptionName ) ) throw new FFMQException ( "Empty subscription name" , "INVALID_SUBSCRIPTION_NAME" ) ; // Remove remaining subscriptions on all topics engine . unsubscribe ( connection . getClientID ( ) , subscriptionName ) ; } finally { externalAccessLock . readLock ( ) . unlock ( ) ; }
public class CmsRoleManager { /** * Returns all groups of organizational units for which the current user * has the { @ link CmsRole # ACCOUNT _ MANAGER } role . < p > * @ param cms the current cms context * @ param ouFqn the fully qualified name of the organizational unit * @ param includeSubOus if sub organizational units should be included in the search * @ return a list of { @ link org . opencms . file . CmsGroup } objects * @ throws CmsException if something goes wrong */ public List < CmsGroup > getManageableGroups ( CmsObject cms , String ouFqn , boolean includeSubOus ) throws CmsException { } }
List < CmsGroup > groups = new ArrayList < CmsGroup > ( ) ; Iterator < CmsOrganizationalUnit > it = getOrgUnitsForRole ( cms , CmsRole . ACCOUNT_MANAGER . forOrgUnit ( ouFqn ) , includeSubOus ) . iterator ( ) ; while ( it . hasNext ( ) ) { CmsOrganizationalUnit orgUnit = it . next ( ) ; groups . addAll ( OpenCms . getOrgUnitManager ( ) . getGroups ( cms , orgUnit . getName ( ) , false ) ) ; } return groups ;
public class UndirectedMultigraph { /** * { @ inheritDoc } */ public UndirectedMultigraph < T > copy ( Set < Integer > toCopy ) { } }
// special case for If the called is requesting a copy of the entire // graph , which is more easily handled with the copy constructor if ( toCopy . size ( ) == order ( ) && toCopy . equals ( vertices ( ) ) ) return new UndirectedMultigraph < T > ( this ) ; UndirectedMultigraph < T > g = new UndirectedMultigraph < T > ( ) ; // long s = System . currentTimeMillis ( ) ; for ( int v : toCopy ) { if ( ! vertexToEdges . containsKey ( v ) ) throw new IllegalArgumentException ( "Request copy of non-present vertex: " + v ) ; g . add ( v ) ; SparseTypedEdgeSet < T > edges = vertexToEdges . get ( v ) ; if ( edges == null ) throw new IllegalArgumentException ( ) ; for ( int v2 : toCopy ) { if ( v == v2 ) break ; if ( edges . connects ( v2 ) ) for ( TypedEdge < T > e : edges . getEdges ( v2 ) ) g . add ( e ) ; } } return g ;
public class LabelingJobDataAttributesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LabelingJobDataAttributes labelingJobDataAttributes , ProtocolMarshaller protocolMarshaller ) { } }
if ( labelingJobDataAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( labelingJobDataAttributes . getContentClassifiers ( ) , CONTENTCLASSIFIERS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class XmlUtils { /** * Concatenate the given { @ code elements } using the given { @ code delimiter } to concatenate . */ @ Nonnull public static String join ( @ Nonnull Iterable < String > elements , @ Nonnull String delimiter ) { } }
StringBuilder result = new StringBuilder ( ) ; Iterator < String > it = elements . iterator ( ) ; while ( it . hasNext ( ) ) { String element = it . next ( ) ; result . append ( element ) ; if ( it . hasNext ( ) ) { result . append ( delimiter ) ; } } return result . toString ( ) ;
public class Event { /** * Add a new event into array with selected event type and input date . * @ param date The event date * @ param useTemp True for using template to create new data * @ return The generated event data map */ public HashMap addEvent ( String date , boolean useTemp ) { } }
HashMap ret = new HashMap ( ) ; if ( useTemp ) { ret . putAll ( template ) ; } else { ret . put ( "event" , eventType ) ; } ret . put ( "date" , date ) ; getInertIndex ( ret ) ; events . add ( next , ret ) ; return ret ;
public class RuleItem { /** * Gets the dateRuleItem value for this RuleItem . * @ return dateRuleItem */ public com . google . api . ads . adwords . axis . v201809 . rm . DateRuleItem getDateRuleItem ( ) { } }
return dateRuleItem ;
public class VdmEditor { /** * React to changed selection . * @ since 3.0 */ protected void selectionChanged ( ) { } }
if ( getSelectionProvider ( ) == null ) return ; INode element = computeHighlightRangeSourceReference ( ) ; // if // ( getPreferenceStore ( ) . getBoolean ( PreferenceConstants . EDITOR _ SYNC _ OUTLINE _ ON _ CURSOR _ MOVE ) ) synchronizeOutlinePage ( element ) ; // if ( fIsBreadcrumbVisible & & fBreadcrumb ! = null & & // ! fBreadcrumb . isActive ( ) ) // setBreadcrumbInput ( element ) ; setSelection ( element , false ) ; // if ( ! fSelectionChangedViaGotoAnnotation ) // updateStatusLine ( ) ; // fSelectionChangedViaGotoAnnotation = false ;
public class SSTable { /** * If the given @ param key occupies only part of a larger buffer , allocate a new buffer that is only * as large as necessary . */ public static DecoratedKey getMinimalKey ( DecoratedKey key ) { } }
return key . getKey ( ) . position ( ) > 0 || key . getKey ( ) . hasRemaining ( ) || ! key . getKey ( ) . hasArray ( ) ? new BufferDecoratedKey ( key . getToken ( ) , HeapAllocator . instance . clone ( key . getKey ( ) ) ) : key ;
public class CollectionInterpreter { /** * < p > applyRowStatistic . < / p > * @ param rowStats a { @ link com . greenpepper . Statistics } object . */ protected void applyRowStatistic ( Statistics rowStats ) { } }
if ( rowStats . exceptionCount ( ) > 0 ) { stats . exception ( ) ; } else if ( rowStats . wrongCount ( ) > 0 ) { stats . wrong ( ) ; } else if ( rowStats . rightCount ( ) > 0 ) { stats . right ( ) ; } else { stats . ignored ( ) ; }
public class AbstractTreebankParserParams { /** * Returns an EquivalenceClasser that classes typed dependencies * by the syntactic categories of mother , head and daughter , * plus direction . * @ return An Equivalence class for typed dependencies */ public static EquivalenceClasser < List < String > , String > typedDependencyClasser ( ) { } }
return new EquivalenceClasser < List < String > , String > ( ) { public String equivalenceClass ( List < String > s ) { if ( s . get ( 5 ) . equals ( leftHeaded ) ) return s . get ( 2 ) + '(' + s . get ( 3 ) + "->" + s . get ( 4 ) + ')' ; return s . get ( 2 ) + '(' + s . get ( 4 ) + "<-" + s . get ( 3 ) + ')' ; } } ;
public class SftpClient { /** * Returns the attributes of the file from the remote computer . * @ param path * the path of the file on the remote computer * @ return the attributes * @ throws SftpStatusException * @ throws SshException */ public SftpFileAttributes stat ( String path ) throws SftpStatusException , SshException { } }
String actual = resolveRemotePath ( path ) ; return sftp . getAttributes ( actual ) ;
public class Node { /** * syck _ str _ blow _ away _ commas */ public void strBlowAwayCommas ( ) { } }
Data . Str d = ( ( Data . Str ) data ) ; byte [ ] buf = d . ptr . buffer ; int go = d . ptr . start ; int end = go + d . len ; for ( ; go < end ; go ++ ) { if ( buf [ go ] == ',' ) { d . len -- ; end -- ; System . arraycopy ( buf , go + 1 , buf , go , end - go ) ; } }
public class WSRdbManagedConnectionImpl { /** * Process request for a LOCAL _ TRANSACTION _ COMMITTED event . * @ param handle the Connection handle requesting to send an event . * @ throws ResourceException if an error occurs committing the transaction or the state is * not valid . */ public void processLocalTransactionCommittedEvent ( Object handle ) throws ResourceException { } }
// A application level local transaction has been committed . final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "processLocalTransactionCommittedEvent" , handle ) ; if ( tc . isDebugEnabled ( ) ) { String cId = null ; try { cId = mcf . getCorrelator ( this ) ; } catch ( SQLException x ) { // will just log the exception here and ignore it since its in trace Tr . debug ( this , tc , "got an exception trying to get the correlator in commit, exception is: " , x ) ; } if ( cId != null ) { StringBuffer stbuf = new StringBuffer ( 200 ) ; stbuf . append ( "Correlator: DB2, ID: " ) ; stbuf . append ( cId ) ; if ( xares != null ) { stbuf . append ( " Transaction : " ) ; stbuf . append ( xares ) ; } stbuf . append ( " COMMIT" ) ; Tr . debug ( this , tc , stbuf . toString ( ) ) ; } } } ResourceException re = stateMgr . isValid ( WSStateManager . LT_COMMIT ) ; if ( re == null ) { // If no work was done during the transaction , the autoCommit value may still be // on . In this case , just no - op , since some drivers like ConnectJDBC 3.1 don ' t // allow commit / rollback when autoCommit is on . if ( ! currentAutoCommit ) try { // autoCommit is off sqlConn . commit ( ) ; } catch ( SQLException se ) { FFDCFilter . processException ( se , "com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.processLocalTransactionCommittedEvent" , "554" , this ) ; throw AdapterUtil . translateSQLException ( se , this , true , getClass ( ) ) ; } // Set the state only after the commit has succeeded . Else , we change the // state but it has not yet been committed . - a real mess // Already validated the state so just set it . stateMgr . transtate = WSStateManager . NO_TRANSACTION_ACTIVE ; } else { throw re ; } // Fill in the ConnectionEvent only if needed . connEvent . recycle ( ConnectionEvent . LOCAL_TRANSACTION_COMMITTED , null , handle ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "Firing LOCAL TRANSACTION COMMITTED event for: " + handle , this ) ; // loop through the listeners for ( int i = 0 ; i < numListeners ; i ++ ) { // send Local Transaction Committed event to the current listener ivEventListeners [ i ] . localTransactionCommitted ( connEvent ) ; } // Reset the indicator so lazy enlistment will be signaled if we end up in a // Global Transaction . wasLazilyEnlistedInGlobalTran = false ; // Replace ConnectionEvent caching with a single reusable instance per // ManagedConnection . if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "processLocalTransactionCommittedEvent" ) ; }
public class NameBasedCandidateFilter { /** * In this case we have to check whether we have conflicting naming * fields . E . g . 2 fields of the same type , but we have to make sure * we match on the correct name . * Therefore we have to go through all other fields and make sure * whenever we find a field that does match its name with the mock * name , we should take that field instead . */ private boolean anotherCandidateMatchesMockName ( final Collection < Object > mocks , final Field candidateFieldToBeInjected , final List < Field > allRemainingCandidateFields ) { } }
String mockName = getMockName ( mocks . iterator ( ) . next ( ) ) . toString ( ) ; for ( Field otherCandidateField : allRemainingCandidateFields ) { if ( ! otherCandidateField . equals ( candidateFieldToBeInjected ) && otherCandidateField . getType ( ) . equals ( candidateFieldToBeInjected . getType ( ) ) && otherCandidateField . getName ( ) . equals ( mockName ) ) { return true ; } } return false ;
public class InterpolateTransform { /** * Puts the next data point of an iterator in the next section of internal buffer . * @ param i The index of the iterator . * @ param datapoint The last data point returned by that iterator . */ private void putDataPoint ( int i , Entry < Long , Double > datapoint ) { } }
timestamps [ i ] = datapoint . getKey ( ) ; values [ i ] = datapoint . getValue ( ) ;
public class Job { /** * Set all unknown fields * @ param unknownFields the new unknown fields */ @ JsonIgnore public void setUnknownFields ( final Map < String , Object > unknownFields ) { } }
this . unknownFields . clear ( ) ; this . unknownFields . putAll ( unknownFields ) ;
public class UnicodeSet { /** * Modifies this set to contain those code points which have the * given value for the given property . Prior contents of this * set are lost . * @ param propertyAlias A string of the property alias . * @ param valueAlias A string of the value alias . * @ param symbols if not null , then symbols are first called to see if a property * is available . If true , then everything else is skipped . * @ return this set */ public UnicodeSet applyPropertyAlias ( String propertyAlias , String valueAlias , SymbolTable symbols ) { } }
checkFrozen ( ) ; int p ; int v ; boolean mustNotBeEmpty = false , invert = false ; if ( symbols != null && ( symbols instanceof XSymbolTable ) && ( ( XSymbolTable ) symbols ) . applyPropertyAlias ( propertyAlias , valueAlias , this ) ) { return this ; } if ( XSYMBOL_TABLE != null ) { if ( XSYMBOL_TABLE . applyPropertyAlias ( propertyAlias , valueAlias , this ) ) { return this ; } } if ( valueAlias . length ( ) > 0 ) { p = UCharacter . getPropertyEnum ( propertyAlias ) ; // Treat gc as gcm if ( p == UProperty . GENERAL_CATEGORY ) { p = UProperty . GENERAL_CATEGORY_MASK ; } if ( ( p >= UProperty . BINARY_START && p < UProperty . BINARY_LIMIT ) || ( p >= UProperty . INT_START && p < UProperty . INT_LIMIT ) || ( p >= UProperty . MASK_START && p < UProperty . MASK_LIMIT ) ) { try { v = UCharacter . getPropertyValueEnum ( p , valueAlias ) ; } catch ( IllegalArgumentException e ) { // Handle numeric CCC if ( p == UProperty . CANONICAL_COMBINING_CLASS || p == UProperty . LEAD_CANONICAL_COMBINING_CLASS || p == UProperty . TRAIL_CANONICAL_COMBINING_CLASS ) { v = Integer . parseInt ( PatternProps . trimWhiteSpace ( valueAlias ) ) ; // If the resultant set is empty then the numeric value // was invalid . // mustNotBeEmpty = true ; // old code was wrong ; anything between 0 and 255 is valid even if unused . if ( v < 0 || v > 255 ) throw e ; } else { throw e ; } } } else { switch ( p ) { case UProperty . NUMERIC_VALUE : { double value = Double . parseDouble ( PatternProps . trimWhiteSpace ( valueAlias ) ) ; applyFilter ( new NumericValueFilter ( value ) , UCharacterProperty . SRC_CHAR ) ; return this ; } case UProperty . NAME : { // Must munge name , since // UCharacter . charFromName ( ) does not do // ' loose ' matching . String buf = mungeCharName ( valueAlias ) ; int ch = UCharacter . getCharFromExtendedName ( buf ) ; if ( ch == - 1 ) { throw new IllegalArgumentException ( "Invalid character name" ) ; } clear ( ) ; add_unchecked ( ch ) ; return this ; } case UProperty . UNICODE_1_NAME : // ICU 49 deprecates the Unicode _ 1 _ Name property APIs . throw new IllegalArgumentException ( "Unicode_1_Name (na1) not supported" ) ; case UProperty . AGE : { // Must munge name , since // VersionInfo . getInstance ( ) does not do // ' loose ' matching . VersionInfo version = VersionInfo . getInstance ( mungeCharName ( valueAlias ) ) ; applyFilter ( new VersionFilter ( version ) , UCharacterProperty . SRC_PROPSVEC ) ; return this ; } case UProperty . SCRIPT_EXTENSIONS : v = UCharacter . getPropertyValueEnum ( UProperty . SCRIPT , valueAlias ) ; // fall through to calling applyIntPropertyValue ( ) break ; default : // p is a non - binary , non - enumerated property that we // don ' t support ( yet ) . throw new IllegalArgumentException ( "Unsupported property" ) ; } } } else { // valueAlias is empty . Interpret as General Category , Script , // Binary property , or ANY or ASCII . Upon success , p and v will // be set . UPropertyAliases pnames = UPropertyAliases . INSTANCE ; p = UProperty . GENERAL_CATEGORY_MASK ; v = pnames . getPropertyValueEnum ( p , propertyAlias ) ; if ( v == UProperty . UNDEFINED ) { p = UProperty . SCRIPT ; v = pnames . getPropertyValueEnum ( p , propertyAlias ) ; if ( v == UProperty . UNDEFINED ) { p = pnames . getPropertyEnum ( propertyAlias ) ; if ( p == UProperty . UNDEFINED ) { p = - 1 ; } if ( p >= UProperty . BINARY_START && p < UProperty . BINARY_LIMIT ) { v = 1 ; } else if ( p == - 1 ) { if ( 0 == UPropertyAliases . compare ( ANY_ID , propertyAlias ) ) { set ( MIN_VALUE , MAX_VALUE ) ; return this ; } else if ( 0 == UPropertyAliases . compare ( ASCII_ID , propertyAlias ) ) { set ( 0 , 0x7F ) ; return this ; } else if ( 0 == UPropertyAliases . compare ( ASSIGNED , propertyAlias ) ) { // [ : Assigned : ] = [ : ^ Cn : ] p = UProperty . GENERAL_CATEGORY_MASK ; v = ( 1 << UCharacter . UNASSIGNED ) ; invert = true ; } else { // Property name was never matched . throw new IllegalArgumentException ( "Invalid property alias: " + propertyAlias + "=" + valueAlias ) ; } } else { // Valid propery name , but it isn ' t binary , so the value // must be supplied . throw new IllegalArgumentException ( "Missing property value" ) ; } } } } applyIntPropertyValue ( p , v ) ; if ( invert ) { complement ( ) ; } if ( mustNotBeEmpty && isEmpty ( ) ) { // mustNotBeEmpty is set to true if an empty set indicates // invalid input . throw new IllegalArgumentException ( "Invalid property value" ) ; } return this ;
public class SerializedLambdas { /** * < p > Converts a serializable lambda to its { @ link SerializedLambda } form . < / p > * < p > See < a href = " https : / / www . jcp . org / en / jsr / detail ? id = 335 " > JSR 335 < / a > for more information : < / p > * < blockquote > As with inner classes , serialization of lambda expressions is strongly discouraged . Names of synthetic methods generated by javac ( or other Java compilers ) to implement lambda expressions are implementation - dependent , may vary between compilers , and may change due to unrelated modifications in the same source file ; differences in such names can disrupt compatibility . Lambda expressions may refer to values namer the enclosing scope ; when the lambda expressions are serialized , these values will be serialized as well . The order in which values namer the enclosing scope are captured is implementation - dependent , may vary between compilers , and any modification of the source file containing the lambda expression may change this capture order , affecting deserialization correctness . Lambda expressions cannot namer field - or method - based mechanisms to control their serialized form . If serializable lambdas are used , to minimize compatibility risks , it is recommended that class files identical to those that were present at serialization time be present at deserialization time . < / blockquote > * < p > This method will throw a { @ link NotASerializedLambdaException } if the argument is not a lambda . * This method will throw a { @ link InspectionException } if the argument cannot be inspected by reflection for any reason . < / p > * @ param lambda must be a lambda or method reference that implements a FunctionalInterface that extends Serializable * @ return the SerializedLambda form of the lambda */ public static SerializedLambda toSerializedLambda ( Serializable lambda ) { } }
Ensure . that ( lambda != null , "lambda != null" ) ; try { Method writeReplace = lambda . getClass ( ) . getDeclaredMethod ( "writeReplace" ) ; writeReplace . setAccessible ( true ) ; Object replacement = writeReplace . invoke ( lambda ) ; if ( ! ( replacement instanceof SerializedLambda ) ) { throw new NotASerializedLambdaException ( "Not an instance of SerializedLambda: " + replacement ) ; } return ( SerializedLambda ) replacement ; } catch ( NotASerializedLambdaException e ) { throw e ; } catch ( NoSuchMethodException e ) { throw new NotASerializedLambdaException ( "Not a lambda: " + lambda ) ; } catch ( Exception e ) { throw new InspectionException ( e ) ; }
public class CascadingClassLoadHelper { /** * Called to give the ClassLoadHelper a chance to initialize itself , including * the opportunity to " steal " the class loader off of the calling thread , * which is the thread that is initializing Quartz . */ public void initialize ( ) { } }
m_aLoadHelpers = new CommonsArrayList < > ( ) ; m_aLoadHelpers . add ( new LoadingLoaderClassLoadHelper ( ) ) ; m_aLoadHelpers . add ( new SimpleClassLoadHelper ( ) ) ; m_aLoadHelpers . add ( new ThreadContextClassLoadHelper ( ) ) ; m_aLoadHelpers . add ( new InitThreadContextClassLoadHelper ( ) ) ; for ( final IClassLoadHelper aLoadHelper : m_aLoadHelpers ) aLoadHelper . initialize ( ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcRailingTypeEnum ( ) { } }
if ( ifcRailingTypeEnumEEnum == null ) { ifcRailingTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 880 ) ; } return ifcRailingTypeEnumEEnum ;
public class RRBudgetV1_3Generator { /** * This method gets Other type description and total cost for * ParticipantTraineeSupportCosts based on BudgetPeriodInfo . * @ param periodInfo * ( BudgetPeriodInfo ) budget period entry . * @ return Other other participant trainee support costs corresponding to * the BudgetPeriodInfo object . */ private gov . grants . apply . forms . rrBudget13V13 . BudgetYearDataType . ParticipantTraineeSupportCosts . Other getOtherPTSupportCosts ( BudgetPeriodDto periodInfo ) { } }
gov . grants . apply . forms . rrBudget13V13 . BudgetYearDataType . ParticipantTraineeSupportCosts . Other other = gov . grants . apply . forms . rrBudget13V13 . BudgetYearDataType . ParticipantTraineeSupportCosts . Other . Factory . newInstance ( ) ; other . setDescription ( OTHERCOST_DESCRIPTION ) ; ScaleTwoDecimal otherCost = ScaleTwoDecimal . ZERO ; if ( periodInfo != null && periodInfo . getpartOtherCost ( ) != null ) { otherCost = periodInfo . getpartOtherCost ( ) ; } other . setCost ( otherCost . bigDecimalValue ( ) ) ; return other ;
public class DefaultFormModel { /** * Initialization of DefaultFormModel . Adds a listener on the Enabled * property in order to switch validating state on or off . When disabling a * formModel , no validation will happen . */ protected void init ( ) { } }
addPropertyChangeListener ( ENABLED_PROPERTY , new PropertyChangeListener ( ) { public void propertyChange ( PropertyChangeEvent evt ) { validatingUpdated ( ) ; } } ) ; validationResultsModel . addPropertyChangeListener ( ValidationResultsModel . HAS_ERRORS_PROPERTY , childStateChangeHandler ) ;
public class AbstractGedLine { /** * Read the source data until the a line is encountered at the same level as * this one . That allows the reading of children . * @ return The GedLine at the current level . Null if the end of data is * reached first . * @ throws IOException If this is a file source and we encounter a problem . */ public final AbstractGedLine readToNext ( ) throws IOException { } }
AbstractGedLine gedLine = source . createGedLine ( this ) ; while ( true ) { if ( gedLine == null || gedLine . getLevel ( ) == - 1 ) { break ; } if ( gedLine . getLevel ( ) <= this . getLevel ( ) ) { return gedLine ; } children . add ( gedLine ) ; gedLine = gedLine . readToNext ( ) ; } return null ;
public class MembershipTypeHandlerImpl { /** * Persists new membership type entity . */ private MembershipType saveMembershipType ( Session session , MembershipTypeImpl mType , boolean broadcast ) throws Exception { } }
Node mtNode = getOrCreateMembershipTypeNode ( session , mType ) ; boolean isNew = mtNode . isNew ( ) ; if ( broadcast ) { preSave ( mType , isNew ) ; } String oldType = mtNode . getName ( ) . equals ( JCROrganizationServiceImpl . JOS_MEMBERSHIP_TYPE_ANY ) ? ANY_MEMBERSHIP_TYPE : mtNode . getName ( ) ; String newType = mType . getName ( ) ; if ( ! oldType . equals ( newType ) ) { String oldPath = mtNode . getPath ( ) ; String newPath = utils . getMembershipTypeNodePath ( newType ) ; session . move ( oldPath , newPath ) ; moveMembershipsInCache ( oldType , newType ) ; removeFromCache ( oldType ) ; } writeMembershipType ( mType , mtNode ) ; session . save ( ) ; putInCache ( mType ) ; if ( broadcast ) { postSave ( mType , isNew ) ; } return mType ;
public class Headers { /** * / * - - - - - [ Set ] - - - - - */ public void set ( AsciiString name , String value ) { } }
if ( name == null ) return ; if ( value == null ) { remove ( name ) ; return ; } Header head = entry ( name , true ) ; if ( head . value == null ) head . value = value ; else { head . value = value ; Header next = head . sameNext ; head . sameNext = null ; head . samePrev = head ; removeSameNext ( next ) ; } assert validateLinks ( ) ;
public class DiskBasedCache { /** * Puts the entry with the specified key into the cache . */ @ Override public synchronized void put ( String key , Entry entry ) { } }
pruneIfNeeded ( entry . data . length ) ; File file = getFileForKey ( key ) ; try { BufferedOutputStream fos = new BufferedOutputStream ( new FileOutputStream ( file ) ) ; CacheHeader e = new CacheHeader ( key , entry ) ; boolean success = e . writeHeader ( fos ) ; if ( ! success ) { fos . close ( ) ; VolleyLog . d ( "Failed to write header for %s" , file . getAbsolutePath ( ) ) ; throw new IOException ( ) ; } fos . write ( entry . data ) ; fos . close ( ) ; putEntry ( key , e ) ; return ; } catch ( IOException e ) { } boolean deleted = file . delete ( ) ; if ( ! deleted ) { VolleyLog . d ( "Could not clean up file %s" , file . getAbsolutePath ( ) ) ; }
public class FragmentRedirectStrategy { /** * For local redirects , converts to relative urls . * @ param request * must be an { @ link OutgoingRequest } . */ @ Override public URI getLocationURI ( HttpRequest request , HttpResponse response , HttpContext context ) throws ProtocolException { } }
URI uri = this . redirectStrategy . getLocationURI ( request , response , context ) ; String resultingPageUrl = uri . toString ( ) ; DriverRequest driverRequest = ( ( OutgoingRequest ) request ) . getOriginalRequest ( ) ; // Remove context if present if ( StringUtils . startsWith ( resultingPageUrl , driverRequest . getVisibleBaseUrl ( ) ) ) { resultingPageUrl = "/" + StringUtils . stripStart ( StringUtils . replace ( resultingPageUrl , driverRequest . getVisibleBaseUrl ( ) , "" ) , "/" ) ; } resultingPageUrl = ResourceUtils . getHttpUrlWithQueryString ( resultingPageUrl , driverRequest , false ) ; return UriUtils . createURI ( ResourceUtils . getHttpUrlWithQueryString ( resultingPageUrl , driverRequest , false ) ) ;
public class AbstractSequenceClassifier { /** * Write the classifications of the Sequence classifier out to a writer in a * format determined by the DocumentReaderAndWriter used . * @ param doc Documents to write out * @ param printWriter Writer to use for output * @ throws IOException If an IO problem */ public void writeAnswers ( List < IN > doc , PrintWriter printWriter , DocumentReaderAndWriter < IN > readerAndWriter ) throws IOException { } }
if ( flags . lowerNewgeneThreshold ) { return ; } if ( flags . numRuns <= 1 ) { readerAndWriter . printAnswers ( doc , printWriter ) ; // out . println ( ) ; printWriter . flush ( ) ; }
public class StringNumberParser { /** * Parse given text as number representation . < br > * < br > E . g . ' 2k ' will be returned as 2048 number . * < br > Next formats are supported ( case insensitive ) : < br > kilobytes - k , kb < br > megabytes - m , mb * < br > gigabytes - g , gb < br > terabytes - t , tb * < br > NOTE : floating point supported , e . g . 1.5m = 1.5 * 1024 * 1024 , < br > WARN : floating point * delimiter depends on OS settings * @ param numberText * @ return * @ throws NumberFormatException */ static public Number parseNumber ( final String numberText ) throws NumberFormatException { } }
final String text = numberText . toLowerCase ( ) . toUpperCase ( ) ; if ( text . endsWith ( "K" ) ) { return Double . valueOf ( text . substring ( 0 , text . length ( ) - 1 ) ) * 1024d ; } else if ( text . endsWith ( "KB" ) ) { return Double . valueOf ( text . substring ( 0 , text . length ( ) - 2 ) ) * 1024d ; } else if ( text . endsWith ( "M" ) ) { return Double . valueOf ( text . substring ( 0 , text . length ( ) - 1 ) ) * 1048576d ; // 1024 * 1024 } else if ( text . endsWith ( "MB" ) ) { return Double . valueOf ( text . substring ( 0 , text . length ( ) - 2 ) ) * 1048576d ; // 1024 * 1024 } else if ( text . endsWith ( "G" ) ) { return Double . valueOf ( text . substring ( 0 , text . length ( ) - 1 ) ) * 1073741824d ; // 1024 * 1024 * // 1024 } else if ( text . endsWith ( "GB" ) ) { return Double . valueOf ( text . substring ( 0 , text . length ( ) - 2 ) ) * 1073741824d ; // 1024 * 1024 * // 1024 } else if ( text . endsWith ( "T" ) ) { return Double . valueOf ( text . substring ( 0 , text . length ( ) - 1 ) ) * 1099511627776d ; // 1024 * 1024 * // 1024 * 1024 } else if ( text . endsWith ( "TB" ) ) { return Double . valueOf ( text . substring ( 0 , text . length ( ) - 2 ) ) * 1099511627776d ; // 1024 * 1024 * // 1024 * 1024 } else { return Double . valueOf ( text ) ; }
public class Resolve { /** * where */ private Symbol choose ( Symbol boundSym , Symbol unboundSym ) { } }
if ( lookupSuccess ( boundSym ) && lookupSuccess ( unboundSym ) ) { return ambiguityError ( boundSym , unboundSym ) ; } else if ( lookupSuccess ( boundSym ) || ( canIgnore ( unboundSym ) && ! canIgnore ( boundSym ) ) ) { return boundSym ; } else if ( lookupSuccess ( unboundSym ) || ( canIgnore ( boundSym ) && ! canIgnore ( unboundSym ) ) ) { return unboundSym ; } else { return boundSym ; }
public class PolicyDefinitionsInner { /** * Creates or updates a policy definition . * @ param policyDefinitionName The name of the policy definition to create . * @ param parameters The policy definition properties . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PolicyDefinitionInner object */ public Observable < PolicyDefinitionInner > createOrUpdateAsync ( String policyDefinitionName , PolicyDefinitionInner parameters ) { } }
return createOrUpdateWithServiceResponseAsync ( policyDefinitionName , parameters ) . map ( new Func1 < ServiceResponse < PolicyDefinitionInner > , PolicyDefinitionInner > ( ) { @ Override public PolicyDefinitionInner call ( ServiceResponse < PolicyDefinitionInner > response ) { return response . body ( ) ; } } ) ;
public class Input { /** * required参数视图 , 如果不存在毕传参数 , 那么返回空数组 , 而不是返回null */ @ JSONField ( serialize = false ) public List < Obj > getRequired ( ) { } }
List < Obj > requred = new ArrayList < > ( ) ; if ( getList ( ) != null ) { for ( Obj obj : getList ( ) ) { if ( obj . isRequired ( ) ) { requred . add ( obj ) ; } } } return requred ;
public class Token { /** * Return the Tag that matches the given class */ @ SuppressWarnings ( "unchecked" ) public < T extends Tag > T getTag ( Class < T > tagClass ) { } }
List < T > matches = getTags ( tagClass ) ; T matchingTag = null ; if ( matches . size ( ) > 0 ) { matchingTag = matches . get ( 0 ) ; } // if ( matches . size ( ) > = 2 ) { // throw new IllegalStateException ( " Multiple identical tags found ( " + matches + " ) " ) ; // else if ( matches . size ( ) = = 1 ) { // matchingTag = matches . get ( 0 ) ; return matchingTag ;
public class GitLabApi { /** * < p > Logs into GitLab using OAuth2 with the provided { @ code username } and { @ code password } , * and creates a new { @ code GitLabApi } instance using returned access token . < / p > * @ param url GitLab URL * @ param username user name for which private token should be obtained * @ param password a char array holding the password for a given { @ code username } * @ return new { @ code GitLabApi } instance configured for a user - specific token * @ throws GitLabApiException GitLabApiException if any exception occurs during execution */ public static GitLabApi oauth2Login ( String url , String username , char [ ] password ) throws GitLabApiException { } }
try ( SecretString secretPassword = new SecretString ( password ) ) { return ( GitLabApi . oauth2Login ( ApiVersion . V4 , url , username , secretPassword , null , null , false ) ) ; }
public class IOUtils { /** * generic processing of a stream with a custom buffer * @ param inputStream * the input stream to process * @ param handler * the handler to apply on the stream * @ param buffer * the buffer to use for stream handling * @ throws IOException */ public static void process ( InputStream inputStream , StreamHandler handler , byte [ ] buffer ) throws IOException { } }
LOGGER . trace ( "process(InputStream, StreamHandler, byte[])" ) ; LOGGER . debug ( "buffer size: {} bytes" , buffer != null ? buffer . length : "null" ) ; int read = - 1 ; while ( ( read = inputStream . read ( buffer ) ) != - 1 ) { LOGGER . debug ( "{} bytes read from stream" , read ) ; handler . handleStreamBuffer ( buffer , 0 , read ) ; }
public class PassiveScanThread { /** * Returns the full set ( both default and " opted - in " ) which are to be * applicable for passive scanning . * @ return a set of { @ code Integer } representing all of the History Types * which are applicable for passive scanning . * @ since TODO add version */ public static Set < Integer > getApplicableHistoryTypes ( ) { } }
Set < Integer > allApplicableTypes = new HashSet < Integer > ( ) ; allApplicableTypes . addAll ( PluginPassiveScanner . getDefaultHistoryTypes ( ) ) ; if ( ! optedInHistoryTypes . isEmpty ( ) ) { allApplicableTypes . addAll ( optedInHistoryTypes ) ; } return allApplicableTypes ;
public class StringUtils { /** * 将Exception的Stack Trace转为字符串 */ static public String getStackTrace ( Exception e ) { } }
ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; PrintStream ps = new PrintStream ( baos ) ; e . printStackTrace ( ps ) ; ps . flush ( ) ; try { return baos . toString ( "UTF-8" ) ; } catch ( UnsupportedEncodingException ee ) { return baos . toString ( ) ; }
public class Symbol { /** * Adds the HIBC prefix and check digit to the specified data , returning the resultant data string . * @ see < a href = " https : / / sourceforge . net / p / zint / code / ci / master / tree / backend / library . c " > Corresponding Zint code < / a > */ private String hibcProcess ( String source ) { } }
// HIBC 2.6 allows up to 110 characters , not including the " + " prefix or the check digit if ( source . length ( ) > 110 ) { throw new OkapiException ( "Data too long for HIBC LIC" ) ; } source = source . toUpperCase ( ) ; if ( ! source . matches ( "[A-Z0-9-\\. \\$/+\\%]+?" ) ) { throw new OkapiException ( "Invalid characters in input" ) ; } int counter = 41 ; for ( int i = 0 ; i < source . length ( ) ; i ++ ) { counter += positionOf ( source . charAt ( i ) , HIBC_CHAR_TABLE ) ; } counter = counter % 43 ; char checkDigit = HIBC_CHAR_TABLE [ counter ] ; encodeInfo += "HIBC Check Digit Counter: " + counter + "\n" ; encodeInfo += "HIBC Check Digit: " + checkDigit + "\n" ; return "+" + source + checkDigit ;
public class WorkflowFactoryImpl { /** * Starts a new row one indentation level to the left . */ private Tree < Row > downLeft ( Element token ) { } }
return current = current . getParent ( ) . addSibling ( Tree . of ( new Row ( token ) ) ) ;
public class NodeGroupClient { /** * Deletes the specified NodeGroup resource . * < p > Sample code : * < pre > < code > * try ( NodeGroupClient nodeGroupClient = NodeGroupClient . create ( ) ) { * ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName . of ( " [ PROJECT ] " , " [ ZONE ] " , " [ NODE _ GROUP ] " ) ; * Operation response = nodeGroupClient . deleteNodeGroup ( nodeGroup . toString ( ) ) ; * < / code > < / pre > * @ param nodeGroup Name of the NodeGroup resource to delete . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final Operation deleteNodeGroup ( String nodeGroup ) { } }
DeleteNodeGroupHttpRequest request = DeleteNodeGroupHttpRequest . newBuilder ( ) . setNodeGroup ( nodeGroup ) . build ( ) ; return deleteNodeGroup ( request ) ;
public class ObjectUtils { /** * Returns the Long represented by the given value , or null if not an long value . */ private static Object toLong ( BigDecimal value ) { } }
Object number ; try { number = value . scale ( ) == 0 ? Long . valueOf ( value . longValueExact ( ) ) : null ; } catch ( Exception e ) { number = null ; } return number ;
public class WebSocketExtensionFactory { /** * Returns a list of extensions that want to be part of websocket request * @ param address WsResourceAddress to which a websocket connection is being attempted * @ param extensionHelper extension helper * @ return list of extensions that want to be part of the request */ public List < WebSocketExtension > offerWebSocketExtensions ( WsResourceAddress address , ExtensionHelper extensionHelper ) { } }
List < WebSocketExtension > list = new ArrayList < > ( ) ; for ( WebSocketExtensionFactorySpi factory : factoriesRO . values ( ) ) { WebSocketExtension extension = factory . offer ( extensionHelper , address ) ; if ( extension != null ) { list . add ( extension ) ; } } return list ;
public class HomographyInducedStereo3Pts { /** * b = [ ( x cross ( A * x ) ) ^ T ( x cross e2 ) ] / | | x cross e2 | | ^ 2 */ private double computeB ( Point2D_F64 x ) { } }
GeometryMath_F64 . mult ( A , x , Ax ) ; GeometryMath_F64 . cross ( x , Ax , t0 ) ; GeometryMath_F64 . cross ( x , e2 , t1 ) ; double top = GeometryMath_F64 . dot ( t0 , t1 ) ; double bottom = t1 . normSq ( ) ; return top / bottom ;