idx int64 0 41.2k | question stringlengths 74 4.04k | target stringlengths 7 750 |
|---|---|---|
34,100 | protected static File toPackageFolder ( String packageName ) { File file = null ; for ( final String element : packageName . split ( "[.]" ) ) { if ( file == null ) { file = new File ( element ) ; } else { file = new File ( file , element ) ; } } return file ; } | Convert a a package name for therelative file . |
34,101 | protected String getBootClassPath ( ) throws IOException { final Toolchain toolchain = this . toolchainManager . getToolchainFromBuildContext ( "jdk" , this . session ) ; if ( toolchain instanceof JavaToolchain && toolchain instanceof ToolchainPrivate ) { final JavaToolchain javaToolChain = ( JavaToolchain ) toolchain ... | Replies the boot classpath . |
34,102 | protected XExpression fromString ( String expression ) { if ( ! Strings . isEmpty ( expression ) ) { ResourceSet resourceSet = this . context . eResource ( ) . getResourceSet ( ) ; URI uri = computeUnusedUri ( resourceSet ) ; Resource resource = getResourceFactory ( ) . createResource ( uri ) ; resourceSet . getResourc... | Create an expression but does not change the container . |
34,103 | public XExpression getDefaultXExpressionForType ( String type ) { XExpression expr = null ; if ( type != null && ! "void" . equals ( type ) && ! Void . class . getName ( ) . equals ( type ) ) { switch ( type ) { case "boolean" : case "java.lang.Boolean" : XBooleanLiteral booleanLiteral = XbaseFactory . eINSTANCE . crea... | Replies the XExpression for the default value associated to the given type . |
34,104 | public String getDefaultValueForType ( String type ) { String defaultValue = "" ; if ( ! Strings . isEmpty ( type ) && ! "void" . equals ( type ) ) { switch ( type ) { case "boolean" : defaultValue = "true" ; break ; case "double" : defaultValue = "0.0" ; break ; case "float" : defaultValue = "0.0f" ; break ; case "int... | Replies the default value for the given type . |
34,105 | public XFeatureCall createReferenceToThis ( ) { final XExpression expr = getXExpression ( ) ; XtendTypeDeclaration type = EcoreUtil2 . getContainerOfType ( expr , XtendTypeDeclaration . class ) ; JvmType jvmObject = getAssociatedElement ( JvmType . class , type , expr . eResource ( ) ) ; final XFeatureCall thisFeature ... | Create a reference to this object or to the current type . |
34,106 | public XFeatureCall createReferenceToSuper ( ) { final XExpression expr = getXExpression ( ) ; XtendTypeDeclaration type = EcoreUtil2 . getContainerOfType ( expr , XtendTypeDeclaration . class ) ; JvmType jvmObject = getAssociatedElement ( JvmType . class , type , expr . eResource ( ) ) ; final XFeatureCall superFeatur... | Create a reference to super object or to the super type . |
34,107 | public static InetAddress getLoopbackAddress ( ) { try { final Enumeration < NetworkInterface > interfaces = NetworkInterface . getNetworkInterfaces ( ) ; if ( interfaces != null ) { NetworkInterface inter ; InetAddress adr ; Enumeration < InetAddress > addrs ; while ( interfaces . hasMoreElements ( ) ) { inter = inter... | Replies the IPv4 loopback address . |
34,108 | public static URI toURI ( String uri ) throws URISyntaxException { final URI u = new URI ( uri ) ; String adr = u . getAuthority ( ) ; if ( adr == null ) { adr = u . getPath ( ) ; } if ( adr != null && adr . endsWith ( ":*" ) ) { return new URI ( u . getScheme ( ) , u . getUserInfo ( ) , adr . substring ( 0 , adr . len... | Convert a string URI to an object URI . |
34,109 | public static URI toURI ( InetAddress adr ) { try { return new URI ( "tcp" , adr . getHostAddress ( ) , null , null ) ; } catch ( URISyntaxException e ) { throw new IOError ( e ) ; } } | Convert an inet address to an URI . |
34,110 | protected LightweightTypeReference toLightweightTypeReference ( JvmType type , EObject context ) { final StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner ( getServices ( ) , context ) ; final LightweightTypeReferenceFactory factory = new LightweightTypeReferenceFactory ( owner , false ) ; return factor... | Create a lightweight type reference from the given type . |
34,111 | protected boolean isIgnored ( String issueCode , EObject currentObject ) { final IssueSeverities severities = getIssueSeverities ( getContext ( ) , currentObject ) ; return severities . isIgnored ( issueCode ) ; } | Replies if the given issue is ignored for the given object . |
34,112 | protected String canonicalName ( EObject object ) { if ( object instanceof JvmIdentifiableElement ) { return ( ( JvmIdentifiableElement ) object ) . getQualifiedName ( ) ; } final EObject jvmElement = this . associations . getPrimaryJvmElement ( object ) ; if ( jvmElement instanceof JvmIdentifiableElement ) { return ( ... | Replies the canonical name of the given object . |
34,113 | public void checkSpaceUse ( SarlSpace space ) { error ( MessageFormat . format ( Messages . SARLValidator_0 , this . grammarAccess . getSpaceKeyword ( ) ) , space , null ) ; } | Space keyword is reserved . |
34,114 | public void checkArtifactUse ( SarlArtifact artifact ) { error ( MessageFormat . format ( Messages . SARLValidator_0 , this . grammarAccess . getSpaceKeyword ( ) ) , artifact , null ) ; } | Artifact keyword is reserved . |
34,115 | public void checkEarlyExitEventInFires ( SarlAction action ) { int i = 0 ; for ( final JvmTypeReference event : action . getFiredEvents ( ) ) { if ( ! this . earlyExitComputer . isEarlyExitEvent ( event ) ) { warning ( MessageFormat . format ( Messages . SARLValidator_95 , event . getSimpleName ( ) ) , action , SarlPac... | Emit a warning when the events after the fires keyword are not early - exit events . |
34,116 | public void checkRequiredCapacityUse ( SarlRequiredCapacity statement ) { warning ( MessageFormat . format ( Messages . SARLValidator_0 , this . grammarAccess . getRequiresKeyword ( ) ) , statement , null ) ; } | Emit a warning when the requires keyword is used . |
34,117 | protected void checkModifiers ( SarlAgent agent ) { this . agentModifierValidator . checkModifiers ( agent , MessageFormat . format ( Messages . SARLValidator_9 , agent . getName ( ) ) ) ; } | Check the modifiers for the SARL agents . |
34,118 | protected void checkModifiers ( SarlBehavior behavior ) { this . behaviorModifierValidator . checkModifiers ( behavior , MessageFormat . format ( Messages . SARLValidator_9 , behavior . getName ( ) ) ) ; } | Check the modifiers for the SARL behaviors . |
34,119 | protected void checkModifiers ( SarlCapacity capacity ) { this . capacityModifierValidator . checkModifiers ( capacity , MessageFormat . format ( Messages . SARLValidator_9 , capacity . getName ( ) ) ) ; } | Check the modifiers for the SARL capacities . |
34,120 | protected void checkModifiers ( SarlSkill skill ) { this . skillModifierValidator . checkModifiers ( skill , MessageFormat . format ( Messages . SARLValidator_9 , skill . getName ( ) ) ) ; } | Check the modifiers for the SARL skills . |
34,121 | public void checkContainerType ( SarlAgent agent ) { final XtendTypeDeclaration declaringType = agent . getDeclaringType ( ) ; if ( declaringType != null ) { final String name = canonicalName ( declaringType ) ; assert name != null ; error ( MessageFormat . format ( Messages . SARLValidator_28 , name ) , agent , null ,... | Check the container for the SARL agents . |
34,122 | public void checkContainerType ( SarlBehavior behavior ) { final XtendTypeDeclaration declaringType = behavior . getDeclaringType ( ) ; if ( declaringType != null ) { final String name = canonicalName ( declaringType ) ; assert name != null ; error ( MessageFormat . format ( Messages . SARLValidator_29 , name ) , behav... | Check the container for the SARL behaviors . |
34,123 | public void checkContainerType ( SarlCapacity capacity ) { final XtendTypeDeclaration declaringType = capacity . getDeclaringType ( ) ; if ( declaringType != null ) { final String name = canonicalName ( declaringType ) ; assert name != null ; error ( MessageFormat . format ( Messages . SARLValidator_30 , name ) , capac... | Check the container for the SARL capacities . |
34,124 | public void checkContainerType ( SarlSkill skill ) { final XtendTypeDeclaration declaringType = skill . getDeclaringType ( ) ; if ( declaringType != null ) { final String name = canonicalName ( declaringType ) ; assert name != null ; error ( MessageFormat . format ( Messages . SARLValidator_31 , name ) , skill , null ,... | Check the container for the SARL skills . |
34,125 | public void checkFinalFieldInitialization ( SarlEvent event ) { final JvmGenericType inferredType = this . associations . getInferredType ( event ) ; if ( inferredType != null ) { checkFinalFieldInitialization ( inferredType ) ; } } | Check if all the fields are initialized in a SARL event . |
34,126 | public void checkFinalFieldInitialization ( SarlBehavior behavior ) { final JvmGenericType inferredType = this . associations . getInferredType ( behavior ) ; if ( inferredType != null ) { checkFinalFieldInitialization ( inferredType ) ; } } | Check if all the fields are initialized in a SARL behavior . |
34,127 | public void checkFinalFieldInitialization ( SarlSkill skill ) { final JvmGenericType inferredType = this . associations . getInferredType ( skill ) ; if ( inferredType != null ) { checkFinalFieldInitialization ( inferredType ) ; } } | Check if all the fields are initialized in a SARL skill . |
34,128 | public void checkFinalFieldInitialization ( SarlAgent agent ) { final JvmGenericType inferredType = this . associations . getInferredType ( agent ) ; if ( inferredType != null ) { checkFinalFieldInitialization ( inferredType ) ; } } | Check if all the fields are initialized in a SARL agent . |
34,129 | @ SuppressWarnings ( { "checkstyle:cyclomaticcomplexity" , "checkstyle:npathcomplexity" , "checkstyle:nestedifdepth" } ) protected void checkSuperConstructor ( XtendTypeDeclaration container , EStructuralFeature feature , Collection < ActionParameterTypes > defaultSignatures ) { final JvmDeclaredType jvmElement = this ... | Check the super constructors . |
34,130 | @ Check ( CheckType . FAST ) public void checkForbiddenCalls ( XAbstractFeatureCall expression ) { if ( this . featureCallValidator . isDisallowedCall ( expression ) ) { error ( MessageFormat . format ( Messages . SARLValidator_36 , expression . getFeature ( ) . getIdentifier ( ) ) , expression , null , ValidationMessa... | Check if the call is forbidden . |
34,131 | @ Check ( CheckType . FAST ) public void checkDiscouragedCalls ( XAbstractFeatureCall expression ) { if ( ! isIgnored ( DISCOURAGED_REFERENCE ) && this . featureCallValidator . isDiscouragedCall ( expression ) ) { addIssue ( MessageFormat . format ( Messages . SARLValidator_37 , expression . getConcreteSyntaxFeatureNam... | Check if the call is discouraged . |
34,132 | public void checkDefaultValueTypeCompatibleWithParameterType ( SarlFormalParameter param ) { final XExpression defaultValue = param . getDefaultValue ( ) ; if ( defaultValue != null ) { final JvmTypeReference rawType = param . getParameterType ( ) ; assert rawType != null ; final LightweightTypeReference toType = toLig... | Check if the default values of the formal parameters have a compatible type with the formal parameter . |
34,133 | public void checkDefaultValueFieldReference ( SarlFormalParameter param ) { final XExpression defaultValue = param . getDefaultValue ( ) ; if ( defaultValue != null ) { final Iterator < XFeatureCall > iter ; if ( defaultValue instanceof XFeatureCall ) { iter = Iterators . singletonIterator ( ( XFeatureCall ) defaultVal... | Check if the default values has not a reference to the not final fields . |
34,134 | @ Check ( CheckType . FAST ) public void checkActionName ( SarlAction action ) { final JvmOperation inferredType = this . associations . getDirectlyInferredOperation ( action ) ; final QualifiedName name = QualifiedName . create ( inferredType . getQualifiedName ( '.' ) . split ( "\\." ) ) ; if ( this . featureNames . ... | Check if the given action has a valid name . |
34,135 | @ Check ( CheckType . FAST ) public void checkFieldName ( SarlField field ) { final JvmField inferredType = this . associations . getJvmField ( field ) ; final QualifiedName name = Utils . getQualifiedName ( inferredType ) ; if ( this . featureNames . isDisallowedName ( name ) ) { final String validName = Utils . fixHi... | Check if the given field has a valid name . |
34,136 | public void checkFieldNameShadowing ( SarlField field ) { if ( ! isIgnored ( VARIABLE_NAME_SHADOWING ) && ! Utils . isHiddenMember ( field . getName ( ) ) ) { final JvmField inferredField = this . associations . getJvmField ( field ) ; final Map < String , JvmField > inheritedFields = new TreeMap < > ( ) ; Utils . popu... | Check if the given field has a name that is shadowing an inherited field . |
34,137 | @ Check ( CheckType . FAST ) public void checkParameterName ( SarlFormalParameter parameter ) { if ( this . grammarAccess . getOccurrenceKeyword ( ) . equals ( parameter . getName ( ) ) ) { error ( MessageFormat . format ( Messages . SARLValidator_14 , this . grammarAccess . getOccurrenceKeyword ( ) ) , parameter , Xte... | Check if the given parameter has a valid name . |
34,138 | @ Check ( CheckType . FAST ) public void checkParameterName ( XVariableDeclaration variable ) { if ( this . grammarAccess . getOccurrenceKeyword ( ) . equals ( variable . getName ( ) ) ) { error ( MessageFormat . format ( Messages . SARLValidator_15 , this . grammarAccess . getOccurrenceKeyword ( ) ) , variable , Xbase... | Check if the given local variable has a valid name . |
34,139 | public void checkRedundantImplementedInterfaces ( SarlSkill skill ) { checkRedundantInterfaces ( skill , SARL_SKILL__IMPLEMENTS , skill . getImplements ( ) , Utils . singletonList ( skill . getExtends ( ) ) ) ; } | Check if implemented interfaces of a skill are redundant . |
34,140 | public void checkRedundantImplementedInterfaces ( SarlClass xtendClass ) { checkRedundantInterfaces ( xtendClass , XTEND_CLASS__IMPLEMENTS , xtendClass . getImplements ( ) , Utils . singletonList ( xtendClass . getExtends ( ) ) ) ; } | Check if implemented interfaces of a Xtend Class are redundant . |
34,141 | public void checkRedundantImplementedInterfaces ( SarlInterface xtendInterface ) { checkRedundantInterfaces ( xtendInterface , XTEND_INTERFACE__EXTENDS , xtendInterface . getExtends ( ) , Collections . < JvmTypeReference > emptyList ( ) ) ; } | Check if implemented interfaces of a Xtend Interface are redundant . |
34,142 | @ Check ( CheckType . FAST ) public void checkBehaviorUnitGuardType ( SarlBehaviorUnit behaviorUnit ) { final XExpression guard = behaviorUnit . getGuard ( ) ; if ( guard != null ) { if ( this . operationHelper . hasSideEffects ( null , guard ) ) { error ( Messages . SARLValidator_53 , guard , null , ValidationMessageA... | Check the type of the behavior unit s guard . |
34,143 | @ Check ( CheckType . FAST ) public void checkCapacityTypeForUses ( SarlCapacityUses uses ) { for ( final JvmParameterizedTypeReference usedType : uses . getCapacities ( ) ) { final LightweightTypeReference ref = toLightweightTypeReference ( usedType ) ; if ( ref != null && ! this . inheritanceHelper . isSarlCapacity (... | Check the type of the capacity uses . |
34,144 | @ Check ( CheckType . FAST ) public void checkActionFires ( SarlAction action ) { for ( final JvmTypeReference event : action . getFiredEvents ( ) ) { final LightweightTypeReference ref = toLightweightTypeReference ( event ) ; if ( ref != null && ! this . inheritanceHelper . isSarlEvent ( ref ) ) { error ( MessageForma... | Check the types of the parameters of the fires statement . |
34,145 | @ Check ( CheckType . FAST ) public void checkSuperTypes ( SarlCapacity capacity ) { checkSuperTypes ( capacity , SARL_CAPACITY__EXTENDS , capacity . getExtends ( ) , Capacity . class , false ) ; } | Check if the supertype of the given capacity is a subtype of Capacity . |
34,146 | @ Check ( CheckType . FAST ) public void checkSuperType ( SarlSkill skill ) { final int nbSuperTypes = checkSuperTypes ( skill , SARL_SKILL__EXTENDS , Utils . singletonList ( skill . getExtends ( ) ) , Skill . class , false ) ; checkImplementedTypes ( skill , SARL_SKILL__IMPLEMENTS , skill . getImplements ( ) , Capacit... | Check if the supertype of the given skill is a subtype of Skill . |
34,147 | @ Check ( CheckType . FAST ) public void checkSuperType ( SarlEvent event ) { checkSuperTypes ( event , SARL_EVENT__EXTENDS , Utils . singletonList ( event . getExtends ( ) ) , Event . class , false ) ; } | Check if the supertype of the given event is a subtype of Event . |
34,148 | @ Check ( CheckType . FAST ) public void checkSuperType ( SarlBehavior behavior ) { checkSuperTypes ( behavior , SARL_BEHAVIOR__EXTENDS , Utils . singletonList ( behavior . getExtends ( ) ) , Behavior . class , false ) ; } | Check if the supertype of the given behavior is a subtype of Behavior . |
34,149 | @ Check ( CheckType . FAST ) public void checkSuperType ( SarlAgent agent ) { checkSuperTypes ( agent , SARL_AGENT__EXTENDS , Utils . singletonList ( agent . getExtends ( ) ) , Agent . class , false ) ; } | Check if the supertype of the given agent is a subtype of Agent . |
34,150 | protected boolean checkImplementedTypes ( XtendTypeDeclaration element , EReference feature , List < ? extends JvmTypeReference > implementedTypes , Class < ? > expectedType , int mandatoryNumberOfTypes , boolean onlySubTypes ) { boolean success = true ; int nb = 0 ; int index = 0 ; for ( final JvmTypeReference superTy... | Check the implemeted type . |
34,151 | @ Check ( CheckType . FAST ) public void checkBehaviorUnitEventType ( SarlBehaviorUnit behaviorUnit ) { final JvmTypeReference event = behaviorUnit . getName ( ) ; final LightweightTypeReference ref = toLightweightTypeReference ( event ) ; if ( ref == null || ! this . inheritanceHelper . isSarlEvent ( ref ) ) { error (... | Check if the parameter of the bahavior unit is an event . |
34,152 | @ Check ( CheckType . FAST ) public void checkCapacityFeatures ( SarlCapacity capacity ) { if ( capacity . getMembers ( ) . isEmpty ( ) ) { if ( ! isIgnored ( DISCOURAGED_CAPACITY_DEFINITION ) ) { addIssue ( Messages . SARLValidator_77 , capacity , null , ValidationMessageAcceptor . INSIGNIFICANT_INDEX , DISCOURAGED_CA... | Check if a capacity has a feature defined inside . |
34,153 | @ Check ( CheckType . NORMAL ) public void checkUnusedCapacities ( SarlCapacityUses uses ) { if ( ! isIgnored ( UNUSED_AGENT_CAPACITY ) ) { final XtendTypeDeclaration container = uses . getDeclaringType ( ) ; final JvmDeclaredType jvmContainer = ( JvmDeclaredType ) this . associations . getPrimaryJvmElement ( container... | Check for unused capacities . |
34,154 | @ Check ( CheckType . NORMAL ) public void checkMultipleCapacityUses ( SarlCapacityUses uses ) { if ( ! isIgnored ( REDUNDANT_CAPACITY_USE ) ) { final XtendTypeDeclaration declaringType = uses . getDeclaringType ( ) ; if ( declaringType != null ) { final Set < String > previousCapacityUses = doGetPreviousCapacities ( u... | Check for multiple capacity use declaration . |
34,155 | public void checkReservedAnnotation ( XtendAnnotationTarget annotationTarget ) { if ( ! isIgnored ( USED_RESERVED_SARL_ANNOTATION ) ) { if ( annotationTarget . getAnnotations ( ) . isEmpty ( ) || ! isRelevantAnnotationTarget ( annotationTarget ) ) { return ; } final QualifiedName reservedPackage = this . qualifiedNameC... | Check for reserved annotations . |
34,156 | protected static XMemberFeatureCall getRootOfMemberFeatureCallSequence ( EObject leaf , EObject container , Procedure1 < XMemberFeatureCall > feedback ) { EObject call = leaf ; EObject obj = EcoreUtil2 . getContainerOfType ( leaf . eContainer ( ) , XExpression . class ) ; while ( obj != null && ( container == null || o... | Replies the member feature call that is the root of a sequence of member feature calls . |
34,157 | protected List < LightweightTypeReference > getParamTypeReferences ( JvmExecutable jvmExecutable , boolean wrapFromPrimitives , boolean wrapToPrimitives ) { assert ( wrapFromPrimitives && ! wrapToPrimitives ) || ( wrapToPrimitives && ! wrapFromPrimitives ) ; final List < LightweightTypeReference > types = newArrayList ... | Retrieve the types of the formal parameters of the given JVM executable object . |
34,158 | public void checkUnmodifiableEventAccess ( SarlBehaviorUnit unit ) { final boolean enable1 = ! isIgnored ( DISCOURAGED_OCCURRENCE_READONLY_USE ) ; final XExpression root = unit . getExpression ( ) ; final String occurrenceKw = this . grammarAccess . getOccurrenceKeyword ( ) ; for ( final XFeatureCall child : EcoreUtil2... | Check for usage of the event functions in the behavior units . |
34,159 | public void checkBreakKeywordUse ( SarlBreakExpression expression ) { final EObject container = Utils . getFirstContainerForPredicate ( expression , it -> ! ( it instanceof XExpression ) || it instanceof XAbstractWhileExpression || it instanceof XBasicForLoopExpression || it instanceof XForLoopExpression ) ; if ( conta... | Check for usage of break inside loops . |
34,160 | public void checkStaticConstructorPrototype ( XtendConstructor constructor ) { if ( constructor . isStatic ( ) ) { if ( ! constructor . getAnnotations ( ) . isEmpty ( ) ) { error ( Messages . SARLValidator_23 , constructor , XtendPackage . eINSTANCE . getXtendAnnotationTarget_Annotations ( ) , ValidationMessageAcceptor... | Check for a valid prototype of a static constructor . |
34,161 | @ SuppressWarnings ( { "checkstyle:nestedifdepth" , "checkstyle:npathcomplexity" , "checkstyle:cyclomaticcomplexity" } ) public void checkUnsynchronizedField ( XtendField field ) { if ( doCheckValidMemberName ( field ) && ! isIgnored ( POTENTIAL_FIELD_SYNCHRONIZATION_PROBLEM ) ) { final JvmField jvmField = this . assoc... | Check if a field needs to be synchronized . |
34,162 | protected boolean isLocallyAssigned ( EObject target , EObject containerToFindUsage ) { if ( this . readAndWriteTracking . isAssigned ( target ) ) { return true ; } final Collection < Setting > usages = XbaseUsageCrossReferencer . find ( target , containerToFindUsage ) ; for ( final Setting usage : usages ) { final EOb... | Replies if the given object is locally assigned . |
34,163 | @ SuppressWarnings ( "static-method" ) protected boolean isOOType ( XtendTypeDeclaration type ) { return type instanceof XtendClass || type instanceof XtendInterface || type instanceof XtendEnum || type instanceof XtendAnnotationType ; } | Replies if the given element is an object oriented type . |
34,164 | @ SuppressWarnings ( "static-method" ) protected boolean isOOActiveAnnotation ( XAnnotation annotation ) { final String name = annotation . getAnnotationType ( ) . getQualifiedName ( ) ; return Strings . equal ( Accessors . class . getName ( ) , name ) || Strings . equal ( Data . class . getName ( ) , name ) || Strings... | Replies if the given annotation is an active annotation for object - oriented elements . |
34,165 | @ SuppressWarnings ( "static-method" ) protected boolean isAOActiveAnnotation ( XAnnotation annotation ) { final String name = annotation . getAnnotationType ( ) . getQualifiedName ( ) ; return Strings . equal ( Accessors . class . getName ( ) , name ) ; } | Replies if the given container can receive an active annotation . |
34,166 | @ SuppressWarnings ( "static-method" ) protected boolean isAOActiveAnnotationReceiver ( XtendTypeDeclaration container ) { return container instanceof SarlAgent || container instanceof SarlBehavior || container instanceof SarlSkill ; } | Replies if the given annotation is an active annotation for agent - oriented elements . |
34,167 | @ SuppressWarnings ( "static-method" ) protected boolean isForbiddenActiveAnnotation ( XAnnotation annotation ) { final String name = annotation . getAnnotationType ( ) . getQualifiedName ( ) ; return Strings . equal ( EqualsHashCode . class . getName ( ) , name ) || Strings . equal ( FinalFieldsConstructor . class . g... | Replies if the given annotation is a forbidden active annotation . |
34,168 | public void checkTopElementsAreUnique ( SarlScript script ) { final Multimap < String , XtendTypeDeclaration > name2type = HashMultimap . create ( ) ; for ( final XtendTypeDeclaration declaration : script . getXtendTypes ( ) ) { final String name = declaration . getName ( ) ; if ( ! Strings . isEmpty ( name ) ) { name2... | Check the top elements within a script are not duplicated . |
34,169 | @ SuppressWarnings ( "static-method" ) protected boolean isDefaultValuedParameterFunction ( XtendFunction function ) { for ( final XtendParameter parameter : function . getParameters ( ) ) { if ( parameter instanceof SarlFormalParameter ) { final SarlFormalParameter sarlParameter = ( SarlFormalParameter ) parameter ; i... | Replies if the given function has a default value for one of its parameters . |
34,170 | protected void reportCastWarnings ( JvmTypeReference concreteSyntax , LightweightTypeReference toType , LightweightTypeReference fromType ) { if ( ! isIgnored ( OBSOLETE_CAST ) && toType . isAssignableFrom ( fromType ) ) { addIssue ( MessageFormat . format ( Messages . SARLValidator_96 , fromType . getHumanReadableName... | Report the warnings associated to the casted expressions . |
34,171 | public void finalizeScript ( ) { if ( this . isFinalized ) { throw new IllegalStateException ( "already finalized" ) ; } this . isFinalized = true ; ImportManager concreteImports = new ImportManager ( true ) ; XImportSection importSection = getScript ( ) . getImportSection ( ) ; if ( importSection != null ) { for ( XIm... | Finalize the script . |
34,172 | public ISarlEventBuilder addSarlEvent ( String name ) { ISarlEventBuilder builder = this . sarlEventProvider . get ( ) ; builder . eInit ( getScript ( ) , name , getTypeResolutionContext ( ) ) ; return builder ; } | Create a SarlEvent builder . |
34,173 | public ISarlCapacityBuilder addSarlCapacity ( String name ) { ISarlCapacityBuilder builder = this . sarlCapacityProvider . get ( ) ; builder . eInit ( getScript ( ) , name , getTypeResolutionContext ( ) ) ; return builder ; } | Create a SarlCapacity builder . |
34,174 | public ISarlAgentBuilder addSarlAgent ( String name ) { ISarlAgentBuilder builder = this . sarlAgentProvider . get ( ) ; builder . eInit ( getScript ( ) , name , getTypeResolutionContext ( ) ) ; return builder ; } | Create a SarlAgent builder . |
34,175 | public ISarlBehaviorBuilder addSarlBehavior ( String name ) { ISarlBehaviorBuilder builder = this . sarlBehaviorProvider . get ( ) ; builder . eInit ( getScript ( ) , name , getTypeResolutionContext ( ) ) ; return builder ; } | Create a SarlBehavior builder . |
34,176 | public ISarlSkillBuilder addSarlSkill ( String name ) { ISarlSkillBuilder builder = this . sarlSkillProvider . get ( ) ; builder . eInit ( getScript ( ) , name , getTypeResolutionContext ( ) ) ; return builder ; } | Create a SarlSkill builder . |
34,177 | public ISarlSpaceBuilder addSarlSpace ( String name ) { ISarlSpaceBuilder builder = this . sarlSpaceProvider . get ( ) ; builder . eInit ( getScript ( ) , name , getTypeResolutionContext ( ) ) ; return builder ; } | Create a SarlSpace builder . |
34,178 | public ISarlArtifactBuilder addSarlArtifact ( String name ) { ISarlArtifactBuilder builder = this . sarlArtifactProvider . get ( ) ; builder . eInit ( getScript ( ) , name , getTypeResolutionContext ( ) ) ; return builder ; } | Create a SarlArtifact builder . |
34,179 | public ISarlClassBuilder addSarlClass ( String name ) { ISarlClassBuilder builder = this . sarlClassProvider . get ( ) ; builder . eInit ( getScript ( ) , name , getTypeResolutionContext ( ) ) ; return builder ; } | Create a SarlClass builder . |
34,180 | public ISarlInterfaceBuilder addSarlInterface ( String name ) { ISarlInterfaceBuilder builder = this . sarlInterfaceProvider . get ( ) ; builder . eInit ( getScript ( ) , name , getTypeResolutionContext ( ) ) ; return builder ; } | Create a SarlInterface builder . |
34,181 | public ISarlEnumerationBuilder addSarlEnumeration ( String name ) { ISarlEnumerationBuilder builder = this . sarlEnumerationProvider . get ( ) ; builder . eInit ( getScript ( ) , name , getTypeResolutionContext ( ) ) ; return builder ; } | Create a SarlEnumeration builder . |
34,182 | public ISarlAnnotationTypeBuilder addSarlAnnotationType ( String name ) { ISarlAnnotationTypeBuilder builder = this . sarlAnnotationTypeProvider . get ( ) ; builder . eInit ( getScript ( ) , name , getTypeResolutionContext ( ) ) ; return builder ; } | Create a SarlAnnotationType builder . |
34,183 | protected void createAgentNameEditor ( Composite parent , String text ) { final Group group = SWTFactory . createGroup ( parent , text , 2 , 1 , GridData . FILL_HORIZONTAL ) ; this . agentNameTextField = SWTFactory . createSingleText ( group , 1 ) ; this . agentNameTextField . addModifyListener ( new ModifyListener ( )... | Creates the widgets for specifying a agent name . |
34,184 | protected void createContextIdentifierTypeEditor ( Composite parent , String text ) { final Group group = SWTFactory . createGroup ( parent , text , 1 , 1 , GridData . FILL_HORIZONTAL ) ; this . defaultContextIdentifierButton = createRadioButton ( group , Messages . MainLaunchConfigurationTab_11 ) ; this . defaultConte... | Creates the widgets for configuring the context identifier . |
34,185 | protected RootContextIdentifierType getSelectedContextIdentifierType ( ) { if ( this . randomContextIdentifierButton . getSelection ( ) ) { return RootContextIdentifierType . RANDOM_CONTEXT_ID ; } if ( this . bootContextIdentifierButton . getSelection ( ) ) { return RootContextIdentifierType . BOOT_AGENT_CONTEXT_ID ; }... | Replies the type of context identifier selected by the user . |
34,186 | protected void updateContextIdentifierTypeFromConfig ( ILaunchConfiguration config ) { final RootContextIdentifierType type = this . accessor . getDefaultContextIdentifier ( config ) ; assert type != null ; switch ( type ) { case RANDOM_CONTEXT_ID : this . randomContextIdentifierButton . setSelection ( true ) ; break ;... | Loads the context identifier type from the launch configuration s preference store . |
34,187 | protected void updateAgentNameFromConfig ( ILaunchConfiguration config ) { final String agentName = this . accessor . getAgent ( config ) ; this . agentNameTextField . setText ( Strings . nullToEmpty ( agentName ) ) ; } | Loads the agent name from the launch configuration s preference store . |
34,188 | protected boolean isValidAgentName ( ) { if ( this . lastAgentNameError != null ) { final boolean isValid = Strings . isNullOrEmpty ( this . lastAgentNameError ) ; if ( ! isValid ) { setErrorMessage ( this . lastAgentNameError ) ; } return isValid ; } final String name = this . agentNameTextField . getText ( ) ; if ( S... | Replies if the agent name is valid . |
34,189 | protected boolean isValidProjectName ( ) { final String name = this . fProjText . getText ( ) ; if ( Strings . isNullOrEmpty ( name ) ) { setErrorMessage ( Messages . MainLaunchConfigurationTab_3 ) ; return false ; } final IWorkspace workspace = ResourcesPlugin . getWorkspace ( ) ; final IStatus status = workspace . va... | Replies if the project name is valid . |
34,190 | protected void initializeAgentName ( IJavaElement javaElement , ILaunchConfigurationWorkingCopy config ) { String name = extractNameFromJavaElement ( javaElement ) ; this . configurator . setAgent ( config , name ) ; if ( name . length ( ) > 0 ) { final int index = name . lastIndexOf ( '.' ) ; if ( index > 0 ) { name =... | Reset the given configuration with the agent name attributes associated to the given element . |
34,191 | protected void handleAgentNameSearchButtonSelected ( ) { final IType [ ] types = searchAgentNames ( ) ; final DebugTypeSelectionDialog mmsd = new DebugTypeSelectionDialog ( getShell ( ) , types , "" ) ; if ( mmsd . open ( ) == Window . CANCEL ) { return ; } final IType type = ( IType ) mmsd . getFirstResult ( ) ; if ( ... | Invoked when the search button for the agent agent was clocked . |
34,192 | @ SuppressWarnings ( "static-method" ) protected boolean saveProjectSpecificOptions ( IProject project , boolean useSpecificOptions ) { if ( project != null ) { try { project . setPersistentProperty ( qualify ( PROPERTY_NAME_HAS_PROJECT_SPECIFIC ) , Boolean . toString ( useSpecificOptions ) ) ; return true ; } catch ( ... | Save the flag that indicates if the specific project options must be used . |
34,193 | public static int compareOsgiVersions ( String v1 , String v2 ) { return Version . parseVersion ( v1 ) . compareTo ( Version . parseVersion ( v2 ) ) ; } | Compare two OSGI versions . |
34,194 | public static int compareMavenVersions ( String v1 , String v2 ) { return parseMavenVersion ( v1 ) . compareTo ( parseMavenVersion ( v2 ) ) ; } | Compare two Maven versions . |
34,195 | public static Version parseMavenVersion ( String version ) { if ( Strings . isNullOrEmpty ( version ) ) { return new Version ( 0 , 0 , 0 ) ; } final boolean isSnapshot ; final String coreVersion ; Matcher matcher = Artifact . VERSION_FILE_PATTERN . matcher ( version ) ; if ( matcher . matches ( ) ) { coreVersion = matc... | Maven version parser . |
34,196 | public static < S extends Capacity > S getInternalSkill ( Agent agent , Class < S > type ) { return agent . getSkill ( type ) ; } | Replies the internal skill of an agent . |
34,197 | public static Charset getStringEncodingCharset ( ) { if ( currentStringEncoding == null ) { final String value = JanusConfig . getSystemProperty ( BYTE_ARRAY_STRING_CHARSET_NAME , null ) ; if ( value != null ) { try { currentStringEncoding = Charset . forName ( value ) ; if ( currentStringEncoding == null ) { currentSt... | Replies the charset that must be used for encoding the strings . |
34,198 | protected void generateIMemberBuilder ( MemberDescription description ) { if ( description . isTopElement ( ) ) { return ; } final TypeReference builder = description . getElementDescription ( ) . getBuilderInterfaceType ( ) ; final StringConcatenationClient content = new StringConcatenationClient ( ) { protected void ... | Generate the member builder interface . |
34,199 | protected void generateMemberAppender ( MemberDescription description ) { if ( description . isTopElement ( ) ) { return ; } final TypeReference appender = description . getElementDescription ( ) . getAppenderType ( ) ; final String generatedFieldAccessor = getGeneratedMemberAccessor ( description ) ; final StringConca... | Generate the member appender . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.