signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SendEmailRequest { /** * A list of tags , in the form of name / value pairs , to apply to an email that you send using the * < code > SendEmail < / code > operation . Tags correspond to characteristics of the email that you define , so that you * can publish email sending events . * @ param emailTags...
if ( emailTags == null ) { this . emailTags = null ; return ; } this . emailTags = new java . util . ArrayList < MessageTag > ( emailTags ) ;
public class UseEnumCollections { /** * implements the visitor to check that the class is greater or equal than 1.5 , and set and clear the stack * @ param classContext * the context object for the currently parsed class */ @ Override public void visitClassContext ( ClassContext classContext ) { } }
try { JavaClass cls = classContext . getJavaClass ( ) ; if ( cls . getMajor ( ) >= Const . MAJOR_1_5 ) { stack = new OpcodeStack ( ) ; checkedFields = new HashSet < > ( ) ; enumRegs = new HashMap < > ( ) ; enumFields = new HashMap < > ( ) ; super . visitClassContext ( classContext ) ; } } finally { stack = null ; check...
public class JSONWriter { /** * Main entry point for non - blueprint instances : called for the root value to * write it out . */ public void writeValue ( Object value ) throws IOException { } }
if ( value == null ) { writeNullValue ( ) ; return ; } _writeValue ( value , _writerLocator . findSerializationType ( value . getClass ( ) ) ) ;
public class RobotControlProxy { /** * / * ( non - Javadoc ) * @ see com . github . thehilikus . jrobocom . RobotControl # createRobot ( com . github . thehilikus . jrobocom . player . InstructionSet , int , boolean ) */ @ Override public void createRobot ( String name , InstructionSet pSet , int banksCount , boolean...
int turnsForBanks = Timing . getInstance ( ) . CREATION_BASE + Timing . getInstance ( ) . CREATION_PER_BANK * banksCount ; if ( pMobile ) { turnsForBanks = ( int ) ( turnsForBanks * Timing . getInstance ( ) . MOBILITY_PENALTY + Timing . getInstance ( ) . MOBILITY_CONSTANT ) ; } int turnsForSet = 0 ; if ( pSet == Instru...
public class ElementFilter { /** * Returns a set of packages in { @ code elements } . * @ return a set of packages in { @ code elements } * @ param elements the elements to filter */ public static Set < PackageElement > packagesIn ( Set < ? extends Element > elements ) { } }
return setFilter ( elements , PACKAGE_KIND , PackageElement . class ) ;
public class CliClient { /** * Prints out KeySlice list * @ param columnFamilyDef - column family definition * @ param slices - list of the KeySlice ' s to print out * @ throws NotFoundException - column not found * @ throws TException - transfer is broken * @ throws IllegalAccessException - can ' t do operat...
AbstractType < ? > validator ; String columnFamilyName = columnFamilyDef . getName ( ) ; AbstractType < ? > keyComparator = getKeyComparatorForCF ( columnFamilyName ) ; for ( KeySlice ks : slices ) { String keyName = ( keyComparator == null ) ? ByteBufferUtil . string ( ks . key ) : keyComparator . getString ( ks . key...
public class AttachmentController { /** * Upload single attachment and update the details in it from the response . */ private Observable < Attachment > upload ( RxComapiClient client , Attachment a ) { } }
return client . service ( ) . messaging ( ) . uploadContent ( a . getFolder ( ) , a . getData ( ) ) . map ( response -> a . updateWithUploadDetails ( response . getResult ( ) ) ) . doOnError ( t -> log . e ( "Error uploading attachment. " + t . getLocalizedMessage ( ) ) ) . onErrorReturn ( a :: setError ) ;
public class AtomContainer { /** * { @ inheritDoc } */ @ Override public void removeAtomOnly ( int position ) { } }
for ( int i = position ; i < atomCount - 1 ; i ++ ) { atoms [ i ] = atoms [ i + 1 ] ; } atoms [ atomCount - 1 ] = null ; atomCount -- ;
public class Builder { /** * Starts an HTML tag . It has no effect on the plain text version . * @ param tag the tag name * @ return this builder */ public Builder tag ( String tag ) { } }
ends . push ( "</" + tag + ">" ) ; html . a ( '<' ) . a ( tag ) . a ( '>' ) ; return this ;
public class AbstractDialogBuilder { /** * Builds a new dialog following the specifications of this builder * @ return New dialog built following the specifications of this builder */ public final T build ( ) { } }
T dialog = buildDialog ( ) ; if ( ! extraWindowHints . isEmpty ( ) ) { Set < Window . Hint > combinedHints = new HashSet < Window . Hint > ( dialog . getHints ( ) ) ; combinedHints . addAll ( extraWindowHints ) ; dialog . setHints ( combinedHints ) ; } return dialog ;
public class AbstractMemberBuilder { /** * Builds the sub component if there is anything to document . * @ param node the XML element that specifies which components to document . * @ param contentTree content tree to which the documentation will be added * @ throws DocletException if there is a problem while bui...
if ( hasMembersToDocument ( ) ) { super . build ( node , contentTree ) ; }
public class AppTemplateProviderElement { @ Override public boolean contains ( String key , String groupId , String templateId , String version ) { } }
return templateRepository . contains ( key , groupId , templateId , version ) ;
public class WorkGroupSummaryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( WorkGroupSummary workGroupSummary , ProtocolMarshaller protocolMarshaller ) { } }
if ( workGroupSummary == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( workGroupSummary . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( workGroupSummary . getState ( ) , STATE_BINDING ) ; protocolMarshaller . marshall ( wo...
public class AgigaDocument { /** * TODO : should this move to an external class ? it might be tricky to do so */ public void writeMucStyleCoref ( Writer writer ) throws IOException { } }
require ( prefs . readWord && prefs . readCoref , "AgigaPrefs.{readWord,readCoref} must be true for writeMucStyleCoref()" ) ; assignMucStyleIdsAndRefsToMentions ( ) ; AgigaMention [ ] mentionArray = getAllMentions ( ) . toArray ( new AgigaMention [ 0 ] ) ; Arrays . sort ( mentionArray , new StartMentionComparator ( ) )...
public class TheMovieDbApi { /** * This method lets users rate a TV show . * A valid session id or guest session id is required . * @ param tvID tvID * @ param rating rating * @ param sessionID sessionID * @ param guestSessionID guestSessionID * @ return * @ throws com . omertron . themoviedbapi . MovieDb...
return tmdbTv . postTVRating ( tvID , rating , sessionID , guestSessionID ) ;
public class ArabicShaping { /** * Convert a range of text in the source array , putting the result * into a range of text in the destination array , and return the number * of characters written . * @ param source An array containing the input text * @ param sourceStart The start of the range of text to conver...
if ( source == null ) { throw new IllegalArgumentException ( "source can not be null" ) ; } if ( sourceStart < 0 || sourceLength < 0 || sourceStart + sourceLength > source . length ) { throw new IllegalArgumentException ( "bad source start (" + sourceStart + ") or length (" + sourceLength + ") for buffer of length " + ...
public class JvmParameterizedTypeReferenceImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EList < JvmTypeReference > getArguments ( ) { } }
if ( arguments == null ) { arguments = new EObjectContainmentEList < JvmTypeReference > ( JvmTypeReference . class , this , TypesPackage . JVM_PARAMETERIZED_TYPE_REFERENCE__ARGUMENTS ) ; } return arguments ;
public class InChITautomerGenerator { /** * Parses the InChI ' s formula ( ignoring hydrogen ) and returns a map * with with a position for each atom , increasing in the order * of the elements as listed in the formula . * @ param inputInchi user input InChI * @ param inputMolecule user input molecule * @ ret...
Map < Integer , IAtom > inchiAtomsByPosition = new HashMap < Integer , IAtom > ( ) ; int position = 0 ; String inchi = inputInchi ; inchi = inchi . substring ( inchi . indexOf ( '/' ) + 1 ) ; String formula = inchi . substring ( 0 , inchi . indexOf ( '/' ) ) ; /* * Test for dots in the formula . For now , bail out when...
public class HttpRequest { /** * 获取客户端地址IP , 与getRemoteAddress ( ) 的区别在于 : 本方法优先取header中指定为RemoteAddress名的值 , 没有则返回getRemoteAddress ( ) 的getHostAddress ( ) 。 < br > * 本方法适用于服务前端有如nginx的代理服务器进行中转 , 通过 getRemoteAddress ( ) 是获取不到客户端的真实IP 。 * @ return 地址 */ public String getRemoteAddr ( ) { } }
if ( remoteAddrHeader != null ) { String val = getHeader ( remoteAddrHeader ) ; if ( val != null ) return val ; } SocketAddress addr = getRemoteAddress ( ) ; if ( addr == null ) return "" ; if ( addr instanceof InetSocketAddress ) return ( ( InetSocketAddress ) addr ) . getAddress ( ) . getHostAddress ( ) ; return Stri...
public class OmsHoughCirclesRaster { /** * Search for a fixed number of circles . * @ param houghValues the hough values . * @ param maxCircles The number of circles that should be found . * @ return the center coordinates . */ private Coordinate [ ] getCenterPoints ( double [ ] [ ] [ ] houghValues , int maxCircl...
Coordinate [ ] centerPoints = new Coordinate [ maxCircles ] ; int xMax = 0 ; int yMax = 0 ; int rMax = 0 ; pm . beginTask ( "Search for circles..." , maxCircles ) ; for ( int c = 0 ; c < maxCircles ; c ++ ) { double counterMax = - 1 ; for ( int radius = radiusMinPixel ; radius <= radiusMaxPixel ; radius = radius + radi...
public class DatabaseTableConfigLoader { /** * Read all of the fields information from the configuration file . */ private static < T > void readFields ( BufferedReader reader , DatabaseTableConfig < T > config ) throws SQLException { } }
List < DatabaseFieldConfig > fields = new ArrayList < DatabaseFieldConfig > ( ) ; while ( true ) { String line ; try { line = reader . readLine ( ) ; } catch ( IOException e ) { throw SqlExceptionUtil . create ( "Could not read next field from config file" , e ) ; } if ( line == null || line . equals ( CONFIG_FILE_FIEL...
public class Cell { /** * Sets the minWidth , prefWidth , maxWidth , minHeight , prefHeight , and maxHeight to the specified values . */ public Cell < C , T > size ( Value < C , T > width , Value < C , T > height ) { } }
minWidth = width ; minHeight = height ; prefWidth = width ; prefHeight = height ; maxWidth = width ; maxHeight = height ; return this ;
public class OrdersInner { /** * Gets a specific order by name . * @ param deviceName The device name . * @ param resourceGroupName The resource group name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the OrderInner object */ public Observable < Ord...
return getWithServiceResponseAsync ( deviceName , resourceGroupName ) . map ( new Func1 < ServiceResponse < OrderInner > , OrderInner > ( ) { @ Override public OrderInner call ( ServiceResponse < OrderInner > response ) { return response . body ( ) ; } } ) ;
public class EmbedBuilder { /** * Updates all fields of the embed using the given updater . * @ param updater The updater for the fields ; the { @ code EditableEmbedField } is only valid during the run of the * updater ; any try to save it in a variable and reuse it later after this method call will fail * with e...
delegate . updateFields ( field -> true , updater ) ; return this ;
public class DatabasesInner { /** * Returns database metric definitions . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param databaseName The n...
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( serverN...
public class BijMap { /** * Returns a collection view of the values from this * < code > BijMap < / code > . The view is fully functional ( i . e . , * allows mutation ) and connected to this bijective map ( i . e . , * changes in one of them are reflected in the other one ) . */ public Collection < B > values ( ...
return new AbstractCollection < B > ( ) { public int size ( ) { return map . size ( ) ; } public Iterator < B > iterator ( ) { return DSUtil . < Map . Entry < A , B > , B > mapIterator ( BijMap . this . entrySet ( ) . iterator ( ) , new Function < Map . Entry < A , B > , B > ( ) { public B f ( Map . Entry < A , B > ent...
public class CommerceOrderPaymentPersistenceImpl { /** * Returns all the commerce order payments . * @ return the commerce order payments */ @ Override public List < CommerceOrderPayment > findAll ( ) { } }
return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class ViewMover { /** * Creates the moving animation * Configures the moving animation based on moving params * @ param params params , which is used to configure the moving animation * @ return moving animation */ private Animation createAnimation ( MovingParams params ) { } }
Animation animation = new TranslateAnimation ( 0 , params . getXAxisDelta ( ) , 0 , params . getYAxisDelta ( ) ) ; animation . setFillEnabled ( true ) ; animation . setFillBefore ( false ) ; animation . setDuration ( params . getAnimationDuration ( ) ) ; Interpolator interpolator = params . getAnimationInterpolator ( )...
public class AbstractBigtableConnection { /** * { @ inheritDoc } */ @ Override public void close ( ) throws IOException { } }
if ( ! this . closed ) { this . session . close ( ) ; // If the clients are shutdown , there shouldn ' t be any more activity on the // batch pool ( assuming we created it ourselves ) . If exceptions were raised // shutting down the clients , it ' s not entirely safe to shutdown the pool // ( via a finally block ) . sh...
public class Locate { /** * Performs a file lookup . Valid options ( and their defaults ) are : * < ul > * < li > basename = False < / li > * < li > count = False < / li > * < li > existing = False < / li > * < li > follow = True < / li > * < li > ignore = False < / li > * < li > nofollow = False < / li >...
List < Object > args = new LinkedList < > ( ) ; Map < String , Boolean > kwargs = new LinkedHashMap < > ( ) ; args . add ( pattern ) ; args . add ( database . orElse ( "" ) ) ; args . add ( limit . orElse ( 0 ) ) ; options . ifPresent ( opts -> kwargs . putAll ( opts . getOpts ( ) ) ) ; return new LocalCall < > ( "loca...
public class Util { /** * Monitor the JDI event stream for { @ link com . sun . jdi . event . VMDeathEvent } * and { @ link com . sun . jdi . event . VMDisconnectEvent } . If encountered , invokes * { @ code unbiddenExitHandler } . * @ param vm the virtual machine to check * @ param unbiddenExitHandler the hand...
if ( vm . canBeModified ( ) ) { new JdiEventHandler ( vm , unbiddenExitHandler ) . start ( ) ; }
public class MetaProperty { /** * Gets the name for the getter for this property * @ return The name of the property . The name is " get " + the capitalized propertyName * or , in the case of boolean values , " is " + the capitalized propertyName */ public static String getGetterName ( String propertyName , Class t...
String prefix = type == boolean . class || type == Boolean . class ? "is" : "get" ; return prefix + MetaClassHelper . capitalize ( propertyName ) ;
public class AbstractAppender { /** * Handles an install response . */ protected void handleInstallResponse ( RaftMemberContext member , InstallRequest request , InstallResponse response , long timestamp ) { } }
if ( response . status ( ) == RaftResponse . Status . OK ) { handleInstallResponseOk ( member , request , response ) ; } else { handleInstallResponseError ( member , request , response ) ; }
public class Match { /** * Mark fields for inclusion during serialization . * @ param fields The fields to include * @ return Match */ public Match include ( String ... fields ) { } }
if ( fields != null ) { includes . addAll ( Arrays . asList ( fields ) ) ; } return this ;
public class ReceiveListenerDispatcher { /** * Return a reference to the instance of this class . Used to implement the * singleton design pattern . * @ return ReceiveListenerDispatcher */ public static ReceiveListenerDispatcher getInstance ( Conversation . ConversationType convType , boolean isOnClientSide ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getInstance" , new Object [ ] { "" + convType , "" + isOnClientSide } ) ; ReceiveListenerDispatcher retInstance ; // A conversation has type CLIENT if it is an Outbound or Inbound connection from a JetStream // client . The...
public class UnsafeUtil { /** * Get the memory address of the given object . * @ param o * @ return */ public static long addressOf ( Object o ) { } }
Object [ ] array = new Object [ ] { o } ; long baseOffset = THE_UNSAFE . arrayBaseOffset ( Object [ ] . class ) ; long objectAddress ; switch ( ADDRESS_SIZE ) { case 4 : objectAddress = THE_UNSAFE . getInt ( array , baseOffset ) ; break ; case 8 : objectAddress = THE_UNSAFE . getLong ( array , baseOffset ) ; break ; de...
public class XMLResultsParser { /** * Sets up an XML parser for the input , and creates the appropriate result type based on the parsed XML . */ private static Result createResults ( Command cmd , InputStream stream , ResultType type ) throws SparqlException { } }
XMLInputFactory xmlStreamFactory = XMLInputFactory . newInstance ( ) ; // Tell the factory to combine adjacent character blocks into a single event , so we don ' t have to do it ourselves . xmlStreamFactory . setProperty ( XMLInputFactory . IS_COALESCING , true ) ; // Tell the factory to create a reader that will close...
public class EmbeddableComponentManager { /** * Note : This method shouldn ' t exist but register / unregister methods should throw a * { @ link ComponentLifecycleException } but that would break backward compatibility to add it . */ private void removeComponentWithoutException ( Type role , String hint ) { } }
try { removeComponent ( role , hint ) ; } catch ( Exception e ) { this . logger . warn ( "Instance released but disposal failed. Some resources may not have been released." , e ) ; }
public class BaseServiceImp { /** * / * ( non - Javadoc ) * @ see com . popbill . api . BaseService # updateContactMember ( java . lang . String , com . popbill . api . ContactInfo , java . lang . String ) */ @ Override public Response updateContact ( String CorpNum , ContactInfo contactInfo , String UserID ) throws ...
String postData = toJsonString ( contactInfo ) ; return httppost ( "/IDs" , CorpNum , postData , UserID , Response . class ) ;
public class NetworkInterfaceTapConfigurationsInner { /** * Creates or updates a Tap configuration in the specified NetworkInterface . * @ param resourceGroupName The name of the resource group . * @ param networkInterfaceName The name of the network interface . * @ param tapConfigurationName The name of the tap ...
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , networkInterfaceName , tapConfigurationName , tapConfigurationParameters ) . map ( new Func1 < ServiceResponse < NetworkInterfaceTapConfigurationInner > , NetworkInterfaceTapConfigurationInner > ( ) { @ Override public NetworkInterfaceTapConfigurationI...
public class BaseTable { /** * Is the record at the Start of the file ? * @ return true if file position is one before the first record . */ public boolean isBOF ( ) { } }
boolean bFlag = ( ( m_iRecordStatus & DBConstants . RECORD_AT_BOF ) != 0 ) ; if ( this . isTable ( ) ) { // If this is a table , it can ' t handle starting and ending keys . . do it manually if ( bFlag ) return bFlag ; if ( this . getRecord ( ) . getKeyArea ( - 1 ) . isModified ( DBConstants . START_SELECT_KEY ) ) { if...
public class MockSubnetController { /** * Clear { @ link # allMockSubnets } and restore it from given a collection of instances . * @ param subnets * collection of MockSubnet to restore */ public void restoreAllMockSubnet ( final Collection < MockSubnet > subnets ) { } }
allMockSubnets . clear ( ) ; if ( null != subnets ) { for ( MockSubnet instance : subnets ) { allMockSubnets . put ( instance . getSubnetId ( ) , instance ) ; } }
public class Inflector { /** * Forge a name from a class and a method . If an annotation is provided , then the method * content is used . * @ param cl Class to get the name * @ param methodName The method name * @ param methodAnnotation The method annotation to override the normal forged name * @ return The ...
if ( methodAnnotation != null && ! "" . equalsIgnoreCase ( methodAnnotation . name ( ) ) ) { return methodAnnotation . name ( ) ; } else { return getHumanName ( cl . getSimpleName ( ) + ": " + methodName ) ; }
public class ProcessLogger { /** * Starts threads that copy the output of the supplied process ' s stdout and stderr streams to * the supplied target logger . When the streams reach EOF , the threads will exit . The threads * will be set to daemon so that they do not prevent the VM from exiting . * @ param target...
new StreamReader ( target , name + " stdout" , process . getInputStream ( ) ) . start ( ) ; new StreamReader ( target , name + " stderr" , process . getErrorStream ( ) ) . start ( ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcMotorConnectionTypeEnum ( ) { } }
if ( ifcMotorConnectionTypeEnumEEnum == null ) { ifcMotorConnectionTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 859 ) ; } return ifcMotorConnectionTypeEnumEEnum ;
public class ToHTMLStream { /** * Calls to this method could be replaced with calls to * getElemDesc ( name ) , but this one should be faster . */ private ElemDesc getElemDesc2 ( String name ) { } }
Object obj = m_htmlInfo . get2 ( name ) ; if ( null != obj ) return ( ElemDesc ) obj ; return m_dummy ;
public class AdminDevice { /** * Get logging target * @ param deviceName * @ return Logging target list * @ throws DevFailed */ @ Command ( name = "GetLoggingTarget" , inTypeDesc = DEVICE_NAME , outTypeDesc = "Logging target list" ) public String [ ] getLoggingTarget ( final String deviceName ) throws DevFailed {...
return LoggingManager . getInstance ( ) . getLoggingTarget ( deviceName ) ;
public class GetServiceStatusResponse { /** * Write members to a MwsWriter . * @ param w * The writer to write to . */ @ Override public void writeFragmentTo ( MwsWriter w ) { } }
w . write ( "GetServiceStatusResult" , getServiceStatusResult ) ; w . write ( "ResponseMetadata" , responseMetadata ) ;
public class NewChunk { /** * Heuristic to decide the basic type of a column */ byte type ( ) { } }
if ( _naCnt == - 1 ) { // No rollups yet ? int nas = 0 , es = 0 , nzs = 0 , ss = 0 ; if ( _ds != null && _ms != null ) { // UUID ? for ( int i = 0 ; i < _sparseLen ; i ++ ) if ( _xs != null && _xs . get ( i ) == Integer . MIN_VALUE ) nas ++ ; else if ( _ds [ i ] != 0 || _ms . get ( i ) != 0 ) nzs ++ ; _uuidCnt = _len -...
public class OrderBy { /** * Creates and chains a Limit object to limit the number query results . * @ param limit The limit expression . * @ return The Limit object that represents the LIMIT clause of the query . */ @ NonNull @ Override public Limit limit ( @ NonNull Expression limit ) { } }
if ( limit == null ) { throw new IllegalArgumentException ( "limit cannot be null." ) ; } return new Limit ( this , limit , null ) ;
public class OSGiServiceRegistryProxyTargetLocator { /** * { @ inheritDoc } */ public ProxyTarget locateProxyTarget ( long timeout , TimeUnit unit ) throws InterruptedException , TimeoutException { } }
String filter = filterString ; if ( filter == null ) { filter = String . format ( "(%s=%s)" , Constants . OBJECTCLASS , serviceInterface ) ; } else { filter = String . format ( "(&(%s=%s)%s)" , Constants . OBJECTCLASS , serviceInterface , filter ) ; } try { final ServiceTracker < Object , Object > tracker = new Service...
public class GameContainer { /** * Sleep for a given period * @ param milliseconds The period to sleep for in milliseconds */ public void sleep ( int milliseconds ) { } }
long target = getTime ( ) + milliseconds ; while ( getTime ( ) < target ) { try { Thread . sleep ( 1 ) ; } catch ( Exception e ) { } }
public class CmsLinkManager { /** * Sets the internal link substitution handler . < p > * @ param cms an OpenCms user context that must have the permissions for role { @ link CmsRole # ROOT _ ADMIN } . < p > * @ param linkSubstitutionHandler the handler to set * @ throws CmsRoleViolationException in case the prov...
OpenCms . getRoleManager ( ) . checkRole ( cms , CmsRole . ROOT_ADMIN ) ; m_linkSubstitutionHandler = linkSubstitutionHandler ;
public class StreamUtility { /** * Returns an XML - appropriate encoding of the given String . * @ param in * The String to encode . * @ return A new , encoded String . */ public static String enc ( String in ) { } }
if ( in == null || in . isEmpty ( ) ) { return "" ; } StringBuilder out = new StringBuilder ( ) ; enc ( in , out ) ; return out . toString ( ) ;
public class CmsEditExternalLinkDialog { /** * Loads the link info and shows the edit dialog . < p > * @ param structureId the structure id * @ return the dialog object */ public static CmsEditExternalLinkDialog loadAndShowDialog ( final CmsUUID structureId ) { } }
final CmsEditExternalLinkDialog dialog = new CmsEditExternalLinkDialog ( structureId ) ; CmsRpcAction < CmsExternalLinkInfoBean > action = new CmsRpcAction < CmsExternalLinkInfoBean > ( ) { @ Override public void execute ( ) { CmsCoreProvider . getVfsService ( ) . loadLinkInfo ( structureId , this ) ; } @ Override prot...
public class CameraEncoder { /** * Release all recording - specific resources . * The Encoder , EGLCore and FullFrameRect are tied to capture resolution , * and other parameters . */ private void releaseEglResources ( ) { } }
mReadyForFrames = false ; if ( mInputWindowSurface != null ) { mInputWindowSurface . release ( ) ; mInputWindowSurface = null ; } if ( mFullScreen != null ) { mFullScreen . release ( ) ; mFullScreen = null ; } if ( mEglCore != null ) { mEglCore . release ( ) ; mEglCore = null ; } mSurfaceTexture = null ;
public class EM { /** * Compute log ( sum ( exp ( x _ i ) ) , with attention to numerical issues . * @ param x Input * @ return Result */ private static double logSumExp ( double [ ] x ) { } }
double max = x [ 0 ] ; for ( int i = 1 ; i < x . length ; i ++ ) { final double v = x [ i ] ; max = v > max ? v : max ; } final double cutoff = max - 35.350506209 ; // log _ e ( 2 * * 51) double acc = 0. ; for ( int i = 0 ; i < x . length ; i ++ ) { final double v = x [ i ] ; if ( v > cutoff ) { acc += v < max ? FastMa...
public class AddOnRunIssuesUtils { /** * Creates a scrollable tree with the given add - ons as root nodes and its issues as child nodes . * @ param availableAddOns the add - ons that are available , used to create check the running issues * @ param addOnsNotRunnable the add - ons with running issues that will be sh...
AddOnSearcher addOnSearcher = new AddOnSearcher ( ) { @ Override public AddOn searchAddOn ( String id ) { return availableAddOns . getAddOn ( id ) ; } } ; DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode ( "" ) ; for ( AddOn addOn : addOnsNotRunnable ) { DefaultMutableTreeNode addOnNode = new DefaultMutable...
public class OpenAPIFilter { /** * { @ inheritDoc } */ @ Override public Parameter visitParameter ( Context context , Parameter p ) { } }
return filter . filterParameter ( p ) ;
public class GitlabAPI { /** * Get information about the approvals present and required for a merge request * EE only . */ public GitlabMergeRequestApprovals getMergeRequestApprovals ( GitlabMergeRequest mr ) throws IOException { } }
String tailUrl = GitlabProject . URL + "/" + sanitizeProjectId ( mr . getProjectId ( ) ) + GitlabMergeRequest . URL + "/" + mr . getIid ( ) + GitlabMergeRequestApprovals . URL ; return retrieve ( ) . to ( tailUrl , GitlabMergeRequestApprovals . class ) ;
public class Util { /** * Computes the CRC32 checksum for { @ code length } bytes of the given data , starting from { @ code off } . * @ param b * the the data to compute the checksum for . * @ param off * the buffer containing the data to compute the checksum for . * @ param length * number of bytes to inc...
CRC32 crc32 = new CRC32 ( ) ; crc32 . update ( b , off , length ) ; return toByteArray ( ( int ) ( crc32 . getValue ( ) & 0xffffffffL ) ) ;
public class FleetAttributesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( FleetAttributes fleetAttributes , ProtocolMarshaller protocolMarshaller ) { } }
if ( fleetAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( fleetAttributes . getFleetId ( ) , FLEETID_BINDING ) ; protocolMarshaller . marshall ( fleetAttributes . getFleetArn ( ) , FLEETARN_BINDING ) ; protocolMarshaller . mars...
public class NamespaceSupport { /** * Reset this Namespace support object for reuse . * < p > It is necessary to invoke this method before reusing the * Namespace support object for a new session . If namespace * declaration URIs are to be supported , that flag must also * be set to a non - default value . * ...
contexts = new Context [ 32 ] ; namespaceDeclUris = false ; contextPos = 0 ; contexts [ contextPos ] = currentContext = new Context ( ) ; currentContext . declarePrefix ( "xml" , XMLNS ) ;
public class SibTr { /** * Produce a formatted view of a list of DataSlices . Duplicate output lines are * suppressed to save space . * @ param slices The list of DataSlices to be formatted * @ return the formatted data slice * @ param max maximun number of bytes that should be formatted for each slice . */ pub...
if ( slices != null ) { StringBuilder builder = new StringBuilder ( ) ; if ( slices . size ( ) != 0 ) { int number = 1 ; int sliceCount = slices . size ( ) ; for ( DataSlice slice : slices ) { builder . append ( "List<DataSlice>@" ) ; builder . append ( Integer . toHexString ( System . identityHashCode ( slices ) ) ) ;...
public class Task { /** * Report a fatal error to the parent ( task ) tracker . */ protected void reportFatalError ( TaskAttemptID id , Throwable throwable , String logMsg ) { } }
LOG . fatal ( logMsg ) ; Throwable tCause = throwable . getCause ( ) ; String cause = tCause == null ? StringUtils . stringifyException ( throwable ) : StringUtils . stringifyException ( tCause ) ; try { umbilical . fatalError ( id , cause ) ; } catch ( IOException ioe ) { LOG . fatal ( "Failed to contact the tasktrack...
public class CassQuery { /** * Create Update CQL query from a given JPA query . * @ param kunderaQuery * the kundera query * @ return the string */ public String createUpdateQuery ( KunderaQuery kunderaQuery ) { } }
EntityMetadata metadata = kunderaQuery . getEntityMetadata ( ) ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( metadata . getPersistenceUnit ( ) ) ; CQLTranslator translator = new CQLTranslator ( ) ; String update_Query = translator . UPDATE_QUERY ; String tab...
public class QueryResultImpl { /** * Attempts to get < code > size < / code > results and puts them into { @ link * # resultNodes } . If the size of { @ link # resultNodes } is less than * < code > size < / code > then there are no more than < code > resultNodes . size ( ) < / code > * results for this query . ...
if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "getResults({}) limit={}" , new Long ( size ) , new Long ( limit ) ) ; } long maxResultSize = size ; // is there any limit ? if ( limit > 0 ) { maxResultSize = limit ; } if ( resultNodes . size ( ) >= maxResultSize ) { // we already have them all return ; } // execute it ...
public class EmailIntentBuilder { /** * Launch the email intent . * @ return { @ code false } if no activity to handle the email intent could be found ; { @ code true } otherwise */ public boolean start ( ) { } }
Intent emailIntent = build ( ) ; try { startActivity ( emailIntent ) ; } catch ( ActivityNotFoundException e ) { return false ; } return true ;
public class Period { /** * Creates a period from two partially specified times , calculating * by field difference . * The two partials must contain the same fields , thus you can specify * two < code > LocalDate < / code > objects , or two < code > LocalTime < / code > objects , * but not one of each . Also ,...
if ( start == null || end == null ) { throw new IllegalArgumentException ( "ReadablePartial objects must not be null" ) ; } if ( start . size ( ) != end . size ( ) ) { throw new IllegalArgumentException ( "ReadablePartial objects must have the same set of fields" ) ; } DurationFieldType [ ] types = new DurationFieldTyp...
public class RestClientUtil { /** * scroll search * https : / / www . elastic . co / guide / en / elasticsearch / reference / 6.2 / search - request - scroll . html * @ param scroll * @ param scrollId * @ return * @ throws ElasticSearchException */ public String searchScroll ( String scroll , String scrollId ...
if ( ! this . client . isV1 ( ) ) { StringBuilder entity = new StringBuilder ( ) ; entity . append ( "{\"scroll\" : \"" ) . append ( scroll ) . append ( "\",\"scroll_id\" : \"" ) . append ( scrollId ) . append ( "\"}" ) ; String result = this . client . executeHttp ( "_search/scroll" , entity . toString ( ) , ClientUti...
public class ST_3DLength { /** * Returns the 3D perimeter of the given polygon . * @ param polygon Polygon * @ return The 3D perimeter of the given polygon */ public static double length3D ( Polygon polygon ) { } }
double length = 0.0 ; length += length3D ( polygon . getExteriorRing ( ) . getCoordinateSequence ( ) ) ; for ( int i = 0 ; i < polygon . getNumInteriorRing ( ) ; i ++ ) { length += length3D ( polygon . getInteriorRingN ( i ) ) ; } return length ;
public class ConvertDescriptors { /** * Converts a floating point description with all positive values into the 8 - bit integer descriptor by * dividing each element in the input by the element maximum value and multiplying by 255. * @ param input Description with elements that are all positive * @ param output U...
double max = 0 ; for ( int i = 0 ; i < input . size ( ) ; i ++ ) { double v = input . value [ i ] ; if ( v > max ) max = v ; } if ( max == 0 ) max = 1.0 ; for ( int i = 0 ; i < input . size ( ) ; i ++ ) { output . value [ i ] = ( byte ) ( 255.0 * input . value [ i ] / max ) ; }
public class StringSupport { /** * Writes the contents of a string to an output stream . * @ param s * @ param output * @ throws IOException */ public static void writeToOutputStream ( String s , OutputStream output ) throws IOException { } }
writeToOutputStream ( s , output , null ) ;
public class ModelItem { /** * Gets the comma separated list of tags . * @ return a comma separated list of tags , * or an empty string if there are no tags */ public String getTags ( ) { } }
Set < String > setOfTags = getTagsAsSet ( ) ; if ( setOfTags . isEmpty ( ) ) { return "" ; } StringBuilder buf = new StringBuilder ( ) ; for ( String tag : setOfTags ) { buf . append ( tag ) ; buf . append ( "," ) ; } String tagsAsString = buf . toString ( ) ; return tagsAsString . substring ( 0 , tagsAsString . length...
public class LabelDictionary { /** * Adds a new label to the dictionary if it has not been added yet . * Returns the ID of the new label in the dictionary . * @ param label add this label to the dictionary if it does not exist yet * @ return ID of label in the dictionary */ public int store ( String label ) { } }
if ( strInt . containsKey ( label ) ) { return ( strInt . get ( label ) . intValue ( ) ) ; } else if ( ! newLabelsAllowed ) { return KEY_DUMMY_LABEL ; } else { // store label Integer intKey = count ++ ; strInt . put ( label , intKey ) ; intStr . put ( intKey , label ) ; return intKey . intValue ( ) ; }
public class DocBookBuilder { /** * Process a topic and add the section info information . This information consists of the keywordset information . The * keywords are populated using the tags assigned to the topic . * @ param buildData Information and data structures for the build . * @ param topic The Topic to ...
if ( doc == null || topic == null ) return ; final String infoName ; if ( buildData . getDocBookVersion ( ) == DocBookVersion . DOCBOOK_50 ) { infoName = "info" ; } else { infoName = DocBookUtilities . TOPIC_ROOT_SECTIONINFO_NODE_NAME ; } final CollectionWrapper < TagWrapper > tags = topic . getTags ( ) ; final List < ...
public class ChangedListBackupManager { /** * Attempts to reload the changed list from a backup file . If there are * no backup files or the backup file cannot be read , returns - 1 , otherwise * the backup file is loaded and the time the backup file was written is * returned . * @ return the write time of the ...
long backupTime = - 1 ; File [ ] backupDirFiles = getSortedBackupDirFiles ( ) ; if ( backupDirFiles . length > 0 ) { File latestBackup = backupDirFiles [ 0 ] ; try { backupTime = Long . parseLong ( latestBackup . getName ( ) ) ; changedList . restore ( latestBackup , this . contentDirs ) ; } catch ( NumberFormatExcepti...
public class UtilCollectionsPersistenceDelegate { /** * $ NON - NLS - 1 $ */ protected boolean mutatesTo ( Object o1 , Object o2 ) { } }
if ( BeansUtils . declaredEquals ( o1 . getClass ( ) ) ) { return o1 . equals ( o2 ) ; } if ( o1 instanceof Collection < ? > ) { Collection < ? > c1 = ( Collection < ? > ) o1 ; Collection < ? > c2 = ( Collection < ? > ) o2 ; return c1 . size ( ) == c2 . size ( ) && c1 . containsAll ( c2 ) ; } if ( o1 instanceof Map < ?...
public class GetKeyPairsResult { /** * An array of key - value pairs containing information about the key pairs . * @ param keyPairs * An array of key - value pairs containing information about the key pairs . */ public void setKeyPairs ( java . util . Collection < KeyPair > keyPairs ) { } }
if ( keyPairs == null ) { this . keyPairs = null ; return ; } this . keyPairs = new java . util . ArrayList < KeyPair > ( keyPairs ) ;
public class FixedWeekdayBetweenFixedParser { /** * Parses the provided configuration and creates holidays for the provided * year . */ public void parse ( final int nYear , final HolidayMap aHolidayMap , final Holidays aConfig ) { } }
for ( final FixedWeekdayBetweenFixed aFixedWeekdayBetweenFixed : aConfig . getFixedWeekdayBetweenFixed ( ) ) { if ( ! isValid ( aFixedWeekdayBetweenFixed , nYear ) ) continue ; final DayOfWeek nExpectedWeekday = XMLHolidayHelper . getWeekday ( aFixedWeekdayBetweenFixed . getWeekday ( ) ) ; LocalDate aFrom = XMLHolidayH...
public class FixedBatchSpliteratorBase { /** * { @ inheritDoc } */ @ Override public Spliterator < T > trySplit ( ) { } }
final HoldingConsumer < T > holder = new HoldingConsumer < > ( ) ; if ( ! tryAdvance ( holder ) ) { return null ; } final Object [ ] a = new Object [ batchSize ] ; int j = 0 ; do { a [ j ] = holder . value ; } while ( ++ j < batchSize && tryAdvance ( holder ) ) ; if ( est != Long . MAX_VALUE ) { est -= j ; } return spl...
public class PublicIPAddressesInner { /** * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set . * @ param resourceGroupName The name of the resource group . * @ param virtualMachineScaleSetName The name of the virtual machine scale set . * @ param ...
return listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync ( resourceGroupName , virtualMachineScaleSetName , virtualmachineIndex , networkInterfaceName , ipConfigurationName ) . map ( new Func1 < ServiceResponse < Page < PublicIPAddressInner > > , Page < PublicIPAddressInner > > ( ) { @ Override publ...
public class ExtDirectFormPostResult { /** * Adds multiple error messages to a specific field . Does not overwrite already * existing errors . * @ param field the name of the field * @ param errors a collection of error messages */ @ SuppressWarnings ( "unchecked" ) public void addErrors ( String field , List < S...
Assert . notNull ( field , "field must not be null" ) ; Assert . notNull ( errors , "field must not be null" ) ; // do not overwrite existing errors Map < String , List < String > > errorMap = ( Map < String , List < String > > ) this . result . get ( ERRORS_PROPERTY ) ; if ( errorMap == null ) { errorMap = new HashMap...
public class OrderBooks { /** * Fake < code > enterOrder < / code > implementation . */ public void enterOrder ( Order order , String instrument ) { } }
books . get ( instrument ) . enter ( order . id ( ) , order . level ( ) . side ( ) , order . level ( ) . price ( ) , order . size ( ) ) ;
public class JBakeConfigurationFactory { /** * Creates a { @ link DefaultJBakeConfiguration } with value site . host replaced * by http : / / localhost : [ server . port ] . * The server . port is read from the project properties file . * @ param sourceFolder The source folder of the project * @ param destinati...
DefaultJBakeConfiguration configuration = ( DefaultJBakeConfiguration ) getConfigUtil ( ) . loadConfig ( sourceFolder ) ; configuration . setDestinationFolder ( destinationFolder ) ; configuration . setClearCache ( isClearCache ) ; configuration . setSiteHost ( "http://localhost:" + configuration . getServerPort ( ) ) ...
public class ClassScanner { /** * 从jar文件中扫描指定的包 * @ param jar jar文件 * @ param packageDirName 文件路径 * @ param packageName 报名 * @ param recursive 是否递归查找 * @ return jar文件中指定包名下的所有class */ public Set < Class < ? > > findAndAddClassesInPackageByFile ( JarFile jar , String packageDirName , String packageName , boole...
LOGGER . debug ( "尝试扫描jar文件{}" ) ; Set < Class < ? > > classes = new LinkedHashSet < > ( ) ; LOGGER . debug ( "jar类型的扫描" ) ; // 获取jar // 从此jar包 得到一个枚举类 Enumeration < JarEntry > entries = jar . entries ( ) ; // 同样的进行循环迭代 while ( entries . hasMoreElements ( ) ) { // 获取jar里的一个实体 可以是目录 和一些jar包里的其他文件 如META - INF等文件 JarEntry...
public class GeneratorSetJson { /** * Reports a GeneratorSetException if the given string is not a valid function id . Otherwise , returns this string . */ private static String validFunction ( String string ) { } }
return GeneratorSet . ALL . equals ( string ) ? string : validIdentifier ( string ) ;
public class SynthesisFilter { /** * Reset the synthesis filter . */ public void reset ( ) { } }
// float [ ] floatp ; // float [ ] floatp2; // initialize v1 [ ] and v2 [ ] : // for ( floatp = v1 + 512 , floatp2 = v2 + 512 ; floatp > v1 ; ) // * - - floatp = * - - floatp2 = 0.0; for ( int p = 0 ; p < 512 ; p ++ ) v1 [ p ] = v2 [ p ] = 0.0f ; // initialize samples [ ] : // for ( floatp = samples + 32 ; floatp > sam...
public class DefaultOperationRequestBuilder { /** * Makes sure that the operation name and the address have been set and returns a ModelNode * representing the operation request . */ public ModelNode buildRequest ( ) throws OperationFormatException { } }
ModelNode address = request . get ( Util . ADDRESS ) ; if ( prefix . isEmpty ( ) ) { address . setEmptyList ( ) ; } else { Iterator < Node > iterator = prefix . iterator ( ) ; while ( iterator . hasNext ( ) ) { OperationRequestAddress . Node node = iterator . next ( ) ; if ( node . getName ( ) != null ) { address . add...
public class JCRStoreResource { /** * { @ inheritDoc } */ @ Override public long write ( final InputStream _in , final long _size , final String _fileName ) throws EFapsException { } }
long size = _size ; try { final Binary bin = getBinary ( _in ) ; final Node resNode ; if ( this . identifier == null ) { final Node fileNode = getFolderNode ( ) . addNode ( getInstance ( ) . getOid ( ) , NodeType . NT_FILE ) ; setIdentifer ( fileNode . getIdentifier ( ) ) ; resNode = fileNode . addNode ( Property . JCR...
public class AttributeWidgetFactory { /** * Remove an attribute widget builder from the collection . * @ param builder the builder to remove . */ public void removeAttributeBuilder ( AttributeWidgetBuilder < ? > builder ) { } }
Iterator < AttributeWidgetBuilder < ? > > iterator = builders . values ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { AttributeWidgetBuilder < ? > widgetBuilder = iterator . next ( ) ; if ( widgetBuilder . equals ( builder ) ) { iterator . remove ( ) ; } }
public class SpoofChecker { /** * Computes the set of numerics for a string , according to UTS 39 section 5.3. */ private void getNumerics ( String input , UnicodeSet result ) { } }
result . clear ( ) ; for ( int utf16Offset = 0 ; utf16Offset < input . length ( ) ; ) { int codePoint = Character . codePointAt ( input , utf16Offset ) ; utf16Offset += Character . charCount ( codePoint ) ; // Store a representative character for each kind of decimal digit if ( UCharacter . getType ( codePoint ) == UCh...
public class BaseWindowedBolt { /** * define a tumbling ingestion time window * @ param size window size */ public BaseWindowedBolt < T > ingestionTimeWindow ( Time size ) { } }
long s = size . toMilliseconds ( ) ; ensurePositiveTime ( s ) ; setSizeAndSlide ( s , DEFAULT_SLIDE ) ; this . windowAssigner = TumblingIngestionTimeWindows . of ( s ) ; return this ;
public class hqlLexer { /** * $ ANTLR start " SKIP " */ public final void mSKIP ( ) throws RecognitionException { } }
try { int _type = SKIP ; int _channel = DEFAULT_TOKEN_CHANNEL ; // hql . g : 60:6 : ( ' skip ' ) // hql . g : 60:8 : ' skip ' { match ( "skip" ) ; if ( state . failed ) return ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class EventsHelper { /** * Bind a function to the keyup event of each matched element . * @ param jsScope * Scope to use * @ return the jQuery code */ public static ChainableStatement keyup ( JsScope jsScope ) { } }
return new DefaultChainableStatement ( KeyboardEvent . KEYUP . getEventLabel ( ) , jsScope . render ( ) ) ;
public class GroupPermissionDao { /** * Delete a single permission . It can be : * < ul > * < li > a global permission granted to a group < / li > * < li > a global permission granted to anyone < / li > * < li > a permission granted to a group for a project < / li > * < li > a permission granted to anyone for...
mapper ( dbSession ) . delete ( permission , organizationUuid , groupId , rootComponentId ) ;
public class AWSServiceCatalogClient { /** * Gets information about the products for the specified portfolio or all products . * @ param searchProductsAsAdminRequest * @ return Result of the SearchProductsAsAdmin operation returned by the service . * @ throws ResourceNotFoundException * The specified resource w...
request = beforeClientExecution ( request ) ; return executeSearchProductsAsAdmin ( request ) ;
public class JarWithDependenciesMojo { /** * Generates the JAR . * @ todo Add license files in META - INF directory . */ public void execute ( ) throws MojoExecutionException { } }
getLog ( ) . debug ( "starting packaging" ) ; // complete jar getLog ( ) . debug ( "assembling complete jar" ) ; File completeFile = createArchive ( null ) ; getProject ( ) . getArtifact ( ) . setFile ( completeFile ) ; AbstractConfiguration [ ] configurations = ( AbstractConfiguration [ ] ) getPluginContext ( ) . get ...
public class CompilationUnit { /** * Adds a ClassNode directly to the unit ( ie . without source ) . * WARNING : the source is needed for error reporting , using * this method without setting a SourceUnit will cause * NullPinterExceptions */ public void addClassNode ( ClassNode node ) { } }
ModuleNode module = new ModuleNode ( this . ast ) ; this . ast . addModule ( module ) ; module . addClass ( node ) ;
public class MaskUtil { /** * Apply mask penalty rule 4 and return the penalty . Calculate the ratio of dark cells and give * penalty if the ratio is far from 50 % . It gives 10 penalty for 5 % distance . */ static int applyMaskPenaltyRule4 ( ByteMatrix matrix ) { } }
int numDarkCells = 0 ; byte [ ] [ ] array = matrix . getArray ( ) ; int width = matrix . getWidth ( ) ; int height = matrix . getHeight ( ) ; for ( int y = 0 ; y < height ; y ++ ) { byte [ ] arrayY = array [ y ] ; for ( int x = 0 ; x < width ; x ++ ) { if ( arrayY [ x ] == 1 ) { numDarkCells ++ ; } } } int numTotalCell...