code
stringlengths
73
34.1k
label
stringclasses
1 value
public ConstructorDoc wrap(ConstructorDoc source) { if (source == null || source instanceof Proxy<?> || !(source instanceof ConstructorDocImpl)) { return source; } return new ConstructorDocWrapper((ConstructorDocImpl) source); }
java
public MethodDoc wrap(MethodDoc source) { if (source == null || source instanceof Proxy<?> || !(source instanceof MethodDocImpl)) { return source; } return new MethodDocWrapper((MethodDocImpl) source); }
java
public AnnotationTypeElementDoc wrap(AnnotationTypeElementDoc source) { if (source == null || source instanceof Proxy<?> || !(source instanceof AnnotationTypeElementDocImpl)) { return source; } return new AnnotationTypeElementDocWrapper((AnnotationTypeElementDocImpl) source); }
java
@Pure @Inline(value = "(long) (($1).doubleValue() * $2.MILLIS_IN_SECOND)", imported = {TimeExtensions.class}) public static long seconds(Number secs) { return (long) (secs.doubleValue() * MILLIS_IN_SECOND); }
java
@Pure @Inline(value = "(long) (($1).doubleValue() * $2.MILLIS_IN_MINUTE)", imported = {TimeExtensions.class}) public static long minutes(Number mins) { return (long) (mins.doubleValue() * MILLIS_IN_MINUTE); }
java
@Pure @Inline(value = "(long) (($1).doubleValue() * $2.MILLIS_IN_HOUR)", imported = {TimeExtensions.class}) public static long hours(Number hours) { return (long) (hours.doubleValue() * MILLIS_IN_HOUR); }
java
@Pure @Inline(value = "(long) (($1).doubleValue() * $2.MILLIS_IN_DAY)", imported = {TimeExtensions.class}) public static long days(Number days) { return (long) (days.doubleValue() * MILLIS_IN_DAY); }
java
@Pure @Inline(value = "(long) (($1).doubleValue() * $2.MILLIS_IN_WEEK)", imported = {TimeExtensions.class}) public static long weeks(Number weeks) { return (long) (weeks.doubleValue() * MILLIS_IN_WEEK); }
java
public Injector createInjectorAndDoEMFRegistration(Module... modules) { doPreSetup(); final Injector injector = createInjector(modules); register(injector); return injector; }
java
@SuppressWarnings("static-method") public Injector createInjector(Module... modules) { return Guice.createInjector(Modules.override(new SARLRuntimeModule()).with(modules)); }
java
protected static int installationOrder(Skill skill) { final int len = StandardBuiltinCapacitiesProvider.SKILL_INSTALLATION_ORDER.length; if (skill instanceof BuiltinSkill) { for (int i = 0; i < len; ++i) { final Class<? extends Skill> type = StandardBuiltinCapacitiesProvider.SKILL_INSTALLATION_ORDER[i]; ...
java
public AbstractSREInstallPage getPage(ISREInstall sre) { final IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint( SARLEclipsePlugin.PLUGIN_ID, SARLEclipseConfig.EXTENSION_POINT_SRE_INSTALL_PAGES); if (sre != null && extensionPoint != null) { IConfigurationElement firstTyp...
java
protected Resource getXtextResource() { //FIXME: for helping to resolve #661 final XtextEditor editor = getEditor(); if (editor != null) { final IResource resource = editor.getResource(); if (resource instanceof IStorage) { final IProject project = resource.getProject(); if (project != null) { ...
java
protected void generateExpressionAppender() { final TypeReference builderInterface = getExpressionBuilderInterface(); final TypeReference appender = getCodeElementExtractor().getElementAppenderImpl("Expression"); //$NON-NLS-1$ final StringConcatenationClient content = new StringConcatenationClient() { @Overrid...
java
protected String ensureContainerKeyword(EObject grammarContainer) { final Iterator<Keyword> iterator = Iterators.filter(grammarContainer.eContents().iterator(), Keyword.class); if (iterator.hasNext()) { return iterator.next().getValue(); } return getExpressionConfig().getFieldContainerDeclarationKeyword(); ...
java
protected String ensureFieldDeclarationKeyword(CodeElementExtractor.ElementDescription memberDescription) { final List<String> modifiers = getCodeBuilderConfig().getModifiers().get(memberDescription.getName()); if (modifiers != null && !modifiers.isEmpty()) { return modifiers.get(0); } return getExpressionCo...
java
protected ExpressionContextDescription getExpressionContextDescription() { for (final CodeElementExtractor.ElementDescription containerDescription : getCodeElementExtractor().getTopElements( getGrammar(), getCodeBuilderConfig())) { final AbstractRule rule = getMemberRule(containerDescription); if (rule != n...
java
public EventSpace postConstruction() { this.spaceRepository.postConstruction(); this.defaultSpace = createSpace(OpenEventSpaceSpecification.class, this.defaultSpaceID); if (this.defaultSpace == null) { // The default space could have been created before thanks to Hazelcast, // thus createSpace returns null ...
java
@SuppressWarnings("checkstyle:magicnumber") public TextStyle capacityMethodInvocation() { final TextStyle textStyle = extensionMethodInvocation().copy(); //textStyle.setColor(new RGB(128, 36, 0)); textStyle.setStyle(SWT.ITALIC); return textStyle; }
java
public void validate(StateAccess validationState, ValidationMessageAcceptor messageAcceptor) { if (isResponsible(validationState.getState().context, validationState.getState().currentObject)) { try { for (final MethodWrapper method : getMethods(validationState.getState().currentObject)) { final Context ct...
java
protected void collectMethods(Class<? extends AbstractExtraLanguageValidator> clazz, Collection<Class<?>> visitedClasses, Collection<MethodWrapper> result) { if (!visitedClasses.add(clazz)) { return; } for (final Method method : clazz.getDeclaredMethods()) { if (method.getAnnotation(Check.class) != nu...
java
@SuppressWarnings("static-method") protected boolean isResponsible(Map<Object, Object> context, EObject eObject) { // Skip the validation of an feature call if one of its container was validated previously if (eObject instanceof XMemberFeatureCall || eObject instanceof XFeatureCall) { final XAbstractFeatureCall...
java
protected void error(String message, EObject source, EStructuralFeature feature) { getContext().getMessageAcceptor().acceptError( MessageFormat.format(getErrorMessageFormat(), message), source, feature, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, IssueCodes.INVALID_EXTRA_LANGUAGE_GENERATION); ...
java
protected void warning(String message, EObject source, EStructuralFeature feature) { getContext().getMessageAcceptor().acceptWarning( MessageFormat.format(getErrorMessageFormat(), message), source, feature, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, IssueCodes.INVALID_EXTRA_LANGUAGE_GENERATION...
java
protected void info(String message, EObject source, EStructuralFeature feature) { getContext().getMessageAcceptor().acceptInfo( MessageFormat.format(getErrorMessageFormat(), message), source, feature, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, IssueCodes.INVALID_EXTRA_LANGUAGE_GENERATION); }
java
public ExtraLanguageTypeConverter getTypeConverter() { ExtraLanguageTypeConverter converter = this.typeConverter; if (converter == null) { converter = createTypeConverterInstance(getTypeConverterInitializer(), null); this.injector.injectMembers(converter); this.typeConverter = converter; } return conve...
java
@SuppressWarnings("static-method") protected ExtraLanguageTypeConverter createTypeConverterInstance( IExtraLanguageConversionInitializer initializer, IExtraLanguageGeneratorContext context) { return new ExtraLanguageTypeConverter(initializer, context); }
java
public ExtraLanguageFeatureNameConverter getFeatureNameConverter() { ExtraLanguageFeatureNameConverter converter = this.featureConverter; if (converter == null) { converter = createFeatureNameConverterInstance(getFeatureConverterInitializer(), null); this.injector.injectMembers(converter); this.featureConv...
java
protected ExtraLanguageFeatureNameConverter createFeatureNameConverterInstance( IExtraLanguageConversionInitializer initializer, IExtraLanguageGeneratorContext context) { return new ExtraLanguageFeatureNameConverter(initializer, context, getExtraLanguageKeywordProvider()); }
java
protected boolean doTypeMappingCheck(EObject source, JvmType type, Procedure3<? super EObject, ? super JvmType, ? super String> errorHandler) { if (source != null && type != null) { final ExtraLanguageTypeConverter converter = getTypeConverter(); final String qn = type.getQualifiedName(); if (converter != nu...
java
protected void doCheckMemberFeatureCallMapping(XAbstractFeatureCall featureCall, Procedure3<? super EObject, ? super JvmType, ? super String> typeErrorHandler, Function2<? super EObject, ? super JvmIdentifiableElement, ? extends Boolean> featureErrorHandler) { final XAbstractFeatureCall rootFeatureCall = Utils....
java
@SuppressWarnings("static-method") protected void handleInvocationTargetException(Throwable targetException, Context context) { // ignore NullPointerException, as not having to check for NPEs all the time is a convenience feature if (!(targetException instanceof NullPointerException)) { Exceptions.throwUnchecke...
java
protected ITreeAppendable generateStaticConstructor(JvmOperation it, ITreeAppendable appendable, GeneratorConfig config) { appendable.newLine(); appendable.openScope(); generateJavaDoc(it, appendable, config); final ITreeAppendable tracedAppendable = appendable.trace(it); tracedAppendable.append("static "); /...
java
public static int open(Shell parentShell) { final SubmitEclipseLogWizard wizard = new SubmitEclipseLogWizard(); final WizardDialog dialog = new WizardDialog(parentShell, wizard); wizard.setWizardDialog(dialog); return dialog.open(); }
java
WizardDialog getWizardDialog() { final WeakReference<WizardDialog> ref = this.wizardDialog; return (ref == null) ? null : ref.get(); }
java
@SuppressWarnings("static-method") protected String buildContent(String description, Charset charset) throws IOException { final StringBuilder fullContent = new StringBuilder(); // User message if (!Strings.isEmpty(description)) { fullContent.append(description); fullContent.append(Messages.SubmitEclipseL...
java
@Inject public void setSpaceService(ContextSpaceService service) { if (this.spaceService != null) { this.spaceService.removeSpaceRepositoryListener(this.serviceListener); } this.spaceService = service; if (this.spaceService != null) { this.spaceService.addSpaceRepositoryListener(this...
java
protected void firePeerConnected(URI peerURI, SpaceID space) { final NetworkServiceListener[] ilisteners; synchronized (this.listeners) { ilisteners = new NetworkServiceListener[this.listeners.size()]; this.listeners.toArray(ilisteners); } for (final NetworkServic...
java
protected void firePeerDisconnected(URI peerURI, SpaceID space) { final NetworkServiceListener[] ilisteners; synchronized (this.listeners) { ilisteners = new NetworkServiceListener[this.listeners.size()]; this.listeners.toArray(ilisteners); } for (final NetworkSer...
java
protected void firePeerDiscovered(URI peerURI) { final NetworkServiceListener[] ilisteners; synchronized (this.listeners) { ilisteners = new NetworkServiceListener[this.listeners.size()]; this.listeners.toArray(ilisteners); } for (final NetworkServiceListener list...
java
private static EventEnvelope extractEnvelope(Socket socket) throws IOException { // To-Do: Read the ZeroMQ socket via a NIO wrapper to support large data: // indeed the arrays has a maximal size bounded by a native int value, and // the real data could be larger than this limit. byte[] ...
java
protected synchronized void receive(EventEnvelope env) throws Exception { this.logger.getKernelLogger().fine(MessageFormat.format(Messages.ZeroMQNetworkService_8, this.validatedURI, env)); final EventDispatch dispatch = this.serializer.deserialize(env); this.logger.getKernelLogger().fine(Message...
java
public GeneratorConfig getGeneratorConfig() { if (this.generatorConfig == null) { this.generatorConfig = this.generatorConfigProvider.get( EcoreUtil.getRootContainer(this.contextObject)); } return this.generatorConfig; }
java
public GeneratorConfig2 getGeneratorConfig2() { if (this.generatorConfig2 == null) { this.generatorConfig2 = this.generatorConfigProvider2.get( EcoreUtil.getRootContainer(this.contextObject)); } return this.generatorConfig2; }
java
public Collection<Procedure1<? super ITreeAppendable>> getGuardEvalationCodeFor(SarlBehaviorUnit source) { assert source != null; final String id = source.getName().getIdentifier(); final Collection<Procedure1<? super ITreeAppendable>> evaluators; final Pair<SarlBehaviorUnit, Collection<Procedure1<? super ITree...
java
public List<Runnable> getPostFinalizationElements() { final GenerationContext prt = getParentContext(); if (prt != null) { return prt.getPostFinalizationElements(); } return this.postFinalization; }
java
public GeneratorConfig2 install(final ResourceSet resourceSet, GeneratorConfig2 config) { GeneratorConfigAdapter adapter = GeneratorConfigAdapter.findInEmfObject(resourceSet); if (adapter == null) { adapter = new GeneratorConfigAdapter(); } adapter.attachToEmfObject(resourceSet); return adapter.getLanguage...
java
protected String getOperatorSymbol(XAbstractFeatureCall call) { if (call != null) { final Resource res = call.eResource(); if (res instanceof StorageAwareResource) { final boolean isLoadedFromStorage = ((StorageAwareResource) res).isLoadedFromStorage(); if (isLoadedFromStorage) { final QualifiedNam...
java
public static String getCallSimpleName(XAbstractFeatureCall featureCall, ILogicalContainerProvider logicalContainerProvider, IdentifiableSimpleNameProvider featureNameProvider, Function0<? extends String> nullKeyword, Function0<? extends String> thisKeyword, Function0<? extends String> superKeyword, F...
java
public static boolean buildCallReceiver(XAbstractFeatureCall call, Function0<? extends String> thisKeyword, Function1<? super XExpression, ? extends String> referenceNameDefinition, List<Object> output) { if (call.isStatic()) { if (call instanceof XMemberFeatureCall) { final XMemberFeatureCall memberFeature...
java
@Provides @Named(JanusConfig.DEFAULT_CONTEXT_ID_NAME) public static UUID getContextID() { String str = JanusConfig.getSystemProperty(JanusConfig.DEFAULT_CONTEXT_ID_NAME); if (Strings.isNullOrEmpty(str)) { Boolean v; // From boot agent type str = JanusConfig.g...
java
@Provides @Named(JanusConfig.DEFAULT_SPACE_ID_NAME) public static UUID getSpaceID() { final String v = JanusConfig.getSystemProperty(JanusConfig.DEFAULT_SPACE_ID_NAME, JanusConfig.DEFAULT_SPACE_ID_VALUE); return UUID.fromString(v); }
java
private static String getPUBURIAsString() { String pubUri = JanusConfig.getSystemProperty(JanusConfig.PUB_URI); if (pubUri == null || pubUri.isEmpty()) { InetAddress a = NetworkUtil.getPrimaryAddress(); if (a == null) { a = NetworkUtil.getLoopbackAddress(); ...
java
public static void populateInterfaceElements( JvmDeclaredType jvmElement, Map<ActionPrototype, JvmOperation> operations, Map<String, JvmField> fields, IActionPrototypeProvider sarlSignatureProvider) { for (final JvmFeature feature : jvmElement.getAllFeatures()) { if (!"java.lang.Object".equals(feature....
java
public static boolean isVarArg(List<? extends XtendParameter> params) { assert params != null; if (params.size() > 0) { final XtendParameter param = params.get(params.size() - 1); assert param != null; return param.isVarArg(); } return false; }
java
public static String createNameForHiddenCapacityImplementationAttribute(String id) { return PREFIX_CAPACITY_IMPLEMENTATION + fixHiddenMember(id.toUpperCase()).replace(".", //$NON-NLS-1$ HIDDEN_MEMBER_REPLACEMENT_CHARACTER); }
java
public static boolean isNameForHiddenCapacityImplementationCallingMethod(String simpleName) { return simpleName != null && simpleName.startsWith(PREFIX_CAPACITY_IMPLEMENTATION) && simpleName.endsWith(POSTFIX_CAPACITY_IMPLEMENTATION_CALLER); }
java
public static String createNameForHiddenGuardEvaluatorMethod(String eventId, int handlerIndex) { return PREFIX_GUARD + fixHiddenMember(eventId) + HIDDEN_MEMBER_CHARACTER + handlerIndex; }
java
public static String createNameForHiddenEventHandlerMethod(String eventId, int handlerIndex) { return PREFIX_EVENT_HANDLER + fixHiddenMember(eventId) + HIDDEN_MEMBER_CHARACTER + handlerIndex; }
java
public static boolean isClass(LightweightTypeReference typeRef) { final JvmType t = typeRef.getType(); if (t instanceof JvmGenericType) { return !((JvmGenericType) t).isInterface(); } return false; }
java
public static boolean isFinal(LightweightTypeReference expressionTypeRef) { if (expressionTypeRef.isArray()) { return isFinal(expressionTypeRef.getComponentType()); } if (expressionTypeRef.isPrimitive()) { return true; } return expressionTypeRef.getType() instanceof JvmDeclaredType && ((JvmDeclaredT...
java
public static boolean isFinal(Class<?> expressionType) { if (expressionType.isArray()) { return isFinal(expressionType.getComponentType()); } if (expressionType.isPrimitive()) { return true; } return expressionType.isEnum() || Modifier.isFinal(expressionType.getModifiers()); }
java
public static boolean isInterface(LightweightTypeReference type) { return type.getType() instanceof JvmGenericType && ((JvmGenericType) type.getType()).isInterface(); }
java
@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:booleanexpressioncomplexity"}) public static boolean canCast( LightweightTypeReference fromType, LightweightTypeReference toType, boolean enablePrimitiveWidening, boolean enableVoidMatchingNull, boolean allowSynonyms) { if (enableVoidMatching...
java
public static LightweightTypeReference toLightweightTypeReference( JvmType type, CommonTypeComputationServices services, boolean keepUnboundWildcardInformation) { if (type == null) { return null; } final StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(services, type); final Lightweigh...
java
public static int compareVersions(String v1, String v2) { // Remove the SNAPSHOT version. //final String fixedv1 = v1.replaceFirst("-SNAPSHOT$", ""); //$NON-NLS-1$ //$NON-NLS-2$ //final String fixedv2 = v2.replaceFirst("-SNAPSHOT$", ""); //$NON-NLS-1$ //$NON-NLS-2$ //final Version vobject1 = Version.parseVersio...
java
public static String getSarlCodeFor(EObject object) { final ICompositeNode node = NodeModelUtils.getNode(object); if (node != null) { String text = node.getText(); if (text != null) { text = text.trim(); text = text.replaceAll("[\n\r\f]+", " "); //$NON-NLS-1$//$NON-NLS-2$ } return Strings.emptyT...
java
public static boolean hasAbstractMember(XtendTypeDeclaration declaration) { if (declaration != null) { for (final XtendMember member : declaration.getMembers()) { if (member instanceof XtendFunction) { if (((XtendFunction) member).isAbstract()) { return true; } } } } return false; }
java
public static boolean isCompatibleSARLLibraryOnClasspath(TypeReferences typeReferences, Notifier context) { final OutParameter<String> version = new OutParameter<>(); final SarlLibraryErrorCode code = getSARLLibraryVersionOnClasspath(typeReferences, context, version); if (code == SarlLibraryErrorCode.SARL_FOUND) ...
java
public static boolean isCompatibleSARLLibraryVersion(String version) { if (version != null) { final Version currentVersion = Version.parseVersion(SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING); final Version paramVersion = Version.parseVersion(version); return currentVersion.getMajor() == paramVersion.get...
java
public static boolean isCompatibleJREVersion(String version) { if (version != null && !version.isEmpty()) { final Version current = Version.parseVersion(version); if (current != null) { final Version minJdk = Version.parseVersion(SARLVersion.MINIMAL_JDK_VERSION); assert minJdk != null; if (current.c...
java
public static boolean isCompatibleXtextVersion(String version) { return version != null && !version.isEmpty() && compareVersions(version, SARLVersion.MINIMAL_XTEXT_VERSION) >= 0; }
java
public static boolean isCompatibleXtextVersion() { final XtextVersion xtextVersion = XtextVersion.getCurrent(); if (xtextVersion != null && !Strings.isNullOrEmpty(xtextVersion.getVersion())) { return isCompatibleXtextVersion(xtextVersion.getVersion()); } return false; }
java
public static boolean isSARLAnnotation(Class<?> type) { return (type != null && Annotation.class.isAssignableFrom(type)) && isSARLAnnotation(type.getPackage().getName()); }
java
public static boolean isFunctionalInterface(JvmGenericType type, IActionPrototypeProvider sarlSignatureProvider) { if (type != null && type.isInterface()) { final Map<ActionPrototype, JvmOperation> operations = new HashMap<>(); populateInterfaceElements(type, operations, null, sarlSignatureProvider); if (ope...
java
@SuppressWarnings("checkstyle:npathcomplexity") public static String dump(Object object, boolean includeStaticField) { if (object == null) { return new String(); } final StringBuilder buffer = new StringBuilder(); final LinkedList<Class<?>> types = new LinkedList<>(); types.add(object.getClass()); while...
java
public static JvmTypeReference cloneWithTypeParametersAndProxies( JvmTypeReference type, Iterable<JvmTypeParameter> executableTypeParameters, Map<String, JvmTypeReference> superTypeParameterMapping, JvmTypeReferenceBuilder typeParameterBuilder, JvmTypesBuilder typeBuilder, TypeReferences typeReferences, ...
java
public static void getSuperTypeParameterMap(JvmDeclaredType type, Map<String, JvmTypeReference> mapping) { for (final JvmTypeReference superTypeReference : type.getSuperTypes()) { if (superTypeReference instanceof JvmParameterizedTypeReference) { final JvmParameterizedTypeReference parameterizedTypeReference =...
java
public static void setStructuralFeature(EObject object, EStructuralFeature property, Object value) { assert object != null; assert property != null; if (value == null) { object.eUnset(property); } else { object.eSet(property, value); } }
java
public static XAbstractFeatureCall getRootFeatureCall(XAbstractFeatureCall featureCall) { final EObject container = featureCall.eContainer(); final XAbstractFeatureCall rootFeatureCall; if (container instanceof XMemberFeatureCall || container instanceof XFeatureCall) { rootFeatureCall = (XAbstractFeatureCall) ...
java
public static XAbstractFeatureCall getRootFeatureCall(XAbstractFeatureCall featureCall, XExpression container, List<JvmFormalParameter> containerParameters) { if (hasLocalParameters(featureCall, container, containerParameters) || !(featureCall instanceof XMemberFeatureCall || featureCall instanceof XFeatureCal...
java
@Override public final boolean isFieldNameSet() { if (_field_name_type != null) { switch (_field_name_type) { case STRING: return _field_name != null; case INT: return _field_name_sid >= 0; default: break; ...
java
int putSymbol(String symbolName) { if (isReadOnly) { throw new ReadOnlyValueException(SymbolTable.class); } if (mySymbolsCount == mySymbolNames.length) { int newlen = mySymbolsCount * 2; if (newlen < DEFAULT_CAPACITY) { ...
java
boolean symtabExtends(SymbolTable other) { // Throws ClassCastException if other isn't a local symtab LocalSymbolTable subset = (LocalSymbolTable) other; // Gather snapshots of each LST's data, so we don't // Superset must have same/more known symbols than subset. if (getMa...
java
public static SymbolToken newSymbolToken(SymbolTable symtab, String text) { // TODO amzn/ion-java/issues/21 symtab should not be null text.getClass(); // quick null check SymbolToken tok = (symtab == null ? null : symtab.find(text)); if (...
java
public static SymbolToken[] newSymbolTokens(SymbolTable symtab, String... text) { if (text != null) { int count = text.length; if (count != 0) { SymbolToken[] result = new SymbolToken[count]; ...
java
public static String[] toStrings(SymbolToken[] symbols, int count) { if (count == 0) return _Private_Utils.EMPTY_STRING_ARRAY; String[] annotations = new String[count]; for (int i = 0; i < count; i++) { SymbolToken tok = symbols[i]; String text = tok.getText(...
java
public static Iterator<IonValue> iterate(ValueFactory valueFactory, IonReader input) { return new IonIteratorImpl(valueFactory, input); }
java
public static boolean isTrivialTable(SymbolTable table) { if (table == null) return true; if (table.isSystemTable()) return true; if (table.isLocalTable()) { // this is only true when there are no local // symbols defined // and there are no import...
java
public static SymbolTable copyLocalSymbolTable(SymbolTable symtab) throws SubstituteSymbolTableException { if (! symtab.isLocalTable()) { String message = "symtab should be a local symtab"; throw new IllegalArgumentException(message); } SymbolTable[] ...
java
public static SymbolTable initialSymtab(_Private_LocalSymbolTableFactory lstFactory, SymbolTable defaultSystemSymtab, SymbolTable... imports) { if (imports == null || imports.length == 0) { return def...
java
public static boolean isNonSymbolScalar(IonType type) { return ! IonType.isContainer(type) && ! type.equals(IonType.SYMBOL); }
java
public static final int getSidForSymbolTableField(String text) { final int shortestFieldNameLength = 4; // 'name' if (text != null && text.length() >= shortestFieldNameLength) { int c = text.charAt(0); switch (c) { case 'v': ...
java
private Timestamp make_localtime() { int offset = _offset != null ? _offset.intValue() : 0; // We use a Copy-Constructor that expects the time parameters to be in // UTC, as that's what we're supposed to have. // As this Copy-Constructor doesn't apply local o...
java
public int getYear() { Timestamp adjusted = this; if (this._offset != null) { if (this._offset.intValue() != 0) { adjusted = make_localtime(); } } return adjusted._year; }
java
public int getMonth() { Timestamp adjusted = this; if (this._offset != null) { if (this._offset.intValue() != 0) { adjusted = make_localtime(); } } return adjusted._month; }
java
public int getHour() { Timestamp adjusted = this; if (this._offset != null) { if (this._offset.intValue() != 0) { adjusted = make_localtime(); } } return adjusted._hour; }
java
public int getMinute() { Timestamp adjusted = this; if (this._offset != null) { if (this._offset.intValue() != 0) { adjusted = make_localtime(); } } return adjusted._minute; }
java
public Timestamp withLocalOffset(Integer offset) { Precision precision = getPrecision(); if (precision.alwaysUnknownOffset() || safeEquals(offset, getLocalOffset())) { return this; } Timestamp ts = createFromUtcFields(precision, ...
java
private void clearUnusedPrecision() { switch (_precision) { case YEAR: _month = 1; case MONTH: _day = 1; case DAY: _hour = 0; _minute = 0; case MINUTE: _second = 0; _fr...
java