signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class StartImportRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StartImportRequest startImportRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( startImportRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( startImportRequest . getPayload ( ) , PAYLOAD_BINDING ) ; protocolMarshaller . marshall ( startImportRequest . getResourceType ( ) , RESOURCETYPE_BINDING ) ; protocol...
public class SubscribedTrackUpdater { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( track != null ) { request . addPostParam ( "Track" , track . toString ( ) ) ; } if ( publisher != null ) { request . addPostParam ( "Publisher" , publisher . toString ( ) ) ; } if ( kind != null ) { request . addPostParam ( "Kind" , kind . toString ( ) ) ; } if ( status != null ) { request . addPostParam ( "Status...
public class ConfigUtils { /** * Returns the specified String property from the configuration * @ param config the configuration * @ param key the key of the property * @ return the String value of the property , or null if not found * @ throws DeployerConfigurationException if an error occurred */ public stati...
return getStringProperty ( config , key , null ) ;
public class DfsServlet { /** * Create a { @ link NameNode } proxy from the current { @ link ServletContext } . */ protected synchronized ClientProtocol createNameNodeProxy ( UnixUserGroupInformation ugi ) throws IOException { } }
if ( nnProxy != null ) { return nnProxy ; } ServletContext context = getServletContext ( ) ; InetSocketAddress nnAddr = ( InetSocketAddress ) context . getAttribute ( "name.node.address" ) ; if ( nnAddr == null ) { throw new IOException ( "The namenode is not out of safemode yet" ) ; } Configuration conf = new Configur...
public class MoreStringUtils { /** * Returns a { @ link File } from the given filename . * Ensures that the incoming filename has backslashes converted to forward slashes ( on Unix OS ) , * and vice - versa on Windows OS , otherwise , the path separation methods of { @ link File } will not * work . * @ param pa...
final String normalized = normalizeSeparators ( filename ) ; return normalized != null ? new File ( parent , normalized ) : parent ;
public class SizeBoundedQueue { /** * Removes and adds to collection c as many elements as possible ( including waiters ) but not exceeding max _ bytes . * E . g . if we have elements { 1000b , 2000b , 4000b } and max _ bytes = 6000 , then only the first 2 elements are removed * and the new size is 4000 * @ param...
if ( c == null ) throw new IllegalArgumentException ( "collection to drain elements to must not be null" ) ; if ( max_bytes <= 0 ) return 0 ; int bytes = 0 ; El < T > el ; boolean at_least_one_removed = false ; lock . lock ( ) ; try { // go as long as there are elements in the queue or pending waiters while ( ( el = qu...
public class ListBackupSelectionsResult { /** * An array of backup selection list items containing metadata about each resource in the list . * @ param backupSelectionsList * An array of backup selection list items containing metadata about each resource in the list . */ public void setBackupSelectionsList ( java ....
if ( backupSelectionsList == null ) { this . backupSelectionsList = null ; return ; } this . backupSelectionsList = new java . util . ArrayList < BackupSelectionsListMember > ( backupSelectionsList ) ;
public class DemoController { /** * Personalized accounts page . Content is private to the user * so it should only be stored in a private cache . */ @ CacheControl ( policy = { } }
CachePolicy . PRIVATE , CachePolicy . MUST_REVALIDATE } ) @ RequestMapping ( "/account.do" ) public String handleAccountRequest ( Model model ) { model . addAttribute ( "pageName" , "Your Account" ) ; return "page" ;
public class POIUtils { /** * シートの最大列数を取得する 。 * < p > { @ literal jxl . Sheet . getColumns ( ) } < / p > * @ param sheet シートオブジェクト * @ return 最大列数 * @ throws IllegalArgumentException { @ literal sheet = = null . } */ public static int getColumns ( final Sheet sheet ) { } }
ArgUtils . notNull ( sheet , "sheet" ) ; int minRowIndex = sheet . getFirstRowNum ( ) ; int maxRowIndex = sheet . getLastRowNum ( ) ; int maxColumnsIndex = 0 ; for ( int i = minRowIndex ; i <= maxRowIndex ; i ++ ) { final Row row = sheet . getRow ( i ) ; if ( row == null ) { continue ; } final int column = row . getLas...
public class AbstractBigtableTable { /** * { @ inheritDoc } */ @ Override public Result increment ( Increment increment ) throws IOException { } }
LOG . trace ( "increment(Increment)" ) ; Span span = TRACER . spanBuilder ( "BigtableTable.increment" ) . startSpan ( ) ; try ( Scope scope = TRACER . withSpan ( span ) ) { ReadModifyWriteRow request = hbaseAdapter . adapt ( increment ) ; return Adapters . ROW_ADAPTER . adaptResponse ( clientWrapper . readModifyWriteRo...
public class LogRef { /** * * Log a debug level message . * * * @ param msg * Log message * * @ param sr * The < code > ServiceReference < / code > of the service * that this * message is associated with . */ public void debug ( String msg , ServiceReference sr ) { } }
doLog ( msg , LOG_DEBUG , sr , null ) ;
public class JavaHelper { /** * Loads a class of the given name from the project class loader or returns null if its not found */ public static Class < ? > loadProjectClass ( Project project , String className ) { } }
URLClassLoader classLoader = getProjectClassLoader ( project ) ; if ( classLoader != null ) { try { return classLoader . loadClass ( className ) ; } catch ( ClassNotFoundException e ) { // ignore } finally { try { classLoader . close ( ) ; } catch ( IOException e ) { // ignore } } } return null ;
public class JSON { /** * / * Mutant factories */ public JSON with ( TokenStreamFactory f ) { } }
if ( f == _streamFactory ) { return this ; } return _with ( _features , f , _treeCodec , _reader , _writer , _prettyPrinter ) ;
public class IR { public static Node sheq ( Node expr1 , Node expr2 ) { } }
return binaryOp ( Token . SHEQ , expr1 , expr2 ) ;
public class ScriptableProcessor { /** * Draws the page to an image file and marks selected areas in the image . * @ param path The path to the destination image file . * @ param areaNames A substring of the names of areas that should be marked in the image . When set to { @ code null } , all the areas are marked ....
try { ImageOutputDisplay disp = new ImageOutputDisplay ( getPage ( ) . getWidth ( ) , getPage ( ) . getHeight ( ) ) ; disp . drawPage ( getPage ( ) ) ; showAreas ( disp , getAreaTree ( ) . getRoot ( ) , areaNames ) ; disp . saveTo ( path ) ; } catch ( IOException e ) { log . error ( "Couldn't write to " + path + ": " +...
public class SimpleMerger { /** * Merges the < em > source < / em > element ( and its " downstream " dependents ) * into < em > target < / em > model . * @ see # merge ( Model , Collection ) * @ param target the BioPAX model to merge into * @ param source object to add or merge */ public void merge ( Model targ...
merge ( target , Collections . singleton ( source ) ) ;
public class UTF8Reader { /** * Skip characters . This method will block until some characters are * available , an I / O error occurs , or the end of the stream is reached . * @ param n The number of characters to skip * @ return The number of characters actually skipped * @ exception IOException If an I / O e...
long remaining = n ; final char [ ] ch = new char [ fBuffer . length ] ; do { int length = ch . length < remaining ? ch . length : ( int ) remaining ; int count = read ( ch , 0 , length ) ; if ( count > 0 ) { remaining -= count ; } else { break ; } } while ( remaining > 0 ) ; long skipped = n - remaining ; return skipp...
public class PhysicalNamingStrategyShogunCore { /** * Converts table names to lower case and limits the length if necessary . */ @ Override public Identifier toPhysicalTableName ( Identifier tableIdentifier , JdbcEnvironment context ) { } }
return convertToLimitedLowerCase ( context , tableIdentifier , tablePrefix ) ;
public class CommerceOrderItemPersistenceImpl { /** * Returns the last commerce order item in the ordered set where CPInstanceId = & # 63 ; . * @ param CPInstanceId the cp instance ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matchin...
int count = countByCPInstanceId ( CPInstanceId ) ; if ( count == 0 ) { return null ; } List < CommerceOrderItem > list = findByCPInstanceId ( CPInstanceId , count - 1 , count , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class MainPopupMenu { /** * ZAP : Added support for submenus */ private JMenu getSuperMenu ( String name , int index ) { } }
JMenu superMenu = superMenus . get ( name ) ; if ( superMenu == null ) { // Use an ExtensionPopupMenu so child menus are dismissed superMenu = new ExtensionPopupMenu ( name ) { private static final long serialVersionUID = 6825880451078204378L ; @ Override public boolean isEnableForComponent ( Component invoker ) { retu...
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...
return intersectAab ( min . x ( ) , min . y ( ) , min . z ( ) , max . x ( ) , max . y ( ) , max . z ( ) , mask , startPlane ) ;
public class br_disable { /** * < pre > * Use this operation to Disable Repeater Instances . * < / pre > */ public static br_disable disable ( nitro_service client , br_disable resource ) throws Exception { } }
return ( ( br_disable [ ] ) resource . perform_operation ( client , "disable" ) ) [ 0 ] ;
public class NetworkServiceRecordAgent { /** * Update a VNFRecordDependency . * @ param idNsr the ID of the NetworkServiceRecord containing the VNFRecordDependency * @ param idVnfrDep the ID of the VNFRecordDependency to update * @ param vnfRecordDependency the updated version of the VNFRecordDependency * @ ret...
String url = idNsr + "/vnfdependencies" + "/" + idVnfrDep ; return ( VNFRecordDependency ) requestPut ( url , vnfRecordDependency ) ;
public class GrassRasterReader { /** * read the null value from the null file ( if it exists ) and returns the information about the * particular cell ( true if it is novalue , false if it is not a novalue * @ param currentfilerow * @ param currentfilecol * @ return */ private boolean readNullValueAtRowCol ( in...
/* * If the null file doesn ' t exist and the map is an integer , than it is an old integer - map * format , where the novalues are the cells that contain the values 0 */ if ( nullFile != null ) { long byteperrow = ( long ) Math . ceil ( fileWindow . getCols ( ) / 8.0 ) ; // in the // null // map of // cell _ misc lo...
public class FeatureMate { /** * Tries to convert the internal geometry to a { @ link LineString } . * < p > This works only for Polygon and Lines features . * < p > From this moment on the internal geometry ( as got by the { @ link # getGeometry ( ) } ) * will be the line type . * < p > To get the original geo...
EGeometryType geometryType = EGeometryType . forGeometry ( getGeometry ( ) ) ; switch ( geometryType ) { case MULTIPOLYGON : case POLYGON : // convert to line Coordinate [ ] tmpCoords = geometry . getCoordinates ( ) ; geometry = GeometryUtilities . gf ( ) . createLineString ( tmpCoords ) ; // reset prepared geometry pr...
public class CommsInboundChain { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . channelfw . ChainEventListener # chainStarted ( com . ibm . websphere . channelfw . ChainData ) */ @ Override public void chainStarted ( ChainData chainData ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "chainStarted" , chainData ) ; chainState . set ( ChainState . STARTED . val ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "chainStarted" ) ;
public class NetworkWatchersInner { /** * Updates a network watcher tags . * @ param resourceGroupName The name of the resource group . * @ param networkWatcherName The name of the network watcher . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the Net...
return updateTagsWithServiceResponseAsync ( resourceGroupName , networkWatcherName ) . map ( new Func1 < ServiceResponse < NetworkWatcherInner > , NetworkWatcherInner > ( ) { @ Override public NetworkWatcherInner call ( ServiceResponse < NetworkWatcherInner > response ) { return response . body ( ) ; } } ) ;
public class Crossover { /** * / * Xianshun says : ( From Section 5.7.3 of Linear Genetic Programming * Crossover requires , by definition , that information is exchanged between individual programs . * However , an exchange always includes two operations on an individual , the deletion and * the insertion of a s...
double prob_r = randEngine . uniform ( ) ; if ( ( gp1 . length ( ) < manager . getMaxProgramLength ( ) ) && ( ( prob_r <= manager . getInsertionProbability ( ) || gp1 . length ( ) == manager . getMinProgramLength ( ) ) ) ) { int i1 = randEngine . nextInt ( gp1 . length ( ) ) ; int max_segment_length = gp2 . length ( ) ...
public class MergeAction { /** * Emits a sentence fragment combining all the merge actions . */ public static void addActionsTo ( SourceBuilder code , Set < MergeAction > mergeActions , boolean forBuilder ) { } }
SetMultimap < String , String > nounsByVerb = TreeMultimap . create ( ) ; mergeActions . forEach ( mergeAction -> { if ( forBuilder || ! mergeAction . builderOnly ) { nounsByVerb . put ( mergeAction . verb , mergeAction . noun ) ; } } ) ; List < String > verbs = ImmutableList . copyOf ( nounsByVerb . keySet ( ) ) ; Str...
public class Script { /** * Exposes the script interpreter . Normally you should not use this directly , instead use * { @ link TransactionInput # verify ( TransactionOutput ) } or * { @ link Script # correctlySpends ( Transaction , int , TransactionWitness , Coin , Script , Set ) } . This method * is useful if y...
final EnumSet < VerifyFlag > flags = enforceNullDummy ? EnumSet . of ( VerifyFlag . NULLDUMMY ) : EnumSet . noneOf ( VerifyFlag . class ) ; executeScript ( txContainingThis , index , script , stack , flags ) ;
public class ID3v2Tag { /** * Determines the new amount of padding to use . If the user has not * changed the amount of padding then existing padding will be overwritten * instead of increasing the size of the file . That is only if there is * a sufficient amount of padding for the updated tag . * @ return the ...
int curSize = getSize ( ) ; int pad = 0 ; if ( ( origPadding == padding ) && ( curSize > origSize ) && ( padding >= ( curSize - origSize ) ) ) { pad = padding - ( curSize - origSize ) ; } else if ( curSize < origSize ) { pad = ( origSize - curSize ) + padding ; } return pad ;
public class StoreRoutingPlan { /** * Check that the key belongs to one of the partitions in the map of replica * type to partitions * @ param nodeId Node on which this is running ( generally stealer node ) * @ param key The key to check * @ param replicaToPartitionList Mapping of replica type to partition list...
boolean checkResult = false ; if ( storeDef . getRoutingStrategyType ( ) . equals ( RoutingStrategyType . TO_ALL_STRATEGY ) || storeDef . getRoutingStrategyType ( ) . equals ( RoutingStrategyType . TO_ALL_LOCAL_PREF_STRATEGY ) ) { checkResult = true ; } else { List < Integer > keyPartitions = new RoutingStrategyFactory...
public class SequenceScalePanel { /** * set some default rendering hints , like text antialiasing on * @ param g2D the graphics object to set the defaults on */ protected void setPaintDefaults ( Graphics2D g2D ) { } }
g2D . setRenderingHint ( RenderingHints . KEY_TEXT_ANTIALIASING , RenderingHints . VALUE_TEXT_ANTIALIAS_ON ) ; g2D . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; g2D . setFont ( seqFont ) ;
public class FuzzySymbolicVariableConstraintSolver { /** * public LinkedHashMap < FuzzySymbolicDomain [ ] , Double > getLabelings ( ) { * return this . sdTuples ; */ private boolean checkEquality ( HashMap < String , Double > a , HashMap < String , Double > b ) { } }
for ( String s : a . keySet ( ) ) { if ( Double . compare ( a . get ( s ) , b . get ( s ) ) != 0 ) return false ; } return true ;
public class QueryBuilder { /** * Set arguments for query . * @ param args Arguments . * @ return The query builder instance for chained calls . */ @ SafeVarargs public final QueryBuilder arguments ( Object ... args ) { } }
set ( Param . QUERY_ARGS , "" ) ; queryArgs = args . clone ( ) ; return this ;
public class FlinkKafkaConsumerBase { /** * Version - specific subclasses which can expose the functionality should override and allow public access . */ protected FlinkKafkaConsumerBase < T > setStartFromTimestamp ( long startupOffsetsTimestamp ) { } }
checkArgument ( startupOffsetsTimestamp >= 0 , "The provided value for the startup offsets timestamp is invalid." ) ; long currentTimestamp = System . currentTimeMillis ( ) ; checkArgument ( startupOffsetsTimestamp <= currentTimestamp , "Startup time[%s] must be before current time[%s]." , startupOffsetsTimestamp , cur...
public class EndpointImpl { /** * { @ inheritDoc } */ @ Override public boolean getHideFromDiscovery ( ) { } }
String v = this . unknownAttributes . getOrDefault ( hideFromDiscoveryQname , XSBooleanValue . toString ( false , false ) ) ; return XSBooleanValue . valueOf ( v ) . getValue ( ) ;
public class JavaDialect { /** * This will add the rule for compiling later on . * It will not actually call the compiler */ public void addRule ( final RuleBuildContext context ) { } }
final RuleImpl rule = context . getRule ( ) ; final RuleDescr ruleDescr = context . getRuleDescr ( ) ; RuleClassBuilder classBuilder = context . getDialect ( ) . getRuleClassBuilder ( ) ; String ruleClass = classBuilder . buildRule ( context ) ; // return if there is no ruleclass name ; if ( ruleClass == null ) { retur...
public class InterProcessSemaphore { /** * < p > Acquire < code > qty < / code > leases . If there are not enough leases available , this method * blocks until either the maximum number of leases is increased enough or other clients / processes * close enough leases . However , this method will only block to a maxi...
long startMs = System . currentTimeMillis ( ) ; long waitMs = TimeUnit . MILLISECONDS . convert ( time , unit ) ; Preconditions . checkArgument ( qty > 0 , "qty cannot be 0" ) ; ImmutableList . Builder < Lease > builder = ImmutableList . builder ( ) ; try { while ( qty -- > 0 ) { long elapsedMs = System . currentTimeMi...
public class UndirectedMultigraph { /** * { @ inheritDoc } */ public Set < TypedEdge < T > > getEdges ( int vertex1 , int vertex2 ) { } }
SparseTypedEdgeSet < T > edges = vertexToEdges . get ( vertex1 ) ; return ( edges == null ) ? Collections . < TypedEdge < T > > emptySet ( ) : edges . getEdges ( vertex2 ) ;
public class AppPackageUrl { /** * Get Resource Url for UpdatePackage * @ param applicationKey The application key uniquely identifies the developer namespace , application ID , version , and package in Dev Center . The format is { Dev Account namespace } . { Application ID } . { Application Version } . { Package nam...
UrlFormatter formatter = new UrlFormatter ( "/api/platform/appdev/apppackages/{applicationKey}/?responseFields={responseFields}" ) ; formatter . formatUrl ( "applicationKey" , applicationKey ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl ....
public class NBTOutputStream { /** * Writes a tag . * @ param tag The tag to write . * @ throws java . io . IOException if an I / O error occurs . */ public void writeTag ( Tag < ? > tag ) throws IOException { } }
String name = tag . getName ( ) ; byte [ ] nameBytes = name . getBytes ( NBTConstants . CHARSET . name ( ) ) ; os . writeByte ( tag . getType ( ) . getId ( ) ) ; os . writeShort ( nameBytes . length ) ; os . write ( nameBytes ) ; if ( tag . getType ( ) == TagType . TAG_END ) { throw new IOException ( "Named TAG_End not...
public class ClassUtils { /** * Similar as { @ link # classForName ( String ) } , but also supports primitive types * and arrays as specified for the JavaType element in the JavaServer Faces Config DTD . * @ param type fully qualified class name or name of a primitive type , both optionally * followed by " [ ] " ...
if ( type == null ) { throw new NullPointerException ( "type" ) ; } // try common types and arrays of common types first Class clazz = ( Class ) COMMON_TYPES . get ( type ) ; if ( clazz != null ) { return clazz ; } int len = type . length ( ) ; if ( len > 2 && type . charAt ( len - 1 ) == ']' && type . charAt ( len - 2...
public class ServerService { /** * Modify ALL existing public IPs on servers * @ param servers The list of server references * @ param config publicIp config * @ return OperationFuture wrapper for list of ServerRef */ public OperationFuture < List < Server > > modifyPublicIp ( List < Server > servers , ModifyPubl...
List < JobFuture > futures = servers . stream ( ) . map ( serverRef -> modifyPublicIp ( serverRef , config ) . jobFuture ( ) ) . collect ( toList ( ) ) ; return new OperationFuture < > ( servers , new ParallelJobsFuture ( futures ) ) ;
public class Solo { /** * Clicks a CheckBox matching the specified index . * @ param index the index of the { @ link CheckBox } to click . { @ code 0 } if only one is available */ public void clickOnCheckBox ( int index ) { } }
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnCheckBox(" + index + ")" ) ; } clicker . clickOn ( CheckBox . class , index ) ;
public class AttributeTypeImpl { /** * Checks that existing instances match the provided regex . * @ param regex The regex to check against * @ throws TransactionException when an instance does not match the provided regex */ private void checkInstancesMatchRegex ( @ Nullable String regex ) { } }
if ( regex != null ) { Pattern pattern = Pattern . compile ( regex ) ; instances ( ) . forEach ( resource -> { String value = ( String ) resource . value ( ) ; Matcher matcher = pattern . matcher ( value ) ; if ( ! matcher . matches ( ) ) { throw TransactionException . regexFailure ( this , value , regex ) ; } } ) ; }
public class AbstractMapServiceFactory { /** * Returns a { @ link MapService } object by populating it with required * auxiliary services . * @ return { @ link MapService } object */ @ Override public MapService createMapService ( ) { } }
NodeEngine nodeEngine = getNodeEngine ( ) ; MapServiceContext mapServiceContext = getMapServiceContext ( ) ; ManagedService managedService = createManagedService ( ) ; CountingMigrationAwareService migrationAwareService = createMigrationAwareService ( ) ; TransactionalService transactionalService = createTransactionalS...
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertCMRFidelityStpCMRExToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class PolicyEventsInner { /** * Queries policy events for the subscription level policy set definition . * @ param subscriptionId Microsoft Azure subscription ID . * @ param policySetDefinitionName Policy set definition name . * @ throws IllegalArgumentException thrown if parameters fail the validation *...
return listQueryResultsForPolicySetDefinitionWithServiceResponseAsync ( subscriptionId , policySetDefinitionName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class RandomUtil { /** * 随机获得列表中的元素 * @ param < T > 元素类型 * @ param list 列表 * @ param limit 限制列表的前N项 * @ return 随机元素 */ public static < T > T randomEle ( List < T > list , int limit ) { } }
return list . get ( randomInt ( limit ) ) ;
public class VariantMetadataManager { /** * Add a variant file metadata to a given variant study metadata ( from study ID ) . * @ param fileMetadata Variant file metadata to add * @ param studyId Study ID */ public void addFile ( VariantFileMetadata fileMetadata , String studyId ) { } }
// Sanity check if ( fileMetadata == null || StringUtils . isEmpty ( fileMetadata . getId ( ) ) ) { logger . error ( "Variant file metadata (or its ID) is null or empty." ) ; return ; } VariantStudyMetadata variantStudyMetadata = getVariantStudyMetadata ( studyId ) ; if ( variantStudyMetadata == null ) { logger . error...
public class UseSplit { /** * implements the visitor to make sure the class is at least java 1.4 and to reset the opcode stack */ @ Override public void visitClassContext ( ClassContext classContext ) { } }
try { JavaClass cls = classContext . getJavaClass ( ) ; if ( cls . getMajor ( ) >= Const . MAJOR_1_4 ) { stack = new OpcodeStack ( ) ; regValueType = new HashMap < Integer , State > ( ) ; super . visitClassContext ( classContext ) ; } } finally { stack = null ; regValueType = null ; }
public class DefaultNodeCreator { /** * { @ inheritDoc } */ @ Override public Node createNode ( GraphDatabaseService database ) { } }
Node node = database . createNode ( label ) ; node . setProperty ( UUID , java . util . UUID . randomUUID ( ) . toString ( ) ) ; return node ;
public class Traversal { /** * A helper method to retrieve a single result from the query or throw an exception if the query yields no results . * @ param query the query to run * @ param entityType the expected type of the entity ( used only for error reporting ) * @ return the single result * @ throws EntityN...
return inTx ( tx -> Util . getSingle ( tx , query , entityType ) ) ;
public class FluentFunctions { /** * Convert a checked statement ( e . g . a method or Consumer with no return value that throws a Checked Exception ) to a * fluent expression ( FluentFunction ) . The input is returned as emitted * < pre > * { @ code * public void print ( String input ) throws IOException { *...
final Consumer < T > toUse = ExceptionSoftener . softenConsumer ( action ) ; return FluentFunctions . of ( t -> { toUse . accept ( t ) ; return t ; } ) ;
public class ScorecardModel { /** * Use the rule interpreter */ public double score_interpreter ( final HashMap < String , Comparable > row ) { } }
double score = _initialScore ; for ( int i = 0 ; i < _rules . length ; i ++ ) score += _rules [ i ] . score ( row . get ( _colNames [ i ] ) ) ; return score ;
public class VoiceApi { /** * Initiate a two - step conference to the specified destination . This places the existing call on * hold and creates a new call in the dialing state ( step 1 ) . After initiating the conference you can use * ` completeConference ( ) ` to complete the conference and bring all parties int...
this . initiateConference ( connId , destination , null , null , null , null , null ) ;
public class Signatures { /** * Collects methods of { @ code clazz } with the given { @ code name } . * Methods are included if their modifier bits match each bit of { @ code include } * and no bit of { @ code exclude } . * @ param clazz * @ param name * @ param include * @ param exclude * @ return method...
final List < Method > result = new ArrayList < > ( ) ; collectMethods ( result , new ArrayList < Class < ? > [ ] > ( ) , new HashSet < Class < ? > > ( ) , clazz , name , include , exclude ) ; return result . toArray ( new Method [ result . size ( ) ] ) ;
public class LFltToDblFunctionBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static LFltToDblFunction fltToDblFunctionFrom ( Consumer < LFltToDblFunctionBuilder > buildingFunction ) { } }
LFltToDblFunctionBuilder builder = new LFltToDblFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class DrawMessage { /** * Inits the graphics2D object . * @ param g * the Graphics object . * @ return the graphics2 d */ private Graphics2D initGraphics2D ( final Graphics g ) { } }
Graphics2D g2 ; g2 = ( Graphics2D ) g ; g2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; g2 . setRenderingHint ( RenderingHints . KEY_RENDERING , RenderingHints . VALUE_RENDER_QUALITY ) ; g2 . setColor ( this . color ) ; return g2 ;
public class CommerceUserSegmentEntryLocalServiceBaseImpl { /** * Updates the commerce user segment entry in the database or adds it if it does not yet exist . Also notifies the appropriate model listeners . * @ param commerceUserSegmentEntry the commerce user segment entry * @ return the commerce user segment entr...
return commerceUserSegmentEntryPersistence . update ( commerceUserSegmentEntry ) ;
public class Weekcycle { /** * / * [ deutsch ] * < p > Ermittelt den zeitlichen Abstand zwischen den angegebenen * Datumsangaben gemessen in dieser Einheit . < / p > * @ param start starting date * @ param end ending date * @ return duration as count of this unit */ public long between ( PlainDate start , Pla...
return this . derive ( start ) . between ( start , end ) ;
public class DatabaseDAODefaultImpl { public void put_device_attribute_property ( Database database , String deviceName , DbAttribute attr ) throws DevFailed { } }
DbAttribute [ ] da = new DbAttribute [ 1 ] ; da [ 0 ] = attr ; put_device_attribute_property ( database , deviceName , da ) ;
public class ImplCommonOps_DSCC { /** * Performs matrix addition : < br > * C = & alpha ; A + & beta ; B * @ param alpha scalar value multiplied against A * @ param A Matrix * @ param beta scalar value multiplied against B * @ param B Matrix * @ param C Output matrix . * @ param gw ( Optional ) Storage fo...
double [ ] x = adjust ( gx , A . numRows ) ; int [ ] w = adjust ( gw , A . numRows , A . numRows ) ; C . indicesSorted = false ; C . nz_length = 0 ; for ( int col = 0 ; col < A . numCols ; col ++ ) { C . col_idx [ col ] = C . nz_length ; multAddColA ( A , col , alpha , C , col + 1 , x , w ) ; multAddColA ( B , col , be...
public class ApiOvhRouter { /** * Alter this object properties * REST : PUT / router / { serviceName } / vpn / { id } * @ param body [ required ] New object properties * @ param serviceName [ required ] The internal name of your Router offer * @ param id [ required ] */ public void serviceName_vpn_id_PUT ( Stri...
String qPath = "/router/{serviceName}/vpn/{id}" ; StringBuilder sb = path ( qPath , serviceName , id ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class StreamConduit { /** * Creates a stream pumper to copy the given input stream to the * given output stream . * @ param is the input stream to copy from . * @ param os the output stream to copy to . * @ param closeWhenExhausted if true close the inputstream . * @ return a thread object that does th...
BlockingStreamPumper pumper = new BlockingStreamPumper ( is , os , closeWhenExhausted ) ; // pumper . setAutoflush ( true ) ; / / always auto - flush final Thread result = new ThreadWithPumper ( pumper ) ; result . setDaemon ( true ) ; return result ;
public class JaxRsClientFactory { /** * Register a list of features for all created clients . */ @ SafeVarargs public final synchronized JaxRsClientFactory addFeatureToAllClients ( Class < ? extends Feature > ... features ) { } }
return addFeatureToGroup ( PrivateFeatureGroup . WILDCARD , features ) ;
public class FindBugsWorker { /** * this method will block current thread until the findbugs is running * @ param findBugs * fb engine , which will be < b > disposed < / b > after the analysis is * done */ private void runFindBugs ( final FindBugs2 findBugs ) { } }
if ( DEBUG ) { FindbugsPlugin . log ( "Running findbugs in thread " + Thread . currentThread ( ) . getName ( ) ) ; } System . setProperty ( "findbugs.progress" , "true" ) ; try { // Perform the analysis ! ( note : This is not thread - safe ) findBugs . execute ( ) ; } catch ( InterruptedException e ) { if ( DEBUG ) { F...
public class IncrementalSemanticAnalysis { /** * Adds the index vector to the semantic vector using the percentage to * specify how much of each dimesion is added . * @ param semantics the semantic vector whose values will be modified by the * index vector * @ param index the index vector that will be added to ...
for ( int p : index . positiveDimensions ( ) ) semantics . add ( p , percentage ) ; for ( int n : index . negativeDimensions ( ) ) semantics . add ( n , - percentage ) ;
public class AmazonCloudDirectoryClient { /** * Retrieves metadata about an object . * @ param getObjectInformationRequest * @ return Result of the GetObjectInformation operation returned by the service . * @ throws InternalServiceException * Indicates a problem that must be resolved by Amazon Web Services . Th...
request = beforeClientExecution ( request ) ; return executeGetObjectInformation ( request ) ;
public class LdapSearcher { /** * Search LDAP and stores the results in searchResults field . * @ param context the name of the context where the search starts ( the depth depends on ldap . search . scope ) * @ param filterExpr the filter expression to use for the search . The expression may contain variables of th...
searchResults . clear ( ) ; LdapContext ldapContext = null ; NamingEnumeration < SearchResult > ldapResult = null ; try { ldapContext = buildLdapContext ( ) ; ldapResult = ldapContext . search ( context , filterExpr , filterArgs , createSearchControls ( ) ) ; while ( ldapResult . hasMore ( ) ) { searchResults . add ( l...
public class IOUtil { /** * close Writer without a Exception * @ param w */ public static void closeEL ( Transport t ) { } }
try { if ( t != null && t . isConnected ( ) ) t . close ( ) ; } catch ( Throwable e ) { ExceptionUtil . rethrowIfNecessary ( e ) ; }
public class SQLUtils { /** * Get the max query result * @ param connection * connection * @ param table * table name * @ param column * column name * @ param where * where clause * @ param args * where arguments * @ return max or null * @ since 1.1.1 */ public static Integer max ( Connection co...
Integer max = null ; if ( count ( connection , table , where , args ) > 0 ) { StringBuilder maxQuery = new StringBuilder ( ) ; maxQuery . append ( "select max(" ) . append ( CoreSQLUtils . quoteWrap ( column ) ) . append ( ") from " ) . append ( CoreSQLUtils . quoteWrap ( table ) ) ; if ( where != null ) { maxQuery . a...
public class FloatWritable { /** * Compares two FloatWritables . */ public int compareTo ( Object o ) { } }
float thisValue = this . value ; float thatValue = ( ( FloatWritable ) o ) . value ; return ( thisValue < thatValue ? - 1 : ( thisValue == thatValue ? 0 : 1 ) ) ;
public class ConcurrentAwaitableCounter { /** * Somewhat loosely defined wait for " next N increments " , because the starting point is not defined from the Java * Memory Model perspective . */ public void awaitNextIncrements ( long nextIncrements ) throws InterruptedException { } }
if ( nextIncrements <= 0 ) { throw new IllegalArgumentException ( "nextIncrements is not positive: " + nextIncrements ) ; } if ( nextIncrements > MAX_COUNT / 4 ) { throw new UnsupportedOperationException ( "Couldn't wait for so many increments: " + nextIncrements ) ; } awaitCount ( ( sync . getCount ( ) + nextIncrement...
public class Config { /** * Returns absolute path to . ekstazi director ( URI . toString ) . Note * that the directory is not created with this invocation . * @ param parentDir * Parent directory for . ekstazi directory * @ return An absolute path ( URI . toString ) that describes . ekstazi directory */ public ...
String pathAsString = parentDir . getAbsolutePath ( ) + System . getProperty ( "file.separator" ) + Names . EKSTAZI_ROOT_DIR_NAME ; return new File ( pathAsString ) . toURI ( ) . toString ( ) ;
public class TorrentHandle { /** * Returns an array ( list ) with information about pieces that are partially * downloaded or not downloaded at all but partially requested . See * { @ link PartialPieceInfo } for the fields in the returned vector . * @ return a list with partial piece info */ public ArrayList < Pa...
partial_piece_info_vector v = new partial_piece_info_vector ( ) ; th . get_download_queue ( v ) ; int size = ( int ) v . size ( ) ; ArrayList < PartialPieceInfo > l = new ArrayList < > ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { l . add ( new PartialPieceInfo ( v . get ( i ) ) ) ; } return l ;
public class CircularQueueCaptureQueriesListener { /** * Log all captured SELECT queries */ public void logSelectQueriesForCurrentThread ( ) { } }
List < String > queries = getSelectQueriesForCurrentThread ( ) . stream ( ) . map ( CircularQueueCaptureQueriesListener :: formatQueryAsSql ) . collect ( Collectors . toList ( ) ) ; ourLog . info ( "Select Queries:\n{}" , String . join ( "\n" , queries ) ) ;
public class ConstructorConstructor { /** * Constructors for common interface types like Map and List and their * subtypes . */ @ SuppressWarnings ( "unchecked" ) // use runtime checks to guarantee that ' T ' is what it is private < T > ObjectConstructor < T > newDefaultImplementationConstructor ( final Type type , C...
if ( Collection . class . isAssignableFrom ( rawType ) ) { if ( SortedSet . class . isAssignableFrom ( rawType ) ) { return new ObjectConstructor < T > ( ) { @ Override public T construct ( ) { return ( T ) new TreeSet < Object > ( ) ; } } ; } else if ( EnumSet . class . isAssignableFrom ( rawType ) ) { return new Obje...
public class ClientHandshaker { /** * Server ' s own key was either a signing - only key , or was too * large for export rules . . . this message holds an ephemeral * RSA key to use for key exchange . */ private void serverKeyExchange ( RSA_ServerKeyExchange mesg ) throws IOException , GeneralSecurityException { } ...
if ( debug != null && Debug . isOn ( "handshake" ) ) { mesg . print ( System . out ) ; } if ( ! mesg . verify ( serverKey , clnt_random , svr_random ) ) { fatalSE ( Alerts . alert_handshake_failure , "server key exchange invalid" ) ; // NOTREACHED } ephemeralServerKey = mesg . getPublicKey ( ) ;
public class LinearSolverQr_DDRM { /** * Performs QR decomposition on A * @ param A not modified . */ @ Override public boolean setA ( DMatrixRMaj A ) { } }
if ( A . numRows > maxRows || A . numCols > maxCols ) { setMaxSize ( A . numRows , A . numCols ) ; } _setA ( A ) ; if ( ! decomposer . decompose ( A ) ) return false ; Q . reshape ( numRows , numRows , false ) ; R . reshape ( numRows , numCols , false ) ; decomposer . getQ ( Q , false ) ; decomposer . getR ( R , false ...
public class AstUtil { /** * Return true only if the specified object responds to the named method * @ param object - the object to check * @ param methodName - the name of the method * @ return true if the object responds to the named method */ public static boolean respondsTo ( Object object , String methodName...
MetaClass metaClass = DefaultGroovyMethods . getMetaClass ( object ) ; if ( ! metaClass . respondsTo ( object , methodName ) . isEmpty ( ) ) { return true ; } Map properties = DefaultGroovyMethods . getProperties ( object ) ; return properties . containsKey ( methodName ) ;
public class ReferenceEventAnalysisEngine { /** * Count the number of { @ link Event } s over a time { @ link Interval } specified in milliseconds . * @ param existingEvents set of { @ link Event } s matching triggering { @ link Event } id / user pulled from { @ link Event } storage * @ param triggeringEvent the { ...
int count = 0 ; long intervalInMillis = configuredDetectionPoint . getThreshold ( ) . getInterval ( ) . toMillis ( ) ; // grab the startTime to begin counting from based on the current time - interval DateTime startTime = DateUtils . getCurrentTimestamp ( ) . minusMillis ( ( int ) intervalInMillis ) ; // count events a...
public class Proxy { /** * Specifies a username for the SOCKS proxy . Supported by SOCKS v5 and above . * @ param username username for the SOCKS proxy * @ return reference to self */ public Proxy setSocksUsername ( String username ) { } }
verifyProxyTypeCompatibility ( ProxyType . MANUAL ) ; this . proxyType = ProxyType . MANUAL ; this . socksUsername = username ; return this ;
public class FormatUtil { /** * Formats the double array d with the default number format . * @ param buf String builder to append to * @ param d the double array to be formatted * @ param sep separator between the single values of the array , e . g . ' , ' * @ return Output buffer buf */ public static StringBu...
if ( d == null ) { return buf . append ( "null" ) ; } if ( d . length == 0 ) { return buf ; } buf . append ( d [ 0 ] ) ; for ( int i = 1 ; i < d . length ; i ++ ) { buf . append ( sep ) . append ( d [ i ] ) ; } return buf ;
public class CasConfigurationJasyptCipherExecutor { /** * Decrypt value string . ( but don ' t log error , for use in shell ) . * @ param value the value * @ return the string */ public String decryptValuePropagateExceptions ( final String value ) { } }
if ( StringUtils . isNotBlank ( value ) && value . startsWith ( ENCRYPTED_VALUE_PREFIX ) ) { initializeJasyptInstanceIfNecessary ( ) ; val encValue = value . substring ( ENCRYPTED_VALUE_PREFIX . length ( ) ) ; LOGGER . trace ( "Decrypting value [{}]..." , encValue ) ; val result = this . jasyptInstance . decrypt ( encV...
public class MarketplaceAgreementsInner { /** * Get marketplace agreement . * @ param publisherId Publisher identifier string of image being deployed . * @ param offerId Offer identifier string of image being deployed . * @ param planId Plan identifier string of image being deployed . * @ param serviceCallback ...
return ServiceFuture . fromResponse ( getAgreementWithServiceResponseAsync ( publisherId , offerId , planId ) , serviceCallback ) ;
public class SoapClient { /** * 设置编码 * @ param charset 编码 * @ return this */ public SoapClient setCharset ( Charset charset ) { } }
this . charset = charset ; try { this . message . setProperty ( SOAPMessage . CHARACTER_SET_ENCODING , this . charset . toString ( ) ) ; this . message . setProperty ( SOAPMessage . WRITE_XML_DECLARATION , "true" ) ; } catch ( SOAPException e ) { // ignore } return this ;
public class VirtualHubsInner { /** * Lists all the VirtualHubs in a subscription . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; VirtualHubInner & gt ; object */ public Observable < Page < VirtualHubInner > > listAsync ( ) { } }
return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < Page < VirtualHubInner > > , Page < VirtualHubInner > > ( ) { @ Override public Page < VirtualHubInner > call ( ServiceResponse < Page < VirtualHubInner > > response ) { return response . body ( ) ; } } ) ;
public class CmsXmlContent { /** * Ensures the parent values to the given path are created . < p > * @ param cms the cms context * @ param valuePath the value path * @ param locale the content locale */ private void ensureParentValues ( CmsObject cms , String valuePath , Locale locale ) { } }
if ( valuePath . contains ( "/" ) ) { String parentPath = valuePath . substring ( 0 , valuePath . lastIndexOf ( "/" ) ) ; if ( ! hasValue ( parentPath , locale ) ) { ensureParentValues ( cms , parentPath , locale ) ; int index = CmsXmlUtils . getXpathIndexInt ( parentPath ) - 1 ; addValue ( cms , parentPath , locale , ...
public class HeatChart { /** * Draws the y - axis label string if it is not null . */ private void drawYLabel ( Graphics2D chartGraphics ) { } }
if ( yAxisLabel != null ) { // Strings are drawn from the baseline position of the leftmost char . int yPosYAxisLabel = heatMapC . y + ( yAxisLabelSize . width / 2 ) ; int xPosYAxisLabel = ( margin / 2 ) + yAxisLabelAscent ; chartGraphics . setFont ( axisLabelsFont ) ; chartGraphics . setColor ( axisLabelColour ) ; // ...
public class ScriptRuntime { /** * Convert the value to a boolean . * See ECMA 9.2. */ public static boolean toBoolean ( Object val ) { } }
for ( ; ; ) { if ( val instanceof Boolean ) return ( ( Boolean ) val ) . booleanValue ( ) ; if ( val == null || val == Undefined . instance ) return false ; if ( val instanceof CharSequence ) return ( ( CharSequence ) val ) . length ( ) != 0 ; if ( val instanceof Number ) { double d = ( ( Number ) val ) . doubleValue (...
public class ChecksumExtensions { /** * Gets the checksum from the given byte arrays with the given algorithm * @ param algorithm * the algorithm to get the checksum . This could be for instance " MD4 " , " MD5 " , * " SHA - 1 " , " SHA - 256 " , " SHA - 384 " or " SHA - 512 " . * @ param byteArrays * the arr...
StringBuilder sb = new StringBuilder ( ) ; for ( byte [ ] byteArray : byteArrays ) { sb . append ( getChecksum ( byteArray , algorithm . getAlgorithm ( ) ) ) ; } return sb . toString ( ) ;
public class OSHelper { /** * Write a file * @ param bytes * @ param targetFileName * @ throws OSHelperException */ public static void writeFile ( byte [ ] bytes , String targetFileName ) throws OSHelperException { } }
FileOutputStream fos ; try { fos = new FileOutputStream ( targetFileName ) ; } catch ( FileNotFoundException ex ) { throw new OSHelperException ( "Received a FileNotFoundException when trying to open target file " + targetFileName + "." , ex ) ; } try { fos . write ( bytes ) ; } catch ( IOException ex ) { throw new OSH...
public class GetIntentResult { /** * An array of sample utterances configured for the intent . * @ param sampleUtterances * An array of sample utterances configured for the intent . */ public void setSampleUtterances ( java . util . Collection < String > sampleUtterances ) { } }
if ( sampleUtterances == null ) { this . sampleUtterances = null ; return ; } this . sampleUtterances = new java . util . ArrayList < String > ( sampleUtterances ) ;
public class ClientRegistry { /** * Gets the { @ link TextureAtlasSprite } to used for the { @ link IBlockState } . < br > * Called via ASM from { @ link BlockModelShapes # getTexture ( IBlockState ) } * @ param state the state * @ return the particle icon */ static TextureAtlasSprite getParticleIcon ( IBlockStat...
Icon icon = null ; IIconProvider provider = IComponent . getComponent ( IIconProvider . class , state . getBlock ( ) ) ; if ( provider instanceof IBlockIconProvider ) icon = ( ( IBlockIconProvider ) provider ) . getParticleIcon ( state ) ; else if ( provider != null ) icon = provider . getIcon ( ) ; return icon != null...
public class NodeTemplateClient { /** * Sets the access control policy on the specified resource . Replaces any existing policy . * < p > Sample code : * < pre > < code > * try ( NodeTemplateClient nodeTemplateClient = NodeTemplateClient . create ( ) ) { * ProjectRegionNodeTemplateResourceName resource = Projec...
SetIamPolicyNodeTemplateHttpRequest request = SetIamPolicyNodeTemplateHttpRequest . newBuilder ( ) . setResource ( resource ) . setRegionSetPolicyRequestResource ( regionSetPolicyRequestResource ) . build ( ) ; return setIamPolicyNodeTemplate ( request ) ;
public class RowOutputBinary { /** * Calculate the size of byte array required to store a row . * @ param data - the row data * @ param l - number of data [ ] elements to include in calculation * @ param types - array of java . sql . Types values * @ return size of byte array */ private static int getSize ( Obj...
int s = 0 ; for ( int i = 0 ; i < l ; i ++ ) { Object o = data [ i ] ; s += 1 ; // type or null if ( o != null ) { switch ( types [ i ] . typeCode ) { case Types . SQL_ALL_TYPES : throw Error . runtimeError ( ErrorCode . U_S0500 , "RowOutputBinary" ) ; case Types . SQL_CHAR : case Types . SQL_VARCHAR : case Types . VAR...
public class ByteArrayWrapper { /** * Compare this object to another ByteArrayWrapper , which must not be null . * @ param other the object to compare to . * @ return a value & lt ; 0 , 0 , or & gt ; 0 as this compares less than , equal to , or * greater than other . * @ throws ClassCastException if the other o...
if ( this == other ) return 0 ; int minSize = size < other . size ? size : other . size ; for ( int i = 0 ; i < minSize ; ++ i ) { if ( bytes [ i ] != other . bytes [ i ] ) { return ( bytes [ i ] & 0xFF ) - ( other . bytes [ i ] & 0xFF ) ; } } return size - other . size ;
public class StringUtils { /** * Performs a case insensitive comparison and returns true if the data * begins with the given sequence . */ public static boolean beginsWithIgnoreCase ( final String data , final String seq ) { } }
return data . regionMatches ( true , 0 , seq , 0 , seq . length ( ) ) ;