idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
12,200 | public static Map createParamMap ( PageContext pContext ) { final HttpServletRequest request = ( HttpServletRequest ) pContext . getRequest ( ) ; return new EnumeratedMap ( ) { public Enumeration enumerateKeys ( ) { return request . getParameterNames ( ) ; } public Object getValue ( Object pKey ) { if ( pKey instanceof... | Creates the Map that maps parameter name to single parameter value . |
12,201 | public static Map createHeaderMap ( PageContext pContext ) { final HttpServletRequest request = ( HttpServletRequest ) pContext . getRequest ( ) ; return new EnumeratedMap ( ) { public Enumeration enumerateKeys ( ) { return request . getHeaderNames ( ) ; } public Object getValue ( Object pKey ) { if ( pKey instanceof S... | Creates the Map that maps header name to single header value . |
12,202 | public static Map createHeadersMap ( PageContext pContext ) { final HttpServletRequest request = ( HttpServletRequest ) pContext . getRequest ( ) ; return new EnumeratedMap ( ) { public Enumeration enumerateKeys ( ) { return request . getHeaderNames ( ) ; } public Object getValue ( Object pKey ) { if ( pKey instanceof ... | Creates the Map that maps header name to an array of header values . |
12,203 | public static Map createInitParamMap ( PageContext pContext ) { final ServletContext context = pContext . getServletContext ( ) ; return new EnumeratedMap ( ) { public Enumeration enumerateKeys ( ) { return context . getInitParameterNames ( ) ; } public Object getValue ( Object pKey ) { if ( pKey instanceof String ) { ... | Creates the Map that maps init parameter name to single init parameter value . |
12,204 | public int doStartTag ( ) throws JspException { try { SPathFilter s = new SPathFilter ( new SPathParser ( select ) . expression ( ) ) ; pageContext . setAttribute ( var , s ) ; return SKIP_BODY ; } catch ( ParseException ex ) { throw new JspTagException ( ex . toString ( ) , ex ) ; } } | applies XPath expression from select and exposes a filter as var |
12,205 | public boolean isMatchingName ( String uri , String localPart ) { if ( localPart == null ) throw new IllegalArgumentException ( "need non-null localPart" ) ; if ( uri != null && uri . equals ( "" ) ) uri = null ; if ( this . localPart == null && this . uri == null ) parseStepName ( ) ; if ( this . uri == null && this .... | Returns true if the given name matches the Step object s name taking into account the Step object s wildcards ; returns false otherwise . |
12,206 | private void parseStepName ( ) { String prefix ; int colonIndex = name . indexOf ( ":" ) ; if ( colonIndex == - 1 ) { prefix = null ; localPart = name ; } else { prefix = name . substring ( 0 , colonIndex ) ; localPart = name . substring ( colonIndex + 1 ) ; } uri = mapPrefix ( prefix ) ; } | Lazily computes some information about our name . |
12,207 | public static XPathContext getContext ( Tag child , PageContext pageContext ) { ForEachTag forEachTag = ( ForEachTag ) TagSupport . findAncestorWithClass ( child , ForEachTag . class ) ; if ( forEachTag != null ) { return forEachTag . getContext ( ) ; } XPathContext context = new XPathContext ( false ) ; VariableStack ... | Return the XPathContext to be used for evaluating expressions . |
12,208 | static Object coerceToJava ( XObject xo ) throws TransformerException { if ( xo instanceof XBoolean ) { return xo . bool ( ) ; } else if ( xo instanceof XNumber ) { return xo . num ( ) ; } else if ( xo instanceof XString ) { return xo . str ( ) ; } else if ( xo instanceof XNodeSet ) { NodeList nodes = xo . nodelist ( )... | Return the Java value corresponding to an XPath result . |
12,209 | public int doStartTag ( ) throws JspException { if ( end != - 1 && begin > end ) { return SKIP_BODY ; } index = 0 ; count = 1 ; last = false ; prepare ( ) ; discardIgnoreSubset ( begin ) ; if ( hasNext ( ) ) { item = next ( ) ; } else { return SKIP_BODY ; } discard ( step - 1 ) ; exposeVariables ( ) ; calibrateLast ( )... | Begins iterating by processing the first item . |
12,210 | private void calibrateLast ( ) throws JspTagException { last = ! hasNext ( ) || atEnd ( ) || ( end != - 1 && ( begin + index + step > end ) ) ; } | Sets last appropriately . |
12,211 | public static String postHexString ( String url , Map < String , String > queryParas , byte [ ] data , Map < String , String > headers ) { return HttpKit . post ( url , queryParas , HexKit . byteToHexString ( data ) , headers ) ; } | Send Hex String request |
12,212 | public static String post ( String url , Map < String , String > queryParas , byte [ ] data , Map < String , String > headers ) { return HttpKit . post ( url , queryParas , ( new String ( data ) ) , headers ) ; } | Send byte data by post request |
12,213 | public static String toStringToken ( String pValue ) { if ( pValue . indexOf ( '\"' ) < 0 && pValue . indexOf ( '\\' ) < 0 ) { return "\"" + pValue + "\"" ; } else { StringBuffer buf = new StringBuffer ( ) ; buf . append ( '\"' ) ; int len = pValue . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char ch = pValue . ... | Converts the specified value to a String token using as the enclosing quotes and escaping any characters that need escaping . |
12,214 | static boolean isJavaIdentifier ( String pValue ) { int len = pValue . length ( ) ; if ( len == 0 ) { return false ; } else { if ( ! Character . isJavaIdentifierStart ( pValue . charAt ( 0 ) ) ) { return false ; } else { for ( int i = 1 ; i < len ; i ++ ) { if ( ! Character . isJavaIdentifierPart ( pValue . charAt ( i ... | Returns true if the specified value is a legal java identifier |
12,215 | public static ValueExpression createValueExpression ( PageContext pageContext , String expression , Class < ? > expectedType ) { ExpressionFactory factory = getExpressionFactory ( pageContext ) ; return factory . createValueExpression ( pageContext . getELContext ( ) , expression , expectedType ) ; } | Create a value expression . |
12,216 | public static ExpressionFactory getExpressionFactory ( PageContext pageContext ) { JspApplicationContext appContext = JspFactory . getDefaultFactory ( ) . getJspApplicationContext ( pageContext . getServletContext ( ) ) ; return appContext . getExpressionFactory ( ) ; } | Return the JSP s ExpressionFactory . |
12,217 | public static < T > T evaluate ( ValueExpression expression , PageContext pageContext ) { if ( expression == null ) { return null ; } @ SuppressWarnings ( "unchecked" ) T value = ( T ) expression . getValue ( pageContext . getELContext ( ) ) ; return value ; } | Evaluate a value expression . To support optional attributes if the expression is null then null will be returned . |
12,218 | public static ExpressionEvaluator getEvaluatorByName ( String name ) throws JspException { try { ExpressionEvaluator evaluator = nameMap . get ( name ) ; if ( evaluator == null ) { nameMap . putIfAbsent ( name , ( ExpressionEvaluator ) Class . forName ( name ) . newInstance ( ) ) ; evaluator = nameMap . get ( name ) ; ... | Gets an ExpressionEvaluator from the cache or seeds the cache if we haven t seen a particular ExpressionEvaluator before . |
12,219 | public static Object coerce ( Object value , Class classe ) throws JspException { try { return Coercions . coerce ( value , classe , logger ) ; } catch ( ELException ex ) { throw new JspException ( ex ) ; } } | Performs a type conversion according to the EL s rules . |
12,220 | public Connection getConnection ( ) throws SQLException { Connection conn = null ; if ( driver != null ) { Properties props = new Properties ( ) ; if ( userName != null ) { props . put ( "user" , userName ) ; } if ( password != null ) { props . put ( "password" , password ) ; } conn = driver . connect ( jdbcURL , props... | Returns a Connection using the DriverManager and all set properties . |
12,221 | public Connection getConnection ( String username , String password ) throws SQLException { throw new SQLException ( Resources . getMessage ( "NOT_SUPPORTED" ) ) ; } | Always throws a SQLException . Username and password are set in the constructor and can not be changed . |
12,222 | public boolean isMatchingAttribute ( org . xml . sax . Attributes a ) { String attValue = a . getValue ( "" , attribute ) ; return ( attValue != null && attValue . equals ( target ) ) ; } | Returns true if the given SAX AttributeList is suitable given our attribute name and target ; returns false otherwise . |
12,223 | public static String replace ( String input , String before , String after ) { if ( before . length ( ) == 0 ) { return input ; } return input . replace ( before , after ) ; } | Returns a string resulting from replacing all occurrences of a before substring with an after substring . The string is processed once and not reprocessed for further replacements . |
12,224 | public static Class getPrimitiveObjectClass ( Class pClass ) { if ( pClass == Boolean . TYPE ) { return Boolean . class ; } else if ( pClass == Byte . TYPE ) { return Byte . class ; } else if ( pClass == Short . TYPE ) { return Short . class ; } else if ( pClass == Character . TYPE ) { return Character . class ; } else... | If the given class is a primitive class returns the object version of that class . Otherwise the class is just returned . |
12,225 | public int doStartTag ( ) throws JspException { try { XPathContext context = XalanUtil . getContext ( this , pageContext ) ; XObject result = select . execute ( context , context . getCurrentNode ( ) , null ) ; pageContext . setAttribute ( var , XalanUtil . coerceToJava ( result ) , scope ) ; return SKIP_BODY ; } catch... | applies XPath expression from select and stores the result in var |
12,226 | private boolean isPrivateIp ( String address ) { InetAddress ip ; try { ip = InetAddress . getByName ( address ) ; } catch ( UnknownHostException e ) { return false ; } return ip . isLoopbackAddress ( ) || ip . isLinkLocalAddress ( ) || ip . isSiteLocalAddress ( ) ; } | Determine whether or not the provided address is private . |
12,227 | private String getRedirectUrl ( HttpServletRequest request , String newScheme ) { String serverName = request . getServerName ( ) ; String uri = request . getRequestURI ( ) ; StringBuilder redirect = new StringBuilder ( 100 ) ; redirect . append ( newScheme ) ; redirect . append ( "://" ) ; redirect . append ( serverNa... | Return the full URL that should be redirected to including query parameters . |
12,228 | public String format ( Comment comment ) { if ( comment == null ) { return "" ; } StringBuilder sb = new StringBuilder ( ) ; for ( CommentElement e : comment ) { if ( e instanceof CommentText ) { sb . append ( renderText ( ( CommentText ) e ) ) ; } else if ( e instanceof InlineLink ) { sb . append ( renderLink ( ( Inli... | Render the comment as an HTML String . |
12,229 | public static void loadProps ( Properties props , File file ) throws IOException { FileInputStream fis = null ; try { fis = new FileInputStream ( file ) ; props . load ( fis ) ; } finally { if ( null != fis ) { fis . close ( ) ; } } } | Loads in the properties file |
12,230 | public static String normalize ( final CharSequence src , final Form form ) { return normalize ( src . toString ( ) , form ) ; } | Normalize a sequence of char values . The sequence will be normalized according to the specified normalization from . |
12,231 | public static boolean isNormalized ( final CharSequence src , final Form form ) { return StringUtils . equals ( src . toString ( ) , normalize ( src . toString ( ) , form ) ) ; } | Determines if the given sequence of char values is normalized . |
12,232 | public static void assertNotEmpty ( final String pstring , final String pmessage ) { if ( pstring == null || pstring . length ( ) == 0 ) { throw new IllegalArgumentException ( pmessage ) ; } } | check if a string is not empty . |
12,233 | public T getMin ( ) { if ( StringUtils . isEmpty ( getInputElement ( ) . getMin ( ) ) ) { return null ; } try { return this . numberParser . parse ( getInputElement ( ) . getMin ( ) ) ; } catch ( final ParseException e ) { return null ; } } | get minimum allowed value . |
12,234 | public T getMax ( ) { if ( StringUtils . isEmpty ( getInputElement ( ) . getMax ( ) ) ) { return null ; } try { return this . numberParser . parse ( getInputElement ( ) . getMax ( ) ) ; } catch ( final ParseException e ) { return null ; } } | get maximum allowed value . |
12,235 | private static boolean isIPv4MappedAddress ( final byte [ ] addr ) { if ( addr . length < INADDR16SZ ) { return false ; } return addr [ 0 ] == 0x00 && addr [ 1 ] == 0x00 && addr [ 2 ] == 0x00 && addr [ 3 ] == 0x00 && addr [ 4 ] == 0x00 && addr [ 5 ] == 0x00 && addr [ 6 ] == 0x00 && addr [ 7 ] == 0x00 && addr [ 8 ] == 0... | Utility routine to check if the InetAddress is an IPv4 mapped IPv6 address . |
12,236 | public void copyFactor ( DDF ddf , List < String > columns ) throws DDFException { if ( columns == null ) { columns = new ArrayList < String > ( ) ; } for ( Schema . Column col : ddf . getSchema ( ) . getColumns ( ) ) { if ( this . getDDF ( ) . getColumn ( col . getName ( ) ) != null && col . getColumnClass ( ) == Sche... | Transfer factor information from ddf to this DDF |
12,237 | public static < T > ValueBox < T > wrap ( final Element element , final Renderer < T > renderer , final Parser < T > parser ) { assert Document . get ( ) . getBody ( ) . isOrHasChild ( element ) ; final ValueBox < T > valueBox = new ValueBox < > ( element , renderer , parser ) ; valueBox . onAttach ( ) ; RootPanel . de... | Creates a ValueBox widget that wraps an existing < ; input type = text > ; element . |
12,238 | public static < T > void fire ( final HasFormSubmitHandlers < T > source , final T value ) { if ( type != null ) { final FormSubmitEvent < T > event = new FormSubmitEvent < > ( value ) ; source . fireEvent ( event ) ; } } | Fires a form submit event on all registered handlers in the handler manager . If no such handlers exist this method will do nothing . |
12,239 | private boolean checkAtVatId ( final String pvatId ) { final int checkSum = pvatId . charAt ( 10 ) - '0' ; final int sum = pvatId . charAt ( 3 ) - '0' + squareSum ( ( pvatId . charAt ( 4 ) - '0' ) * 2 ) + pvatId . charAt ( 5 ) - '0' + squareSum ( ( pvatId . charAt ( 6 ) - '0' ) * 2 ) + pvatId . charAt ( 7 ) - '0' + squ... | check the VAT identification number country version for Austria . |
12,240 | private boolean checkBeVatId ( final String pvatId ) { final int numberPart = Integer . parseInt ( pvatId . substring ( 2 , 10 ) ) ; final int checkSum = Integer . parseInt ( pvatId . substring ( 10 ) ) ; final int calculatedCheckSumBe = MODULO_97 - numberPart % MODULO_97 ; return checkSum == calculatedCheckSumBe ; } | check the VAT identification number country version for Belgium . |
12,241 | private boolean checkDkVatId ( final String pvatId ) { final int sum = ( pvatId . charAt ( 2 ) - '0' ) * 2 + ( pvatId . charAt ( 3 ) - '0' ) * 7 + ( pvatId . charAt ( 4 ) - '0' ) * 6 + ( pvatId . charAt ( 5 ) - '0' ) * 5 + ( pvatId . charAt ( 6 ) - '0' ) * 4 + ( pvatId . charAt ( 7 ) - '0' ) * 3 + ( pvatId . charAt ( 8... | check the VAT identification number country version for Denmark . |
12,242 | private boolean checkDeVatId ( final String pvatId ) { final int checkSum = pvatId . charAt ( 10 ) - '0' ; int sum = 10 ; for ( int i = 2 ; i < 10 ; i ++ ) { int summe = ( pvatId . charAt ( i ) - '0' + sum ) % 10 ; if ( summe == 0 ) { summe = 10 ; } sum = 2 * summe % MODULO_11 ; } int calculatedCheckSum = MODULO_11 - s... | check the VAT identification number country version for Germany . |
12,243 | private boolean checkFiVatId ( final String pvatId ) { final int checkSum = pvatId . charAt ( 9 ) - '0' ; final int sum = ( pvatId . charAt ( 2 ) - '0' ) * 7 + ( pvatId . charAt ( 3 ) - '0' ) * 9 + ( pvatId . charAt ( 4 ) - '0' ) * 10 + ( pvatId . charAt ( 5 ) - '0' ) * 5 + ( pvatId . charAt ( 6 ) - '0' ) * 8 + ( pvatI... | check the VAT identification number country version for Finland . |
12,244 | private boolean checkFrVatId ( final String pvatId ) { final int checkSum = Integer . parseInt ( pvatId . substring ( 2 , 4 ) ) ; final int sum = Integer . parseInt ( pvatId . substring ( 4 ) ) ; final int calculatedCheckSum = ( 12 + 3 * ( sum % MODULO_97 ) ) % MODULO_97 ; return checkSum == calculatedCheckSum ; } | check the VAT identification number country version for France . |
12,245 | private boolean checkGrVatId ( final String pvatId ) { final int checkSum = pvatId . charAt ( 10 ) - '0' ; final int sum = ( pvatId . charAt ( 2 ) - '0' ) * 256 + ( pvatId . charAt ( 3 ) - '0' ) * 128 + ( pvatId . charAt ( 4 ) - '0' ) * 64 + ( pvatId . charAt ( 5 ) - '0' ) * 32 + ( pvatId . charAt ( 6 ) - '0' ) * 16 + ... | check the VAT identification number country version for Greece . |
12,246 | private boolean checkIeVatId ( final String pvatId ) { final char checkSum = pvatId . charAt ( 9 ) ; String vatId = pvatId ; if ( pvatId . charAt ( 3 ) >= 'A' && pvatId . charAt ( 3 ) <= 'Z' ) { vatId = pvatId . substring ( 0 , 2 ) + "0" + pvatId . substring ( 4 , 9 ) + pvatId . substring ( 2 , 3 ) + pvatId . substring... | check the VAT identification number country version for Ireland . |
12,247 | private boolean checkItVatId ( final String pvatId ) { final int checkSum = pvatId . charAt ( 12 ) - '0' ; final int sum = pvatId . charAt ( 2 ) - '0' + squareSum ( ( pvatId . charAt ( 3 ) - '0' ) * 2 ) + pvatId . charAt ( 4 ) - '0' + squareSum ( ( pvatId . charAt ( 5 ) - '0' ) * 2 ) + pvatId . charAt ( 6 ) - '0' + squ... | check the VAT identification number country version for Italy . |
12,248 | private boolean checkLuVatId ( final String pvatId ) { final int numberPart = Integer . parseInt ( pvatId . substring ( 2 , 8 ) ) ; final int checkSum = Integer . parseInt ( pvatId . substring ( 8 ) ) ; final int calculatedCheckSum = numberPart % 89 ; return checkSum == calculatedCheckSum ; } | check the VAT identification number country version for Luxembourg . |
12,249 | private boolean checkNlVatId ( final String pvatId ) { final int checkSum = pvatId . charAt ( 10 ) - '0' ; final int sum = ( pvatId . charAt ( 2 ) - '0' ) * 9 + ( pvatId . charAt ( 3 ) - '0' ) * 8 + ( pvatId . charAt ( 4 ) - '0' ) * 7 + ( pvatId . charAt ( 5 ) - '0' ) * 6 + ( pvatId . charAt ( 6 ) - '0' ) * 5 + ( pvatI... | check the VAT identification number country version for Netherlands . |
12,250 | private boolean checkNoVatId ( final String pvatId ) { final int checkSum = pvatId . charAt ( 10 ) - '0' ; final int sum = ( pvatId . charAt ( 2 ) - '0' ) * 3 + ( pvatId . charAt ( 3 ) - '0' ) * 2 + ( pvatId . charAt ( 4 ) - '0' ) * 7 + ( pvatId . charAt ( 5 ) - '0' ) * 6 + ( pvatId . charAt ( 6 ) - '0' ) * 5 + ( pvatI... | check the VAT identification number country version for Norway . |
12,251 | private boolean checkPlVatId ( final String pvatId ) { final int checkSum = pvatId . charAt ( 11 ) - '0' ; final int sum = ( pvatId . charAt ( 2 ) - '0' ) * 6 + ( pvatId . charAt ( 3 ) - '0' ) * 5 + ( pvatId . charAt ( 4 ) - '0' ) * 7 + ( pvatId . charAt ( 5 ) - '0' ) * 2 + ( pvatId . charAt ( 6 ) - '0' ) * 3 + ( pvatI... | check the VAT identification number country version for Poland . |
12,252 | private boolean checkPtVatId ( final String pvatId ) { final int checkSum = pvatId . charAt ( 10 ) - '0' ; final int sum = ( pvatId . charAt ( 2 ) - '0' ) * 9 + ( pvatId . charAt ( 3 ) - '0' ) * 8 + ( pvatId . charAt ( 4 ) - '0' ) * 7 + ( pvatId . charAt ( 5 ) - '0' ) * 6 + ( pvatId . charAt ( 6 ) - '0' ) * 5 + ( pvatI... | check the VAT identification number country version for Portugal . |
12,253 | private boolean checkSeVatId ( final String pvatId ) { final int checkSum = pvatId . charAt ( 11 ) - '0' ; final int sum = squareSum ( ( pvatId . charAt ( 2 ) - '0' ) * 2 ) + pvatId . charAt ( 3 ) - '0' + squareSum ( ( pvatId . charAt ( 4 ) - '0' ) * 2 ) + pvatId . charAt ( 5 ) - '0' + squareSum ( ( pvatId . charAt ( 6... | check the VAT identification number country version for Sweden . |
12,254 | private boolean checkSiVatId ( final String pvatId ) { boolean checkSumOk ; final int checkSum = pvatId . charAt ( 9 ) - '0' ; final int sum = ( pvatId . charAt ( 2 ) - '0' ) * 8 + ( pvatId . charAt ( 3 ) - '0' ) * 7 + ( pvatId . charAt ( 4 ) - '0' ) * 6 + ( pvatId . charAt ( 5 ) - '0' ) * 5 + ( pvatId . charAt ( 6 ) -... | check the VAT identification number country version for Slovenia . |
12,255 | private static int squareSum ( final int pvalue ) { int result = 0 ; for ( final char valueDigit : String . valueOf ( pvalue ) . toCharArray ( ) ) { result += Character . digit ( valueDigit , 10 ) ; } return result ; } | calculate square sum . |
12,256 | @ SuppressWarnings ( "checkstyle:rightCurly" ) boolean isAncestor ( final ClassLoader cl ) { ClassLoader acl = this ; do { acl = acl . parent ; if ( Objects . equals ( cl , acl ) ) { return true ; } } while ( acl != null ) ; return false ; } | loader s delegation chain . |
12,257 | public static String getValueWithGlobalDefault ( String section , ConfigConstant key ) { String value = getValue ( section , key ) ; return ( Strings . isNullOrEmpty ( value ) ? getGlobalValue ( key ) : value ) ; } | If the named section does not have the value then try the same key from the global section |
12,258 | @ ExceptionHandler ( MethodArgumentNotValidException . class ) @ ResponseStatus ( HttpStatus . BAD_REQUEST ) public ValidationResultInterface processValidationError ( final MethodArgumentNotValidException pexception ) { final BindingResult result = pexception . getBindingResult ( ) ; final List < FieldError > fieldErro... | handle validation errors . |
12,259 | public static Optional < File > resolvePluginDependency ( Dependency d , List < RemoteRepository > pluginRepos , ArtifactResolver resolver , RepositorySystemSession repoSystemSession ) { Artifact a = new DefaultArtifact ( d . getGroupId ( ) , d . getArtifactId ( ) , d . getClassifier ( ) , d . getType ( ) , d . getVers... | Uses the aether to resolve a plugin dependency and returns the file for further processing . |
12,260 | public static < T extends User , V extends EditorWithErrorHandling < ? , ? > , M extends LoginMessages , H extends HttpMessages > LoginCallback < T , V , M , H > buildLoginCallback ( final V pview , final Session psession , final M ploginErrorMessage ) { return new LoginCallback < > ( pview , psession , ploginErrorMess... | create login callback implementation . |
12,261 | private void fillEntries ( final Collection < T > pids ) { this . entries . clear ( ) ; final Stream < IdAndNameBean < T > > stream = pids . stream ( ) . map ( proEnum -> new IdAndNameBean < > ( proEnum , this . messages . name ( proEnum ) ) ) ; final Stream < IdAndNameBean < T > > sortedStream ; if ( this . sortOrder ... | fill entries of the radio buttons . |
12,262 | public void createRecursiveNavigation ( final TreeItem pitem , final List < NavigationEntryInterface > plist , final NavigationEntryInterface pactiveEntry ) { for ( final NavigationEntryInterface navEntry : plist ) { final TreeItem newItem ; if ( navEntry instanceof NavigationEntryFolder ) { newItem = new TreeItem ( na... | create navigation in a recursive way . |
12,263 | @ UiHandler ( "navTree" ) final void menuItemSelected ( final SelectionEvent < TreeItem > pselectionEvent ) { if ( selectedItem != null && ! selectedItem . equals ( pselectionEvent . getSelectedItem ( ) ) ) { pselectionEvent . getSelectedItem ( ) . setSelected ( false ) ; selectedItem . setSelected ( true ) ; } } | menu item is selected in the menu tree . |
12,264 | public PropertyDescriptorImpl shallowCopy ( ) { final ConstraintDescriptorImpl < ? > [ ] desc = new ConstraintDescriptorImpl < ? > [ descriptors . size ( ) ] ; descriptors . toArray ( desc ) ; return new PropertyDescriptorImpl ( name , elementClass , cascaded , parentBeanMetadata , validationGroupsMetadata , desc ) ; } | create a copy of this instance and return it . |
12,265 | public static ConstraintViolationException instantiate ( final SerializationStreamReader streamReader ) throws SerializationException { final String message = streamReader . readString ( ) ; @ SuppressWarnings ( "unchecked" ) final Set < ConstraintViolation < ? > > set = ( Set < ConstraintViolation < ? > > ) streamRead... | instantiate constraint violation exception . |
12,266 | public final SourceWriter getSourceWriter ( final JClassType pclassType , final GeneratorContext pcontext , final TreeLogger plogger ) { final String packageName = pclassType . getPackage ( ) . getName ( ) ; final String simpleName = pclassType . getSimpleSourceName ( ) + "Generated" ; final ClassSourceFileComposerFact... | get source writer for the generator . |
12,267 | public GroupChain getGroupChainFor ( final Collection < Class < ? > > groups ) { if ( groups == null || groups . isEmpty ( ) ) { throw new IllegalArgumentException ( "At least one group has to be specified." ) ; } groups . forEach ( clazz -> { if ( ! validationGroupsMetadata . containsGroup ( clazz ) && ! validationGro... | Generates a chain of groups to be validated given the specified validation groups . |
12,268 | private void insertInheritedGroups ( final Class < ? > clazz , final GroupChain chain ) { validationGroupsMetadata . getParentsOfGroup ( clazz ) . forEach ( inheritedGroup -> { final Group group = new Group ( inheritedGroup ) ; chain . insertGroup ( group ) ; insertInheritedGroups ( inheritedGroup , chain ) ; } ) ; } | Recursively add inherited groups into the group chain . |
12,269 | public void init ( final ConstraintValidatorFactory factory , final MessageInterpolator messageInterpolator , final TraversableResolver traversableResolver , final ParameterNameProvider pparameterNameProvider ) { contraintValidatorFactory = factory ; this . messageInterpolator = messageInterpolator ; this . traversable... | initialize values . |
12,270 | public String getList ( ) { String result = "" ; int i = 1 ; for ( String s : mReps . keySet ( ) ) { result += ( i ++ ) + ". key='" + s + "', value='" + mReps . get ( s ) + "'\n" ; } return result ; } | Returns a String list of current representations useful for debugging |
12,271 | @ SuppressWarnings ( { "unchecked" } ) public final ArrayList < ConstraintViolation < ? > > getValidationErrorSet ( final Object pclass ) { return new ArrayList < > ( validationErrorSet . stream ( ) . map ( violation -> ConstraintViolationImpl . forBeanValidation ( violation . getMessageTemplate ( ) , Collections . emp... | get validation error set . |
12,272 | @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public final void setValidationErrorSet ( final Set pvalidationErrorSet ) { validationErrorSet = new ArrayList < > ( ( List < SerializeableConstraintValidationImpl < ? > > ) pvalidationErrorSet . stream ( ) . map ( violation -> new SerializeableConstraintValidationImp... | set validation error set . |
12,273 | @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public void initializeEditors ( final Object editor ) { if ( editor instanceof HasValueChangeHandlers && valueChangeHandler != null ) { ( ( HasValueChangeHandlers ) editor ) . addValueChangeHandler ( valueChangeHandler ) ; if ( validateOnVueChangeHandler != null ) { (... | initialize one editor . |
12,274 | public final String create ( ) throws UnableToCompleteException { final SourceWriter sourceWriter = getSourceWriter ( logger , context ) ; if ( sourceWriter != null ) { writeClassBody ( sourceWriter ) ; sourceWriter . commit ( logger ) ; } return getQualifiedName ( ) ; } | create logger . |
12,275 | public static String getSystemProperty ( String dKey , String shellKey , String defautValue ) { String value = System . getProperty ( dKey ) ; if ( value == null || value . length ( ) == 0 ) { value = System . getenv ( shellKey ) ; if ( value == null || value . length ( ) == 0 ) { value = defautValue ; } } return value... | Get system property |
12,276 | private boolean checkEsTin ( final String ptin ) { final char [ ] checkArray = { 'T' , 'R' , 'W' , 'A' , 'G' , 'M' , 'Y' , 'F' , 'P' , 'D' , 'X' , 'B' , 'N' , 'J' , 'Z' , 'S' , 'Q' , 'V' , 'H' , 'L' , 'C' , 'K' , 'E' } ; final char checkSum = ptin . charAt ( 8 ) ; final char calculatedCheckSum ; final int sum ; if ( St... | check the Tax Identification Number number country version for Spain . |
12,277 | public final void setCountryCode ( final String pcountryCode , final Locale plocale ) { if ( StringUtils . isEmpty ( pcountryCode ) ) { defaultCountryData = null ; } else { defaultCountryData = CreatePhoneCountryConstantsClass . create ( plocale ) . countryMap ( ) . get ( pcountryCode ) ; } } | set country code . |
12,278 | public final String formatE123International ( final String pphoneNumber , final String pcountryCode ) { return this . formatE123International ( this . parsePhoneNumber ( pphoneNumber , pcountryCode ) ) ; } | format phone number in E123 international format . |
12,279 | public final String formatE123National ( final String pphoneNumber , final String pcountryCode ) { return this . formatE123National ( this . parsePhoneNumber ( pphoneNumber , pcountryCode ) ) ; } | format phone number in E123 national format . |
12,280 | public final String formatDin5008 ( final PhoneNumberInterface pphoneNumberData , final PhoneCountryData pcountryData ) { if ( pphoneNumberData != null && StringUtils . equals ( pcountryData . getCountryCodeData ( ) . getCountryCode ( ) , pphoneNumberData . getCountryCode ( ) ) ) { return this . formatDin5008National (... | format phone number in DIN 5008 format . |
12,281 | public final String formatDin5008National ( final String pphoneNumber , final String pcountryCode ) { return this . formatDin5008National ( this . parsePhoneNumber ( pphoneNumber , pcountryCode ) ) ; } | format phone number in DIN 5008 national format . |
12,282 | public final String formatRfc3966 ( final String pphoneNumber , final String pcountryCode ) { return this . formatRfc3966 ( this . parsePhoneNumber ( pphoneNumber , pcountryCode ) ) ; } | format phone number in RFC 3966 format . |
12,283 | public final String formatMs ( final String pphoneNumber , final String pcountryCode ) { return this . formatMs ( this . parsePhoneNumber ( pphoneNumber , pcountryCode ) ) ; } | format phone number in Microsoft canonical address format . |
12,284 | public final String formatCommon ( final PhoneNumberInterface pphoneNumberData , final PhoneCountryData pcountryData ) { if ( pphoneNumberData != null && pcountryData != null && StringUtils . equals ( pcountryData . getCountryCodeData ( ) . getCountryCode ( ) , pphoneNumberData . getCountryCode ( ) ) ) { return this . ... | format phone number in common format . |
12,285 | public final String formatCommonInternational ( final String pphoneNumber , final String pcountryCode ) { return this . formatCommonInternational ( this . parsePhoneNumber ( pphoneNumber , pcountryCode ) ) ; } | format phone number in common international format . |
12,286 | public final String formatCommonNational ( final String pphoneNumber , final String pcountryCode ) { return this . formatCommonNational ( this . parsePhoneNumber ( pphoneNumber , pcountryCode ) ) ; } | format phone number in common national format . |
12,287 | public final String formatCommonNational ( final PhoneNumberInterface pphoneNumberData ) { final StringBuilder resultNumber = new StringBuilder ( ) ; if ( isPhoneNumberNotEmpty ( pphoneNumberData ) ) { PhoneCountryData phoneCountryData = null ; for ( final PhoneCountryCodeData country : CreatePhoneCountryConstantsClass... | format phone number in Common national format . |
12,288 | public final boolean isPhoneNumberEmpty ( final PhoneNumberInterface pphoneNumberData ) { return pphoneNumberData == null || StringUtils . isBlank ( pphoneNumberData . getCountryCode ( ) ) || StringUtils . isBlank ( pphoneNumberData . getLineNumber ( ) ) ; } | check if phone number is empty . |
12,289 | public GwtValidationContext < T > appendIndex ( final String name , final int index ) { final GwtValidationContext < T > temp = new GwtValidationContext < > ( this . rootBeanClass , this . rootBean , this . beanDescriptor , this . messageInterpolator , this . traversableResolver , this . validator , this . validatedObj... | Append an indexed node to the path . |
12,290 | public GwtValidationContext < T > appendIterable ( final String name ) { final GwtValidationContext < T > temp = new GwtValidationContext < > ( this . rootBeanClass , this . rootBean , this . beanDescriptor , this . messageInterpolator , this . traversableResolver , this . validator , this . validatedObjects ) ; temp .... | Append an iterable node to the path . |
12,291 | public GwtValidationContext < T > appendKey ( final String name , final Object key ) { final GwtValidationContext < T > temp = new GwtValidationContext < > ( this . rootBeanClass , this . rootBean , this . beanDescriptor , this . messageInterpolator , this . traversableResolver , this . validator , this . validatedObje... | Append a keyed node to the path . |
12,292 | public < A extends Annotation , V > ConstraintValidatorContextImpl < A , V > createConstraintValidatorContext ( final ConstraintDescriptor < A > descriptor ) { return new ConstraintValidatorContextImpl < > ( PathImpl . createCopy ( this . path ) , descriptor ) ; } | create constraint validator context . |
12,293 | public DDF groupBy ( List < String > groupedColumns , List < String > aggregateFunctions ) throws DDFException { mGroupedColumns = groupedColumns ; return agg ( aggregateFunctions ) ; } | dplyr - like |
12,294 | public static void prepare ( ) throws InterruptedException { semaphore . acquire ( ) ; if ( cacheReference == masterCache ) { slaveCache . clear ( ) ; } else { masterCache . clear ( ) ; } } | Prepare to build cache |
12,295 | public static void switchCache ( ) throws InterruptedException { if ( cacheReference == masterCache ) { cacheReference = slaveCache ; masterCache . clear ( ) ; } else { cacheReference = masterCache ; slaveCache . clear ( ) ; } } | Switch online and standby cache |
12,296 | public static TextBox wrap ( final Element element ) { assert Document . get ( ) . getBody ( ) . isOrHasChild ( element ) ; final TextBox textBox = new TextBox ( element ) ; textBox . onAttach ( ) ; RootPanel . detachOnWindowClose ( textBox ) ; return textBox ; } | Creates a TextBox widget that wraps an existing < ; input type = text > ; element . |
12,297 | static < T > Predicate < T > createMostSpecificMatchPredicate ( final Iterable < T > source , final Function < T , Class < ? > > toClass ) { return input -> { final Class < ? > inputClass = toClass . apply ( input ) ; for ( final Class < ? > match : Iterables . transform ( source , toClass ) ) { if ( ! inputClass . equ... | Creates a Predicate that returns false if source contains an associated class that is a super type of the class associated with the tested T . |
12,298 | static Set < Class < ? > > findBestMatches ( final Class < ? > target , final Set < Class < ? > > availableClasses ) { final Set < Class < ? > > matches = new HashSet < > ( ) ; if ( availableClasses . contains ( target ) ) { return ImmutableSet . < Class < ? > > of ( target ) ; } else { for ( final Class < ? > clazz : ... | Selects first only the classes that are assignable from the target and then returns the most specific matching classes . |
12,299 | @ SuppressWarnings ( "checkstyle:rightCurly" ) static < T > ImmutableList < T > sortMostSpecificFirst ( final Iterable < T > classes , final Function < T , Class < ? > > toClass ) { final List < T > working = Lists . newArrayList ( ) ; for ( final T t : classes ) { if ( ! working . contains ( t ) ) { working . add ( t ... | Returns a Immutable List sorted with the most specific associated class first . Each element is guaranteed to not be assignable to any element that appears before it in the list . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.