idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
7,400 | public FineUploader5DeleteFile setMethod ( final EHttpMethod eMethod ) { ValueEnforcer . notNull ( eMethod , "Method" ) ; m_eDeleteFileMethod = eMethod ; return this ; } | Set the method to use for delete requests . Accepts POST or DELETE . |
7,401 | public List < JavaComment > javaDocOnly ( final List < JavaComment > originals ) { final List < JavaComment > results = new ArrayList < JavaComment > ( originals . size ( ) ) ; for ( JavaComment comment : originals ) { comment . _switch ( new JavaComment . SwitchBlockWithDefault ( ) { public void _case ( JavaDocComment x ) { results . add ( x ) ; } protected void _default ( JavaComment x ) { } } ) ; } return results ; } | Turns a list of JavaComment into list of comments that only has javadoc comments |
7,402 | public List < JavaComment > stripTags ( final Set < String > tagNames , List < JavaComment > originals ) { final List < JavaComment > results = new ArrayList < JavaComment > ( originals . size ( ) ) ; for ( JavaComment original : originals ) { results . add ( original . match ( new JavaComment . MatchBlock < JavaComment > ( ) { public JavaComment _case ( JavaDocComment x ) { final List < JDTagSection > newTagSections = new ArrayList < JDTagSection > ( x . tagSections . size ( ) ) ; for ( JDTagSection tagSection : x . tagSections ) { if ( ! tagNames . contains ( tagSection . name ) ) { newTagSections . add ( tagSection ) ; } } return _JavaDocComment ( x . start , x . generalSection , newTagSections , x . end ) ; } public JavaComment _case ( JavaBlockComment x ) { return x ; } public JavaComment _case ( JavaEOLComment x ) { return x ; } } ) ) ; } return results ; } | Produce a copy of a list of comments where all javadoc comments have had the specified tags removed . Non javadoc comments are left alone . |
7,403 | public List < JavaComment > paramDoc ( final String paramName , List < JavaComment > originals ) { final List < JavaComment > results = new ArrayList < JavaComment > ( originals . size ( ) ) ; for ( JavaComment original : originals ) { original . _switch ( new JavaComment . SwitchBlock ( ) { public void _case ( JavaDocComment x ) { paramDocSections ( paramName , x . tagSections , results ) ; } public void _case ( JavaBlockComment x ) { } public void _case ( JavaEOLComment x ) { } } ) ; } return results ; } | Produce a copy of a list of JavaDoc comments by pulling specified parameter tags out of an orignal list of comments . Block and EOL comments are skipped . JavaDoc comments are stripped down to only have the content of the specified param tag |
7,404 | void set ( final int intVal ) { this . type = ClassWriter . INT ; this . intVal = intVal ; this . hashCode = 0x7FFFFFFF & ( type + intVal ) ; } | Sets this item to an integer item . |
7,405 | void set ( final long longVal ) { this . type = ClassWriter . LONG ; this . longVal = longVal ; this . hashCode = 0x7FFFFFFF & ( type + ( int ) longVal ) ; } | Sets this item to a long item . |
7,406 | void set ( final float floatVal ) { this . type = ClassWriter . FLOAT ; this . intVal = Float . floatToRawIntBits ( floatVal ) ; this . hashCode = 0x7FFFFFFF & ( type + ( int ) floatVal ) ; } | Sets this item to a float item . |
7,407 | void set ( final double doubleVal ) { this . type = ClassWriter . DOUBLE ; this . longVal = Double . doubleToRawLongBits ( doubleVal ) ; this . hashCode = 0x7FFFFFFF & ( type + ( int ) doubleVal ) ; } | Sets this item to a double item . |
7,408 | void set ( String name , String desc , int bsmIndex ) { this . type = ClassWriter . INDY ; this . longVal = bsmIndex ; this . strVal1 = name ; this . strVal2 = desc ; this . hashCode = 0x7FFFFFFF & ( ClassWriter . INDY + bsmIndex * strVal1 . hashCode ( ) * strVal2 . hashCode ( ) ) ; } | Sets the item to an InvokeDynamic item . |
7,409 | void set ( int position , int hashCode ) { this . type = ClassWriter . BSM ; this . intVal = position ; this . hashCode = hashCode ; } | Sets the item to a BootstrapMethod item . |
7,410 | public synchronized boolean isClassAffected ( String className ) { if ( isOnMustRunList ( className ) ) { return true ; } boolean isAffected = true ; String fullMethodName = className + "." + CLASS_EXT ; Set < RegData > regData = mStorer . load ( mRootDir , className , CLASS_EXT ) ; isAffected = isAffected ( regData ) ; recordTestAffectedOutcome ( fullMethodName , isAffected ) ; return isAffected ; } | Checks if class is affected since the last run . |
7,411 | private boolean isExcluded ( String fullMethodName ) { if ( mExcludes != null ) { for ( String s : mExcludes ) { if ( fullMethodName . startsWith ( s ) ) { return true ; } } } return false ; } | Checks if user requested that the given name is always run . True if this name has to be always run false otherwise . |
7,412 | private boolean hasHashChanged ( Set < RegData > regData ) { for ( RegData el : regData ) { if ( hasHashChanged ( mHasher , el ) ) { Log . d ( "CHANGED" , el . getURLExternalForm ( ) ) ; return true ; } } return false ; } | Hashes files and compares with the old hashes . If any hash is different returns true ; false otherwise . |
7,413 | private boolean hasHashChanged ( Hasher hasher , RegData regDatum ) { String urlExternalForm = regDatum . getURLExternalForm ( ) ; Boolean modified = mUrlExternalForm2Modified . get ( urlExternalForm ) ; if ( modified != null ) { return modified ; } String newHash = hasher . hashURL ( urlExternalForm ) ; modified = ! newHash . equals ( regDatum . getHash ( ) ) ; mUrlExternalForm2Modified . put ( urlExternalForm , modified ) ; return modified ; } | Hashes file and compares with the old hash . If hashes are different return true ; false otherwise |
7,414 | public FineUploader5Blobs setDefaultName ( final String sDefaultName ) { ValueEnforcer . notEmpty ( sDefaultName , "DefaultName" ) ; m_sBlobsDefaultName = sDefaultName ; return this ; } | The default name to be used for nameless Blobs . |
7,415 | protected String getObjectDisplayName ( final WPECTYPE aWPEC , final DATATYPE aObject ) { return null ; } | Get the display name of the passed object . |
7,416 | public static IIcon get ( final EDefaultIcon eDefaultIcon ) { if ( eDefaultIcon == null ) return null ; return s_aMap . get ( eDefaultIcon ) ; } | Get the icon assigned to the passed default icon . |
7,417 | public static void set ( final EDefaultIcon eDefaultIcon , final IIcon aIcon ) { ValueEnforcer . notNull ( eDefaultIcon , "DefaultIcon" ) ; if ( aIcon != null ) s_aMap . put ( eDefaultIcon , aIcon ) ; else s_aMap . remove ( eDefaultIcon ) ; } | Set the icon to be used for the specified default icon . Existing definitions are simply overwritten . |
7,418 | public FineUploader5Session setEndpoint ( final ISimpleURL aEndpoint ) { ValueEnforcer . notNull ( aEndpoint , "Endpoint" ) ; m_aSessionEndpoint = aEndpoint ; return this ; } | If non - null Fine Uploader will send a GET request on startup to this endpoint expecting a JSON response containing data about the initial file list to populate . |
7,419 | protected UserDataObject getUserDataObject ( final IRequestWebScopeWithoutResponse aRequestScope , final String sFilename ) { final String sFilename1 = URLHelper . urlDecode ( sFilename ) ; return new UserDataObject ( sFilename1 ) ; } | Get the user data object matching the passed request and filename |
7,420 | public static void setUserDataPath ( final String sUserDataPath ) { ValueEnforcer . isTrue ( StringHelper . getLength ( sUserDataPath ) >= 2 , "userDataPath is too short" ) ; ValueEnforcer . isTrue ( StringHelper . startsWith ( sUserDataPath , '/' ) , "userDataPath must start with a slash" ) ; s_aRWLock . writeLocked ( ( ) -> s_sUserDataPath = sUserDataPath ) ; } | Set the user data path relative to the URL context and relative to the servlet context directory . |
7,421 | public static FileSystemResource getResource ( final IUserDataObject aUDO ) { ValueEnforcer . notNull ( aUDO , "UDO" ) ; return _getFileIO ( ) . getResource ( getUserDataPath ( ) + aUDO . getPath ( ) ) ; } | Get the file system resource of the passed UDO object . |
7,422 | public static File getFile ( final IUserDataObject aUDO ) { ValueEnforcer . notNull ( aUDO , "UDO" ) ; return _getFileIO ( ) . getFile ( getUserDataPath ( ) + aUDO . getPath ( ) ) ; } | Get the File of the passed UDO object . |
7,423 | public void addAllOutOfBandNodesToHead ( final List < IHCNode > aAllOOBNodes ) { ValueEnforcer . notNull ( aAllOOBNodes , "AllOOBNodes" ) ; for ( final IHCNode aNode : aAllOOBNodes ) { final IHCNode aUnwrappedNode = HCHelper . getUnwrappedNode ( aNode ) ; if ( HCJSNodeDetector . isDirectJSNode ( aUnwrappedNode ) ) m_aHead . addJS ( aNode ) ; else if ( HCCSSNodeDetector . isDirectCSSNode ( aUnwrappedNode ) ) m_aHead . addCSS ( aNode ) ; else throw new IllegalStateException ( "Found illegal out-of-band head node: " + aNode ) ; } } | Add the passed OOB nodes to the head . |
7,424 | public void moveScriptElementsToBody ( ) { final ICommonsList < IHCNode > aJSNodes = new CommonsArrayList < > ( ) ; m_aHead . getAllAndRemoveAllJSNodes ( aJSNodes ) ; int nFirstScriptIndex = 0 ; if ( m_aBody . hasChildren ( ) ) for ( final IHCNode aChild : m_aBody . getAllChildren ( ) ) { if ( aChild instanceof IHCScript < ? > ) { final boolean bIsInlineBeforeFiles = ( aChild instanceof IHCScriptInline < ? > ) && ! ( ( IHCScriptInline < ? > ) aChild ) . isEmitAfterFiles ( ) ; if ( ! bIsInlineBeforeFiles ) { break ; } } nFirstScriptIndex ++ ; } m_aBody . addChildrenAt ( nFirstScriptIndex , aJSNodes ) ; } | Move all JS nodes from the head to the body . |
7,425 | private String _readAndParseCSS ( final IHasInputStream aISP , final String sBasePath , final boolean bRegular ) { final CascadingStyleSheet aCSS = CSSReader . readFromStream ( aISP , m_aCharset , ECSSVersion . CSS30 ) ; if ( aCSS == null ) { LOGGER . error ( "Failed to parse CSS. Returning 'as-is'" ) ; return StreamHelper . getAllBytesAsString ( aISP , m_aCharset ) ; } CSSVisitor . visitCSSUrl ( aCSS , new AbstractModifyingCSSUrlVisitor ( ) { protected String getModifiedURI ( final String sURI ) { if ( LinkHelper . hasKnownProtocol ( sURI ) ) { return sURI ; } return FilenameHelper . getCleanConcatenatedUrlPath ( sBasePath , sURI ) ; } } ) ; return new CSSWriter ( ECSSVersion . CSS30 , ! bRegular ) . setWriteHeaderText ( false ) . setWriteFooterText ( false ) . getCSSAsString ( aCSS ) ; } | Unify all paths in a CSS relative to the passed base path . |
7,426 | public static boolean isCSSNode ( final IHCNode aNode ) { final IHCNode aUnwrappedNode = HCHelper . getUnwrappedNode ( aNode ) ; return isDirectCSSNode ( aUnwrappedNode ) ; } | Check if the passed node is a CSS node after unwrapping . |
7,427 | public static boolean isCSSInlineNode ( final IHCNode aNode ) { final IHCNode aUnwrappedNode = HCHelper . getUnwrappedNode ( aNode ) ; return isDirectCSSInlineNode ( aUnwrappedNode ) ; } | Check if the passed node is an inline CSS node after unwrapping . |
7,428 | public static boolean isCSSFileNode ( final IHCNode aNode ) { final IHCNode aUnwrappedNode = HCHelper . getUnwrappedNode ( aNode ) ; return isDirectCSSFileNode ( aUnwrappedNode ) ; } | Check if the passed node is a file CSS node after unwrapping . |
7,429 | public static void setConversionSettings ( final HCConversionSettings aConversionSettings ) { ValueEnforcer . notNull ( aConversionSettings , "ConversionSettings" ) ; s_aRWLock . writeLocked ( ( ) -> s_aConversionSettings = aConversionSettings ) ; } | Set the global conversion settings . |
7,430 | public static void setBaseDirectory ( final String sBaseDirectory ) { ValueEnforcer . notNull ( sBaseDirectory , "BaseDirectory" ) ; s_aRWLock . writeLocked ( ( ) -> { s_sBaseDirectory = sBaseDirectory ; } ) ; } | Set the base directory to be used . |
7,431 | public FineUploaderBasic setMaxConnections ( final int nMaxConnections ) { ValueEnforcer . isGT0 ( nMaxConnections , "MaxConnections" ) ; m_nMaxConnections = nMaxConnections ; return this ; } | Maximum allowable concurrent uploads . |
7,432 | public FineUploaderBasic setSizeLimit ( final int nSizeLimit ) { ValueEnforcer . isGE0 ( nSizeLimit , "SizeLimit" ) ; m_nValidationSizeLimit = nSizeLimit ; return this ; } | Maximum allowable size in bytes for a file . |
7,433 | public FineUploaderBasic setMinSizeLimit ( final int nMinSizeLimit ) { ValueEnforcer . isGE0 ( nMinSizeLimit , "MinSizeLimit" ) ; m_nValidationMinSizeLimit = nMinSizeLimit ; return this ; } | Minimum allowable size in bytes for a file . |
7,434 | public FineUploaderBasic setInputName ( final String sInputName ) { ValueEnforcer . notEmpty ( sInputName , "InputName" ) ; m_sRequestInputName = sInputName ; return this ; } | This usually only useful with the ajax uploader which sends the name of the file as a parameter using a key name equal to the value of this options . In the case of the form uploader this is simply the value of the name attribute of the file s associated input element . |
7,435 | protected void fillMicroElement ( final IMicroElement aElement , final IHCConversionSettingsToNode aConversionSettings ) { final boolean bHTML5 = aConversionSettings . getHTMLVersion ( ) . isAtLeastHTML5 ( ) ; if ( StringHelper . hasText ( m_sID ) ) aElement . setAttribute ( CHTMLAttributes . ID , m_sID ) ; if ( StringHelper . hasText ( m_sTitle ) ) aElement . setAttribute ( CHTMLAttributes . TITLE , m_sTitle ) ; if ( StringHelper . hasText ( m_sLanguage ) ) { aElement . setAttribute ( new MicroQName ( XMLConstants . XML_NS_URI , CHTMLAttributes . LANG . getName ( ) ) , m_sLanguage ) ; aElement . setAttribute ( CHTMLAttributes . LANG , m_sLanguage ) ; } if ( m_eDirection != null ) aElement . setAttribute ( CHTMLAttributes . DIR , m_eDirection ) ; aElement . setAttribute ( CHTMLAttributes . CLASS , getAllClassesAsString ( ) ) ; aElement . setAttribute ( CHTMLAttributes . STYLE , getAllStylesAsString ( aConversionSettings . getCSSWriterSettings ( ) ) ) ; if ( m_aJSHandler != null ) { final IJSWriterSettings aJSWriterSettings = aConversionSettings . getJSWriterSettings ( ) ; for ( final EJSEvent eEvent : EJSEvent . values ( ) ) { final CollectingJSCodeProvider aProvider = m_aJSHandler . getHandler ( eEvent ) ; if ( aProvider != null ) { final String sJSCode = aProvider . getJSCode ( aJSWriterSettings ) ; aElement . setAttribute ( eEvent . getHTMLEventName ( ) , CJS . JS_PREFIX + sJSCode ) ; } } } if ( m_nTabIndex != DEFAULT_TABINDEX ) aElement . setAttribute ( CHTMLAttributes . TABINDEX , m_nTabIndex ) ; if ( StringHelper . hasText ( m_sAccessKey ) ) aElement . setAttribute ( CHTMLAttributes . ACCESSKEY , m_sAccessKey ) ; if ( bHTML5 ) { if ( m_eTranslate . isDefined ( ) ) aElement . setAttribute ( CHTMLAttributes . TRANSLATE , m_eTranslate . isTrue ( ) ? CHTMLAttributeValues . YES : CHTMLAttributeValues . NO ) ; if ( m_eContentEditable != null ) aElement . setAttribute ( CHTMLAttributes . CONTENTEDITABLE , m_eContentEditable ) ; if ( StringHelper . hasText ( m_sContextMenuID ) ) aElement . setAttribute ( CHTMLAttributes . CONTEXTMENU , m_sContextMenuID ) ; if ( m_eDraggable != null ) aElement . setAttribute ( CHTMLAttributes . DRAGGABLE , m_eDraggable ) ; if ( m_eDropZone != null ) aElement . setAttribute ( CHTMLAttributes . DROPZONE , m_eDropZone ) ; if ( m_bHidden ) aElement . setAttribute ( CHTMLAttributes . HIDDEN , CHTMLAttributeValues . HIDDEN ) ; if ( m_bSpellCheck ) aElement . setAttribute ( CHTMLAttributes . SPELLCHECK , CHTMLAttributeValues . SPELLCHECK ) ; } if ( m_eRole != null ) aElement . setAttribute ( CHTMLAttributes . ROLE , m_eRole . getID ( ) ) ; if ( m_aCustomAttrs != null ) for ( final Map . Entry < IMicroQName , String > aEntry : m_aCustomAttrs . entrySet ( ) ) aElement . setAttribute ( aEntry . getKey ( ) , aEntry . getValue ( ) ) ; } | Set all attributes and child elements of this object |
7,436 | public JSRegExLiteral gim ( final boolean bGlobal , final boolean bCaseInsensitive , final boolean bMultiLine ) { return global ( bGlobal ) . caseInsensitive ( bCaseInsensitive ) . multiLine ( bMultiLine ) ; } | Set global case insensitive and multi line at once |
7,437 | public boolean isExpectedNonce ( final String sNonceToCheck ) { final String sThisNonce = getNonce ( ) ; return StringHelper . hasText ( sThisNonce ) && sThisNonce . equals ( sNonceToCheck ) && CSRFManager . getInstance ( ) . isValidNonce ( sNonceToCheck ) ; } | Check if the passed nonce is the expected one for this session . |
7,438 | public void generateNewNonce ( ) { final CSRFManager aCSRFMgr = CSRFManager . getInstance ( ) ; m_aRWLock . writeLocked ( ( ) -> { aCSRFMgr . removeNonce ( m_sNonce ) ; m_sNonce = aCSRFMgr . createNewNonce ( ) ; } ) ; } | Generate a new nonce for this session . |
7,439 | protected final String getSelectedObjectID ( final WPECTYPE aWPEC ) { return aWPEC . params ( ) . getAsString ( CPageParam . PARAM_OBJECT ) ; } | Get the ID of the selected object from the passed execution context . |
7,440 | protected TOOLBAR_TYPE createEditToolbar ( final WPECTYPE aWPEC , final FORM_TYPE aForm , final DATATYPE aSelectedObject ) { final Locale aDisplayLocale = aWPEC . getDisplayLocale ( ) ; final TOOLBAR_TYPE aToolbar = createNewEditToolbar ( aWPEC ) ; aToolbar . addHiddenField ( CPageParam . PARAM_ACTION , CPageParam . ACTION_EDIT ) ; aToolbar . addHiddenField ( CPageParam . PARAM_OBJECT , aSelectedObject . getID ( ) ) ; aToolbar . addHiddenField ( CPageParam . PARAM_SUBACTION , CPageParam . ACTION_SAVE ) ; aToolbar . addSubmitButton ( getEditToolbarSubmitButtonText ( aDisplayLocale ) , getEditToolbarSubmitButtonIcon ( ) ) ; aToolbar . addButtonCancel ( aDisplayLocale ) ; modifyEditToolbar ( aWPEC , aSelectedObject , aToolbar ) ; return aToolbar ; } | Create toolbar for editing an existing object |
7,441 | protected TOOLBAR_TYPE createCreateToolbar ( final WPECTYPE aWPEC , final FORM_TYPE aForm , final DATATYPE aSelectedObject ) { final Locale aDisplayLocale = aWPEC . getDisplayLocale ( ) ; final TOOLBAR_TYPE aToolbar = createNewCreateToolbar ( aWPEC ) ; aToolbar . addHiddenField ( CPageParam . PARAM_ACTION , CPageParam . ACTION_CREATE ) ; if ( aSelectedObject != null ) aToolbar . addHiddenField ( CPageParam . PARAM_OBJECT , aSelectedObject . getID ( ) ) ; aToolbar . addHiddenField ( CPageParam . PARAM_SUBACTION , CPageParam . ACTION_SAVE ) ; aToolbar . addSubmitButton ( getCreateToolbarSubmitButtonText ( aDisplayLocale ) , getCreateToolbarSubmitButtonIcon ( ) ) ; aToolbar . addButtonCancel ( aDisplayLocale ) ; modifyCreateToolbar ( aWPEC , aToolbar ) ; return aToolbar ; } | Create toolbar for creating a new object |
7,442 | protected boolean performLocking ( final WPECTYPE aWPEC , final DATATYPE aSelectedObject , final EWebPageFormAction eFormAction ) { return eFormAction . isModifying ( ) || eFormAction . isCustom ( ) ; } | Check if locking should be performed on the current request or not . Override with care! |
7,443 | public static < Value extends Comparable < Value > > int nullSafeCompare ( final Value first , final Value second ) { if ( first == null ) { return second == null ? EQUAL_COMPARE_RESULT : LOWER_THAN_COMPARE_RESULT ; } return second == null ? GREATER_THAN_COMPARE_RESULT : first . compareTo ( second ) ; } | Safely compares two values that might be null . Null value is considered lower than non - null even if the non - null value is minimal in its range . |
7,444 | public Collection < Utterance > call ( final AnalysisRequest request ) { ClientResponse response = null ; try { response = service . type ( MediaType . APPLICATION_JSON ) . accept ( MediaType . APPLICATION_JSON ) . post ( ClientResponse . class , request ) ; return response . getEntity ( new GenericType < Collection < Utterance > > ( ) { } ) ; } finally { if ( response != null ) { try { response . close ( ) ; } catch ( final Throwable ignored ) { } } } } | Call the webservice with some request to analyse for SNOMED CT codes - this method can be used repeatedly on the same SnomedClient instance . |
7,445 | protected SimpleURL getURLForNonExistingItem ( final IRequestWebScopeWithoutResponse aRequestScope , final String sKey ) { return new SimpleURL ( aRequestScope . getFullContextPath ( ) ) ; } | Get the URL to redirect in case an invalid go mapping key was provided . |
7,446 | public PhotonSessionStatePerApp state ( final String sAppID ) { ValueEnforcer . notEmpty ( sAppID , "AppID" ) ; return m_aStateMap . computeIfAbsent ( sAppID , k -> new PhotonSessionStatePerApp ( ) ) ; } | Get or create a new state for the provided app ID . |
7,447 | public final IMPLTYPE setMode ( final EHCScriptInlineMode eMode ) { m_eScriptMode = ValueEnforcer . notNull ( eMode , "Mode" ) ; return thisAsT ( ) ; } | Set the masking mode . |
7,448 | protected void format ( final JSFormatter aFormatter , final String sIndent ) { if ( ! isEmpty ( ) ) aFormatter . plain ( sIndent ) ; final Iterator < Object > aIter = iterator ( ) ; while ( aIter . hasNext ( ) ) { final Object aValue = aIter . next ( ) ; if ( aValue instanceof String ) { int nIdx ; String sValue = ( String ) aValue ; while ( ( nIdx = sValue . indexOf ( '\n' ) ) != - 1 ) { final String sLine = sValue . substring ( 0 , nIdx ) ; if ( sLine . length ( ) > 0 ) aFormatter . plain ( _escape ( sLine ) ) ; sValue = sValue . substring ( nIdx + 1 ) ; aFormatter . nlFix ( ) . plain ( sIndent ) ; } if ( sValue . length ( ) != 0 ) aFormatter . plain ( _escape ( sValue ) ) ; } else if ( aValue instanceof AbstractJSClass ) { ( ( AbstractJSClass ) aValue ) . printLink ( aFormatter ) ; } else if ( aValue instanceof AbstractJSType ) { aFormatter . generatable ( ( AbstractJSType ) aValue ) ; } else throw new IllegalStateException ( "Unsupported value: " + aValue ) ; } if ( ! isEmpty ( ) ) aFormatter . nlFix ( ) ; } | Writes this part into the formatter by using the specified indentation . |
7,449 | private static String _escape ( final String sStr ) { String ret = sStr ; while ( true ) { final int idx = ret . indexOf ( "*/" ) ; if ( idx < 0 ) return ret ; ret = ret . substring ( 0 , idx + 1 ) + "<!-- + ret . substring ( idx + 1 ) ; } } | Escapes the appearance of the comment terminator . |
7,450 | public boolean skipSpaces ( ) { while ( m_nPos < m_sValue . length ( ) && m_sValue . charAt ( m_nPos ) == ' ' ) m_nPos ++ ; return m_nPos < m_sValue . length ( ) ; } | Skips spaces . |
7,451 | public String readUntil ( final char ... aEndChars ) { final StringBuilder aSB = new StringBuilder ( ) ; int nPos = m_nPos ; while ( nPos < m_sValue . length ( ) ) { final char ch = m_sValue . charAt ( nPos ) ; if ( ch == '\\' && nPos + 1 < m_sValue . length ( ) ) { final char c = m_sValue . charAt ( nPos + 1 ) ; if ( MarkdownHelper . isEscapeChar ( c ) ) { aSB . append ( c ) ; nPos ++ ; } else aSB . append ( ch ) ; } else { boolean bEndReached = false ; for ( final char cElement : aEndChars ) if ( ch == cElement ) { bEndReached = true ; break ; } if ( bEndReached ) break ; aSB . append ( ch ) ; } nPos ++ ; } final char ch = nPos < m_sValue . length ( ) ? m_sValue . charAt ( nPos ) : '\n' ; for ( final char cElement : aEndChars ) if ( ch == cElement ) { m_nPos = nPos ; return aSB . toString ( ) ; } return null ; } | Reads chars from this line until any end char is reached . |
7,452 | private int _countCharsStart ( final char ch ) { int nCount = 0 ; for ( int i = 0 ; i < m_sValue . length ( ) ; i ++ ) { final char c = m_sValue . charAt ( i ) ; if ( c == ' ' ) continue ; if ( c != ch ) break ; nCount ++ ; } return nCount ; } | Counts the amount of ch at the start of this line ignoring spaces . |
7,453 | public static void assertThatEndMethodCheckFileExists ( String uniqueFileName ) throws IOException { Enumeration < URL > resources = ClassLoader . getSystemResources ( uniqueFileName ) ; if ( ! resources . hasMoreElements ( ) ) { throw new AssertionError ( "End method check uniqueFileName named: " + uniqueFileName + " doesn't exist.\n" + "Either you didn't use anywhere the annotation @EndMethodCheckFile(\"" + uniqueFileName + "\")\n" + "or the annotation processor wasn't invoked by the compiler and you have to check it's configuration.\n" + "For more about annotation processor configuration and possible issues see:\n" + "https://github.com/c0stra/fluent-api-end-check" ) ; } URL url = resources . nextElement ( ) ; if ( resources . hasMoreElements ( ) ) { throw new IllegalArgumentException ( "Too many files with the same name: " + uniqueFileName + " found on class-path.\n" + "Chosen end method check file name is not unique.\n" + "Files found:\n" + url + "\n" + resources . nextElement ( ) ) ; } } | Assertion method to check that requested EndMethodCheckFile got created . |
7,454 | public FineUploader5Resume setRecordsExpireIn ( final int nRecordsExpireIn ) { ValueEnforcer . isGE0 ( nRecordsExpireIn , "RecordsExpireIn" ) ; m_nResumeRecordsExpireIn = nRecordsExpireIn ; return this ; } | The number of days before a persistent resume record will expire . |
7,455 | public FineUploader5Resume setParamNameResuming ( final String sParamNameResuming ) { ValueEnforcer . notEmpty ( sParamNameResuming , "ParamNameResuming" ) ; m_sResumeParamNamesResuming = sParamNameResuming ; return this ; } | Sent with the first request of the resume with a value of true . |
7,456 | protected String badIdentifier ( String expected ) { error ( expected ) ; final String id = "@" + ( nextId ++ ) ; if ( ! peekPunctuation ( ) ) { final Token token = getNextToken ( ) ; return "BAD_IDENTIFIER" + "_" + friendlyName ( token ) + id ; } else { return "NO_IDENTIFIER" + id ; } } | Called by the parser whenever a required identifier is missing . |
7,457 | private void error ( String expected , String actual ) { if ( ! recovering ) { recovering = true ; final String outputString = ( EOF_STRING . equals ( actual ) || UNTERMINATED_COMMENT_STRING . equals ( actual ) || COMMENT_NOT_ALLOWED . equals ( actual ) ) ? actual : "'" + actual + "'" ; errors . add ( SyntaxError . _UnexpectedToken ( expected , outputString , lookahead ( 1 ) . beginLine ) ) ; } } | If not currently recovering adds an error to the errors list and sets recovering to true |
7,458 | private String friendlyName ( Token token ) { return token . kind == EOF ? EOF_STRING : token . kind == UNTERMINATED_COMMENT ? UNTERMINATED_COMMENT_STRING : token . image ; } | Turn a token into a user readable name |
7,459 | private Token lookahead ( int n ) { Token current = token ; for ( int i = 0 ; i < n ; i ++ ) { if ( current . next == null ) { current . next = token_source . getNextToken ( ) ; } current = current . next ; } return current ; } | look ahead n tokens . 0 is the current token 1 is the next token 2 the one after that etc |
7,460 | public IRole createNewRole ( final String sName , final String sDescription , final Map < String , String > aCustomAttrs ) { final Role aRole = new Role ( sName , sDescription , aCustomAttrs ) ; m_aRWLock . writeLocked ( ( ) -> { internalCreateItem ( aRole ) ; } ) ; AuditHelper . onAuditCreateSuccess ( Role . OT , aRole . getID ( ) , sName ) ; m_aCallbacks . forEach ( aCB -> aCB . onRoleCreated ( aRole , false ) ) ; return aRole ; } | Create a new role . |
7,461 | public IRole createPredefinedRole ( final String sID , final String sName , final String sDescription , final Map < String , String > aCustomAttrs ) { final Role aRole = new Role ( StubObject . createForCurrentUserAndID ( sID , aCustomAttrs ) , sName , sDescription ) ; m_aRWLock . writeLocked ( ( ) -> { internalCreateItem ( aRole ) ; } ) ; AuditHelper . onAuditCreateSuccess ( Role . OT , aRole . getID ( ) , "predefind-role" , sName ) ; m_aCallbacks . forEach ( aCB -> aCB . onRoleCreated ( aRole , true ) ) ; return aRole ; } | Create a predefined role . |
7,462 | public EChange deleteRole ( final String sRoleID ) { Role aDeletedRole ; m_aRWLock . writeLock ( ) . lock ( ) ; try { aDeletedRole = internalDeleteItem ( sRoleID ) ; if ( aDeletedRole == null ) { AuditHelper . onAuditDeleteFailure ( Role . OT , "no-such-role-id" , sRoleID ) ; return EChange . UNCHANGED ; } BusinessObjectHelper . setDeletionNow ( aDeletedRole ) ; } finally { m_aRWLock . writeLock ( ) . unlock ( ) ; } AuditHelper . onAuditDeleteSuccess ( Role . OT , sRoleID ) ; m_aCallbacks . forEach ( aCB -> aCB . onRoleDeleted ( aDeletedRole ) ) ; return EChange . CHANGED ; } | Delete the role with the passed ID |
7,463 | public EChange renameRole ( final String sRoleID , final String sNewName ) { final Role aRole = getOfID ( sRoleID ) ; if ( aRole == null ) { AuditHelper . onAuditModifyFailure ( Role . OT , sRoleID , "no-such-id" ) ; return EChange . UNCHANGED ; } m_aRWLock . writeLock ( ) . lock ( ) ; try { if ( aRole . setName ( sNewName ) . isUnchanged ( ) ) return EChange . UNCHANGED ; BusinessObjectHelper . setLastModificationNow ( aRole ) ; internalUpdateItem ( aRole ) ; } finally { m_aRWLock . writeLock ( ) . unlock ( ) ; } AuditHelper . onAuditModifySuccess ( Role . OT , "name" , sRoleID , sNewName ) ; m_aCallbacks . forEach ( aCB -> aCB . onRoleRenamed ( aRole ) ) ; return EChange . CHANGED ; } | Rename the role with the passed ID |
7,464 | public AnnotationVisitor visitAnnotation ( String desc , boolean visible ) { if ( fv != null ) { return fv . visitAnnotation ( desc , visible ) ; } return null ; } | Visits an annotation of the field . |
7,465 | public static IMicroElement getFirstChildElement ( final IMicroElement aElement , final EHTMLElement eHTMLElement ) { ValueEnforcer . notNull ( aElement , "element" ) ; ValueEnforcer . notNull ( eHTMLElement , "HTMLElement" ) ; IMicroElement aChild = aElement . getFirstChildElement ( eHTMLElement . getElementName ( ) ) ; if ( aChild == null ) { aChild = aElement . getFirstChildElement ( eHTMLElement . getElementNameUpperCase ( ) ) ; } return aChild ; } | Find the first HTML child element within a start element . This check considers both lower - and upper - case element names . Mixed case is not supported! |
7,466 | public static ICommonsList < IMicroElement > getChildElements ( final IMicroElement aElement , final EHTMLElement eHTMLElement ) { ValueEnforcer . notNull ( aElement , "element" ) ; ValueEnforcer . notNull ( eHTMLElement , "HTMLElement" ) ; final ICommonsList < IMicroElement > ret = new CommonsArrayList < > ( ) ; ret . addAll ( aElement . getAllChildElements ( eHTMLElement . getElementName ( ) ) ) ; ret . addAll ( aElement . getAllChildElements ( eHTMLElement . getElementNameUpperCase ( ) ) ) ; return ret ; } | Get a list of all HTML child elements of the given element . This methods handles lower - and upper - cased elements . |
7,467 | public static String getAsHTMLID ( final String sSrc ) { String ret = StringHelper . getNotNull ( sSrc , "" ) . trim ( ) ; ret = StringHelper . removeMultiple ( ret , ID_REMOVE_CHARS ) ; return ret . isEmpty ( ) ? "_" : ret ; } | Convert the passed ID string to a valid HTML ID . |
7,468 | public String hashSystemEnv ( ) { List < String > system = new ArrayList < String > ( ) ; for ( Entry < Object , Object > el : System . getProperties ( ) . entrySet ( ) ) { system . add ( el . getKey ( ) + " " + el . getValue ( ) ) ; } Map < String , String > env = System . getenv ( ) ; for ( Entry < String , String > el : env . entrySet ( ) ) { system . add ( el . getKey ( ) + " " + el . getValue ( ) ) ; } Collections . sort ( system ) ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { DataOutputStream dos = new DataOutputStream ( baos ) ; for ( String s : system ) { dos . write ( s . getBytes ( ) ) ; } } catch ( IOException ex ) { } return hashByteArray ( baos . toByteArray ( ) ) ; } | Hashes system environment . |
7,469 | protected String hashURL ( URL url , String externalForm ) { if ( url == null ) return ERR_HASH ; String hash = path2Hash . get ( externalForm ) ; if ( hash != null ) { return hash ; } if ( mIsSemanticHashing ) { byte [ ] bytes = FileUtil . loadBytes ( url ) ; if ( bytes == null ) return ERR_HASH ; bytes = BytecodeCleaner . removeDebugInfo ( bytes ) ; hash = hashByteArray ( bytes ) ; } else { Checksum cksum = new Adler32 ( ) ; byte [ ] bytes = FileUtil . loadBytes ( url , cksum ) ; if ( bytes == null ) return ERR_HASH ; hash = Long . toString ( cksum . getValue ( ) ) ; } path2Hash . put ( externalForm , hash ) ; return hash ; } | Hash resource at the given URL . |
7,470 | protected String hashByteArray ( byte [ ] data ) { if ( mCRC32 != null ) { return hashCRC32 ( data ) ; } else if ( mHashAlgorithm != null ) { return messageDigest ( data ) ; } else { return hashCRC32 ( data ) ; } } | Hashes byte array . |
7,471 | public static boolean isIgnorable ( Class < ? > clz ) { return clz . isArray ( ) || clz . isPrimitive ( ) || isIgnorableBinName ( clz . getName ( ) ) ; } | Checks if class should be ignored when collecting dependencies . |
7,472 | public static boolean isRetransformIgnorable ( Class < ? > clz ) { String className = clz . getName ( ) ; return ( isIgnorableBinName ( className ) || className . startsWith ( Names . ORG_APACHE_MAVEN_BIN , 0 ) || className . startsWith ( Names . ORG_JUNIT_PACKAGE_BIN , 0 ) || className . startsWith ( Names . JUNIT_FRAMEWORK_PACKAGE_BIN , 0 ) ) ; } | Checks if the given class should be instrumented . Returns true if the class should not be instrumented false otherwise . |
7,473 | public static URL extractJarURL ( URL url ) throws IOException { JarURLConnection connection = ( JarURLConnection ) url . openConnection ( ) ; return connection . getJarFileURL ( ) ; } | Extract URL part that corresponds to jar portion of the given url . |
7,474 | public static boolean isPrimitiveDesc ( String desc ) { if ( desc . length ( ) > 1 ) return false ; char c = desc . charAt ( 0 ) ; return c == 'Z' || c == 'B' || c == 'C' || c == 'D' || c == 'F' || c == 'I' || c == 'J' || c == 'S' ; } | Returns true if descriptor describes one of the primitive types . |
7,475 | public void beforeAddRenderedMenuItem ( final IWebPageExecutionContext aWPEC , final IMenuObject aMenuObj , final IHCElement < ? > aPreviousLI ) { if ( aMenuObj . getMenuObjectType ( ) == EMenuObjectType . SEPARATOR && aPreviousLI != null ) aPreviousLI . addStyle ( CCSSProperties . MARGIN_BOTTOM . newValue ( "1em" ) ) ; } | Called before a menu item is rendered . |
7,476 | public IHCNode renderMenuSeparator ( final IWebPageExecutionContext aWPEC , final IMenuSeparator aMenuSeparator ) { return null ; } | Render a menu separator |
7,477 | public IHCNode renderMenuItemPage ( final IWebPageExecutionContext aWPEC , final IMenuItemPage aMenuItemPage ) { if ( ! aMenuItemPage . matchesDisplayFilter ( ) ) return null ; final Locale aDisplayLocale = aWPEC . getDisplayLocale ( ) ; final HCA ret = new HCA ( aWPEC . getLinkToMenuItem ( aMenuItemPage . getID ( ) ) ) ; if ( aMenuItemPage . hasTarget ( ) ) ret . setTarget ( new HC_Target ( aMenuItemPage . getTarget ( ) ) ) ; ret . addChild ( aMenuItemPage . getDisplayText ( aDisplayLocale ) ) ; return ret ; } | Render a menu item to an internal page |
7,478 | public IHCNode renderMenuItemExternal ( final IWebPageExecutionContext aWPEC , final IMenuItemExternal aMenuItemExternal ) { if ( ! aMenuItemExternal . matchesDisplayFilter ( ) ) return null ; final Locale aDisplayLocale = aWPEC . getDisplayLocale ( ) ; final HCA ret = new HCA ( aMenuItemExternal . getURL ( ) ) ; if ( aMenuItemExternal . hasTarget ( ) ) ret . setTarget ( new HC_Target ( aMenuItemExternal . getTarget ( ) ) ) ; ret . addChild ( aMenuItemExternal . getDisplayText ( aDisplayLocale ) ) ; return ret ; } | Render a menu item to an external page |
7,479 | public EChange removeByName ( final String sName ) { final IJSDeclaration aDecl = m_aDecls . remove ( sName ) ; if ( aDecl == null ) return EChange . UNCHANGED ; m_aObjs . remove ( aDecl ) ; return EChange . CHANGED ; } | Removes a declaration from this package . |
7,480 | public int pos ( final int nNewPos ) { ValueEnforcer . isBetweenInclusive ( nNewPos , "NewPos" , 0 , m_aObjs . size ( ) ) ; final int nOldPos = m_nPos ; m_nPos = nNewPos ; return nOldPos ; } | Sets the current position . |
7,481 | public JSDefinedClass _class ( final String sName ) throws JSNameAlreadyExistsException { final JSDefinedClass aDefinedClass = new JSDefinedClass ( sName ) ; return addDeclaration ( aDefinedClass ) ; } | Add a class to this package . |
7,482 | public IMPLTYPE _throw ( final IJSExpression aExpr ) { addStatement ( new JSThrow ( aExpr ) ) ; return thisAsT ( ) ; } | Create a throw statement and add it to this block |
7,483 | public JSConditional _if ( final IJSExpression aTest , final IHasJSCode aThen ) { return addStatement ( new JSConditional ( aTest , aThen ) ) ; } | Create an If statement and add it to this block |
7,484 | public IMPLTYPE _return ( final IJSExpression aExpr ) { addStatement ( new JSReturn ( aExpr ) ) ; return thisAsT ( ) ; } | Create a return statement and add it to this block |
7,485 | public final InternalErrorBuilder setDuplicateEliminiationCounter ( final int nDuplicateEliminiationCounter ) { ValueEnforcer . isGE0 ( nDuplicateEliminiationCounter , "DuplicateEliminiationCounter" ) ; m_nDuplicateEliminiationCounter = nDuplicateEliminiationCounter ; return this ; } | Set the duplicate elimination counter . |
7,486 | public final InternalErrorBuilder setFromWebExecutionContext ( final ISimpleWebExecutionContext aSWEC ) { setDisplayLocale ( aSWEC . getDisplayLocale ( ) ) ; setRequestScope ( aSWEC . getRequestScope ( ) ) ; return this ; } | Shortcut for setting display locale and request scope at once from a web execution context |
7,487 | public String handle ( ) { return InternalErrorHandler . handleInternalError ( m_bSendEmail , m_bSaveAsXML , m_aUIErrorHandler , m_aThrowable , m_aRequestScope , m_aCustomData , m_aEmailAttachments , m_aDisplayLocale , m_bInvokeCustomExceptionHandler , m_bAddClassPath , m_nDuplicateEliminiationCounter ) ; } | The main handling routine |
7,488 | public BootstrapBorderBuilder type ( final EBootstrapBorderType eType ) { ValueEnforcer . notNull ( eType , "Type" ) ; m_eType = eType ; return this ; } | Set the border type . Default is no border . |
7,489 | public BootstrapBorderBuilder radius ( final EBootstrapBorderRadiusType eRadius ) { ValueEnforcer . notNull ( eRadius , "Radius" ) ; m_eRadius = eRadius ; return this ; } | Set the border radius . Default is no radius . |
7,490 | public static JSAnonymousFunction createFunctionPrintSum ( final String sPrefix , final String sSuffix , final String sBothPrefix , final String sBothSep , final String sBothSuffix ) { final JSAnonymousFunction aFuncPrintSum = new JSAnonymousFunction ( ) ; IJSExpression aTotal = aFuncPrintSum . param ( "t" ) ; IJSExpression aPageTotal = aFuncPrintSum . param ( "pt" ) ; if ( StringHelper . hasText ( sPrefix ) ) { aTotal = JSExpr . lit ( sPrefix ) . plus ( aTotal ) ; aPageTotal = JSExpr . lit ( sPrefix ) . plus ( aPageTotal ) ; } if ( StringHelper . hasText ( sSuffix ) ) { aTotal = aTotal . plus ( sSuffix ) ; aPageTotal = aPageTotal . plus ( sSuffix ) ; } IJSExpression aBoth ; if ( StringHelper . hasText ( sBothPrefix ) ) aBoth = JSExpr . lit ( sBothPrefix ) . plus ( aPageTotal ) ; else aBoth = aPageTotal ; if ( StringHelper . hasText ( sBothSep ) ) aBoth = aBoth . plus ( sBothSep ) ; aBoth = aBoth . plus ( aTotal ) ; if ( StringHelper . hasText ( sBothSuffix ) ) aBoth = aBoth . plus ( sBothSuffix ) ; aFuncPrintSum . body ( ) . _return ( JSOp . cond ( aTotal . eq ( aPageTotal ) , aTotal , aBoth ) ) ; return aFuncPrintSum ; } | Create the JS function to print the sum in the footer |
7,491 | public static JSInvocation createClearFilterCode ( final IJSExpression aDTSelect ) { return aDTSelect . invoke ( "DataTable" ) . invoke ( "search" ) . arg ( "" ) . invoke ( "columns" ) . invoke ( "search" ) . arg ( "" ) . invoke ( "draw" ) ; } | Remove all filters and redraw the data table |
7,492 | protected IHCElement < ? > createSingleErrorNode ( final IError aError , final Locale aContentLocale ) { return BootstrapFormHelper . createDefaultErrorNode ( aError , aContentLocale ) ; } | Create the node for a single error . |
7,493 | public boolean canExecute ( final IRequestWebScopeWithoutResponse aRequestScope , final MutableInt aStatusCode ) { if ( aRequestScope == null ) return false ; for ( final String sRequiredHeader : m_aDescriptor . requiredHeaders ( ) ) if ( aRequestScope . headers ( ) . getFirstHeaderValue ( sRequiredHeader ) == null ) { LOGGER . warn ( "Request '" + m_sPath + "' is missing required HTTP header '" + sRequiredHeader + "'" ) ; return false ; } for ( final String sRequiredParam : m_aDescriptor . requiredParams ( ) ) if ( ! aRequestScope . params ( ) . containsKey ( sRequiredParam ) ) { LOGGER . warn ( "Request '" + m_sPath + "' is missing required HTTP parameter '" + sRequiredParam + "'" ) ; return false ; } if ( m_aDescriptor . hasExecutionFilter ( ) ) if ( ! m_aDescriptor . getExecutionFilter ( ) . canExecute ( aRequestScope ) ) { LOGGER . warn ( "Request '" + m_sPath + "' cannot be executed because of ExecutionFilter" ) ; return false ; } if ( m_aDescriptor . allowedMimeTypes ( ) . isNotEmpty ( ) ) { final String sContentType = aRequestScope . getContentType ( ) ; final MimeType aMT = MimeTypeParser . safeParseMimeType ( sContentType ) ; final String sMimeTypeToCheck = aMT == null ? sContentType : aMT . getAsStringWithoutParameters ( ) ; if ( ! m_aDescriptor . allowedMimeTypes ( ) . contains ( sMimeTypeToCheck ) && ! m_aDescriptor . allowedMimeTypes ( ) . contains ( sMimeTypeToCheck . toLowerCase ( CGlobal . DEFAULT_LOCALE ) ) ) { LOGGER . warn ( "Request '" + m_sPath + "' contains the Content-Type '" + sContentType + "' which is not in the allowed list of " + m_aDescriptor . allowedMimeTypes ( ) ) ; aStatusCode . set ( HttpServletResponse . SC_UNSUPPORTED_MEDIA_TYPE ) ; return false ; } } return true ; } | Check if all pre - requisites are handled correctly . This checks if all required headers and params are present . |
7,494 | public static IMimeType getMimeType ( final IRequestWebScopeWithoutResponse aRequestScope ) { return new MimeType ( CMimeType . TEXT_HTML ) . addParameter ( CMimeType . PARAMETER_NAME_CHARSET , HCSettings . getHTMLCharset ( ) . name ( ) ) ; } | Get the HTML MIME type to use |
7,495 | public static void mergeExternalCSSAndJSNodes ( final IRequestWebScopeWithoutResponse aRequestScope , final HCHead aHead , final boolean bMergeCSS , final boolean bMergeJS , final IWebSiteResourceBundleProvider aWSRBMgr ) { if ( ! bMergeCSS && ! bMergeJS ) { return ; } final boolean bRegular = HCSettings . isUseRegularResources ( ) ; if ( bMergeCSS ) { final ICommonsList < IHCNode > aCSSNodes = new CommonsArrayList < > ( ) ; aHead . getAllAndRemoveAllCSSNodes ( aCSSNodes ) ; final ICommonsList < WebSiteResourceWithCondition > aCSSs = new CommonsArrayList < > ( ) ; for ( final IHCNode aNode : aCSSNodes ) { boolean bStartMerge = true ; if ( HCCSSNodeDetector . isDirectCSSFileNode ( aNode ) ) { final ICSSPathProvider aPathProvider = ( ( HCLink ) aNode ) . getPathProvider ( ) ; if ( aPathProvider != null ) { aCSSs . add ( WebSiteResourceWithCondition . createForCSS ( aPathProvider , bRegular ) ) ; bStartMerge = false ; } } if ( bStartMerge ) { if ( ! aCSSs . isEmpty ( ) ) { for ( final WebSiteResourceBundleSerialized aBundle : aWSRBMgr . getResourceBundles ( aCSSs , bRegular ) ) aHead . addCSS ( aBundle . createNode ( aRequestScope ) ) ; aCSSs . clear ( ) ; } aHead . addCSS ( aNode ) ; } } if ( ! aCSSs . isEmpty ( ) ) for ( final WebSiteResourceBundleSerialized aBundle : aWSRBMgr . getResourceBundles ( aCSSs , bRegular ) ) aHead . addCSS ( aBundle . createNode ( aRequestScope ) ) ; } if ( bMergeJS ) { final ICommonsList < IHCNode > aJSNodes = new CommonsArrayList < > ( ) ; aHead . getAllAndRemoveAllJSNodes ( aJSNodes ) ; final ICommonsList < WebSiteResourceWithCondition > aJSs = new CommonsArrayList < > ( ) ; for ( final IHCNode aNode : aJSNodes ) { boolean bStartMerge = true ; if ( HCJSNodeDetector . isDirectJSFileNode ( aNode ) ) { final IJSPathProvider aPathProvider = ( ( HCScriptFile ) aNode ) . getPathProvider ( ) ; if ( aPathProvider != null ) { aJSs . add ( WebSiteResourceWithCondition . createForJS ( aPathProvider , bRegular ) ) ; bStartMerge = false ; } } if ( bStartMerge ) { if ( ! aJSs . isEmpty ( ) ) { for ( final WebSiteResourceBundleSerialized aBundle : aWSRBMgr . getResourceBundles ( aJSs , bRegular ) ) aHead . addJS ( aBundle . createNode ( aRequestScope ) ) ; aJSs . clear ( ) ; } aHead . addJS ( aNode ) ; } } if ( ! aJSs . isEmpty ( ) ) for ( final WebSiteResourceBundleSerialized aBundle : aWSRBMgr . getResourceBundles ( aJSs , bRegular ) ) aHead . addJS ( aBundle . createNode ( aRequestScope ) ) ; } } | Merge external CSS and JS contents to a single resource for improved browser performance . All source nodes are taken from the head and all target nodes are written to the head . |
7,496 | public boolean isAccessTokenUsed ( final String sTokenString ) { if ( StringHelper . hasNoText ( sTokenString ) ) return false ; return containsAny ( x -> x . findFirstAccessToken ( y -> y . getTokenString ( ) . equals ( sTokenString ) ) != null ) ; } | Check if the passed token string was already used in this application . This method considers all access token - revoked expired or active . |
7,497 | public static void execute ( Object mojo ) throws Exception { if ( ! ( isSurefirePlugin ( mojo ) || isFailsafePlugin ( mojo ) ) ) { return ; } if ( isAlreadyInvoked ( mojo ) ) { return ; } checkSurefireVersion ( mojo ) ; checkSurefireConfiguration ( mojo ) ; try { updateArgLine ( mojo ) ; updateExcludes ( mojo ) ; updateParallel ( mojo ) ; } catch ( Exception ex ) { throwMojoExecutionException ( mojo , "Unsupported surefire version" , ex ) ; } } | This method is invoked before SurefirePlugin execute method . |
7,498 | private static void checkSurefireVersion ( Object mojo ) throws Exception { try { getField ( SKIP_TESTS_FIELD , mojo ) ; getField ( FORK_MODE_FIELD , mojo ) ; getField ( ARGLINE_FIELD , mojo ) ; getField ( EXCLUDES_FIELD , mojo ) ; } catch ( NoSuchMethodException ex ) { throwMojoExecutionException ( mojo , "Unsupported surefire version. An alternative is to use select/restore goals." , ex ) ; } } | Checks that Surefire has all the metohds that are needed i . e . check Surefire version . Currently we support 2 . 7 and newer . |
7,499 | private static void checkSurefireConfiguration ( Object mojo ) throws Exception { String forkCount = null ; try { forkCount = invokeAndGetString ( GET_FORK_COUNT , mojo ) ; } catch ( NoSuchMethodException ex ) { } String forkMode = null ; try { forkMode = getStringField ( FORK_MODE_FIELD , mojo ) ; } catch ( NoSuchMethodException ex ) { } if ( ( forkCount != null && forkCount . equals ( "0" ) ) || ( forkMode != null && ( forkMode . equals ( "never" ) || forkMode . equals ( "none" ) ) ) ) { throwMojoExecutionException ( mojo , "Fork has to be enabled when running tests with Ekstazi; check forkMode and forkCount parameters." , null ) ; } } | Checks that surefire configuration allows integration with Ekstazi . At the moment we check that forking is enabled . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.