code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
protected static File toPackageFolder(String packageName) {
File file = null;
for (final String element : packageName.split("[.]")) { //$NON-NLS-1$
if (file == null) {
file = new File(element);
} else {
file = new File(file, element);
}
}
return file;
} | java |
protected String getBootClassPath() throws IOException {
final Toolchain toolchain = this.toolchainManager.getToolchainFromBuildContext("jdk", this.session); //$NON-NLS-1$
if (toolchain instanceof JavaToolchain && toolchain instanceof ToolchainPrivate) {
final JavaToolchain javaToolChain = (JavaToolchain) toolch... | java |
@Pure
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.getResources().add(resour... | java |
@Pure
public XExpression getDefaultXExpressionForType(String type) {
//TODO: Check if a similar function exists in the Xbase library.
XExpression expr = null;
if (type != null && !"void".equals(type) && !Void.class.getName().equals(type)) {
switch (type) {
case "boolean":
case "java.lang.Boolean":
X... | java |
@Pure
public String getDefaultValueForType(String type) {
//TODO: Check if a similar function exists in the Xbase library.
String defaultValue = "";
if (!Strings.isEmpty(type) && !"void".equals(type)) {
switch (type) {
case "boolean":
defaultValue = "true";
break;
case "double":
defaultValue... | java |
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 = XbaseFactory.eIN... | java |
public XFeatureCall createReferenceToSuper() {
final XExpression expr = getXExpression();
XtendTypeDeclaration type = EcoreUtil2.getContainerOfType(expr, XtendTypeDeclaration.class);
JvmType jvmObject = getAssociatedElement(JvmType.class, type, expr.eResource());
final XFeatureCall superFeature = XbaseFactory.e... | java |
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 = ... | java |
public static URI toURI(String uri) throws URISyntaxException {
final URI u = new URI(uri);
// Inspired by ZeroMQ
String adr = u.getAuthority();
if (adr == null) {
adr = u.getPath();
}
if (adr != null && adr.endsWith(":*")) { //$NON-NLS-1$
return new URI(u.getScheme(), u.getUserInfo(), adr.substring(0... | java |
public static URI toURI(InetAddress adr) {
try {
return new URI("tcp", adr.getHostAddress(), null, null); //$NON-NLS-1$
} catch (URISyntaxException e) {
throw new IOError(e);
}
} | java |
protected LightweightTypeReference toLightweightTypeReference(JvmType type, EObject context) {
final StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(getServices(), context);
final LightweightTypeReferenceFactory factory = new LightweightTypeReferenceFactory(owner, false);
return factory.toLightw... | java |
protected boolean isIgnored(String issueCode, EObject currentObject) {
final IssueSeverities severities = getIssueSeverities(getContext(), currentObject);
return severities.isIgnored(issueCode);
} | java |
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 ((JvmIdentif... | java |
@Check
public void checkSpaceUse(SarlSpace space) {
error(MessageFormat.format(
Messages.SARLValidator_0,
this.grammarAccess.getSpaceKeyword()),
space,
null);
} | java |
@Check
public void checkArtifactUse(SarlArtifact artifact) {
error(MessageFormat.format(
Messages.SARLValidator_0,
this.grammarAccess.getSpaceKeyword()),
artifact,
null);
} | java |
@Check
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,
... | java |
@Check
public void checkRequiredCapacityUse(SarlRequiredCapacity statement) {
warning(MessageFormat.format(
Messages.SARLValidator_0,
this.grammarAccess.getRequiresKeyword()),
statement,
null);
} | java |
@Check
protected void checkModifiers(SarlAgent agent) {
this.agentModifierValidator.checkModifiers(agent,
MessageFormat.format(Messages.SARLValidator_9, agent.getName()));
} | java |
@Check
protected void checkModifiers(SarlBehavior behavior) {
this.behaviorModifierValidator.checkModifiers(behavior,
MessageFormat.format(Messages.SARLValidator_9, behavior.getName()));
} | java |
@Check
protected void checkModifiers(SarlCapacity capacity) {
this.capacityModifierValidator.checkModifiers(capacity,
MessageFormat.format(Messages.SARLValidator_9, capacity.getName()));
} | java |
@Check
protected void checkModifiers(SarlSkill skill) {
this.skillModifierValidator.checkModifiers(skill,
MessageFormat.format(Messages.SARLValidator_9, skill.getName()));
} | java |
@Check
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,
nu... | java |
@Check
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... | java |
@Check
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... | java |
@Check
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,
nu... | java |
@Check
public void checkFinalFieldInitialization(SarlEvent event) {
final JvmGenericType inferredType = this.associations.getInferredType(event);
if (inferredType != null) {
checkFinalFieldInitialization(inferredType);
}
} | java |
@Check
public void checkFinalFieldInitialization(SarlBehavior behavior) {
final JvmGenericType inferredType = this.associations.getInferredType(behavior);
if (inferredType != null) {
checkFinalFieldInitialization(inferredType);
}
} | java |
@Check
public void checkFinalFieldInitialization(SarlSkill skill) {
final JvmGenericType inferredType = this.associations.getInferredType(skill);
if (inferredType != null) {
checkFinalFieldInitialization(inferredType);
}
} | java |
@Check
public void checkFinalFieldInitialization(SarlAgent agent) {
final JvmGenericType inferredType = this.associations.getInferredType(agent);
if (inferredType != null) {
checkFinalFieldInitialization(inferredType);
}
} | java |
@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity", "checkstyle:nestedifdepth"})
protected void checkSuperConstructor(
XtendTypeDeclaration container,
EStructuralFeature feature,
Collection<ActionParameterTypes> defaultSignatures) {
final JvmDeclaredType jvmElement = this.ass... | java |
@Check(CheckType.FAST)
public void checkForbiddenCalls(XAbstractFeatureCall expression) {
if (this.featureCallValidator.isDisallowedCall(expression)) {
error(
MessageFormat.format(
Messages.SARLValidator_36,
expression.getFeature().getIdentifier()),
expression,
null,
ValidationMe... | java |
@Check(CheckType.FAST)
public void checkDiscouragedCalls(XAbstractFeatureCall expression) {
if (!isIgnored(DISCOURAGED_REFERENCE)
&& this.featureCallValidator.isDiscouragedCall(expression)) {
addIssue(
MessageFormat.format(Messages.SARLValidator_37,
expression.getConcreteSyntaxFeatureName()),
... | java |
@Check
public void checkDefaultValueTypeCompatibleWithParameterType(SarlFormalParameter param) {
final XExpression defaultValue = param.getDefaultValue();
if (defaultValue != null) {
final JvmTypeReference rawType = param.getParameterType();
assert rawType != null;
final LightweightTypeReference toType = ... | java |
@Check
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... | java |
@Check(CheckType.FAST)
public void checkActionName(SarlAction action) {
final JvmOperation inferredType = this.associations.getDirectlyInferredOperation(action);
final QualifiedName name = QualifiedName.create(inferredType.getQualifiedName('.').split("\\.")); //$NON-NLS-1$
if (this.featureNames.isDisallowedName(... | java |
@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.fixHiddenMember(field.getName... | java |
@Check
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.populateInheritance... | java |
@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,
XtendPackage.Literal... | java |
@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,
XbasePackage.Literals.... | java |
@Check
public void checkRedundantImplementedInterfaces(SarlSkill skill) {
checkRedundantInterfaces(
skill,
SARL_SKILL__IMPLEMENTS,
skill.getImplements(),
Utils.singletonList(skill.getExtends()));
} | java |
@Check
public void checkRedundantImplementedInterfaces(SarlClass xtendClass) {
checkRedundantInterfaces(
xtendClass,
XTEND_CLASS__IMPLEMENTS,
xtendClass.getImplements(),
Utils.singletonList(xtendClass.getExtends()));
} | java |
@Check
public void checkRedundantImplementedInterfaces(SarlInterface xtendInterface) {
checkRedundantInterfaces(
xtendInterface,
XTEND_INTERFACE__EXTENDS,
xtendInterface.getExtends(),
Collections.<JvmTypeReference>emptyList());
} | java |
@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,
ValidationMessageAcce... | java |
@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(ref)) {
error... | java |
@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(MessageFormat.format(
Me... | java |
@Check(CheckType.FAST)
public void checkSuperTypes(SarlCapacity capacity) {
checkSuperTypes(
capacity,
SARL_CAPACITY__EXTENDS,
capacity.getExtends(),
Capacity.class,
false);
} | java |
@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(),
C... | java |
@Check(CheckType.FAST)
public void checkSuperType(SarlEvent event) {
checkSuperTypes(
event,
SARL_EVENT__EXTENDS,
Utils.singletonList(event.getExtends()),
Event.class,
false);
} | java |
@Check(CheckType.FAST)
public void checkSuperType(SarlBehavior behavior) {
checkSuperTypes(
behavior,
SARL_BEHAVIOR__EXTENDS,
Utils.singletonList(behavior.getExtends()),
Behavior.class,
false);
} | java |
@Check(CheckType.FAST)
public void checkSuperType(SarlAgent agent) {
checkSuperTypes(
agent,
SARL_AGENT__EXTENDS,
Utils.singletonList(agent.getExtends()),
Agent.class,
false);
} | java |
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 JvmTypeReferenc... | java |
@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(MessageFormat.forma... | java |
@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_CAP... | java |
@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);
final Map<Str... | java |
@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(uses,
dec... | java |
@Check
public void checkReservedAnnotation(XtendAnnotationTarget annotationTarget) {
if (!isIgnored(USED_RESERVED_SARL_ANNOTATION)) {
if (annotationTarget.getAnnotations().isEmpty() || !isRelevantAnnotationTarget(annotationTarget)) {
return;
}
final QualifiedName reservedPackage = this.qualifiedNameConv... | java |
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 || obj != container... | java |
protected List<LightweightTypeReference> getParamTypeReferences(JvmExecutable jvmExecutable,
boolean wrapFromPrimitives, boolean wrapToPrimitives) {
assert (wrapFromPrimitives && !wrapToPrimitives) || (wrapToPrimitives && !wrapFromPrimitives);
final List<LightweightTypeReference> types = newArrayList();
for (f... | java |
@Check
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.getA... | java |
@Check
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 ... | java |
@Check
public void checkStaticConstructorPrototype(XtendConstructor constructor) {
if (constructor.isStatic()) {
if (!constructor.getAnnotations().isEmpty()) {
error(Messages.SARLValidator_23,
constructor,
XtendPackage.eINSTANCE.getXtendAnnotationTarget_Annotations(),
ValidationMessageAccept... | java |
@Check
@SuppressWarnings({"checkstyle:nestedifdepth", "checkstyle:npathcomplexity", "checkstyle:cyclomaticcomplexity"})
public void checkUnsynchronizedField(XtendField field) {
if (doCheckValidMemberName(field) && !isIgnored(POTENTIAL_FIELD_SYNCHRONIZATION_PROBLEM)) {
final JvmField jvmField = this.associations.... | java |
protected boolean isLocallyAssigned(EObject target, EObject containerToFindUsage) {
if (this.readAndWriteTracking.isAssigned(target)) {
return true;
}
final Collection<Setting> usages = XbaseUsageCrossReferencer.find(target, containerToFindUsage);
// field are assigned when they are not used as the left oper... | java |
@SuppressWarnings("static-method")
protected boolean isOOType(XtendTypeDeclaration type) {
return type instanceof XtendClass
|| type instanceof XtendInterface
|| type instanceof XtendEnum
|| type instanceof XtendAnnotationType;
} | java |
@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.equal(Delegate.class.getNa... | java |
@SuppressWarnings("static-method")
protected boolean isAOActiveAnnotation(XAnnotation annotation) {
final String name = annotation.getAnnotationType().getQualifiedName();
return Strings.equal(Accessors.class.getName(), name);
} | java |
@SuppressWarnings("static-method")
protected boolean isAOActiveAnnotationReceiver(XtendTypeDeclaration container) {
return container instanceof SarlAgent
|| container instanceof SarlBehavior
|| container instanceof SarlSkill;
} | java |
@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.getName(), name);
} | java |
@Check
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)) {
name2type.put(... | java |
@SuppressWarnings("static-method")
protected boolean isDefaultValuedParameterFunction(XtendFunction function) {
for (final XtendParameter parameter : function.getParameters()) {
if (parameter instanceof SarlFormalParameter) {
final SarlFormalParameter sarlParameter = (SarlFormalParameter) parameter;
if (s... | java |
protected void reportCastWarnings(JvmTypeReference concreteSyntax, LightweightTypeReference toType, LightweightTypeReference fromType) {
if (!isIgnored(OBSOLETE_CAST) && toType.isAssignableFrom(fromType)) {
addIssue(MessageFormat.format(Messages.SARLValidator_96, fromType.getHumanReadableName(),
toType.getHum... | java |
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 (XImportDecla... | java |
public ISarlEventBuilder addSarlEvent(String name) {
ISarlEventBuilder builder = this.sarlEventProvider.get();
builder.eInit(getScript(), name, getTypeResolutionContext());
return builder;
} | java |
public ISarlCapacityBuilder addSarlCapacity(String name) {
ISarlCapacityBuilder builder = this.sarlCapacityProvider.get();
builder.eInit(getScript(), name, getTypeResolutionContext());
return builder;
} | java |
public ISarlAgentBuilder addSarlAgent(String name) {
ISarlAgentBuilder builder = this.sarlAgentProvider.get();
builder.eInit(getScript(), name, getTypeResolutionContext());
return builder;
} | java |
public ISarlBehaviorBuilder addSarlBehavior(String name) {
ISarlBehaviorBuilder builder = this.sarlBehaviorProvider.get();
builder.eInit(getScript(), name, getTypeResolutionContext());
return builder;
} | java |
public ISarlSkillBuilder addSarlSkill(String name) {
ISarlSkillBuilder builder = this.sarlSkillProvider.get();
builder.eInit(getScript(), name, getTypeResolutionContext());
return builder;
} | java |
public ISarlSpaceBuilder addSarlSpace(String name) {
ISarlSpaceBuilder builder = this.sarlSpaceProvider.get();
builder.eInit(getScript(), name, getTypeResolutionContext());
return builder;
} | java |
public ISarlArtifactBuilder addSarlArtifact(String name) {
ISarlArtifactBuilder builder = this.sarlArtifactProvider.get();
builder.eInit(getScript(), name, getTypeResolutionContext());
return builder;
} | java |
public ISarlClassBuilder addSarlClass(String name) {
ISarlClassBuilder builder = this.sarlClassProvider.get();
builder.eInit(getScript(), name, getTypeResolutionContext());
return builder;
} | java |
public ISarlInterfaceBuilder addSarlInterface(String name) {
ISarlInterfaceBuilder builder = this.sarlInterfaceProvider.get();
builder.eInit(getScript(), name, getTypeResolutionContext());
return builder;
} | java |
public ISarlEnumerationBuilder addSarlEnumeration(String name) {
ISarlEnumerationBuilder builder = this.sarlEnumerationProvider.get();
builder.eInit(getScript(), name, getTypeResolutionContext());
return builder;
} | java |
public ISarlAnnotationTypeBuilder addSarlAnnotationType(String name) {
ISarlAnnotationTypeBuilder builder = this.sarlAnnotationTypeProvider.get();
builder.eInit(getScript(), name, getTypeResolutionContext());
return builder;
} | java |
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() {
@SuppressWarnings("sy... | java |
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.defaultContextIdentifierButton.ad... | java |
protected RootContextIdentifierType getSelectedContextIdentifierType() {
if (this.randomContextIdentifierButton.getSelection()) {
return RootContextIdentifierType.RANDOM_CONTEXT_ID;
}
if (this.bootContextIdentifierButton.getSelection()) {
return RootContextIdentifierType.BOOT_AGENT_CONTEXT_ID;
}
return ... | java |
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;
case BO... | java |
protected void updateAgentNameFromConfig(ILaunchConfiguration config) {
final String agentName = this.accessor.getAgent(config);
this.agentNameTextField.setText(Strings.nullToEmpty(agentName));
} | java |
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 (Strings.i... | java |
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.validateName(nam... | java |
protected void initializeAgentName(IJavaElement javaElement, ILaunchConfigurationWorkingCopy config) {
String name = extractNameFromJavaElement(javaElement);
// Set the attribute
this.configurator.setAgent(config, name);
// Rename the launch configuration
if (name.length() > 0) {
final int index = name.l... | java |
protected void handleAgentNameSearchButtonSelected() {
final IType[] types = searchAgentNames();
// Ask to the user
final DebugTypeSelectionDialog mmsd = new DebugTypeSelectionDialog(getShell(),
types, ""); //$NON-NLS-1$
if (mmsd.open() == Window.CANCEL) {
return;
}
final IType type = (IType) mmsd.ge... | java |
@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;
} catc... | java |
public static int compareOsgiVersions(String v1, String v2) {
return Version.parseVersion(v1).compareTo(Version.parseVersion(v2));
} | java |
public static int compareMavenVersions(String v1, String v2) {
return parseMavenVersion(v1).compareTo(parseMavenVersion(v2));
} | java |
public static Version parseMavenVersion(String version) {
if (Strings.isNullOrEmpty(version)) {
return new Version(0, 0, 0);
}
// Detect the snapshot
final boolean isSnapshot;
final String coreVersion;
Matcher matcher = Artifact.VERSION_FILE_PATTERN.matcher(version);
if (matcher.matches()) {
coreVe... | java |
@Pure
public static <S extends Capacity> S getInternalSkill(Agent agent, Class<S> type) {
return agent.getSkill(type);
} | java |
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) {
cu... | java |
protected void generateIMemberBuilder(MemberDescription description) {
if (description.isTopElement()) {
return;
}
final TypeReference builder = description.getElementDescription().getBuilderInterfaceType();
final StringConcatenationClient content = new StringConcatenationClient() {
@Override
protected... | java |
protected void generateMemberAppender(MemberDescription description) {
if (description.isTopElement()) {
return;
}
final TypeReference appender = description.getElementDescription().getAppenderType();
final String generatedFieldAccessor = getGeneratedMemberAccessor(description);
final StringConcatenationCl... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.