signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Traverson { /** * Follow the { @ link Link } s of the current resource , selected by its link - relation type and returns a { @ link Stream } * containing the returned { @ link HalRepresentation HalRepresentations } . * The EmbeddedTypeInfo is used to define the specific type of embedded items . * Te...
checkState ( ) ; try { if ( startWith != null ) { lastResult = traverseInitialResource ( type , embeddedTypeInfo , true ) ; } else if ( ! hops . isEmpty ( ) ) { lastResult = traverseHop ( lastResult . get ( 0 ) , type , embeddedTypeInfo , true ) ; } return ( Stream < T > ) lastResult . stream ( ) ; } catch ( final Exce...
public class FloatingPointBitsConverterUtil { /** * Converts a sortable long to double . * @ see # sortableLongToDouble ( long ) */ public static double sortableLongToDouble ( long value ) { } }
value = value ^ ( value >> 63 ) & Long . MAX_VALUE ; return Double . longBitsToDouble ( value ) ;
public class AbstractExtraLanguageGenerator { /** * Compute the expected type of the given expression . * @ param expr the expression . * @ return the expected type of the argument . */ protected LightweightTypeReference getExpectedType ( XExpression expr ) { } }
final IResolvedTypes resolvedTypes = getTypeResolver ( ) . resolveTypes ( expr ) ; final LightweightTypeReference actualType = resolvedTypes . getActualType ( expr ) ; return actualType ;
public class DownloadDataProcess { /** * Move this file . */ public void moveThisFile ( String strURL , String strName ) { } }
try { URL url = new URL ( strURL ) ; InputStream inputStream = url . openStream ( ) ; InputStreamReader inStream = new InputStreamReader ( inputStream ) ; LineNumberReader reader = new LineNumberReader ( inStream ) ; String strDir = strName . substring ( 0 , strName . lastIndexOf ( '/' ) ) ; File fileDirDest = new File...
public class RTMPProtocolDecoder { /** * Checks if the passed action is a reserved stream method . * @ param action * Action to check * @ return true if passed action is a reserved stream method , false otherwise */ @ SuppressWarnings ( "unused" ) private boolean isStreamCommand ( String action ) { } }
switch ( StreamAction . getEnum ( action ) ) { case CREATE_STREAM : case DELETE_STREAM : case RELEASE_STREAM : case PUBLISH : case PLAY : case PLAY2 : case SEEK : case PAUSE : case PAUSE_RAW : case CLOSE_STREAM : case RECEIVE_VIDEO : case RECEIVE_AUDIO : return true ; default : log . debug ( "Stream action {} is not a ...
public class IntAVLTree { /** * Update < code > node < / code > with the current data . */ public void update ( int node ) { } }
final int prev = prev ( node ) ; final int next = next ( node ) ; if ( ( prev == NIL || compare ( prev ) > 0 ) && ( next == NIL || compare ( next ) < 0 ) ) { // Update can be done in - place copy ( node ) ; for ( int n = node ; n != NIL ; n = parent ( n ) ) { fixAggregates ( n ) ; } } else { // TODO : it should be poss...
public class JobScheduleOperations { /** * Updates the specified job schedule . * This method performs a full replace of all the updatable properties of the job schedule . For example , if the schedule parameter is null , then the Batch service removes the job schedule ’ s existing schedule and replaces it with the d...
updateJobSchedule ( jobScheduleId , schedule , jobSpecification , null , null ) ;
public class EntityJsonParser { /** * Parse a single StructuredObject instance from the given URL . * Callers may prefer to catch EntityJSONException and treat all failures in the same way . * @ param instanceUrl A URL pointing to the JSON representation of a StructuredObject instance . * @ return A StructuredObj...
try { return new StructuredObject ( validate ( STRUCTURED_OBJECT_SCHEMA_URL , instanceUrl ) ) ; } catch ( NoSchemaException | InvalidSchemaException e ) { // In theory this cannot happen throw new RuntimeException ( e ) ; }
public class UIData { /** * < p > If " name " is something other than " value " , " var " , or " rowIndex " , rely * on the superclass conversion from < code > ValueBinding < / code > to * < code > ValueExpression < / code > . < / p > * @ param name Name of the attribute or property for which to set a * { @ lin...
if ( "value" . equals ( name ) ) { setDataModel ( null ) ; } else if ( "var" . equals ( name ) || "rowIndex" . equals ( name ) ) { throw new IllegalArgumentException ( ) ; } super . setValueBinding ( name , binding ) ;
public class Files { /** * Reads all bytes from a file into a byte array . * @ param file the file to read from * @ return a byte array containing all the bytes from file * @ throws IllegalArgumentException if the file is bigger than the largest * possible byte array ( 2 ^ 31 - 1) * @ throws IOException if an...
FileInputStream in = null ; try { in = new FileInputStream ( file ) ; return readFile ( in , in . getChannel ( ) . size ( ) ) ; } finally { if ( in != null ) { in . close ( ) ; } }
public class JulLogger { /** * { @ inheritDoc } * @ see Level # SEVERE * @ see Logger # log ( Level , String , Throwable ) */ @ Override public void error ( Throwable t ) { } }
log . log ( Level . SEVERE , t . getMessage ( ) , t ) ;
public class AcceptChargingStationJsonCommandHandler { /** * { @ inheritDoc } */ @ Override public void handle ( String chargingStationId , JsonObject commandObject , IdentityContext identityContext ) throws UserIdentityUnauthorizedException { } }
ChargingStation chargingStation = repository . findOne ( chargingStationId ) ; ChargingStationId csId = new ChargingStationId ( chargingStationId ) ; if ( chargingStation == null ) { // charging station doesn ' t exist yet , check if the user identity is allowed to create / maintain charging stations if ( ! userIdentit...
public class JobValidator { /** * Validate the Job ' s network mode . * @ param job The Job to check . * @ return A set of error Strings */ private Set < String > validateJobNetworkMode ( final Job job ) { } }
final String networkMode = job . getNetworkMode ( ) ; if ( networkMode == null ) { return emptySet ( ) ; } final Set < String > errors = Sets . newHashSet ( ) ; if ( ! VALID_NETWORK_MODES . contains ( networkMode ) && ! networkMode . startsWith ( "container:" ) ) { errors . add ( String . format ( "A Docker container's...
public class URLEncodedUtils { /** * Emcode / escape a portion of a URL , to use with the query part ensure { @ code plusAsBlank } is true . * @ param content the portion to decode * @ param charset the charset to use * @ param blankAsPlus if { @ code true } , then convert space to ' + ' ( e . g . for www - url -...
if ( content == null ) { return null ; } StringBuilder buf = new StringBuilder ( ) ; ByteBuffer bb = charset . encode ( content ) ; while ( bb . hasRemaining ( ) ) { int b = bb . get ( ) & 0xff ; if ( safechars . get ( b ) ) { buf . append ( ( char ) b ) ; } else if ( blankAsPlus && b == ' ' ) { buf . append ( '+' ) ; ...
public class Entry { /** * If the entry carries information about a suppressed exception , clear it . */ public void resetSuppressedLoadExceptionInformation ( ) { } }
LoadExceptionPiggyBack inf = getPiggyBack ( LoadExceptionPiggyBack . class ) ; if ( inf != null ) { inf . info = null ; }
public class SelectorNode { /** * Evaluate this node as a number */ public final Number evaluateNumeric ( Message message ) throws JMSException { } }
Object value = evaluate ( message ) ; if ( value == null ) return null ; if ( value instanceof Number ) return ArithmeticUtils . normalize ( ( Number ) value ) ; throw new FFMQException ( "Expected a numeric but got : " + value . toString ( ) , "INVALID_SELECTOR_EXPRESSION" ) ;
public class SubStringOperation { /** * Get the ' to ' parameter from the parameters . If the parameter is not set the defaultValue is taken instead . */ private Integer getToParameter ( Map < String , String > parameters , Integer defaultValue ) throws TransformationOperationException { } }
return getSubStringParameter ( parameters , toParam , defaultValue ) ;
public class SupplierBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */ @ Nonnull public static < T > SupplierBuilder < T > supplier ( Consumer < Supplier < T > > consumer ) { } }
return new SupplierBuilder ( consumer ) ;
public class MorkMapper { /** * Read input . Wraps mapper . read with Mork - specific error handling . * Return type depends on the mapper actually used . * @ return null if an error has been reported */ private Object invokeMapper ( File source ) throws IOException { } }
Object [ ] results ; String name ; Reader src ; name = source . getPath ( ) ; mork . output . verbose ( "mapping " + name ) ; results = run ( name ) ; mork . output . verbose ( "finished mapping " + name ) ; if ( results == null ) { return null ; } else { return results [ 0 ] ; }
public class DefaultLoaderService { /** * ( non - Javadoc ) * @ see * org . javamoney . moneta . spi . LoaderService # registerData ( java . lang . String , * org . javamoney . moneta . spi . LoaderService . UpdatePolicy , java . util . Map , * java . net . URL , java . net . URL [ ] ) */ @ Override public void...
if ( resources . containsKey ( loadDataInformation . getResourceId ( ) ) ) { throw new IllegalArgumentException ( "Resource : " + loadDataInformation . getResourceId ( ) + " already registered." ) ; } LoadableResource resource = new LoadableResourceBuilder ( ) . withCache ( CACHE ) . withLoadDataInformation ( loadDataI...
public class VForDefinition { /** * Init the key variable and add it to the parser context * @ param name Name of the variable * @ param context Context of the template parser */ private void initKeyVariable ( String name , TemplateParserContext context ) { } }
this . keyVariableInfo = context . addLocalVariable ( "String" , name . trim ( ) ) ;
public class SignatureUtils { /** * @ param className * the name of the class * @ return the class name , discarding any anonymous component */ public static String getNonAnonymousPortion ( String className ) { } }
String [ ] components = CLASS_COMPONENT_DELIMITER . split ( className ) ; StringBuilder buffer = new StringBuilder ( className . length ( ) ) . append ( components [ 0 ] ) ; for ( int i = 1 ; ( i < components . length ) && ! ANONYMOUS_COMPONENT . matcher ( components [ i ] ) . matches ( ) ; i ++ ) { buffer . append ( V...
public class AbstractEJBRuntime { /** * d744887 */ public void sendMDBBindingMessage ( BeanMetaData bmd ) { } }
// Currently , an information message is only logged for message endpoints // that use a JCA resource adapter , not a message listener port . if ( bmd . ivActivationSpecJndiName != null ) { Tr . info ( tc , "MDB_ACTIVATION_SPEC_INFO_CNTR0180I" , new Object [ ] { bmd . j2eeName . getComponent ( ) , bmd . j2eeName . getM...
public class OptionalHeader { /** * Returns the optional data directory entry for the given key or absent if * entry doesn ' t exist . * @ param key * @ return the data directory entry for the given key or absent if entry * doesn ' t exist . */ public Optional < DataDirEntry > maybeGetDataDirEntry ( DataDirecto...
return Optional . fromNullable ( dataDirectory . get ( key ) ) ;
public class ExpandableRecyclerAdapter { /** * Notify any registered observers that the { @ code itemCount } parents starting * at { @ code parentPositionStart } have changed . This will also trigger an item changed * for children of the parent list specified . * This is an item change event , not a structural ch...
int flatParentPositionStart = getFlatParentPosition ( parentPositionStart ) ; int flatParentPosition = flatParentPositionStart ; int sizeChanged = 0 ; int changed ; P parent ; for ( int j = 0 ; j < itemCount ; j ++ ) { parent = mParentList . get ( parentPositionStart ) ; changed = changeParentWrapper ( flatParentPositi...
public class ListFlowsResult { /** * A list of flow summaries . * @ param flows * A list of flow summaries . */ public void setFlows ( java . util . Collection < ListedFlow > flows ) { } }
if ( flows == null ) { this . flows = null ; return ; } this . flows = new java . util . ArrayList < ListedFlow > ( flows ) ;
public class ApiConfigHandler { /** * < pre > * Path to the script from the application root directory . * < / pre > * < code > string script = 3 ; < / code > */ public com . google . protobuf . ByteString getScriptBytes ( ) { } }
java . lang . Object ref = script_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; script_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; }
public class Strings { /** * Return a string composed of the given array . * @ param buff Buffer used to construct string value ( not reset ) . * @ param array Array of objects . * @ param prefix String prefix . * @ param separator Element sepearator . * @ param suffix String suffix . * @ return String in t...
buff . append ( prefix ) ; join ( buff , array , separator ) ; buff . append ( suffix ) ; return buff . toString ( ) ;
public class DatumWriterGenerator { /** * Generates a { @ link DatumWriter } class for encoding data of the given output type with the given schema . * @ param outputType Type information of the output data type . * @ param schema Schema of the output data type . * @ return A { @ link co . cask . tigon . internal...
classWriter = new ClassWriter ( ClassWriter . COMPUTE_FRAMES ) ; TypeToken < ? > interfaceType = getInterfaceType ( outputType ) ; // Generate the class String className = getClassName ( interfaceType , schema ) ; classType = Type . getObjectType ( className ) ; classWriter . visit ( Opcodes . V1_6 , Opcodes . ACC_PUBL...
public class PrivateZonesInner { /** * Deletes a Private DNS zone . WARNING : All DNS records in the zone will also be deleted . This operation cannot be undone . Private DNS zone cannot be deleted unless all virtual network links to it are removed . * @ param resourceGroupName The name of the resource group . * @ ...
deleteWithServiceResponseAsync ( resourceGroupName , privateZoneName , ifMatch ) . toBlocking ( ) . last ( ) . body ( ) ;
public class ImplementationLoader { /** * Returns the implementation for a given class . * @ return the implementation for the given class . */ public static < E > E get ( Class < E > type ) { } }
ServiceLoader < E > loader = ServiceLoader . load ( type ) ; Iterator < E > iterator = loader . iterator ( ) ; if ( iterator . hasNext ( ) ) { return iterator . next ( ) ; // only one is expected } try { // loads the default implementation return ( E ) Class . forName ( getDefaultImplementationName ( type ) ) . newInst...
public class EntityFinder { /** * Returns the ProteinSequence or null if one can ' t be created * @ param str * @ return */ private static ProteinSequence getProteinSequence ( String str ) { } }
try { ProteinSequence s = new ProteinSequence ( str ) ; return s ; } catch ( CompoundNotFoundException e ) { logger . error ( "Unexpected error when creating ProteinSequence" , e ) ; } return null ;
public class Vector3f { /** * / * ( non - Javadoc ) * @ see org . joml . Vector3fc # rotateX ( float , org . joml . Vector3f ) */ public Vector3f rotateX ( float angle , Vector3f dest ) { } }
float sin = ( float ) Math . sin ( angle ) , cos = ( float ) Math . cosFromSin ( sin , angle ) ; float y = this . y * cos - this . z * sin ; float z = this . y * sin + this . z * cos ; dest . x = this . x ; dest . y = y ; dest . z = z ; return dest ;
public class WsEncoder { /** * Encodes string for binary transparency over SOAP . */ public static String encode ( String value ) { } }
if ( value == null ) return null ; StringBuilder encoded = null ; int len = value . length ( ) ; for ( int c = 0 ; c < len ; c ++ ) { char ch = value . charAt ( c ) ; if ( ( ch < ' ' && ch != '\n' && ch != '\r' ) || ch == '\\' ) { if ( encoded == null ) { encoded = new StringBuilder ( ) ; if ( c > 0 ) encoded . append ...
public class RRBudgetV1_1Generator { /** * This method gets BudgetYear1DataType details like * BudgetPeriodStartDate , BudgetPeriodEndDate , BudgetPeriod * KeyPersons , OtherPersonnel , TotalCompensation , Equipment , ParticipantTraineeSupportCosts , Travel , OtherDirectCosts * DirectCosts , IndirectCosts , Cogni...
BudgetYear1DataType budgetYear = BudgetYear1DataType . Factory . newInstance ( ) ; if ( periodInfo != null ) { budgetYear . setBudgetPeriodStartDate ( s2SDateTimeService . convertDateToCalendar ( periodInfo . getStartDate ( ) ) ) ; budgetYear . setBudgetPeriodEndDate ( s2SDateTimeService . convertDateToCalendar ( perio...
public class LookupLocation { /** * Helper function to format a string for parent locations . * @ param parents List of parent locations . * @ return Formatted string representing parent locations . */ public static String getParentLocationString ( Location [ ] parents ) { } }
StringBuilder sb = new StringBuilder ( ) ; if ( parents != null ) { for ( Location parent : parents ) { if ( sb . length ( ) > 0 ) { sb . append ( ", " ) ; } sb . append ( String . format ( "%s (%s)" , parent . getLocationName ( ) , parent . getDisplayType ( ) ) ) ; } } else { sb . append ( "N/A" ) ; } return sb . toSt...
public class DefaultAndroidDeferredManager { /** * Return a { @ link Promise } for the { @ link DeferredAsyncTask } . * This can also automatically execute the task in background depending on * { @ link DeferredAsyncTask # getStartPolicy ( ) } and / or { @ link DefaultDeferredManager # isAutoSubmit ( ) } . * Prio...
if ( task . getStartPolicy ( ) == StartPolicy . AUTO || ( task . getStartPolicy ( ) == StartPolicy . DEFAULT && isAutoSubmit ( ) ) ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . HONEYCOMB ) { task . executeOnExecutor ( getExecutorService ( ) , EMPTY_PARAMS ) ; } else { task . execute ( EMPTY_PARAMS ) ; }...
public class VoltDDLElementTracker { /** * Add a table / column partition mapping for a PARTITION / REPLICATE statements . * Validate input data and reject duplicates . * @ param tableName table name * @ param colName column name */ void addPartition ( String tableName , String colName ) { } }
if ( m_partitionMap . containsKey ( tableName . toLowerCase ( ) ) ) { m_compiler . addInfo ( String . format ( "Replacing partition column %s on table %s with column %s\n" , m_partitionMap . get ( tableName . toLowerCase ( ) ) , tableName , colName ) ) ; } m_partitionMap . put ( tableName . toLowerCase ( ) , colName . ...
public class SourceFeatureQualifierCheck { /** * ENA - 2825 */ private void checkMetagenomeSource ( Origin origin , SourceFeature source ) { } }
List < Qualifier > metagenomeSourceQual = source . getQualifiers ( Qualifier . METAGENOME_SOURCE_QUALIFIER_NAME ) ; if ( metagenomeSourceQual != null && ! metagenomeSourceQual . isEmpty ( ) ) { Qualifier envSample = source . getSingleQualifier ( Qualifier . ENVIRONMENTAL_SAMPLE_QUALIFIER_NAME ) ; if ( envSample == null...
public class MessageFormat { /** * Sets the format to use for the format element with the given * format element index within the previously set pattern string . * The format element index is the zero - based number of the format * element counting from the start of the pattern string . * Since the order of for...
if ( formatElementIndex > maxOffset ) { throw new ArrayIndexOutOfBoundsException ( maxOffset , formatElementIndex ) ; } formats [ formatElementIndex ] = newFormat ;
public class OntopProtegeReasoner { /** * Replaces the owl connection with a new one * Called when the user cancels a query . Easier to get a new connection , than waiting for the cancel * @ return The old connection : The caller must close this connection */ public OWLConnection replaceConnection ( ) throws OntopC...
OWLConnection oldconn = this . owlConnection ; owlConnection = reasoner . getConnection ( ) ; return oldconn ;
public class BioPAXIOHandlerAdapter { /** * Paxtools maps BioPAX : comment ( L3 ) and BioPAX : COMMENT ( L2 ) to rdf : comment . This method handles that . * @ param bpe to be bound . * @ return a property editor responsible for editing comments . */ protected StringPropertyEditor getRDFCommentEditor ( BioPAXElemen...
StringPropertyEditor editor ; Class < ? extends BioPAXElement > inter = bpe . getModelInterface ( ) ; if ( this . getLevel ( ) . equals ( BioPAXLevel . L3 ) ) { editor = ( StringPropertyEditor ) this . getEditorMap ( ) . getEditorForProperty ( "comment" , inter ) ; } else { editor = ( StringPropertyEditor ) this . getE...
public class VariantSet { /** * Returns true of the variantSet passed in parameter has the same default * value * @ param obj * the variantSet to test * @ return true of the variantSet passed in parameter has the same default * value */ public boolean hasSameDefaultVariant ( VariantSet obj ) { } }
return ( this . defaultVariant == null && obj . defaultVariant == null ) || ( this . defaultVariant != null && this . defaultVariant . equals ( obj . defaultVariant ) ) ;
public class EfficientCacheView { /** * Look for a child view of the parent view id with the given id . If this view has the given * id , return this view . * The method is more efficient than a " normal " " findViewById " : the second time you will * called this method with the same argument , the view return wi...
View viewRetrieve = retrieveFromCache ( parentId , id ) ; if ( viewRetrieve == null ) { viewRetrieve = findViewById ( parentId , id ) ; if ( viewRetrieve != null ) { storeView ( parentId , id , viewRetrieve ) ; } } return castView ( viewRetrieve ) ;
public class MiscUtils { /** * Serialize and then deserialize an invocation so that it has serializedParams set for command logging if the * invocation is sent to a local site . * @ return The round - tripped version of the invocation * @ throws IOException */ public static StoredProcedureInvocation roundTripForC...
if ( invocation . getSerializedParams ( ) != null ) { return invocation ; } ByteBuffer buf = ByteBuffer . allocate ( invocation . getSerializedSize ( ) ) ; invocation . flattenToBuffer ( buf ) ; buf . flip ( ) ; StoredProcedureInvocation rti = new StoredProcedureInvocation ( ) ; rti . initFromBuffer ( buf ) ; return rt...
public class PortletDefinitionRegistryImpl { /** * / * ( non - Javadoc ) * @ see org . apereo . portal . portlet . registry . IPortletDefinitionRegistry # savePortletDefinition ( org . apereo . portal . portlet . om . IPortletDefinition ) */ @ Override public IPortletDefinition savePortletDefinition ( IPortletDefinit...
Validate . notNull ( portletDefinition , "portletDefinition can not be null" ) ; return this . portletDefinitionDao . savePortletDefinition ( portletDefinition ) ;
public class VpnSitesInner { /** * Retrieves the details of a VPNsite . * @ param resourceGroupName The resource group name of the VpnSite . * @ param vpnSiteName The name of the VpnSite being retrieved . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws ...
return ServiceFuture . fromResponse ( getByResourceGroupWithServiceResponseAsync ( resourceGroupName , vpnSiteName ) , serviceCallback ) ;
public class UserAccessDecisionVoter { /** * This method returns userId argument of the target method invocation . */ private Long getUserIdArg ( Object [ ] arguments ) { } }
if ( arguments . length <= USER_ID_INDEX ) { log . error ( "Illegal number of args: " + arguments . length ) ; } return ( Long ) arguments [ USER_ID_INDEX ] ;
public class MetadataTemplate { /** * Deletes the schema of an existing metadata template . * @ param api the API connection to be used * @ param scope the scope of the object * @ param template Unique identifier of the template */ public static void deleteMetadataTemplate ( BoxAPIConnection api , String scope , ...
URL url = METADATA_TEMPLATE_URL_TEMPLATE . build ( api . getBaseURL ( ) , scope , template ) ; BoxJSONRequest request = new BoxJSONRequest ( api , url , "DELETE" ) ; request . send ( ) ;
public class LeaderService { /** * Wait for the specified amount of time or until this service is stopped , whichever comes first . */ private synchronized void sleep ( long waitNanos ) throws InterruptedException { } }
while ( waitNanos > 0 && isRunning ( ) ) { long start = System . nanoTime ( ) ; TimeUnit . NANOSECONDS . timedWait ( this , waitNanos ) ; waitNanos -= System . nanoTime ( ) - start ; }
public class HtmlAdaptorServlet { /** * Update the writable attributes of a MBean * @ param request The HTTP request * @ param response The HTTP response * @ exception ServletException Thrown if an error occurs * @ exception IOException Thrown if an I / O error occurs */ private void updateAttributes ( HttpServ...
String name = request . getParameter ( "name" ) ; if ( trace ) log . trace ( "updateAttributes, name=" + name ) ; Enumeration paramNames = request . getParameterNames ( ) ; HashMap < String , String > attributes = new HashMap < String , String > ( ) ; while ( paramNames . hasMoreElements ( ) ) { String param = ( String...
public class ViewSet { /** * Creates a container view , where the scope of the view is the specified software system . * @ param softwareSystem the SoftwareSystem object representing the scope of the view * @ param key the key for the view ( must be unique ) * @ param description a description of the view * @ r...
assertThatTheSoftwareSystemIsNotNull ( softwareSystem ) ; assertThatTheViewKeyIsSpecifiedAndUnique ( key ) ; ContainerView view = new ContainerView ( softwareSystem , key , description ) ; view . setViewSet ( this ) ; containerViews . add ( view ) ; return view ;
public class MuzeiArtProvider { /** * Callback when the user wishes to see more information about the given artwork . The default * implementation opens the { @ link ProviderContract . Artwork # WEB _ URI web uri } of the artwork . * @ param artwork The artwork the user wants to see more information about . * @ r...
if ( artwork . getWebUri ( ) != null && getContext ( ) != null ) { try { Intent intent = new Intent ( Intent . ACTION_VIEW , artwork . getWebUri ( ) ) ; intent . addFlags ( Intent . FLAG_ACTIVITY_NEW_TASK ) ; getContext ( ) . startActivity ( intent ) ; return true ; } catch ( ActivityNotFoundException e ) { Log . w ( T...
public class CommandRunner { /** * Run the command and wait for completion . */ public void run ( List < String > command , @ Nullable Path workingDirectory , @ Nullable Map < String , String > environment , ConsoleListener consoleListener ) throws InterruptedException , CommandExitException , CommandExecutionException...
ProcessExecutor processExecutor = processExecutorFactory . newProcessExecutor ( ) ; try { int exitCode = processExecutor . run ( command , workingDirectory , environment , streamHandlerFactory . newHandler ( consoleListener ) , streamHandlerFactory . newHandler ( consoleListener ) ) ; if ( exitCode != 0 ) { throw new C...
public class DefaultWardenService { /** * Create a warden alert which will annotate the corresponding warden metric with suspension events . * @ param user The user for which the notification should be created . Cannot be null . * @ param counter The policy counter for which the notification should be created . Can...
String metricExp = _constructWardenMetricExpression ( "-1h" , user , counter ) ; Alert alert = new Alert ( _adminUser , _adminUser , _constructWardenAlertName ( user , counter ) , metricExp , "*/5 * * * *" ) ; List < Trigger > triggers = new ArrayList < > ( ) ; EntityManager em = emf . get ( ) ; double limit = PolicyLi...
public class SrvAccSettings { /** * < p > Save acc - settings into DB . < / p > * @ param pAddParam additional param * @ param pEntity entity * @ throws Exception - an exception */ @ Override public final synchronized void saveAccSettings ( final Map < String , Object > pAddParam , final AccSettings pEntity ) thr...
if ( pEntity . getIsNew ( ) ) { throw new ExceptionWithCode ( ExceptionWithCode . FORBIDDEN , "Attempt to insert accounting settings by " + pAddParam . get ( "user" ) ) ; } else { if ( pEntity . getCostPrecision ( ) < 0 || pEntity . getCostPrecision ( ) > 4 ) { throw new ExceptionWithCode ( ExceptionWithCode . WRONG_PA...
public class AjaxRadioPanel { /** * Factory method for create the new { @ link RadioGroup } . This method is invoked in the * constructor from the derived classes and can be overridden so users can provide their own * version of a new { @ link RadioGroup } . * @ param id * the id * @ param model * the model...
return ComponentFactory . newRadioGroup ( id , model ) ;
public class TimerNpRunnable { /** * Executes the timer work with configured retries . * The EJB 3.1 spec , section 18.4.3 says , " If the transaction fails or * is rolled back , the container must retry the timeout at least once . " * We allow the user to configure a retry count of 0 , which will cause * NO re...
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) // F743-425 . CodRev Tr . entry ( tc , "run: " + ivTimer . ivTaskId ) ; // F743-425 . CodRev if ( serverStopping ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "Server shutting down; aborti...
public class SignalUtil { /** * Logs a warning message . If the elapsed time is greater than * { @ link # SIGNAL _ LOG _ QUIESCE _ TIMEOUT _ MINUTES } then the log message will indicate that wait * logging for the thread is being quiesced , and a value of true is returned . Otherwise , false * is returned . * T...
return logWaiting ( log , callerClass , callerMethod , waitObj , start , extraArgs ) ;
public class BlockLeaf { /** * Fill the entry set from the tree map . */ void fillDeltaEntries ( Set < PageLeafEntry > entries , Row row , int tail ) { } }
int rowOffset = _rowHead ; byte [ ] buffer = _buffer ; while ( rowOffset < tail ) { int code = buffer [ rowOffset ] & CODE_MASK ; int len = getLength ( code , row ) ; if ( code == INSERT || code == REMOVE ) { PageLeafEntry entry = new PageLeafEntry ( this , row , rowOffset , len , code ) ; entries . add ( entry ) ; } r...
public class Snappy { /** * Computes the CRC32C checksum of the supplied data and performs the " mask " operation * on the computed checksum * @ param data The input data to calculate the CRC32C checksum of */ static int calculateChecksum ( ByteBuf data , int offset , int length ) { } }
Crc32c crc32 = new Crc32c ( ) ; try { crc32 . update ( data , offset , length ) ; return maskChecksum ( ( int ) crc32 . getValue ( ) ) ; } finally { crc32 . reset ( ) ; }
public class Batch { /** * Get body parameters * @ return Values of body parameters ( name of parameter : value of the parameter ) */ @ Override public Map < String , Object > getBodyParameters ( ) { } }
ArrayList < Map < String , Object > > requestMaps = new ArrayList < Map < String , Object > > ( ) ; for ( Request r : this . requests ) requestMaps . add ( requestToBatchMap ( r ) ) ; HashMap < String , Object > result = new HashMap < String , Object > ( ) ; result . put ( "requests" , requestMaps ) ; result . put ( "d...
public class LoggerModule { /** * Log processor for level TRACE * { @ sample . xml . . / . . / . . / doc / soitoolkit - connector . xml . sample soitoolkit : log - trace } * @ param message Log - message to be processed * @ param integrationScenario Optional name of the integration scenario or business process ...
return doLog ( LogLevelType . TRACE , message , integrationScenario , contractId , correlationId , extraInfo ) ;
public class KbState { /** * Returns { @ code true } if this state is consistent { @ code other } . * Two states are consistent if every assigned function value is * equal . * @ param other * @ return */ public boolean isConsistentWith ( KbState other ) { } }
// Both states need to have the same functions in the same order . // Don ' t check the names specifically though , because it ' s expensive . Preconditions . checkArgument ( other . functionNames . size ( ) == functionNames . size ( ) ) ; List < FunctionAssignment > otherAssignments = other . getAssignments ( ) ; for ...
public class MatchmakingConfiguration { /** * Amazon Resource Name ( < a href = " https : / / docs . aws . amazon . com / AmazonS3 / latest / dev / s3 - arn - format . html " > ARN < / a > ) that * is assigned to a game session queue and uniquely identifies it . Format is * < code > arn : aws : gamelift : & lt ; re...
if ( this . gameSessionQueueArns == null ) { setGameSessionQueueArns ( new java . util . ArrayList < String > ( gameSessionQueueArns . length ) ) ; } for ( String ele : gameSessionQueueArns ) { this . gameSessionQueueArns . add ( ele ) ; } return this ;
public class ResourceManager { /** * Gets the String associated with < code > key < / code > after having resolved * any nested keys ( { @ link # resolve ( String ) } ) and applied a formatter using * the given < code > args < / code > . * @ param key the key to lookup * @ param args the arguments to pass to th...
String value = getString ( key ) ; return MessageFormat . format ( value , args ) ;
public class JndiUtils { /** * Lookup object in JNDI * @ param name object name * @ param < T > object class parameter type * @ return object */ public static < T > T lookup ( String name ) { } }
InitialContext initialContext = initialContext ( ) ; try { @ SuppressWarnings ( "unchecked" ) T object = ( T ) initialContext . lookup ( name ) ; if ( object == null ) { throw new NameNotFoundException ( name + " was found but is null" ) ; } return object ; } catch ( NameNotFoundException e ) { throw new IllegalArgumen...
public class DataStream { /** * Initiates a Project transformation on a { @ link Tuple } { @ link DataStream } . < br > * < b > Note : Only Tuple DataStreams can be projected . < / b > * < p > The transformation projects each Tuple of the DataSet onto a ( sub ) set of * fields . * @ param fieldIndexes * The f...
return new StreamProjection < > ( this , fieldIndexes ) . projectTupleX ( ) ;
public class TransactionManager { /** * Same as { @ link # callInTransaction ( ConnectionSource , Callable ) } except this has a table - name . * WARNING : it is up to you to properly synchronize around this method if multiple threads are using a * connection - source which works gives out a single - connection . T...
DatabaseConnection connection = connectionSource . getReadWriteConnection ( tableName ) ; try { boolean saved = connectionSource . saveSpecialConnection ( connection ) ; return callInTransaction ( connection , saved , connectionSource . getDatabaseType ( ) , callable ) ; } finally { // we should clear aggressively conn...
public class RouteFilterRulesInner { /** * Gets all RouteFilterRules in a route filter . * @ param resourceGroupName The name of the resource group . * @ param routeFilterName The name of the route filter . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throw...
return AzureServiceFuture . fromPageResponse ( listByRouteFilterSinglePageAsync ( resourceGroupName , routeFilterName ) , new Func1 < String , Observable < ServiceResponse < Page < RouteFilterRuleInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < RouteFilterRuleInner > > > call ( String nextPag...
public class UtilIO { /** * Constructs the path for a source code file residing in the examples or demonstrations directory * In the case of the file not being in either directory , an empty string is returned * The expected parameters are class . getPackage ( ) . getName ( ) , class . getSimpleName ( ) * @ param...
String path = "" ; if ( pkg == null || app == null ) return path ; String pathToBase = getPathToBase ( ) ; if ( pathToBase != null ) { if ( pkg . contains ( "examples" ) ) path = new File ( pathToBase , "examples/src/main/java/" ) . getAbsolutePath ( ) ; else if ( pkg . contains ( "demonstrations" ) ) path = new File (...
public class IvyOverSLF4JLogger { /** * Logs depending on the < code > _ level < / code > given < code > _ message < / code > . * @ param _ message message to log * @ param _ level level to log */ public void log ( final String _message , final int _level ) { } }
switch ( _level ) { case 4 : if ( IvyOverSLF4JLogger . LOG . isDebugEnabled ( ) ) { IvyOverSLF4JLogger . LOG . debug ( _message ) ; } break ; case 3 : if ( IvyOverSLF4JLogger . LOG . isWarnEnabled ( ) ) { IvyOverSLF4JLogger . LOG . warn ( _message ) ; } break ; case 2 : if ( IvyOverSLF4JLogger . LOG . isInfoEnabled ( )...
public class ApiOvhMe { /** * Alter this object properties * REST : PUT / me / paymentMean / paypal / { id } * @ param body [ required ] New object properties * @ param id [ required ] Id of the object */ public void paymentMean_paypal_id_PUT ( Long id , OvhPaypal body ) throws IOException { } }
String qPath = "/me/paymentMean/paypal/{id}" ; StringBuilder sb = path ( qPath , id ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class StopRunRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StopRunRequest stopRunRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( stopRunRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stopRunRequest . getArn ( ) , ARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ;...
public class GitlabAPI { /** * Return Merge Request . * @ param projectId The id of the project * @ param mergeRequestIid The internal id of the merge request * @ return the Gitlab Merge Request * @ throws IOException on gitlab api call error */ public GitlabMergeRequest getMergeRequestByIid ( Serializable proj...
String tailUrl = GitlabProject . URL + "/" + sanitizeProjectId ( projectId ) + GitlabMergeRequest . URL + "/" + mergeRequestIid ; return retrieve ( ) . to ( tailUrl , GitlabMergeRequest . class ) ;
public class MTRandom { /** * This method resets the state of this instance using the 64 * bits of seed data provided . Note that if the same seed data * is passed to two different instances of MTRandom ( both of * which share the same compatibility state ) then the sequence * of numbers generated by both insta...
if ( compat ) { setSeed ( ( int ) seed ) ; } else { // Annoying runtime check for initialisation of internal data // caused by java . util . Random invoking setSeed ( ) during init . // This is unavoidable because no fields in our instance will // have been initialised at this point , not even if the code // were place...
public class JSModuleGraph { /** * Returns the transitive dependencies of the module . */ private Set < JSModule > getTransitiveDeps ( JSModule m ) { } }
Set < JSModule > deps = dependencyMap . computeIfAbsent ( m , JSModule :: getAllDependencies ) ; return deps ;
public class ColumnMapper { /** * Returns { @ code true } if the specified Cassandra type / marshaller is supported , { @ code false } otherwise . * @ param type A Cassandra type / marshaller . * @ return { @ code true } if the specified Cassandra type / marshaller is supported , { @ code false } otherwise . */ pub...
AbstractType < ? > checkedType = type ; if ( type . isCollection ( ) ) { if ( type instanceof MapType < ? , ? > ) { checkedType = ( ( MapType < ? , ? > ) type ) . getValuesType ( ) ; } else if ( type instanceof ListType < ? > ) { checkedType = ( ( ListType < ? > ) type ) . getElementsType ( ) ; } else if ( type instanc...
public class OlapAggregate { /** * Check required parameters and set default values . */ private void checkDefaults ( ) { } }
Utils . require ( m_shards != null || m_shardsRange != null , "shards or range parameter is not set" ) ; Utils . require ( m_shards == null || m_shardsRange == null , "shards and range parameters cannot be both set" ) ; Utils . require ( m_xshards == null || m_xshardsRange == null , "xshards and xrange parameters canno...
public class CmsInternalLinkValidationDialog { /** * Creates the list of widgets for this dialog . < p > */ @ Override protected void defineWidgets ( ) { } }
// initialize the project object to use for the dialog initSessionObject ( ) ; setKeyPrefix ( KEY_PREFIX ) ; // widgets to display addWidget ( new CmsWidgetDialogParameter ( this , "resources" , "/" , PAGES [ 0 ] , new CmsVfsFileWidget ( false , null ) , 1 , CmsWidgetDialogParameter . MAX_OCCURENCES ) ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link VerticalDatumRefType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link VerticalDatumRefType } { @ ...
return new JAXBElement < VerticalDatumRefType > ( _UsesVerticalDatum_QNAME , VerticalDatumRefType . class , null , value ) ;
public class XmlUtil { /** * Dump a { @ link Document } or { @ link Node } - compatible object to the given { @ link OutputStream } ( e . g . System . out ) . * @ param _ docOrNode { @ link Document } or { @ link Node } object * @ param _ outStream { @ link OutputStream } to print on * @ throws IOException on err...
if ( _docOrNode == null || _outStream == null ) { throw new IOException ( "Cannot print (on) 'null' object" ) ; } TransformerFactory tf = TransformerFactory . newInstance ( ) ; Transformer transformer ; try { transformer = tf . newTransformer ( ) ; transformer . setOutputProperty ( OutputKeys . OMIT_XML_DECLARATION , "...
public class CommerceTierPriceEntryPersistenceImpl { /** * Returns the first commerce tier price entry in the ordered set where commercePriceEntryId = & # 63 ; and minQuantity & le ; & # 63 ; . * @ param commercePriceEntryId the commerce price entry ID * @ param minQuantity the min quantity * @ param orderByCompa...
CommerceTierPriceEntry commerceTierPriceEntry = fetchByC_LtM_First ( commercePriceEntryId , minQuantity , orderByComparator ) ; if ( commerceTierPriceEntry != null ) { return commerceTierPriceEntry ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "commercePric...
public class LogLevelMapping { /** * Converts the JDK level to a name supported by Selenium . * @ param level log level to get the string name of * @ return string name representation of the level selenium supports */ public static String getName ( Level level ) { } }
Level normalized = normalize ( level ) ; return normalized == Level . FINE ? DEBUG : normalized . getName ( ) ;
public class JdbcTemplateJdbcHelper { /** * { @ inheritDoc } */ @ Override public int execute ( Connection conn , String sql , Object ... bindValues ) { } }
long timestampStart = System . currentTimeMillis ( ) ; try { JdbcTemplate jdbcTemplate = jdbcTemplate ( conn ) ; return bindValues != null && bindValues . length > 0 ? jdbcTemplate . update ( sql , bindValues ) : jdbcTemplate . update ( sql ) ; } catch ( DataAccessException dae ) { throw translateSQLException ( dae ) ;...
public class ThreadDelegatedScope { /** * Returns the context ( the set of objects bound to the scope ) for the current thread . * A context may be shared by multiple threads . */ public ThreadDelegatedContext getContext ( ) { } }
ThreadDelegatedContext context = threadLocal . get ( ) ; if ( context == null ) { context = new ThreadDelegatedContext ( ) ; threadLocal . set ( context ) ; } return context ;
public class NetworkManager { /** * Deploys all network components . */ private void deployComponents ( Collection < ComponentContext < ? > > components , final CountingCompletionHandler < Void > counter ) { } }
for ( final ComponentContext < ? > component : components ) { deployComponent ( component , new Handler < AsyncResult < Void > > ( ) { @ Override public void handle ( AsyncResult < Void > result ) { if ( result . failed ( ) ) { counter . fail ( result . cause ( ) ) ; } else { data . put ( component . address ( ) , Cont...
public class AstNode { /** * Remove the child node from this node , and replace that child with its first child ( if there is one ) . * @ param child the child to be extracted ; may not be null and must have at most 1 child * @ see # extractFromParent ( ) */ public void extractChild ( AstNode child ) { } }
if ( child . getChildCount ( ) == 0 ) { removeChild ( child ) ; } else { AstNode grandChild = child . getFirstChild ( ) ; replaceChild ( child , grandChild ) ; }
public class ClassFieldsScreen { /** * Set up all the screen fields . */ public void setupSFields ( ) { } }
this . getRecord ( ClassFields . CLASS_FIELDS_FILE ) . getField ( ClassFields . CLASS_FIELDS_TYPE ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( ClassFields . CLASS_FIELDS_FILE ) . getF...
public class Templater { /** * Builds the project and stores it at the specified { @ code projectRoot } . * You need to have specified at least the main class name for the project * to be built . * @ param projectRoot * @ throws NullPointerException if { @ code projectRoot = = null } . * @ throws IllegalArgum...
if ( projectRoot == null ) { throw new NullPointerException ( "projectRoot" ) ; } if ( mainClass == null ) { throw new IllegalArgumentException ( "No main class specified" ) ; } mainClassName = mainClass . substring ( mainClass . lastIndexOf ( '.' ) + 1 ) ; if ( executable == null || executable . length ( ) == 0 ) { ex...
public class FileClassManager { /** * Moves a class definition from the specified directory tree to another * specified directory tree . * @ param fromDirectory The root of the directory tree from which to move * the class definition . * @ param name The fully qualified name of the class to move . * @ param t...
String baseName = getBaseFileName ( name ) ; File fromClassFile = new File ( fromDirectory , baseName + CLASS_EXTENSION ) ; File toClassFile = new File ( toDirectory , baseName + CLASS_EXTENSION ) ; File fromDigestFile = new File ( fromDirectory , baseName + DIGEST_EXTENSION ) ; File toDigestFile = new File ( toDirecto...
public class XMLSerializer { /** * Private methods - - - - - */ private void processStartElement ( ) throws SAXException { } }
if ( openStartElement ) { final QName qName = elementStack . getFirst ( ) ; // peek for ( final NamespaceMapping p : qName . mappings ) { if ( p . newMapping ) { transformer . startPrefixMapping ( p . prefix , p . uri ) ; } } final Attributes atts = openAttributes != null ? openAttributes : EMPTY_ATTS ; transformer . s...
public class Unobfuscated { /** * Return un - obfuscated data as byte array . * @ return un - obfuscated data */ public byte [ ] asByteArray ( ) { } }
Objects . requireNonNull ( data ) ; byte [ ] ret = Arrays . copyOf ( data , data . length ) ; Arrays . fill ( data , ( byte ) 0 ) ; data = null ; return ret ;
public class Rectangle { /** * Sets all the values . * @ param x The x coordinate of the position * @ param y The y coordinate of the position * @ param width The width * @ param height The height */ public void set ( int x , int y , int width , int height ) { } }
setPosition ( x , y ) ; setSize ( width , height ) ;
public class CommonSuffixExtractor { /** * 此方法认为后缀一定是整个的词语 , 所以length是以词语为单位的 * @ param length * @ param size * @ param extend * @ return */ public List < String > extractSuffixByWords ( int length , int size , boolean extend ) { } }
TFDictionary suffixTreeSet = new TFDictionary ( ) ; for ( String key : tfDictionary . keySet ( ) ) { List < Term > termList = StandardTokenizer . segment ( key ) ; if ( termList . size ( ) > length ) { suffixTreeSet . add ( combine ( termList . subList ( termList . size ( ) - length , termList . size ( ) ) ) ) ; if ( e...
public class RandomVariableLowMemory { /** * / * ( non - Javadoc ) * @ see net . finmath . stochastic . RandomVariableInterface # addRatio ( net . finmath . stochastic . RandomVariableInterface , net . finmath . stochastic . RandomVariableInterface ) */ public RandomVariableInterface addRatio ( RandomVariableInterfac...
// Set time of this random variable to maximum of time with respect to which measurability is known . double newTime = Math . max ( Math . max ( time , numerator . getFiltrationTime ( ) ) , denominator . getFiltrationTime ( ) ) ; if ( isDeterministic ( ) && numerator . isDeterministic ( ) && denominator . isDeterminist...
public class QueryRequest { /** * This is a legacy parameter . Use < code > KeyConditionExpression < / code > instead . For more information , see < a href = * " https : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / LegacyConditionalParameters . KeyConditions . html " * > KeyConditions ...
setKeyConditions ( keyConditions ) ; return this ;
public class Model { /** * This is a convenience method to create a model instance already initialized with values . * Example : * < pre > * Person p = Person . create ( " name " , " Sam " , " last _ name " , " Margulis " , " dob " , " 2001-01-07 " ) ; * < / pre > * The first ( index 0 ) and every other eleme...
return ModelDelegate . create ( Model . < T > modelClass ( ) , namesAndValues ) ;
public class CDL { /** * Produce a comma delimited text row from a JSONArray . Values containing * the comma character will be quoted . < p > * @ param ja A JSONArray of strings * @ return A string ending in NEWLINE */ public static String rowToString ( JSONArray ja ) { } }
StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < ja . length ( ) ; i += 1 ) { if ( i > 0 ) { sb . append ( ',' ) ; } Object o = ja . opt ( i ) ; if ( o != null ) { String s = o . toString ( ) ; if ( s . indexOf ( ',' ) >= 0 ) { if ( s . indexOf ( '"' ) >= 0 ) { sb . append ( '\'' ) ; sb . append ( s ) ; s...
public class sms_profile { /** * < pre > * Use this operation to modify sms profile . . * < / pre > */ public static sms_profile update ( nitro_service client , sms_profile resource ) throws Exception { } }
resource . validate ( "modify" ) ; return ( ( sms_profile [ ] ) resource . update_resource ( client ) ) [ 0 ] ;