code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private synchronized void reopen(String reason, long targetPos, long length)
throws IOException {
if (wrappedStream != null) {
closeStream("reopen(" + reason + ")", contentRangeFinish, false);
}
contentRangeFinish = calculateRequestLimit(inputPolicy, targetPos,
length, contentLength, r... | java |
private void lazySeek(long targetPos, long len) throws IOException {
//For lazy seek
seekInStream(targetPos, len);
//re-open at specific location if needed
if (wrappedStream == null) {
reopen("read from new offset", targetPos, len);
}
} | java |
static long calculateRequestLimit(
COSInputPolicy inputPolicy,
long targetPos,
long length,
long contentLength,
long readahead) {
long rangeLimit;
switch (inputPolicy) {
case Random:
// positioned.
// read either this block, or the here + readahead value.
... | java |
public static String getContainerName(String hostname,
boolean serviceRequired) throws IOException {
int i = hostname.lastIndexOf(".");
if (i <= 0) {
if (serviceRequired) {
throw badHostName(hostname);
}
return hostname;
}
return hostname.substring(0, i);
} | java |
public static String getServiceName(String hostname) throws IOException {
int i = hostname.lastIndexOf(".");
if (i <= 0) {
throw badHostName(hostname);
}
String service = hostname.substring(i + 1);
if (service.isEmpty() || service.contains(".")) {
throw badHostName(hostname);
}
r... | java |
public static boolean validSchema(URI uri) throws IOException {
LOG.trace("Checking schema {}", uri.toString());
String hostName = Utils.getHost(uri);
LOG.trace("Got hostname as {}", hostName);
int i = hostName.lastIndexOf(".");
if (i < 0) {
return false;
}
String service = hostName.su... | java |
public static String getHost(URI uri) throws IOException {
String host = uri.getHost();
if (host != null) {
return host;
}
host = uri.toString();
int sInd = host.indexOf("//") + 2;
host = host.substring(sInd);
int eInd = host.indexOf("/");
if (eInd != -1) {
host = host.substr... | java |
public static String getOption(Properties props, String key) throws IOException {
String val = props.getProperty(key);
if (val == null) {
throw new IOException("Undefined property: " + key);
}
return val;
} | java |
public static void updateProperty(Configuration conf, String prefix, String[] altPrefix,
String key, Properties props, String propsKey,
boolean required) throws ConfigurationParseException {
String val = conf.get(prefix + key);
String altKey = prefix + key;
if (val == null) {
// try altern... | java |
public static String extractTaskID(String path, String identifier) {
LOG.debug("extract task id for {}", path);
if (path.contains(HADOOP_ATTEMPT)) {
String prf = path.substring(path.indexOf(HADOOP_ATTEMPT));
if (prf.contains("/")) {
return TaskAttemptID.forName(prf.substring(0, prf.indexOf("... | java |
public static long lastModifiedAsLong(String strTime) throws IOException {
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(TIME_PATTERN,
Locale.US);
try {
long lastModified = simpleDateFormat.parse(strTime).getTime();
if (lastModified == 0) {
lastModified = System.curr... | java |
public static IOException extractException(String operation, String path,
ExecutionException ee) {
IOException ioe;
Throwable cause = ee.getCause();
if (cause instanceof AmazonClientException) {
ioe = translateException(operation, path, (AmazonClientException) cause);
} else if (cause instan... | java |
static boolean containsInterruptedException(Throwable thrown) {
if (thrown == null) {
return false;
}
if (thrown instanceof InterruptedException || thrown instanceof InterruptedIOException) {
return true;
}
// tail recurse
return containsInterruptedException(thrown.getCause());
} | java |
public static int ensureOutputParameterInRange(String name, long size) {
if (size > Integer.MAX_VALUE) {
LOG.warn("cos: {} capped to ~2.14GB"
+ " (maximum allowed size with current output mechanism)", name);
return Integer.MAX_VALUE;
} else {
return (int) size;
}
} | java |
public static COSFileStatus createFileStatus(Path keyPath,
S3ObjectSummary summary,
long blockSize) {
long size = summary.getSize();
return createFileStatus(keyPath,
objectRepresentsDirectory(summary.getKey(), size),
size, summary.getLastModified(), blockSize);
} | java |
public static IStoreClient getStoreClient(URI fsuri, Configuration conf) throws IOException {
final String fsSchema = fsuri.toString().substring(0, fsuri.toString().indexOf("://"));
final ClassLoader classLoader = ObjectStoreVisitor.class.getClassLoader();
String[] supportedSchemas = conf.get("fs.stocator.s... | java |
public void createAccount() {
mAccount = new AccountFactory(mAccountConfig).setHttpClient(httpclient).createAccount();
mAccess = mAccount.getAccess();
if (mRegion != null) {
mAccess.setPreferredRegion(mRegion);
}
} | java |
public void createDummyAccount() {
mAccount = new DummyAccountFactory(mAccountConfig).setHttpClient(httpclient).createAccount();
mAccess = mAccount.getAccess();
} | java |
public void authenticate() {
if (mAccount == null) {
// Create account also performs authentication.
createAccount();
} else {
mAccess = mAccount.authenticate();
if (mRegion != null) {
mAccess.setPreferredRegion(mRegion);
}
}
} | java |
public String getAccessURL() {
if (mUsePublicURL) {
LOG.trace("Using public URL: " + mAccess.getPublicURL());
return mAccess.getPublicURL();
}
LOG.trace("Using internal URL: " + mAccess.getInternalURL());
return mAccess.getInternalURL();
} | java |
private synchronized COSDataBlocks.DataBlock createBlockIfNeeded() throws IOException {
if (activeBlock == null) {
blockCount++;
if (blockCount >= COSConstants.MAX_MULTIPART_COUNT) {
LOG.error("Number of partitions in stream exceeds limit for S3: "
+ COSConstants.MAX_MULTIPART_COUNT
... | java |
private synchronized void uploadCurrentBlock() throws IOException {
if (!hasActiveBlock()) {
throw new IllegalStateException("No active block");
}
LOG.debug("Writing block # {}", blockCount);
if (multiPartUpload == null) {
LOG.debug("Initiating Multipart upload");
multiPartUpload = new... | java |
private void putObject() throws IOException {
LOG.debug("Executing regular upload for {}", writeOperationHelper);
final COSDataBlocks.DataBlock block = getActiveBlock();
int size = block.dataSize();
final COSDataBlocks.BlockUploadData uploadData = block.startUpload();
final PutObjectRequest putObje... | java |
@Override
public FSDataOutputStream createObject(String objName, String contentType,
Map<String, String> metadata, Statistics statistics) throws IOException {
final URL url = new URL(mJossAccount.getAccessURL() + "/" + getURLEncodedObjName(objName));
LOG.debug("PUT {}. Content-Type : {}", url.toString()... | java |
private void setCorrectSize(StoredObject tmp, Container cObj) {
long objectSize = tmp.getContentLength();
if (objectSize == 0) {
// we may hit a well known Swift bug.
// container listing reports 0 for large objects.
StoredObject soDirect = cObj
.getObject(tmp.getName());
long ... | java |
private FileStatus createFileStatus(StoredObject tmp, Container cObj,
String hostName, Path path) throws IllegalArgumentException, IOException {
String newMergedPath = getMergedPath(hostName, path, tmp.getName());
return new FileStatus(tmp.getContentLength(), false, 1, blockSize,
Utils.lastModifie... | java |
public static Properties initialize(URI uri, Configuration conf,
String scheme) throws IOException {
LOG.debug("COS driver: initialize start for {} ", uri.toString());
String host = Utils.getHost(uri);
LOG.debug("extracted host name from {} is {}", uri.toString(), host);
String bucket = Utils.getC... | java |
private HttpRequestRetryHandler getRetryHandler() {
final HttpRequestRetryHandler myRetryHandler = new HttpRequestRetryHandler() {
public boolean retryRequest(IOException exception, int executionCount, HttpContext context) {
if (executionCount >= connectionConfiguration.getExecutionCount()) {
... | java |
public CloseableHttpClient createHttpConnection() {
LOG.trace("HTTP build new connection based on connection pool");
return HttpClients
.custom()
.setRetryHandler(getRetryHandler())
.setConnectionManager(connectionPool)
.setDefaultRequestConfig(rConfig)
... | java |
public void setGraphvizCommand(String cmd) {
if (cmd != null && cmd.length() == 0)
cmd = null;
graphvizCommand = cmd;
} | java |
public String javaName(final JvmVisibility visibility) {
if ((visibility != null)) {
String _switchResult = null;
if (visibility != null) {
switch (visibility) {
case PRIVATE:
_switchResult = "private ";
break;
case PUBLIC:
_switchResult = ... | java |
protected String getInvalidWritableVariableAccessMessage(XVariableDeclaration variable, XAbstractFeatureCall featureCall, IResolvedTypes resolvedTypes) {
// TODO this should be part of a separate validation service
XClosure containingClosure = EcoreUtil2.getContainerOfType(featureCall, XClosure.class);
if (contai... | java |
public void setDocumentation(/* @Nullable */ JvmIdentifiableElement jvmElement, /* @Nullable */ String documentation) {
if(jvmElement == null || documentation == null)
return;
DocumentationAdapter documentationAdapter = new DocumentationAdapter();
documentationAdapter.setDocumentation(documentation);
jvmElem... | java |
public void copyDocumentationTo(/* @Nullable */ final EObject source, /* @Nullable */ JvmIdentifiableElement jvmElement) {
if(source == null || jvmElement == null)
return;
DocumentationAdapter documentationAdapter = new DocumentationAdapter() {
private boolean computed = false;
@Override
public Strin... | java |
protected boolean isPrimitiveBoolean(JvmTypeReference typeRef) {
if (InferredTypeIndicator.isInferred(typeRef)) {
return false;
}
return typeRef != null && typeRef.getType() != null &&
!typeRef.getType().eIsProxy() &&
"boolean".equals(typeRef.getType().getIdentifier());
} | java |
public void setGeneratorProjectName(String generatorProjectName) {
if (generatorProjectName == null || "".equals(generatorProjectName.trim())) {
return;
}
this.generatorProjectName = generatorProjectName.trim();
} | java |
public void setFileExtension(String modelFileExtension) {
if (modelFileExtension == null || "".equals(modelFileExtension.trim())) {
return;
}
this.modelFileExtension = modelFileExtension.trim();
} | java |
public static String getCharacterName(char character) {
String transliterated = transliterator.transliterate(String.valueOf(character));
// returns strings in the for of SEMICOLON}
return transliterated.substring("\\N{".length(),transliterated.length()-"}".length());
} | java |
@Override
protected List<String> getSignificantContent() {
final List<String> result = super.getSignificantContent();
if (((result.size() >= 1) && Objects.equal(this.getLineDelimiter(), IterableExtensions.<String>last(result)))) {
int _size = result.size();
int _minus = (_size - 1);
return r... | java |
public void selectStrategy() {
LightweightTypeReference expectedType = expectation.getExpectedType();
if (expectedType == null) {
strategy = getClosureWithoutExpectationHelper();
} else {
JvmOperation operation = functionTypes.findImplementingOperation(expectedType);
JvmType type = expectedType.getType()... | java |
protected void validateResourceState(Resource resource) {
if (resource instanceof StorageAwareResource && ((StorageAwareResource) resource).isLoadedFromStorage()) {
LOG.error("Discouraged attempt to compute types for resource that was loaded from storage. Resource was : "+resource.getURI(), new Exception());
}
... | java |
public synchronized String getString() {
// check state and initialize buffer
if (outputFileName == null)
throw new IllegalStateException();
StringBuffer out = new StringBuffer();
// start the SMAP
out.append("SMAP\n");
out.append(outputFileName + '\n');
out.append(defaultStratum + '\n');
// includ... | java |
@Deprecated
protected boolean doValidateLambdaContents(XClosure closure, DiagnosticChain diagnostics, Map<Object, Object> context) {
return true;
} | java |
public boolean isJavaSwitchExpression(final XSwitchExpression it) {
boolean _xblockexpression = false;
{
final LightweightTypeReference switchType = this.getSwitchVariableType(it);
if ((switchType == null)) {
return false;
}
boolean _isSubtypeOf = switchType.isSubtypeOf(Integer.T... | java |
public boolean isJava7SwitchExpression(final XSwitchExpression it) {
boolean _xblockexpression = false;
{
final LightweightTypeReference switchType = this.getSwitchVariableType(it);
if ((switchType == null)) {
return false;
}
boolean _isSubtypeOf = switchType.isSubtypeOf(Integer.... | java |
protected boolean isMultilineLambda(final XClosure closure) {
final ILeafNode closingBracket = this._nodeModelAccess.nodeForKeyword(closure, "]");
HiddenLeafs _hiddenLeafsBefore = null;
if (closingBracket!=null) {
_hiddenLeafsBefore=this._hiddenLeafAccess.getHiddenLeafsBefore(closingBracket);
}
... | java |
protected List<ICompositeNode> internalFindValidReplaceRootNodeForChangeRegion(List<ICompositeNode> nodesEnclosingRegion) {
List<ICompositeNode> result = new ArrayList<ICompositeNode>();
boolean mustSkipNext = false;
for (int i = 0; i < nodesEnclosingRegion.size(); i++) {
ICompositeNode node = nodesEnclosingRe... | java |
public ResolvedFeatures getResolvedFeatures(LightweightTypeReference contextType, JavaVersion targetVersion) {
return new ResolvedFeatures(contextType, overrideTester, targetVersion);
} | java |
public Class<? extends org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor> bindIParseTreeConstructor() {
return org.eclipse.xtext.generator.parser.antlr.debug.parseTreeConstruction.SimpleAntlrParsetreeConstructor.class;
} | java |
@org.eclipse.xtext.service.SingletonBinding(eager=true) public Class<? extends org.eclipse.xtext.generator.parser.antlr.debug.validation.SimpleAntlrJavaValidator> bindSimpleAntlrJavaValidator() {
return org.eclipse.xtext.generator.parser.antlr.debug.validation.SimpleAntlrJavaValidator.class;
} | java |
public Class<? extends org.eclipse.xtext.formatting.IFormatter> bindIFormatter() {
return org.eclipse.xtext.generator.parser.antlr.debug.formatting.SimpleAntlrFormatter.class;
} | java |
protected void addLocalToCurrentScope(XExpression expression, ITypeComputationState state) {
if (expression instanceof XVariableDeclaration) {
addLocalToCurrentScope((XVariableDeclaration)expression, state);
}
} | java |
protected void _computeTypes(XDoWhileExpression object, ITypeComputationState state) {
ITypeComputationResult loopBodyResult = computeWhileLoopBody(object, state, false);
boolean noImplicitReturn = (loopBodyResult.getConformanceFlags() & ConformanceFlags.NO_IMPLICIT_RETURN) != 0;
LightweightTypeReference primitiv... | java |
protected EObject findAccessibleType(String fragment, ResourceSet resourceSet, Iterator<IEObjectDescription> fromIndex) throws UnknownNestedTypeException {
IEObjectDescription description = fromIndex.next();
return getAccessibleType(description, fragment, resourceSet);
} | java |
protected EObject getAccessibleType(IEObjectDescription description, String fragment, ResourceSet resourceSet) throws UnknownNestedTypeException {
EObject typeProxy = description.getEObjectOrProxy();
if (typeProxy.eIsProxy()) {
typeProxy = EcoreUtil.resolve(typeProxy, resourceSet);
}
if (!typeProxy.eIsProxy(... | java |
public EObject resolveJavaObject(JvmType rootType, String fragment) throws UnknownNestedTypeException {
if (fragment.endsWith("[]")) {
return resolveJavaArrayObject(rootType, fragment);
}
int slash = fragment.indexOf('/');
if (slash != -1) {
if (slash == 0)
return null;
String containerFragment = ... | java |
protected void cumulateDistance(final List<LightweightTypeReference> references, Multimap<JvmType, LightweightTypeReference> all,
Multiset<JvmType> cumulatedDistance) {
for(LightweightTypeReference other: references) {
Multiset<JvmType> otherDistance = LinkedHashMultiset.create();
initializeDistance(other, a... | java |
public void configureFormatterPreferences(Binder binder) {
binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
} | java |
@Override
public void resolveLazyCrossReferences(CancelIndicator monitor) {
IParseResult parseResult = getParseResult();
if (parseResult != null) {
batchLinkingService.resolveBatched(parseResult.getRootASTElement(), monitor);
}
operationCanceledManager.checkCanceled(monitor);
super.resolveLazyCrossReferen... | java |
private void markPendingInitialization(JvmDeclaredTypeImplCustom type) {
type.setPendingInitialization(true);
for (JvmMember member : type.basicGetMembers()) {
if (member instanceof JvmDeclaredTypeImplCustom) {
markPendingInitialization((JvmDeclaredTypeImplCustom) member);
}
}
} | java |
protected Map<JvmIdentifiableElement, ResolvedTypes> prepare(ResolvedTypes resolvedTypes, IFeatureScopeSession featureScopeSession) {
Map<JvmIdentifiableElement, ResolvedTypes> resolvedTypesByContext = Maps.newHashMapWithExpectedSize(3);
JvmType root = getRootJvmType();
rootedInstances.add(root);
recordExpress... | java |
protected XExpression getInferredFrom(JvmTypeReference typeReference) {
if (InferredTypeIndicator.isInferred(typeReference)) {
XComputedTypeReference computed = (XComputedTypeReference) typeReference;
if (computed.getEquivalent() instanceof XComputedTypeReference) {
XComputedTypeReference inferred = (XCompu... | java |
private boolean isRawType(JvmTypeParameter current, RecursionGuard<JvmTypeParameter> guard) {
if (guard.tryNext(current)) {
List<JvmTypeConstraint> constraints = current.getConstraints();
for(int i = 0, size = constraints.size(); i < size; i++) {
JvmTypeConstraint constraint = constraints.get(i);
if (co... | java |
public ParameterizedTypeReference toInstanceTypeReference() {
ParameterizedTypeReference result = getOwner().newParameterizedTypeReference(getType());
for(LightweightTypeReference typeArgument: getTypeArguments()) {
result.addTypeArgument(typeArgument.getInvariantBoundSubstitute());
}
return result;
} | java |
@Override
public void visit(final String name, final Object value) {
JvmAnnotationValue annotationValue = proxies.createAnnotationValue(value);
annotationValue.setOperation(proxies.createMethodProxy(annotationType, name));
values.addUnique(annotationValue);
} | java |
@Override
public IResourceDescriptions getResourceDescriptions(ResourceSet resourceSet) {
IResourceDescriptions result = super.getResourceDescriptions(resourceSet);
if (compilerPhases.isIndexing(resourceSet)) {
// during indexing we don't want to see any local files
String projectName = getProjectName(resou... | java |
public void clearResourceSet(final ResourceSet resourceSet) {
final boolean wasDeliver = resourceSet.eDeliver();
try {
resourceSet.eSetDeliver(false);
resourceSet.getResources().clear();
} finally {
resourceSet.eSetDeliver(wasDeliver);
}
} | java |
protected final boolean announceSynonym(LightweightTypeReference synonym, ConformanceHint hint, Acceptor acceptor) {
if (synonym.isUnknown()) {
return true;
}
return acceptor.accept(synonym, hint);
} | java |
protected final boolean announceSynonym(LightweightTypeReference synonym, EnumSet<ConformanceHint> hints, Acceptor acceptor) {
if (synonym.isUnknown()) {
return true;
}
return acceptor.accept(synonym, hints);
} | java |
protected final boolean announceSynonym(LightweightTypeReference synonym, int flags, Acceptor acceptor) {
if (synonym.isUnknown()) {
return true;
}
return acceptor.accept(synonym, flags | ConformanceFlags.CHECKED_SUCCESS);
} | java |
protected File getTmpFolder() {
final ArrayList<?> _cacheKey = CollectionLiterals.newArrayList();
final File _result;
synchronized (_createCache_getTmpFolder) {
if (_createCache_getTmpFolder.containsKey(_cacheKey)) {
return _createCache_getTmpFolder.get(_cacheKey);
}
File _createTe... | java |
protected static void deleteDir(final File dir) {
try {
boolean _exists = dir.exists();
boolean _not = (!_exists);
if (_not) {
return;
}
org.eclipse.xtext.util.Files.sweepFolder(dir);
try {
dir.delete();
} finally {
}
} catch (Throwable _e) {
... | java |
public static List<AbstractElement> getFirstSet(AbstractElement element) {
return org.eclipse.xtext.xtext.generator.parser.antlr.AntlrGrammarGenUtil.getFirstSet(element);
} | java |
public IScope createSimpleFeatureCallScope(EObject context, IFeatureScopeSession session, IResolvedTypes resolvedTypes) {
IScope root = IScope.NULLSCOPE;
if (context instanceof XFeatureCall) {
XFeatureCall featureCall = (XFeatureCall) context;
if (!featureCall.isExplicitOperationCallOrBuilderSyntax()) {
r... | java |
public IScope createFeatureCallScopeForReceiver(final XExpression featureCall, final XExpression receiver, IFeatureScopeSession session, IResolvedTypes resolvedTypes) {
if (receiver == null || receiver.eIsProxy())
return IScope.NULLSCOPE;
LightweightTypeReference receiverType = resolvedTypes.getActualType(receiv... | java |
protected IScope createDynamicExtensionsScope(
EObject featureCall,
XExpression firstArgument,
LightweightTypeReference firstArgumentType,
boolean implicitArgument,
IScope parent,
IFeatureScopeSession session) {
return new DynamicExtensionsScope(parent, session, firstArgument, firstArgumentType, imp... | java |
protected IScope createStaticExtensionsScope(
EObject featureCall,
XExpression firstArgument,
LightweightTypeReference firstArgumentType,
boolean implicitArgument,
IScope parent,
IFeatureScopeSession session) {
return new StaticExtensionImportsScope(parent, session, firstArgument, firstArgumentType,... | java |
protected IScope createNestedTypeLiteralScope(
EObject featureCall,
LightweightTypeReference enclosingType,
JvmDeclaredType rawEnclosingType,
IScope parent,
IFeatureScopeSession session) {
return new NestedTypeLiteralScope(parent, session, asAbstractFeatureCall(featureCall), enclosingType, rawEnclosing... | java |
protected IScope createStaticFeaturesScope(EObject featureCall, IScope parent, IFeatureScopeSession session) {
return new StaticImportsScope(parent, session, asAbstractFeatureCall(featureCall));
} | java |
protected IScope createLocalVariableScope(EObject featureCall, IScope parent, IFeatureScopeSession session, IResolvedTypes resolvedTypes) {
return new LocalVariableScope(parent, session, asAbstractFeatureCall(featureCall));
} | java |
protected CompositeScope createCompositeScope(EObject featureCall, IScope parent, IFeatureScopeSession session) {
return new CompositeScope(parent, session, asAbstractFeatureCall(featureCall));
} | java |
protected IScope createReceiverFeatureScope(
EObject featureCall,
XExpression receiver,
LightweightTypeReference receiverType,
JvmIdentifiableElement receiverFeature,
boolean implicitReceiver,
boolean validStatic,
TypeBucket receiverBucket,
IScope parent,
IFeatureScopeSession session) {
ret... | java |
protected void addIssue(final JvmDeclaredType type, final String fileName) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("The type ");
String _simpleName = type.getSimpleName();
_builder.append(_simpleName);
_builder.append(" is already defined");
{
if ((fileN... | java |
protected void handleCollectionTypeNotAvailable(XCollectionLiteral literal, ITypeComputationState state, Class<?> clazz) {
for(XExpression element: literal.getElements()) {
state.withNonVoidExpectation().computeTypes(element);
}
state.acceptActualType(state.getReferenceOwner().newUnknownTypeReference(clazz.get... | java |
protected boolean matchesExpectation(LightweightTypeReference elementType, LightweightTypeReference expectation) {
return expectation != null && expectation.isResolved() && !expectation.isWildcard() && expectation.isAssignableFrom(elementType);
} | java |
protected LightweightTypeReference doNormalizeElementType(LightweightTypeReference actual, LightweightTypeReference expected) {
if (matchesExpectation(actual, expected)) {
return expected;
}
return normalizeFunctionTypeReference(actual);
} | java |
protected List<LightweightTypeReference> computeCollectionTypeCandidates(XCollectionLiteral literal, JvmGenericType collectionType, LightweightTypeReference elementTypeExpectation, ITypeComputationState state) {
List<XExpression> elements = literal.getElements();
if(!elements.isEmpty()) {
List<LightweightTypeRef... | java |
@Override
protected List<XExpression> getArguments() {
List<XExpression> syntacticArguments = getSyntacticArguments();
XExpression firstArgument = getFirstArgument();
if (firstArgument != null) {
return createArgumentList(firstArgument, syntacticArguments);
}
return syntacticArguments;
} | java |
protected IScope createAnonymousClassConstructorScope(final JvmGenericType anonymousType, EObject context, final IFeatureScopeSession session) {
// we don't care about the type scope since the type is well known here
IVisibilityHelper protectedIsVisible = new IVisibilityHelper() {
@Override
public boolean isV... | java |
public String toJavaIdentifier(final String text, final boolean uppercaseFirst) {
return GrammarAccessUtil.toJavaIdentifier(text, Boolean.valueOf(uppercaseFirst));
} | java |
public String gaRuleIdentifyer(final AbstractRule rule) {
final String plainName = RuleNames.getRuleNames(rule).getUniqueRuleName(rule);
return this.toJavaIdentifier(plainName, true);
} | java |
public String gaRuleAccessMethodName(final AbstractRule rule) {
String _gaRuleIdentifyer = this.gaRuleIdentifyer(rule);
String _plus = ("get" + _gaRuleIdentifyer);
return (_plus + "Rule");
} | java |
public String gaRuleElementsMethodName(final AbstractRule rule) {
String _gaRuleIdentifyer = this.gaRuleIdentifyer(rule);
String _plus = ("get" + _gaRuleIdentifyer);
return (_plus + "Access");
} | java |
public IScope createFeatureCallSerializationScope(EObject context) {
if (!(context instanceof XAbstractFeatureCall)) {
return IScope.NULLSCOPE;
}
XAbstractFeatureCall call = (XAbstractFeatureCall) context;
JvmIdentifiableElement feature = call.getFeature();
// this and super - logical container aware Featu... | java |
public void optimizeLineSection() {
/* Some debugging code
for (int i = 0; i < lineData.size(); i++) {
LineInfo li = (LineInfo)lineData.get(i);
System.out.print(li.toString());
}
*/
//Incorporate each LineInfo into the previous LineInfo's
//outputLineIncrement, ... | java |
public GeneratorConfig copy(final GeneratorConfig other) {
this.generateExpressions = other.generateExpressions;
this.generateSyntheticSuppressWarnings = other.generateSyntheticSuppressWarnings;
this.generateGeneratedAnnotation = other.generateGeneratedAnnotation;
this.includeDateInGeneratedAnnotation =... | java |
public static int compareFlags(int left, int right) {
if (left == right) {
return 0;
}
int leftSuccess = left & SUCCESS_OR_LAMBDA;
int rightSuccess = right & SUCCESS_OR_LAMBDA;
if (leftSuccess != rightSuccess) {
if (leftSuccess == 0)
return 1;
if (rightSuccess == 0)
return -1;
if (leftSucc... | java |
public static boolean sanityCheck(int flags) {
doCheck(flags, ConformanceFlags.CHECKED | ConformanceFlags.UNCHECKED);
if ((flags & ConformanceFlags.UNCHECKED) == 0) {
doCheck(flags, ConformanceFlags.CHECK_RESULTS);
} else if ((flags & (ConformanceFlags.SEALED | ConformanceFlags.CHECK_RESULTS)) != 0) {
throw... | java |
@Override
protected Map<JvmTypeParameter, LightweightMergedBoundTypeArgument> getTypeParameterMapping() {
if (typeParameterMapping == null) {
typeParameterMapping = initializeTypeParameterMapping();
}
return typeParameterMapping;
} | java |
protected String getArgumentTypesAsString() {
if(!getArguments().isEmpty()) {
StringBuilder b = new StringBuilder();
b.append("(");
for(int i=0; i<getArguments().size(); ++i) {
LightweightTypeReference actualType = getActualType(getArguments().get(i));
if(actualType != null)
b.append(actualType... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.