code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public boolean stop() { if (scheduledFuture != null && !scheduledFuture.isCancelled()) { scheduledFuture.cancel(DO_NOT_INTERRUPT_IF_RUNNING); if (LOG.isDebugEnabled()) { LOG.debug("{} Cache Manager stopped.", cache.getClass().getSimpleName()); } return true; } return false; } }
public class class_name { public boolean stop() { if (scheduledFuture != null && !scheduledFuture.isCancelled()) { scheduledFuture.cancel(DO_NOT_INTERRUPT_IF_RUNNING); // depends on control dependency: [if], data = [none] if (LOG.isDebugEnabled()) { LOG.debug("{} Cache Manager stopped.", cache.getClass().getSimpleName()); // depends on control dependency: [if], data = [none] } return true; // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { public Object readObject(Class cl) throws IOException { if (cl == null || cl == Object.class) return readObject(); int tag = read(); switch (tag) { case 'N': return null; case 'M': { String type = readType(); // hessian/3386 if ("".equals(type)) { Deserializer reader; reader = _serializerFactory.getDeserializer(cl); return reader.readMap(this); } else { Deserializer reader; reader = _serializerFactory.getObjectDeserializer(type); return reader.readMap(this); } } case 'V': { String type = readType(); int length = readLength(); Deserializer reader; reader = _serializerFactory.getObjectDeserializer(type); if (cl != reader.getType() && cl.isAssignableFrom(reader.getType())) return reader.readList(this, length); reader = _serializerFactory.getDeserializer(cl); Object v = reader.readList(this, length); return v; } case 'R': { int ref = parseInt(); return _refs.get(ref); } case 'r': { String type = readType(); String url = readString(); return resolveRemote(type, url); } } _peek = tag; // hessian/332i vs hessian/3406 //return readObject(); Object value = _serializerFactory.getDeserializer(cl).readObject(this); return value; } }
public class class_name { public Object readObject(Class cl) throws IOException { if (cl == null || cl == Object.class) return readObject(); int tag = read(); switch (tag) { case 'N': return null; case 'M': { String type = readType(); // hessian/3386 if ("".equals(type)) { Deserializer reader; reader = _serializerFactory.getDeserializer(cl); // depends on control dependency: [if], data = [none] return reader.readMap(this); // depends on control dependency: [if], data = [none] } else { Deserializer reader; reader = _serializerFactory.getObjectDeserializer(type); // depends on control dependency: [if], data = [none] return reader.readMap(this); // depends on control dependency: [if], data = [none] } } case 'V': { String type = readType(); int length = readLength(); Deserializer reader; reader = _serializerFactory.getObjectDeserializer(type); if (cl != reader.getType() && cl.isAssignableFrom(reader.getType())) return reader.readList(this, length); reader = _serializerFactory.getDeserializer(cl); Object v = reader.readList(this, length); return v; } case 'R': { int ref = parseInt(); return _refs.get(ref); } case 'r': { String type = readType(); String url = readString(); return resolveRemote(type, url); } } _peek = tag; // hessian/332i vs hessian/3406 //return readObject(); Object value = _serializerFactory.getDeserializer(cl).readObject(this); return value; } }
public class class_name { private Tuple<Stmt.Case> parseCaseBlock(EnclosingScope scope) { // First, determine the initial indentation of this block based on the // first statement (or null if there is no statement). Indent indent = getIndent(); // We must create a new scope to ensure variables declared within this // block are not visible in the enclosing scope. EnclosingScope caseScope = scope.newEnclosingScope(indent); // Second, check that this is indeed the initial indentation for this // block (i.e. that it is strictly greater than parent indent). if (indent == null || indent.lessThanEq(scope.getIndent())) { // Initial indent either doesn't exist or is not strictly greater // than parent indent and,therefore, signals an empty block. // return new Tuple<>(); } else { // Initial indent is valid, so we proceed parsing case statements // with the appropriate level of indent. // ArrayList<Stmt.Case> cases = new ArrayList<>(); Indent nextIndent; while ((nextIndent = getIndent()) != null && indent.lessThanEq(nextIndent)) { // At this point, nextIndent contains the indent of the current // statement. However, this still may not be equivalent to this // block's indentation level. // First, check the indentation matches that for this block. if (!indent.equivalent(nextIndent)) { // No, it's not equivalent so signal an error. syntaxError("unexpected end-of-block", indent); } // Second, parse the actual case statement at this point! cases.add(parseCaseStatement(caseScope)); } checkForDuplicateDefault(cases); checkForDuplicateConditions(cases); return new Tuple<>(cases); } } }
public class class_name { private Tuple<Stmt.Case> parseCaseBlock(EnclosingScope scope) { // First, determine the initial indentation of this block based on the // first statement (or null if there is no statement). Indent indent = getIndent(); // We must create a new scope to ensure variables declared within this // block are not visible in the enclosing scope. EnclosingScope caseScope = scope.newEnclosingScope(indent); // Second, check that this is indeed the initial indentation for this // block (i.e. that it is strictly greater than parent indent). if (indent == null || indent.lessThanEq(scope.getIndent())) { // Initial indent either doesn't exist or is not strictly greater // than parent indent and,therefore, signals an empty block. // return new Tuple<>(); // depends on control dependency: [if], data = [none] } else { // Initial indent is valid, so we proceed parsing case statements // with the appropriate level of indent. // ArrayList<Stmt.Case> cases = new ArrayList<>(); Indent nextIndent; while ((nextIndent = getIndent()) != null && indent.lessThanEq(nextIndent)) { // At this point, nextIndent contains the indent of the current // statement. However, this still may not be equivalent to this // block's indentation level. // First, check the indentation matches that for this block. if (!indent.equivalent(nextIndent)) { // No, it's not equivalent so signal an error. syntaxError("unexpected end-of-block", indent); // depends on control dependency: [if], data = [none] } // Second, parse the actual case statement at this point! cases.add(parseCaseStatement(caseScope)); // depends on control dependency: [while], data = [none] } checkForDuplicateDefault(cases); // depends on control dependency: [if], data = [none] checkForDuplicateConditions(cases); // depends on control dependency: [if], data = [none] return new Tuple<>(cases); // depends on control dependency: [if], data = [none] } } }
public class class_name { public SizeableLinkedList<WAMInstruction> compileBodyCall(Functor expression, boolean isFirstBody, boolean isLastBody, boolean chainRule, int permVarsRemaining) { // Used to build up the results in. SizeableLinkedList<WAMInstruction> instructions = new SizeableLinkedList<WAMInstruction>(); // Generate the call or tail-call instructions, followed by the call address, which is f_n of the // called program. if (isLastBody) { // Deallocate the stack frame at the end of the clause, but prior to calling the last // body predicate. // This is not required for chain rules, as they do not need a stack frame. if (!chainRule) { instructions.add(new WAMInstruction(WAMInstruction.WAMInstructionSet.Deallocate)); } instructions.add(new WAMInstruction(WAMInstruction.WAMInstructionSet.CallInternal, (byte) (permVarsRemaining & 0xff), new FunctorName("execute", 1))); } else { instructions.add(new WAMInstruction(WAMInstruction.WAMInstructionSet.CallInternal, (byte) (permVarsRemaining & 0xff), new FunctorName("call", 1))); } return instructions; } }
public class class_name { public SizeableLinkedList<WAMInstruction> compileBodyCall(Functor expression, boolean isFirstBody, boolean isLastBody, boolean chainRule, int permVarsRemaining) { // Used to build up the results in. SizeableLinkedList<WAMInstruction> instructions = new SizeableLinkedList<WAMInstruction>(); // Generate the call or tail-call instructions, followed by the call address, which is f_n of the // called program. if (isLastBody) { // Deallocate the stack frame at the end of the clause, but prior to calling the last // body predicate. // This is not required for chain rules, as they do not need a stack frame. if (!chainRule) { instructions.add(new WAMInstruction(WAMInstruction.WAMInstructionSet.Deallocate)); // depends on control dependency: [if], data = [none] } instructions.add(new WAMInstruction(WAMInstruction.WAMInstructionSet.CallInternal, (byte) (permVarsRemaining & 0xff), new FunctorName("execute", 1))); // depends on control dependency: [if], data = [none] } else { instructions.add(new WAMInstruction(WAMInstruction.WAMInstructionSet.CallInternal, (byte) (permVarsRemaining & 0xff), new FunctorName("call", 1))); // depends on control dependency: [if], data = [none] } return instructions; } }
public class class_name { @Override public ZonedDateTime plus(TemporalAmount amountToAdd) { if (amountToAdd instanceof Period) { Period periodToAdd = (Period) amountToAdd; return resolveLocal(dateTime.plus(periodToAdd)); } Objects.requireNonNull(amountToAdd, "amountToAdd"); return (ZonedDateTime) amountToAdd.addTo(this); } }
public class class_name { @Override public ZonedDateTime plus(TemporalAmount amountToAdd) { if (amountToAdd instanceof Period) { Period periodToAdd = (Period) amountToAdd; return resolveLocal(dateTime.plus(periodToAdd)); // depends on control dependency: [if], data = [none] } Objects.requireNonNull(amountToAdd, "amountToAdd"); return (ZonedDateTime) amountToAdd.addTo(this); } }
public class class_name { public void clearSources() { synchronized (mAudioSources) { for (GVRAudioSource source : mAudioSources) { source.setListener(null); } mAudioSources.clear(); } } }
public class class_name { public void clearSources() { synchronized (mAudioSources) { for (GVRAudioSource source : mAudioSources) { source.setListener(null); // depends on control dependency: [for], data = [source] } mAudioSources.clear(); } } }
public class class_name { public JndiPermission withNewActions(int actionBits) { actionBits &= ACTION_ALL; if (actionBits == this.actionBits) { return this; } else { return new JndiPermission(getName(), actionBits); } } }
public class class_name { public JndiPermission withNewActions(int actionBits) { actionBits &= ACTION_ALL; if (actionBits == this.actionBits) { return this; // depends on control dependency: [if], data = [none] } else { return new JndiPermission(getName(), actionBits); // depends on control dependency: [if], data = [none] } } }
public class class_name { private DependencyInfo createDependencyInfo(Package packageInfo) { DependencyInfo dependencyInfo = null; if (StringUtils.isNotBlank(packageInfo.getPackageName()) && StringUtils.isNotBlank(packageInfo.getVersion()) && StringUtils.isNotBlank(packageInfo.getArchitecture())) { dependencyInfo = new DependencyInfo( null, MessageFormat.format(ALPINE_PACKAGE_PATTERN, packageInfo.getPackageName() + Constants.DASH + packageInfo.getVersion()), packageInfo.getVersion() + Constants.DASH + packageInfo.getArchitecture()); } if (dependencyInfo != null) { return dependencyInfo; } else { return null; } } }
public class class_name { private DependencyInfo createDependencyInfo(Package packageInfo) { DependencyInfo dependencyInfo = null; if (StringUtils.isNotBlank(packageInfo.getPackageName()) && StringUtils.isNotBlank(packageInfo.getVersion()) && StringUtils.isNotBlank(packageInfo.getArchitecture())) { dependencyInfo = new DependencyInfo( null, MessageFormat.format(ALPINE_PACKAGE_PATTERN, packageInfo.getPackageName() + Constants.DASH + packageInfo.getVersion()), packageInfo.getVersion() + Constants.DASH + packageInfo.getArchitecture()); // depends on control dependency: [if], data = [none] } if (dependencyInfo != null) { return dependencyInfo; // depends on control dependency: [if], data = [none] } else { return null; // depends on control dependency: [if], data = [none] } } }
public class class_name { private void generate(List<MetaTypeInformationSpecification> metatype) { XMLOutputFactory factory = XMLOutputFactory.newInstance(); try { PrintWriter writer = new PrintWriter(generatorOptions.getOutputFile(), generatorOptions.getEncoding()); XMLStreamWriter xmlWriter = null; if (generatorOptions.getCompactOutput()) { xmlWriter = new CompactOutputXMLStreamWriter(factory.createXMLStreamWriter(writer)); } else { xmlWriter = new IndentingXMLStreamWriter(factory.createXMLStreamWriter(writer), writer); } SchemaWriter schemaWriter = new SchemaWriter(xmlWriter); schemaWriter.setIgnoredPids(generatorOptions.getIgnoredPids()); schemaWriter.setGenerateDocumentation(true); schemaWriter.setEncoding(generatorOptions.getEncoding()); schemaWriter.setLocale(generatorOptions.getLocale()); schemaWriter.setSchemaVersion(generatorOptions.getSchemaVersion()); schemaWriter.setOutputVersion(generatorOptions.getOutputVersion()); for (MetaTypeInformationSpecification item : metatype) { schemaWriter.add(item); } schemaWriter.generate(true); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } } }
public class class_name { private void generate(List<MetaTypeInformationSpecification> metatype) { XMLOutputFactory factory = XMLOutputFactory.newInstance(); try { PrintWriter writer = new PrintWriter(generatorOptions.getOutputFile(), generatorOptions.getEncoding()); XMLStreamWriter xmlWriter = null; if (generatorOptions.getCompactOutput()) { xmlWriter = new CompactOutputXMLStreamWriter(factory.createXMLStreamWriter(writer)); // depends on control dependency: [if], data = [none] } else { xmlWriter = new IndentingXMLStreamWriter(factory.createXMLStreamWriter(writer), writer); // depends on control dependency: [if], data = [none] } SchemaWriter schemaWriter = new SchemaWriter(xmlWriter); schemaWriter.setIgnoredPids(generatorOptions.getIgnoredPids()); // depends on control dependency: [try], data = [none] schemaWriter.setGenerateDocumentation(true); // depends on control dependency: [try], data = [none] schemaWriter.setEncoding(generatorOptions.getEncoding()); // depends on control dependency: [try], data = [none] schemaWriter.setLocale(generatorOptions.getLocale()); // depends on control dependency: [try], data = [none] schemaWriter.setSchemaVersion(generatorOptions.getSchemaVersion()); // depends on control dependency: [try], data = [none] schemaWriter.setOutputVersion(generatorOptions.getOutputVersion()); // depends on control dependency: [try], data = [none] for (MetaTypeInformationSpecification item : metatype) { schemaWriter.add(item); // depends on control dependency: [for], data = [item] } schemaWriter.generate(true); // depends on control dependency: [try], data = [none] } catch (RuntimeException e) { throw e; } catch (Exception e) { // depends on control dependency: [catch], data = [none] throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static <K, V, E> Map<K, V> transformMapValue(Map<K, E> input, Function<E, V> f) { // This screams for a map function! Gimme functional programming pleasee... if (input.isEmpty()) return Collections.emptyMap(); if (input.size() == 1) { Map.Entry<K, E> single = input.entrySet().iterator().next(); return singletonMap(single.getKey(), f.transform(single.getValue())); } else { Map<K, V> copy = new HashMap<>(input.size()); for (Map.Entry<K, E> entry : input.entrySet()) copy.put(entry.getKey(), f.transform(entry.getValue())); return unmodifiableMap(copy); } } }
public class class_name { public static <K, V, E> Map<K, V> transformMapValue(Map<K, E> input, Function<E, V> f) { // This screams for a map function! Gimme functional programming pleasee... if (input.isEmpty()) return Collections.emptyMap(); if (input.size() == 1) { Map.Entry<K, E> single = input.entrySet().iterator().next(); return singletonMap(single.getKey(), f.transform(single.getValue())); // depends on control dependency: [if], data = [none] } else { Map<K, V> copy = new HashMap<>(input.size()); for (Map.Entry<K, E> entry : input.entrySet()) copy.put(entry.getKey(), f.transform(entry.getValue())); return unmodifiableMap(copy); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static void getPaymentMethodNonces(final BraintreeFragment fragment, boolean defaultFirst) { final Uri uri = Uri.parse(TokenizationClient.versionedPath(TokenizationClient.PAYMENT_METHOD_ENDPOINT)) .buildUpon() .appendQueryParameter("default_first", String.valueOf(defaultFirst)) .appendQueryParameter("session_id", fragment.getSessionId()) .build(); fragment.waitForConfiguration(new ConfigurationListener() { @Override public void onConfigurationFetched(Configuration configuration) { fragment.getHttpClient().get(uri.toString(), new HttpResponseCallback() { @Override public void success(String responseBody) { try { fragment.postCallback(PaymentMethodNonce.parsePaymentMethodNonces(responseBody)); fragment.sendAnalyticsEvent("get-payment-methods.succeeded"); } catch (JSONException e) { fragment.postCallback(e); fragment.sendAnalyticsEvent("get-payment-methods.failed"); } } @Override public void failure(Exception exception) { fragment.postCallback(exception); fragment.sendAnalyticsEvent("get-payment-methods.failed"); } }); } }); } }
public class class_name { public static void getPaymentMethodNonces(final BraintreeFragment fragment, boolean defaultFirst) { final Uri uri = Uri.parse(TokenizationClient.versionedPath(TokenizationClient.PAYMENT_METHOD_ENDPOINT)) .buildUpon() .appendQueryParameter("default_first", String.valueOf(defaultFirst)) .appendQueryParameter("session_id", fragment.getSessionId()) .build(); fragment.waitForConfiguration(new ConfigurationListener() { @Override public void onConfigurationFetched(Configuration configuration) { fragment.getHttpClient().get(uri.toString(), new HttpResponseCallback() { @Override public void success(String responseBody) { try { fragment.postCallback(PaymentMethodNonce.parsePaymentMethodNonces(responseBody)); // depends on control dependency: [try], data = [none] fragment.sendAnalyticsEvent("get-payment-methods.succeeded"); // depends on control dependency: [try], data = [none] } catch (JSONException e) { fragment.postCallback(e); fragment.sendAnalyticsEvent("get-payment-methods.failed"); } // depends on control dependency: [catch], data = [none] } @Override public void failure(Exception exception) { fragment.postCallback(exception); fragment.sendAnalyticsEvent("get-payment-methods.failed"); } }); } }); } }
public class class_name { public void marshall(SampledHTTPRequest sampledHTTPRequest, ProtocolMarshaller protocolMarshaller) { if (sampledHTTPRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(sampledHTTPRequest.getRequest(), REQUEST_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getWeight(), WEIGHT_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getTimestamp(), TIMESTAMP_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getAction(), ACTION_BINDING); protocolMarshaller.marshall(sampledHTTPRequest.getRuleWithinRuleGroup(), RULEWITHINRULEGROUP_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(SampledHTTPRequest sampledHTTPRequest, ProtocolMarshaller protocolMarshaller) { if (sampledHTTPRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(sampledHTTPRequest.getRequest(), REQUEST_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(sampledHTTPRequest.getWeight(), WEIGHT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(sampledHTTPRequest.getTimestamp(), TIMESTAMP_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(sampledHTTPRequest.getAction(), ACTION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(sampledHTTPRequest.getRuleWithinRuleGroup(), RULEWITHINRULEGROUP_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public C.List<FastStr> split(String regex, int limit) { /* fastpath if the regex is a (1)one-char String and this character is not one of the RegEx's meta characters ".$|()[{^?*+\\", or (2)two-char String and the first char is the backslash and the second is not the ascii digit or ascii letter. */ char ch; if (((regex.length() == 1 && ".$|()[{^?*+\\".indexOf(ch = regex.charAt(0)) == -1) || (regex.length() == 2 && regex.charAt(0) == '\\' && (((ch = regex.charAt(1))-'0')|('9'-ch)) < 0 && ((ch-'a')|('z'-ch)) < 0 && ((ch-'A')|('Z'-ch)) < 0)) && (ch < Character.MIN_HIGH_SURROGATE || ch > Character.MAX_LOW_SURROGATE)) { int off = 0; int next = 0; boolean limited = limit > 0; C.List<FastStr> list = C.newList(); while ((next = indexOf(ch, off)) != -1) { if (!limited || list.size() < limit - 1) { list.add(substr(off, next)); off = next + 1; } else { // last one //assert (list.size() == limit - 1); list.add(substr(off, buf.length)); off = buf.length; break; } } // If no match was found, return this if (off == 0) { return C.listOf(this); } // Add remaining segment if (!limited || list.size() < limit) { list.add(substr(off, buf.length)); } // Construct result int resultSize = list.size(); if (limit == 0) { while (resultSize > 0 && list.get(resultSize - 1).length() == 0) { resultSize--; } } return list.subList(0, resultSize); } String[] sa = Pattern.compile(regex).split(this, limit); int len = sa.length; FastStr[] ssa = new FastStr[len]; for (int i = 0; i < len; ++i) { ssa[i] = unsafeOf(sa[i]); } return C.listOf(ssa); } }
public class class_name { @Override public C.List<FastStr> split(String regex, int limit) { /* fastpath if the regex is a (1)one-char String and this character is not one of the RegEx's meta characters ".$|()[{^?*+\\", or (2)two-char String and the first char is the backslash and the second is not the ascii digit or ascii letter. */ char ch; if (((regex.length() == 1 && ".$|()[{^?*+\\".indexOf(ch = regex.charAt(0)) == -1) || (regex.length() == 2 && regex.charAt(0) == '\\' && (((ch = regex.charAt(1))-'0')|('9'-ch)) < 0 && ((ch-'a')|('z'-ch)) < 0 && ((ch-'A')|('Z'-ch)) < 0)) && (ch < Character.MIN_HIGH_SURROGATE || ch > Character.MAX_LOW_SURROGATE)) { int off = 0; int next = 0; boolean limited = limit > 0; C.List<FastStr> list = C.newList(); while ((next = indexOf(ch, off)) != -1) { if (!limited || list.size() < limit - 1) { list.add(substr(off, next)); // depends on control dependency: [if], data = [none] off = next + 1; // depends on control dependency: [if], data = [none] } else { // last one //assert (list.size() == limit - 1); list.add(substr(off, buf.length)); // depends on control dependency: [if], data = [none] off = buf.length; // depends on control dependency: [if], data = [none] break; } } // If no match was found, return this if (off == 0) { return C.listOf(this); // depends on control dependency: [if], data = [none] } // Add remaining segment if (!limited || list.size() < limit) { list.add(substr(off, buf.length)); // depends on control dependency: [if], data = [none] } // Construct result int resultSize = list.size(); if (limit == 0) { while (resultSize > 0 && list.get(resultSize - 1).length() == 0) { resultSize--; // depends on control dependency: [while], data = [none] } } return list.subList(0, resultSize); // depends on control dependency: [if], data = [none] } String[] sa = Pattern.compile(regex).split(this, limit); int len = sa.length; FastStr[] ssa = new FastStr[len]; for (int i = 0; i < len; ++i) { ssa[i] = unsafeOf(sa[i]); // depends on control dependency: [for], data = [i] } return C.listOf(ssa); } }
public class class_name { @SuppressWarnings({"PMD.AvoidProtectedMethodInFinalClassNotExtending", "PMD.CyclomaticComplexity", "checkstyle:CyclomaticComplexity"}) protected static Type resolveTypeVariables(final Type type, final Map<String, Type> generics, final boolean countPreservedVariables) { Type resolvedGenericType = null; if (type instanceof TypeVariable) { // simple named generics resolved to target types resolvedGenericType = declaredGeneric((TypeVariable) type, generics); } else if (type instanceof ExplicitTypeVariable) { // special type used to preserve named generic (and differentiate from type variable) resolvedGenericType = declaredGeneric((ExplicitTypeVariable) type, generics, countPreservedVariables); } else if (type instanceof Class) { resolvedGenericType = type; } else if (type instanceof ParameterizedType) { // here parameterized type could shrink to class (if it has no arguments and owner class) resolvedGenericType = resolveParameterizedTypeVariables( (ParameterizedType) type, generics, countPreservedVariables); } else if (type instanceof GenericArrayType) { // here generic array could shrink to array class (if component type shrink to simple class) resolvedGenericType = resolveGenericArrayTypeVariables( (GenericArrayType) type, generics, countPreservedVariables); } else if (type instanceof WildcardType) { // here wildcard could shrink to upper type (if it has only one upper type) resolvedGenericType = resolveWildcardTypeVariables( (WildcardType) type, generics, countPreservedVariables); } return resolvedGenericType; } }
public class class_name { @SuppressWarnings({"PMD.AvoidProtectedMethodInFinalClassNotExtending", "PMD.CyclomaticComplexity", "checkstyle:CyclomaticComplexity"}) protected static Type resolveTypeVariables(final Type type, final Map<String, Type> generics, final boolean countPreservedVariables) { Type resolvedGenericType = null; if (type instanceof TypeVariable) { // simple named generics resolved to target types resolvedGenericType = declaredGeneric((TypeVariable) type, generics); // depends on control dependency: [if], data = [none] } else if (type instanceof ExplicitTypeVariable) { // special type used to preserve named generic (and differentiate from type variable) resolvedGenericType = declaredGeneric((ExplicitTypeVariable) type, generics, countPreservedVariables); // depends on control dependency: [if], data = [none] } else if (type instanceof Class) { resolvedGenericType = type; // depends on control dependency: [if], data = [none] } else if (type instanceof ParameterizedType) { // here parameterized type could shrink to class (if it has no arguments and owner class) resolvedGenericType = resolveParameterizedTypeVariables( (ParameterizedType) type, generics, countPreservedVariables); // depends on control dependency: [if], data = [none] } else if (type instanceof GenericArrayType) { // here generic array could shrink to array class (if component type shrink to simple class) resolvedGenericType = resolveGenericArrayTypeVariables( (GenericArrayType) type, generics, countPreservedVariables); // depends on control dependency: [if], data = [none] } else if (type instanceof WildcardType) { // here wildcard could shrink to upper type (if it has only one upper type) resolvedGenericType = resolveWildcardTypeVariables( (WildcardType) type, generics, countPreservedVariables); // depends on control dependency: [if], data = [none] } return resolvedGenericType; } }
public class class_name { @VisibleForTesting @SuppressWarnings("unchecked") <T> Collection<Class<T>> getTopLevelClasses(Collection<String> importSpecs, Class<T> iface) { // count number of FQCNs in importSpecs int fqcnCount = 0; for (String importSpec : importSpecs) { if (!(importSpec.endsWith(".*") || importSpec.endsWith(".**"))) { fqcnCount++; } } HashMap<String,Class<T>> classes = Maps.newLinkedHashMap(); for (ClassLoader loader : getClassLoaders()) { if (importSpecs.size() == fqcnCount) { // importSpecs consists solely of FQCNs! // Thus, we can omit the expensive ClassPath.from(loader) scan of the classpath. for (String importSpec : importSpecs) { Class clazz; try { //clazz = Class.forName(importSpec, true, loader); clazz = loader.loadClass(importSpec); } catch (ClassNotFoundException e) { continue; } addClass(clazz, classes, iface); } } else { // Need to scan the classpath via ClassPath.from(loader) ClassPath classPath; try { classPath = ClassPath.from(loader); } catch (IOException e) { continue; } for (String importSpec : importSpecs) { Set<ClassInfo> classInfos = null; if (importSpec.endsWith(".**")) { String packageName = importSpec.substring(0, importSpec.length() - ".**".length()); classInfos = classPath.getTopLevelClassesRecursive(packageName); } else if (importSpec.endsWith(".*")) { String packageName = importSpec.substring(0, importSpec.length() - ".*".length()); classInfos = classPath.getTopLevelClasses(packageName); } else { // importSpec is assumed to be a fully qualified class name Class clazz; try { //clazz = Class.forName(importSpec, true, loader); clazz = loader.loadClass(importSpec); } catch (ClassNotFoundException e) { continue; } addClass(clazz, classes, iface); continue; } for (ClassInfo info : classInfos) { Class clazz; try { clazz = info.load(); // clazz = Class.forName(info.getName()); } catch (NoClassDefFoundError e) { continue; } catch (ExceptionInInitializerError e) { continue; } catch (UnsatisfiedLinkError e) { continue; } addClass(clazz, classes, iface); } } } } return classes.values(); } }
public class class_name { @VisibleForTesting @SuppressWarnings("unchecked") <T> Collection<Class<T>> getTopLevelClasses(Collection<String> importSpecs, Class<T> iface) { // count number of FQCNs in importSpecs int fqcnCount = 0; for (String importSpec : importSpecs) { if (!(importSpec.endsWith(".*") || importSpec.endsWith(".**"))) { fqcnCount++; // depends on control dependency: [if], data = [none] } } HashMap<String,Class<T>> classes = Maps.newLinkedHashMap(); for (ClassLoader loader : getClassLoaders()) { if (importSpecs.size() == fqcnCount) { // importSpecs consists solely of FQCNs! // Thus, we can omit the expensive ClassPath.from(loader) scan of the classpath. for (String importSpec : importSpecs) { Class clazz; try { //clazz = Class.forName(importSpec, true, loader); clazz = loader.loadClass(importSpec); // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException e) { continue; } // depends on control dependency: [catch], data = [none] addClass(clazz, classes, iface); // depends on control dependency: [for], data = [none] } } else { // Need to scan the classpath via ClassPath.from(loader) ClassPath classPath; try { classPath = ClassPath.from(loader); // depends on control dependency: [try], data = [none] } catch (IOException e) { continue; } // depends on control dependency: [catch], data = [none] for (String importSpec : importSpecs) { Set<ClassInfo> classInfos = null; if (importSpec.endsWith(".**")) { String packageName = importSpec.substring(0, importSpec.length() - ".**".length()); classInfos = classPath.getTopLevelClassesRecursive(packageName); // depends on control dependency: [if], data = [none] } else if (importSpec.endsWith(".*")) { String packageName = importSpec.substring(0, importSpec.length() - ".*".length()); classInfos = classPath.getTopLevelClasses(packageName); // depends on control dependency: [if], data = [none] } else { // importSpec is assumed to be a fully qualified class name Class clazz; try { //clazz = Class.forName(importSpec, true, loader); clazz = loader.loadClass(importSpec); // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException e) { continue; } // depends on control dependency: [catch], data = [none] addClass(clazz, classes, iface); // depends on control dependency: [if], data = [none] continue; } for (ClassInfo info : classInfos) { Class clazz; try { clazz = info.load(); // depends on control dependency: [try], data = [none] // clazz = Class.forName(info.getName()); } catch (NoClassDefFoundError e) { continue; } catch (ExceptionInInitializerError e) { // depends on control dependency: [catch], data = [none] continue; } catch (UnsatisfiedLinkError e) { // depends on control dependency: [catch], data = [none] continue; } // depends on control dependency: [catch], data = [none] addClass(clazz, classes, iface); // depends on control dependency: [for], data = [none] } } } } return classes.values(); } }
public class class_name { public short getDepth() { if (0 == index) return 0; if (-1 == depth) { synchronized (this) { if (-1 == depth) { TrieNode parent = getParent(); assert (null == parent || parent.index < index); depth = (short) (null == parent ? 0 : (parent.getDepth() + 1)); } } } return depth; } }
public class class_name { public short getDepth() { if (0 == index) return 0; if (-1 == depth) { synchronized (this) { // depends on control dependency: [if], data = [none] if (-1 == depth) { TrieNode parent = getParent(); assert (null == parent || parent.index < index); // depends on control dependency: [if], data = [none] depth = (short) (null == parent ? 0 : (parent.getDepth() + 1)); // depends on control dependency: [if], data = [none] } } } return depth; } }
public class class_name { private void processNVPs(String nvps, JmsDestination dest, Map<String,String> nvpReturn) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "processNVPs", new Object[]{nvps, dest}); Map<String,String> propertyMap; if (nvpReturn==null) { // no map provided by caller, so make one of our own propertyMap = new HashMap<String,String>(); } else { // use the callers map, after clearing it nvpReturn.clear(); propertyMap = nvpReturn; } // Process any name value pairs if (nvps != null && !nvps.equals("")) { // Use a regular expression to split on an '&' only if it isn't preceeded by a '\'. // Statement goal = matching an '&' only if not preceeded by a '\' String[] nvpArray = splitOnNonEscapedChar(nvps, '&', -1); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // At this point we have an array of strings in the format 'name=value'* // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Begin processing on each NVP. for (int i = 0; i < nvpArray.length; i++) { String nvp = nvpArray[i]; // First check that the URI element is correctly formed // ie. it contains an '=' char and has a value after the '='. int equalsIndex = nvp.indexOf(STRING_EQUALS_SIGN); if (equalsIndex == -1) { // doesn't have an equals JmsErrorUtils.newThrowable( // d267332 just log an FFDC. Don't throw an exception and lose the destination JMSException.class, "MALFORMED_URI_ELEMENT_CWSIA0382", new Object[] { nvp, nvps }, null, "URIDestinationCreator.processNVPs#1", this, tc); continue; } if (equalsIndex == nvp.length() - 1) { // '=' is the last char, so there is no value part JmsErrorUtils.newThrowable( // d267332 just log an FFDC. Don't throw an exception and lose the destination JMSException.class, "MALFORMED_URI_ELEMENT_CWSIA0382", new Object[] { nvp, nvps }, null, "URIDestinationCreator.processNVPs#2", this, tc); continue; } // For each element in the array separate the name and value, then process. String namePart = nvp.substring(0, equalsIndex); String valuePart = nvp.substring(equalsIndex + 1); // validate the name and value strings - check for unescaped illegal character etc.. String[] validatedNVP = validateNVP(namePart, valuePart, nvps, dest); namePart = validatedNVP[0]; valuePart = validatedNVP[1]; // special case forward and reverse routing path NVPs if (namePart.equals(FORWARD_RP)) { String[] frp = valuePart.split("<#>"); ((JmsDestinationImpl) dest).setForwardRoutingPath(frp); continue; // don't put this property in the map, and start the for loop again } else if (namePart.equals(REVERSE_RP)) { String[] rrp = valuePart.split("<#>"); ((JmsDestinationImpl) dest).setReverseRoutingPath(rrp); continue; // don't put this property in the map, and start the for loop again } // add the NVP to the property map propertyMap.put(namePart, valuePart); } } // Do we need to perform topic wild card translation? if (dest instanceof JmsTopic && propertyMap.containsKey(MA88_BROKER_VERSION)) { String topicName = ((JmsTopicImpl) dest).getTopicName(); // no point converting something thats empty, and avoids NPEs if (topicName != null) { // get the value of the brokerVersion property, and remove it from the map, // since it isn't needed by configureDestinationFromMap(). String bVer = propertyMap.remove(MA88_BROKER_VERSION); if ("1".equals(bVer)) { // EB/MQSI topic syntax try { // perform the conversion topicName = twt.convertEventBrokerToSIB(topicName); } catch (ParseException pe) { // No FFDC code needed // d238447 FFDC review. Is this an internal or external error? Play it safe and // generate an FFDC. JmsErrorUtils.newThrowable( // d267332 just log an FFDC. Don't throw an exception and lose the destination JMSException.class, "MALFORMED_URI_ELEMENT_CWSIA0382", new Object[] { topicName, nvps }, pe, "URIDestinationCreator.processNVPs#3", this, tc); } } else { // default to MA0C (Fuji) topic syntax try { // perform the conversion topicName = twt.convertMA0CToSIB(topicName); } catch (ParseException pe) { // No FFDC code needed // d238447 FFDC review. // Updated during d272111. ParseException can be generated in response to badly formed // input from user code, so don't FFDC. JmsErrorUtils.newThrowable( // d267332 just log an FFDC. Don't throw an exception and lose the destination JMSException.class, "MALFORMED_URI_ELEMENT_CWSIA0382", new Object[] { topicName, nvps }, pe, "URIDestinationCreator.processNVPs#4", this, tc); } } // put the converted topicName back into the Topic ((JmsTopicImpl)dest).setTopicName(topicName); } // if topicName != null } // end of if (need to convert topic wildcards) // configure the destination object using the map configureDestinationFromMap(dest, propertyMap, nvps); } }
public class class_name { private void processNVPs(String nvps, JmsDestination dest, Map<String,String> nvpReturn) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "processNVPs", new Object[]{nvps, dest}); Map<String,String> propertyMap; if (nvpReturn==null) { // no map provided by caller, so make one of our own propertyMap = new HashMap<String,String>(); } else { // use the callers map, after clearing it nvpReturn.clear(); propertyMap = nvpReturn; } // Process any name value pairs if (nvps != null && !nvps.equals("")) { // Use a regular expression to split on an '&' only if it isn't preceeded by a '\'. // Statement goal = matching an '&' only if not preceeded by a '\' String[] nvpArray = splitOnNonEscapedChar(nvps, '&', -1); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // At this point we have an array of strings in the format 'name=value'* // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Begin processing on each NVP. for (int i = 0; i < nvpArray.length; i++) { String nvp = nvpArray[i]; // First check that the URI element is correctly formed // ie. it contains an '=' char and has a value after the '='. int equalsIndex = nvp.indexOf(STRING_EQUALS_SIGN); if (equalsIndex == -1) { // doesn't have an equals JmsErrorUtils.newThrowable( // d267332 just log an FFDC. Don't throw an exception and lose the destination JMSException.class, "MALFORMED_URI_ELEMENT_CWSIA0382", new Object[] { nvp, nvps }, null, "URIDestinationCreator.processNVPs#1", this, tc); // depends on control dependency: [if], data = [none] continue; } if (equalsIndex == nvp.length() - 1) { // '=' is the last char, so there is no value part JmsErrorUtils.newThrowable( // d267332 just log an FFDC. Don't throw an exception and lose the destination JMSException.class, "MALFORMED_URI_ELEMENT_CWSIA0382", new Object[] { nvp, nvps }, null, "URIDestinationCreator.processNVPs#2", this, tc); // depends on control dependency: [if], data = [none] continue; } // For each element in the array separate the name and value, then process. String namePart = nvp.substring(0, equalsIndex); String valuePart = nvp.substring(equalsIndex + 1); // validate the name and value strings - check for unescaped illegal character etc.. String[] validatedNVP = validateNVP(namePart, valuePart, nvps, dest); namePart = validatedNVP[0]; // depends on control dependency: [for], data = [none] valuePart = validatedNVP[1]; // depends on control dependency: [for], data = [none] // special case forward and reverse routing path NVPs if (namePart.equals(FORWARD_RP)) { String[] frp = valuePart.split("<#>"); ((JmsDestinationImpl) dest).setForwardRoutingPath(frp); // depends on control dependency: [if], data = [none] continue; // don't put this property in the map, and start the for loop again } else if (namePart.equals(REVERSE_RP)) { String[] rrp = valuePart.split("<#>"); ((JmsDestinationImpl) dest).setReverseRoutingPath(rrp); // depends on control dependency: [if], data = [none] continue; // don't put this property in the map, and start the for loop again } // add the NVP to the property map propertyMap.put(namePart, valuePart); // depends on control dependency: [for], data = [none] } } // Do we need to perform topic wild card translation? if (dest instanceof JmsTopic && propertyMap.containsKey(MA88_BROKER_VERSION)) { String topicName = ((JmsTopicImpl) dest).getTopicName(); // no point converting something thats empty, and avoids NPEs if (topicName != null) { // get the value of the brokerVersion property, and remove it from the map, // since it isn't needed by configureDestinationFromMap(). String bVer = propertyMap.remove(MA88_BROKER_VERSION); if ("1".equals(bVer)) { // EB/MQSI topic syntax try { // perform the conversion topicName = twt.convertEventBrokerToSIB(topicName); // depends on control dependency: [try], data = [none] } catch (ParseException pe) { // No FFDC code needed // d238447 FFDC review. Is this an internal or external error? Play it safe and // generate an FFDC. JmsErrorUtils.newThrowable( // d267332 just log an FFDC. Don't throw an exception and lose the destination JMSException.class, "MALFORMED_URI_ELEMENT_CWSIA0382", new Object[] { topicName, nvps }, pe, "URIDestinationCreator.processNVPs#3", this, tc); } // depends on control dependency: [catch], data = [none] } else { // default to MA0C (Fuji) topic syntax try { // perform the conversion topicName = twt.convertMA0CToSIB(topicName); // depends on control dependency: [try], data = [none] } catch (ParseException pe) { // No FFDC code needed // d238447 FFDC review. // Updated during d272111. ParseException can be generated in response to badly formed // input from user code, so don't FFDC. JmsErrorUtils.newThrowable( // d267332 just log an FFDC. Don't throw an exception and lose the destination JMSException.class, "MALFORMED_URI_ELEMENT_CWSIA0382", new Object[] { topicName, nvps }, pe, "URIDestinationCreator.processNVPs#4", this, tc); } // depends on control dependency: [catch], data = [none] } // put the converted topicName back into the Topic ((JmsTopicImpl)dest).setTopicName(topicName); // depends on control dependency: [if], data = [(topicName] } // if topicName != null } // end of if (need to convert topic wildcards) // configure the destination object using the map configureDestinationFromMap(dest, propertyMap, nvps); } }
public class class_name { public static <T> SimpleQueue<T> createQueue(int capacityHint) { if (capacityHint < 0) { return new SpscLinkedArrayQueue<T>(-capacityHint); } return new SpscArrayQueue<T>(capacityHint); } }
public class class_name { public static <T> SimpleQueue<T> createQueue(int capacityHint) { if (capacityHint < 0) { return new SpscLinkedArrayQueue<T>(-capacityHint); // depends on control dependency: [if], data = [none] } return new SpscArrayQueue<T>(capacityHint); } }
public class class_name { public void print () { for (int c = 0; c < m_nCols; ++c) { System.out.print (" " + m_aValues[0][c]); } System.out.println (); } }
public class class_name { public void print () { for (int c = 0; c < m_nCols; ++c) { System.out.print (" " + m_aValues[0][c]); // depends on control dependency: [for], data = [c] } System.out.println (); } }
public class class_name { public static void changeUpperLevelFinalLength( final Map<String, ConfigRangeAttrs> shiftMap, final String addedFullName, final int increasedLength) { String[] parts = addedFullName.split(":"); StringBuilder fname = new StringBuilder(); for (int i = 0; i < (parts.length - 1); i++) { if (i == 0) { fname.append(parts[i]); } else { fname.append(":").append(parts[i]); } String sname = fname.toString(); shiftMap.get(sname).setFinalLength( shiftMap.get(sname).getFinalLength() + increasedLength); } } }
public class class_name { public static void changeUpperLevelFinalLength( final Map<String, ConfigRangeAttrs> shiftMap, final String addedFullName, final int increasedLength) { String[] parts = addedFullName.split(":"); StringBuilder fname = new StringBuilder(); for (int i = 0; i < (parts.length - 1); i++) { if (i == 0) { fname.append(parts[i]); // depends on control dependency: [if], data = [none] } else { fname.append(":").append(parts[i]); // depends on control dependency: [if], data = [none] } String sname = fname.toString(); shiftMap.get(sname).setFinalLength( shiftMap.get(sname).getFinalLength() + increasedLength); // depends on control dependency: [for], data = [none] } } }
public class class_name { private char rdCh() { char c = super.readCh(); if (c == '\n') { linecount++; charpos = 0; } else if (c == '\t') { charpos += Properties.parser_tabstop - charpos % Properties.parser_tabstop; } else if (c != (char) -1) { charpos++; } ch = c; charsread++; offset = getCurrentRawReadOffset(); // if(ch == '\r') // { // ch = rdCh(); // }else // { // ch = c; // } return ch; } }
public class class_name { private char rdCh() { char c = super.readCh(); if (c == '\n') { linecount++; // depends on control dependency: [if], data = [none] charpos = 0; // depends on control dependency: [if], data = [none] } else if (c == '\t') { charpos += Properties.parser_tabstop - charpos % Properties.parser_tabstop; // depends on control dependency: [if], data = [none] } else if (c != (char) -1) { charpos++; // depends on control dependency: [if], data = [none] } ch = c; charsread++; offset = getCurrentRawReadOffset(); // if(ch == '\r') // { // ch = rdCh(); // }else // { // ch = c; // } return ch; } }
public class class_name { @Override public boolean isReady() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "isReady", this.listener); //If the listener is not set then we have no way to know if we can read in a non-blocking manner //return true so we don't accidentally block an app who doesn't set a listener but calls isReady if(this.listener == null || isFinished()){ if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "isReady", "ReadListener not set or isFinished returned true"); return true; } boolean isReady = false; //Synchronize to ensure that no two methods can overlap in here as that could cause issue synchronized (this.lockObj){ //If asyncReadOutstanding returns true, it means we don't need to do this check //If checkAvailable returns true then it means data is available right now //If it returns false it means we need to check if data is available immediately //If data is available immediately it will be populated and we return true //If not then we return false and an async read is in progress or we're finished if(!asyncReadOutstanding){ if(!checkAvailable()){ isReady = this.httpin.asyncCheckBuffers(this.callback); if(!isReady){ if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "asyncCheckBuffers returned false. An async read is now outstanding or no more data"); } this.asyncReadOutstanding = true; } } else isReady = true; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "isReady", isReady + " " + this.listener); return isReady; } }
public class class_name { @Override public boolean isReady() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "isReady", this.listener); //If the listener is not set then we have no way to know if we can read in a non-blocking manner //return true so we don't accidentally block an app who doesn't set a listener but calls isReady if(this.listener == null || isFinished()){ if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "isReady", "ReadListener not set or isFinished returned true"); return true; // depends on control dependency: [if], data = [none] } boolean isReady = false; //Synchronize to ensure that no two methods can overlap in here as that could cause issue synchronized (this.lockObj){ //If asyncReadOutstanding returns true, it means we don't need to do this check //If checkAvailable returns true then it means data is available right now //If it returns false it means we need to check if data is available immediately //If data is available immediately it will be populated and we return true //If not then we return false and an async read is in progress or we're finished if(!asyncReadOutstanding){ if(!checkAvailable()){ isReady = this.httpin.asyncCheckBuffers(this.callback); // depends on control dependency: [if], data = [none] if(!isReady){ if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "asyncCheckBuffers returned false. An async read is now outstanding or no more data"); // depends on control dependency: [if], data = [none] } this.asyncReadOutstanding = true; // depends on control dependency: [if], data = [none] } } else isReady = true; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "isReady", isReady + " " + this.listener); return isReady; } }
public class class_name { public static Excel07SaxReader read07BySax(File file, int sheetIndex, RowHandler rowHandler) { try { return new Excel07SaxReader(rowHandler).read(file, sheetIndex); } catch (NoClassDefFoundError e) { throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG); } } }
public class class_name { public static Excel07SaxReader read07BySax(File file, int sheetIndex, RowHandler rowHandler) { try { return new Excel07SaxReader(rowHandler).read(file, sheetIndex); // depends on control dependency: [try], data = [none] } catch (NoClassDefFoundError e) { throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private void indent() throws IOException { if (indent>=0) { out.write('\n'); for (int i=indent*2; i>0; ) { int len = Math.min(i,INDENT.length); out.write(INDENT,0,len); i-=len; } } } }
public class class_name { private void indent() throws IOException { if (indent>=0) { out.write('\n'); for (int i=indent*2; i>0; ) { int len = Math.min(i,INDENT.length); out.write(INDENT,0,len); // depends on control dependency: [for], data = [none] i-=len; // depends on control dependency: [for], data = [i] } } } }
public class class_name { @Override public void removeByUuid(String uuid) { for (CPMeasurementUnit cpMeasurementUnit : findByUuid(uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(cpMeasurementUnit); } } }
public class class_name { @Override public void removeByUuid(String uuid) { for (CPMeasurementUnit cpMeasurementUnit : findByUuid(uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(cpMeasurementUnit); // depends on control dependency: [for], data = [cpMeasurementUnit] } } }
public class class_name { public synchronized void rollbackToSavepoint() { if (isClosed) { return; } String name = (String) sessionContext.savepoints.getKey(0); database.txManager.rollbackSavepoint(this, 0); try { database.logger.writeToLog(this, getSavepointRollbackSQL(name)); } catch (HsqlException e) {} } }
public class class_name { public synchronized void rollbackToSavepoint() { if (isClosed) { return; // depends on control dependency: [if], data = [none] } String name = (String) sessionContext.savepoints.getKey(0); database.txManager.rollbackSavepoint(this, 0); try { database.logger.writeToLog(this, getSavepointRollbackSQL(name)); // depends on control dependency: [try], data = [none] } catch (HsqlException e) {} // depends on control dependency: [catch], data = [none] } }
public class class_name { public static JustificationBuilder getInstance() { if (instance == null) { synchronized (JustificationBuilderImpl.class) { if (instance == null) { instance = new JustificationBuilderImpl(); } } } return instance; } }
public class class_name { public static JustificationBuilder getInstance() { if (instance == null) { synchronized (JustificationBuilderImpl.class) { // depends on control dependency: [if], data = [none] if (instance == null) { instance = new JustificationBuilderImpl(); // depends on control dependency: [if], data = [none] } } } return instance; } }
public class class_name { private Variable makeVerticalVariable(int vert_sys, int n_levels, float[] vert_args) throws IOException { String vert_unit = null; String vert_type; ArrayFloat.D1 data = new ArrayFloat.D1(n_levels); AxisType axisType = null; switch (vert_sys) { case (0): vert_unit = null; vert_type = "height"; break; case (1): case (2): vert_unit = "km"; vert_type = "altitude"; axisType = AxisType.Height; break; case (3): vert_unit = "mbar"; vert_type = "pressure"; axisType = AxisType.Pressure; break; default: throw new IOException("vert_sys unknown"); } Variable vertVar = new Variable(ncfile, null, null, vert_type); vertVar.setDimensions(LEVEL); vertVar.setDataType(DataType.FLOAT); if (vert_unit != null) { vertVar.addAttribute(new Attribute(CDM.UNITS, vert_unit)); } if (axisType != null) { vertVar.addAttribute(new Attribute(_Coordinate.AxisType, axisType.toString())); } switch (vert_sys) { case (0): case (1): for (int i = 0; i < n_levels; i++) { data.set(i, vert_args[0] + vert_args[1] * i); } break; case (2): // Altitude in km - non-linear for (int i = 0; i < n_levels; i++) { data.set(i, vert_args[i]); } break; case (3): // heights of pressure surfaces in km - non-linear try { Vis5DVerticalSystem.Vis5DVerticalCoordinateSystem vert_cs = new Vis5DVerticalSystem.Vis5DVerticalCoordinateSystem(); float[][] pressures = new float[1][n_levels]; System.arraycopy(vert_args, 0, pressures[0], 0, n_levels); for (int i = 0; i < n_levels; i++) { pressures[0][i] *= 1000; // km->m } pressures = vert_cs.fromReference(pressures); // convert to pressures for (int i = 0; i < n_levels; i++) { data.set(i, pressures[0][i]); } } catch (VisADException ve) { throw new IOException("unable to make vertical system"); } break; } vertVar.setCachedData(data, false); return vertVar; } }
public class class_name { private Variable makeVerticalVariable(int vert_sys, int n_levels, float[] vert_args) throws IOException { String vert_unit = null; String vert_type; ArrayFloat.D1 data = new ArrayFloat.D1(n_levels); AxisType axisType = null; switch (vert_sys) { case (0): vert_unit = null; vert_type = "height"; break; case (1): case (2): vert_unit = "km"; vert_type = "altitude"; axisType = AxisType.Height; break; case (3): vert_unit = "mbar"; vert_type = "pressure"; axisType = AxisType.Pressure; break; default: throw new IOException("vert_sys unknown"); } Variable vertVar = new Variable(ncfile, null, null, vert_type); vertVar.setDimensions(LEVEL); vertVar.setDataType(DataType.FLOAT); if (vert_unit != null) { vertVar.addAttribute(new Attribute(CDM.UNITS, vert_unit)); } if (axisType != null) { vertVar.addAttribute(new Attribute(_Coordinate.AxisType, axisType.toString())); } switch (vert_sys) { case (0): case (1): for (int i = 0; i < n_levels; i++) { data.set(i, vert_args[0] + vert_args[1] * i); // depends on control dependency: [for], data = [i] } break; case (2): // Altitude in km - non-linear for (int i = 0; i < n_levels; i++) { data.set(i, vert_args[i]); // depends on control dependency: [for], data = [i] } break; case (3): // heights of pressure surfaces in km - non-linear try { Vis5DVerticalSystem.Vis5DVerticalCoordinateSystem vert_cs = new Vis5DVerticalSystem.Vis5DVerticalCoordinateSystem(); float[][] pressures = new float[1][n_levels]; System.arraycopy(vert_args, 0, pressures[0], 0, n_levels); // depends on control dependency: [try], data = [none] for (int i = 0; i < n_levels; i++) { pressures[0][i] *= 1000; // km->m // depends on control dependency: [for], data = [i] } pressures = vert_cs.fromReference(pressures); // convert to pressures // depends on control dependency: [try], data = [none] for (int i = 0; i < n_levels; i++) { data.set(i, pressures[0][i]); // depends on control dependency: [for], data = [i] } } catch (VisADException ve) { throw new IOException("unable to make vertical system"); } // depends on control dependency: [catch], data = [none] break; } vertVar.setCachedData(data, false); return vertVar; } }
public class class_name { public static String serializeNoNS(Node node) { StringBuffer buf = new StringBuffer(); buf.append("<"); buf.append(node.getLocalName()); for (Entry<QName, String> entry : getAttributes(node).entrySet()) { QName name = entry.getKey(); if (name.getNamespaceURI() != null) { buf.append(" "); buf.append(name.getLocalPart()); buf.append("=\""); buf.append(entry.getValue()); buf.append("\""); } } boolean tagOpen = true; NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node n = children.item(i); short type = node.getNodeType(); if (type == Node.TEXT_NODE) { if (tagOpen) { buf.append(">\n"); tagOpen = false; } buf.append(node.getTextContent()); } else if (type == Node.ELEMENT_NODE) { if (tagOpen) { buf.append(">\n"); tagOpen = false; } buf.append(serializeNoNS(n)); buf.append("\n"); } } if (tagOpen) { buf.append("/>\n"); } else { buf.append("</"); buf.append(node.getLocalName()); buf.append(">\n"); } return buf.toString(); // ByteArrayOutputStream baos = new ByteArrayOutputStream(); // try { // TransformerFactory factory = TransformerFactory.newInstance(); // File f = Misc.getResourceAsFile("com/occamlab/te/drop-ns.xsl"); // Transformer transformer = factory.newTransformer(new // StreamSource(f)); // // DOMSource src = new DOMSource(node); // StreamResult dest = new StreamResult(baos); // transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, // "yes"); // transformer.transform(src, dest); // } catch (Exception e) { // System.out.println("Error serializing node. "+e.getMessage()); // } // // return baos.toString(); } }
public class class_name { public static String serializeNoNS(Node node) { StringBuffer buf = new StringBuffer(); buf.append("<"); buf.append(node.getLocalName()); for (Entry<QName, String> entry : getAttributes(node).entrySet()) { QName name = entry.getKey(); if (name.getNamespaceURI() != null) { buf.append(" "); // depends on control dependency: [if], data = [none] buf.append(name.getLocalPart()); // depends on control dependency: [if], data = [none] buf.append("=\""); // depends on control dependency: [if], data = [none] buf.append(entry.getValue()); // depends on control dependency: [if], data = [none] buf.append("\""); // depends on control dependency: [if], data = [none] } } boolean tagOpen = true; NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node n = children.item(i); short type = node.getNodeType(); if (type == Node.TEXT_NODE) { if (tagOpen) { buf.append(">\n"); // depends on control dependency: [if], data = [none] tagOpen = false; // depends on control dependency: [if], data = [none] } buf.append(node.getTextContent()); // depends on control dependency: [if], data = [none] } else if (type == Node.ELEMENT_NODE) { if (tagOpen) { buf.append(">\n"); // depends on control dependency: [if], data = [none] tagOpen = false; // depends on control dependency: [if], data = [none] } buf.append(serializeNoNS(n)); // depends on control dependency: [if], data = [none] buf.append("\n"); // depends on control dependency: [if], data = [none] } } if (tagOpen) { buf.append("/>\n"); // depends on control dependency: [if], data = [none] } else { buf.append("</"); // depends on control dependency: [if], data = [none] buf.append(node.getLocalName()); // depends on control dependency: [if], data = [none] buf.append(">\n"); // depends on control dependency: [if], data = [none] } return buf.toString(); // ByteArrayOutputStream baos = new ByteArrayOutputStream(); // try { // TransformerFactory factory = TransformerFactory.newInstance(); // File f = Misc.getResourceAsFile("com/occamlab/te/drop-ns.xsl"); // Transformer transformer = factory.newTransformer(new // StreamSource(f)); // // DOMSource src = new DOMSource(node); // StreamResult dest = new StreamResult(baos); // transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, // "yes"); // transformer.transform(src, dest); // } catch (Exception e) { // System.out.println("Error serializing node. "+e.getMessage()); // } // // return baos.toString(); } }
public class class_name { private void exportInternalAPI(ClassLoader cl) { String[] packages = { "com.sun.tools.doclets", "com.sun.tools.doclets.standard", "com.sun.tools.doclets.internal.toolkit", "com.sun.tools.doclets.internal.toolkit.taglets", "com.sun.tools.doclets.internal.toolkit.builders", "com.sun.tools.doclets.internal.toolkit.util", "com.sun.tools.doclets.internal.toolkit.util.links", "com.sun.tools.doclets.formats.html", "com.sun.tools.doclets.formats.html.markup" }; try { Method getModuleMethod = Class.class.getDeclaredMethod("getModule"); Object thisModule = getModuleMethod.invoke(getClass()); Class<?> moduleClass = Class.forName("java.lang.Module"); Method addExportsMethod = moduleClass.getDeclaredMethod("addExports", String.class, moduleClass); Method getUnnamedModuleMethod = ClassLoader.class.getDeclaredMethod("getUnnamedModule"); Object target = getUnnamedModuleMethod.invoke(cl); for (String pack : packages) { addExportsMethod.invoke(thisModule, pack, target); } } catch (Exception e) { // do nothing } } }
public class class_name { private void exportInternalAPI(ClassLoader cl) { String[] packages = { "com.sun.tools.doclets", "com.sun.tools.doclets.standard", "com.sun.tools.doclets.internal.toolkit", "com.sun.tools.doclets.internal.toolkit.taglets", "com.sun.tools.doclets.internal.toolkit.builders", "com.sun.tools.doclets.internal.toolkit.util", "com.sun.tools.doclets.internal.toolkit.util.links", "com.sun.tools.doclets.formats.html", "com.sun.tools.doclets.formats.html.markup" }; try { Method getModuleMethod = Class.class.getDeclaredMethod("getModule"); Object thisModule = getModuleMethod.invoke(getClass()); Class<?> moduleClass = Class.forName("java.lang.Module"); Method addExportsMethod = moduleClass.getDeclaredMethod("addExports", String.class, moduleClass); Method getUnnamedModuleMethod = ClassLoader.class.getDeclaredMethod("getUnnamedModule"); Object target = getUnnamedModuleMethod.invoke(cl); for (String pack : packages) { addExportsMethod.invoke(thisModule, pack, target); } } catch (Exception e) { // do nothing } // depends on control dependency: [catch], data = [none] } }
public class class_name { private DocPath getPath(LinkInfoImpl linkInfo) { if (linkInfo.context == LinkInfoImpl.Kind.PACKAGE_FRAME) { //Not really necessary to do this but we want to be consistent //with 1.4.2 output. return DocPath.forName(linkInfo.utils, linkInfo.typeElement); } return m_writer.pathToRoot.resolve(DocPath.forClass(linkInfo.utils, linkInfo.typeElement)); } }
public class class_name { private DocPath getPath(LinkInfoImpl linkInfo) { if (linkInfo.context == LinkInfoImpl.Kind.PACKAGE_FRAME) { //Not really necessary to do this but we want to be consistent //with 1.4.2 output. return DocPath.forName(linkInfo.utils, linkInfo.typeElement); // depends on control dependency: [if], data = [none] } return m_writer.pathToRoot.resolve(DocPath.forClass(linkInfo.utils, linkInfo.typeElement)); } }
public class class_name { public static Vector2ifx convert(Tuple2D<?> tuple) { if (tuple instanceof Vector2ifx) { return (Vector2ifx) tuple; } return new Vector2ifx(tuple.getX(), tuple.getY()); } }
public class class_name { public static Vector2ifx convert(Tuple2D<?> tuple) { if (tuple instanceof Vector2ifx) { return (Vector2ifx) tuple; // depends on control dependency: [if], data = [none] } return new Vector2ifx(tuple.getX(), tuple.getY()); } }
public class class_name { @Nullable private TableReportEntryTable convertToTableReportEntryTable( String tableId, Map<String, Object> map, Predicate<String> placementFilter, Predicate<Boolean> droppedFilter, Predicate<Boolean> facadeFilter) { // Check the filters for placement, dropped, and facade String placement = (String) map.get("placement"); if (!placementFilter.apply(placement)) { return null; } Boolean dropped = Objects.firstNonNull((Boolean) map.get("dropped"), false); if (!droppedFilter.apply(dropped)) { return null; } Boolean facade = Objects.firstNonNull((Boolean) map.get("facade"), false); if (!facadeFilter.apply(facade)) { return null; } List<Integer> shards = Lists.newArrayList(); // Aggregate the column, size and update statistics across all shards. TableStatistics.Aggregator aggregator = TableStatistics.newAggregator(); Object shardJson = map.get("shards"); if (shardJson != null) { Map<String, TableStatistics> shardMap = JsonHelper.convert( shardJson, new TypeReference<Map<String, TableStatistics>>() { }); for (Map.Entry<String, TableStatistics> entry : shardMap.entrySet()) { Integer shardId = Integer.parseInt(entry.getKey()); shards.add(shardId); aggregator.add(entry.getValue()); } } TableStatistics tableStatistics = aggregator.aggregate(); Collections.sort(shards); return new TableReportEntryTable(tableId, placement, shards, dropped, facade, tableStatistics.getRecordCount(), tableStatistics.getColumnStatistics().toStatistics(), tableStatistics.getSizeStatistics().toStatistics(), tableStatistics.getUpdateTimeStatistics().toStatistics()); } }
public class class_name { @Nullable private TableReportEntryTable convertToTableReportEntryTable( String tableId, Map<String, Object> map, Predicate<String> placementFilter, Predicate<Boolean> droppedFilter, Predicate<Boolean> facadeFilter) { // Check the filters for placement, dropped, and facade String placement = (String) map.get("placement"); if (!placementFilter.apply(placement)) { return null; // depends on control dependency: [if], data = [none] } Boolean dropped = Objects.firstNonNull((Boolean) map.get("dropped"), false); if (!droppedFilter.apply(dropped)) { return null; // depends on control dependency: [if], data = [none] } Boolean facade = Objects.firstNonNull((Boolean) map.get("facade"), false); if (!facadeFilter.apply(facade)) { return null; // depends on control dependency: [if], data = [none] } List<Integer> shards = Lists.newArrayList(); // Aggregate the column, size and update statistics across all shards. TableStatistics.Aggregator aggregator = TableStatistics.newAggregator(); Object shardJson = map.get("shards"); if (shardJson != null) { Map<String, TableStatistics> shardMap = JsonHelper.convert( shardJson, new TypeReference<Map<String, TableStatistics>>() { }); for (Map.Entry<String, TableStatistics> entry : shardMap.entrySet()) { Integer shardId = Integer.parseInt(entry.getKey()); shards.add(shardId); // depends on control dependency: [for], data = [none] aggregator.add(entry.getValue()); // depends on control dependency: [for], data = [entry] } } TableStatistics tableStatistics = aggregator.aggregate(); Collections.sort(shards); return new TableReportEntryTable(tableId, placement, shards, dropped, facade, tableStatistics.getRecordCount(), tableStatistics.getColumnStatistics().toStatistics(), tableStatistics.getSizeStatistics().toStatistics(), tableStatistics.getUpdateTimeStatistics().toStatistics()); } }
public class class_name { public void processSpace(Properties props) { COALS_LOGGER.info("Droppring dimensions from co-occurrance matrix."); // Read in the matrix from a file with dimensions dropped. finalCorrelation = buildMatrix(maxWords, maxDimensions); COALS_LOGGER.info("Done dropping dimensions."); if (transform != null) { COALS_LOGGER.info("Normalizing co-occurrance matrix."); // Normalize the matrix using correlation. int wordCount = finalCorrelation.rows(); finalCorrelation = transform.transform(finalCorrelation); COALS_LOGGER.info("Done normalizing co-occurrance matrix."); } if (reducer != null) { if (reducedDimensions > finalCorrelation.columns()) throw new IllegalArgumentException( "Cannot reduce to more dimensions than exist"); COALS_LOGGER.info("Reducing using SVD."); try { File coalsMatrixFile = File.createTempFile("coals-term-doc-matrix", "dat"); coalsMatrixFile.deleteOnExit(); MatrixIO.writeMatrix(finalCorrelation, coalsMatrixFile, Format.SVDLIBC_SPARSE_BINARY); MatrixFile processedSpace = new MatrixFile( coalsMatrixFile, Format.SVDLIBC_SPARSE_BINARY); reducer.factorize(processedSpace, reducedDimensions); finalCorrelation = reducer.dataClasses(); } catch (IOException ioe) { throw new IOError(ioe); } COALS_LOGGER.info("Done reducing using SVD."); } } }
public class class_name { public void processSpace(Properties props) { COALS_LOGGER.info("Droppring dimensions from co-occurrance matrix."); // Read in the matrix from a file with dimensions dropped. finalCorrelation = buildMatrix(maxWords, maxDimensions); COALS_LOGGER.info("Done dropping dimensions."); if (transform != null) { COALS_LOGGER.info("Normalizing co-occurrance matrix."); // depends on control dependency: [if], data = [none] // Normalize the matrix using correlation. int wordCount = finalCorrelation.rows(); finalCorrelation = transform.transform(finalCorrelation); // depends on control dependency: [if], data = [none] COALS_LOGGER.info("Done normalizing co-occurrance matrix."); // depends on control dependency: [if], data = [none] } if (reducer != null) { if (reducedDimensions > finalCorrelation.columns()) throw new IllegalArgumentException( "Cannot reduce to more dimensions than exist"); COALS_LOGGER.info("Reducing using SVD."); // depends on control dependency: [if], data = [none] try { File coalsMatrixFile = File.createTempFile("coals-term-doc-matrix", "dat"); coalsMatrixFile.deleteOnExit(); // depends on control dependency: [try], data = [none] MatrixIO.writeMatrix(finalCorrelation, coalsMatrixFile, Format.SVDLIBC_SPARSE_BINARY); // depends on control dependency: [try], data = [none] MatrixFile processedSpace = new MatrixFile( coalsMatrixFile, Format.SVDLIBC_SPARSE_BINARY); reducer.factorize(processedSpace, reducedDimensions); // depends on control dependency: [try], data = [none] finalCorrelation = reducer.dataClasses(); // depends on control dependency: [try], data = [none] } catch (IOException ioe) { throw new IOError(ioe); } // depends on control dependency: [catch], data = [none] COALS_LOGGER.info("Done reducing using SVD."); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override protected void dialogButtonsHtml(StringBuffer result, int button, String attribute) { attribute = appendDelimiter(attribute); switch (button) { case BUTTON_OK: result.append("<input name=\"ok\" value=\""); result.append(getConfigurationContentStringValue(NODE_BUTTON_ACCEPT)); result.append("\""); if (attribute.toLowerCase().indexOf("onclick") == -1) { result.append(" type=\"submit\""); } else { result.append(" type=\"button\""); } result.append(" class=\"dialogbutton\""); result.append(attribute); result.append(">\n"); break; case BUTTON_CANCEL: result.append("<input name=\"cancel\" type=\"button\" value=\""); result.append(getConfigurationContentStringValue(NODE_BUTTON_DECLINE)); result.append("\""); if (attribute.toLowerCase().indexOf("onclick") == -1) { result.append(" onclick=\"submitAction('" + DIALOG_CANCEL + "', form);\""); } result.append(" class=\"dialogbutton\""); result.append(attribute); result.append(">\n"); break; default: // other buttons are not overridden, call super implementation super.dialogButtonsHtml(result, button, attribute); } } }
public class class_name { @Override protected void dialogButtonsHtml(StringBuffer result, int button, String attribute) { attribute = appendDelimiter(attribute); switch (button) { case BUTTON_OK: result.append("<input name=\"ok\" value=\""); result.append(getConfigurationContentStringValue(NODE_BUTTON_ACCEPT)); result.append("\""); if (attribute.toLowerCase().indexOf("onclick") == -1) { result.append(" type=\"submit\""); // depends on control dependency: [if], data = [none] } else { result.append(" type=\"button\""); // depends on control dependency: [if], data = [none] } result.append(" class=\"dialogbutton\""); result.append(attribute); result.append(">\n"); break; case BUTTON_CANCEL: result.append("<input name=\"cancel\" type=\"button\" value=\""); result.append(getConfigurationContentStringValue(NODE_BUTTON_DECLINE)); result.append("\""); if (attribute.toLowerCase().indexOf("onclick") == -1) { result.append(" onclick=\"submitAction('" + DIALOG_CANCEL + "', form);\""); // depends on control dependency: [if], data = [none] } result.append(" class=\"dialogbutton\""); result.append(attribute); result.append(">\n"); break; default: // other buttons are not overridden, call super implementation super.dialogButtonsHtml(result, button, attribute); } } }
public class class_name { public static PlainChangesLogImpl createCopy(List<ItemState> items, String pairId, PlainChangesLog originalLog) { if (originalLog.getSession() != null) { return new PlainChangesLogImpl(items, originalLog.getSession().getId(), originalLog.getEventType(), pairId, originalLog.getSession()); } return new PlainChangesLogImpl(items, originalLog.getSessionId(), originalLog.getEventType(), pairId, null); } }
public class class_name { public static PlainChangesLogImpl createCopy(List<ItemState> items, String pairId, PlainChangesLog originalLog) { if (originalLog.getSession() != null) { return new PlainChangesLogImpl(items, originalLog.getSession().getId(), originalLog.getEventType(), pairId, originalLog.getSession()); // depends on control dependency: [if], data = [none] } return new PlainChangesLogImpl(items, originalLog.getSessionId(), originalLog.getEventType(), pairId, null); } }
public class class_name { @Override public String getQueryString() { try { collaborator.preInvoke(componentMetaData); return request.getQueryString(); } finally { collaborator.postInvoke(); } } }
public class class_name { @Override public String getQueryString() { try { collaborator.preInvoke(componentMetaData); // depends on control dependency: [try], data = [none] return request.getQueryString(); // depends on control dependency: [try], data = [none] } finally { collaborator.postInvoke(); } } }
public class class_name { public Dimension getDimension() { Dimension ret = null; try { ret = Dimension.get(UUID.fromString(this.dimensionUUID)); } catch (final CacheReloadException e) { Attribute.LOG.error("Catched CacheReloadException", e); } return ret; } }
public class class_name { public Dimension getDimension() { Dimension ret = null; try { ret = Dimension.get(UUID.fromString(this.dimensionUUID)); // depends on control dependency: [try], data = [none] } catch (final CacheReloadException e) { Attribute.LOG.error("Catched CacheReloadException", e); } // depends on control dependency: [catch], data = [none] return ret; } }
public class class_name { public DataFrame getDataFrame(String query, EntityMetadata m, KunderaQuery kunderaQuery) { PersistenceUnitMetadata puMetadata = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata( persistenceUnit); String clientName = puMetadata.getProperty(DATA_CLIENT).toLowerCase(); SparkDataClient dataClient = SparkDataClientFactory.getDataClient(clientName); if (registeredTables.get(m.getTableName()) == null || !registeredTables.get(m.getTableName())) { dataClient.registerTable(m, this); registeredTables.put(m.getTableName(), true); } // at this level temp table or table should be ready DataFrame dataFrame = sqlContext.sql(query); return dataFrame; } }
public class class_name { public DataFrame getDataFrame(String query, EntityMetadata m, KunderaQuery kunderaQuery) { PersistenceUnitMetadata puMetadata = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata( persistenceUnit); String clientName = puMetadata.getProperty(DATA_CLIENT).toLowerCase(); SparkDataClient dataClient = SparkDataClientFactory.getDataClient(clientName); if (registeredTables.get(m.getTableName()) == null || !registeredTables.get(m.getTableName())) { dataClient.registerTable(m, this); // depends on control dependency: [if], data = [none] registeredTables.put(m.getTableName(), true); // depends on control dependency: [if], data = [none] } // at this level temp table or table should be ready DataFrame dataFrame = sqlContext.sql(query); return dataFrame; } }
public class class_name { public int calculate_framesize() { if (h_layer == 1) { framesize = (12 * bitrates[h_version][0][h_bitrate_index]) / frequencies[h_version][h_sample_frequency]; if (h_padding_bit != 0 ) framesize++; framesize <<= 2; // one slot is 4 bytes long nSlots = 0; } else { framesize = (144 * bitrates[h_version][h_layer - 1][h_bitrate_index]) / frequencies[h_version][h_sample_frequency]; if (h_version == MPEG2_LSF || h_version == MPEG25_LSF) framesize >>= 1; // SZD if (h_padding_bit != 0) framesize++; // Layer III slots if (h_layer == 3) { if (h_version == MPEG1) { nSlots = framesize - ((h_mode == SINGLE_CHANNEL) ? 17 : 32) // side info size - ((h_protection_bit!=0) ? 0 : 2) // CRC size - 4; // header size } else { // MPEG-2 LSF, SZD: MPEG-2.5 LSF nSlots = framesize - ((h_mode == SINGLE_CHANNEL) ? 9 : 17) // side info size - ((h_protection_bit!=0) ? 0 : 2) // CRC size - 4; // header size } } else { nSlots = 0; } } framesize -= 4; // subtract header size return framesize; } }
public class class_name { public int calculate_framesize() { if (h_layer == 1) { framesize = (12 * bitrates[h_version][0][h_bitrate_index]) / frequencies[h_version][h_sample_frequency]; // depends on control dependency: [if], data = [none] if (h_padding_bit != 0 ) framesize++; framesize <<= 2; // one slot is 4 bytes long // depends on control dependency: [if], data = [none] nSlots = 0; // depends on control dependency: [if], data = [none] } else { framesize = (144 * bitrates[h_version][h_layer - 1][h_bitrate_index]) / frequencies[h_version][h_sample_frequency]; // depends on control dependency: [if], data = [none] if (h_version == MPEG2_LSF || h_version == MPEG25_LSF) framesize >>= 1; // SZD if (h_padding_bit != 0) framesize++; // Layer III slots if (h_layer == 3) { if (h_version == MPEG1) { nSlots = framesize - ((h_mode == SINGLE_CHANNEL) ? 17 : 32) // side info size - ((h_protection_bit!=0) ? 0 : 2) // CRC size - 4; // header size // depends on control dependency: [if], data = [none] } else { // MPEG-2 LSF, SZD: MPEG-2.5 LSF nSlots = framesize - ((h_mode == SINGLE_CHANNEL) ? 9 : 17) // side info size - ((h_protection_bit!=0) ? 0 : 2) // CRC size - 4; // header size // depends on control dependency: [if], data = [none] } } else { nSlots = 0; // depends on control dependency: [if], data = [none] } } framesize -= 4; // subtract header size return framesize; } }
public class class_name { @Override public void internalError(final Exception cause) { logError("Internal Server Error on " + request().getUri(), cause); if (this.api_version > 0) { // always default to the latest version of the error formatter since we // need to return something switch (this.api_version) { case 1: default: sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR, serializer.formatErrorV1(cause)); } return; } ThrowableProxy tp = new ThrowableProxy(cause); tp.calculatePackagingData(); final String pretty_exc = ThrowableProxyUtil.asString(tp); tp = null; if (hasQueryStringParam("json")) { // 32 = 10 + some extra space as exceptions always have \t's to escape. final StringBuilder buf = new StringBuilder(32 + pretty_exc.length()); buf.append("{\"err\":\""); HttpQuery.escapeJson(pretty_exc, buf); buf.append("\"}"); sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR, buf); } else { sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR, makePage("Internal Server Error", "Houston, we have a problem", "<blockquote>" + "<h1>Internal Server Error</h1>" + "Oops, sorry but your request failed due to a" + " server error.<br/><br/>" + "Please try again in 30 seconds.<pre>" + pretty_exc + "</pre></blockquote>")); } } }
public class class_name { @Override public void internalError(final Exception cause) { logError("Internal Server Error on " + request().getUri(), cause); if (this.api_version > 0) { // always default to the latest version of the error formatter since we // need to return something switch (this.api_version) { case 1: default: sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR, serializer.formatErrorV1(cause)); } return; // depends on control dependency: [if], data = [none] } ThrowableProxy tp = new ThrowableProxy(cause); tp.calculatePackagingData(); final String pretty_exc = ThrowableProxyUtil.asString(tp); tp = null; if (hasQueryStringParam("json")) { // 32 = 10 + some extra space as exceptions always have \t's to escape. final StringBuilder buf = new StringBuilder(32 + pretty_exc.length()); buf.append("{\"err\":\""); // depends on control dependency: [if], data = [none] HttpQuery.escapeJson(pretty_exc, buf); // depends on control dependency: [if], data = [none] buf.append("\"}"); // depends on control dependency: [if], data = [none] sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR, buf); // depends on control dependency: [if], data = [none] } else { sendReply(HttpResponseStatus.INTERNAL_SERVER_ERROR, makePage("Internal Server Error", "Houston, we have a problem", "<blockquote>" + "<h1>Internal Server Error</h1>" + "Oops, sorry but your request failed due to a" + " server error.<br/><br/>" + "Please try again in 30 seconds.<pre>" + pretty_exc + "</pre></blockquote>")); // depends on control dependency: [if], data = [none] } } }
public class class_name { private List<String> getFedoraTables() { try { InputStream in = getClass().getClassLoader() .getResourceAsStream(DBSPEC_LOCATION); List<TableSpec> specs = TableSpec.getTableSpecs(in); ArrayList<String> names = new ArrayList<String>(); for (TableSpec spec: specs) { names.add(spec.getName().toUpperCase()); } return names; } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("Unexpected error reading dbspec file", e); } } }
public class class_name { private List<String> getFedoraTables() { try { InputStream in = getClass().getClassLoader() .getResourceAsStream(DBSPEC_LOCATION); List<TableSpec> specs = TableSpec.getTableSpecs(in); ArrayList<String> names = new ArrayList<String>(); for (TableSpec spec: specs) { names.add(spec.getName().toUpperCase()); // depends on control dependency: [for], data = [spec] } return names; // depends on control dependency: [try], data = [none] } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("Unexpected error reading dbspec file", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static final GVRPickedObject[] pickVisible(GVRScene scene) { sFindObjectsLock.lock(); try { final GVRPickedObject[] result = NativePicker.pickVisible(scene.getNative()); return result; } finally { sFindObjectsLock.unlock(); } } }
public class class_name { public static final GVRPickedObject[] pickVisible(GVRScene scene) { sFindObjectsLock.lock(); try { final GVRPickedObject[] result = NativePicker.pickVisible(scene.getNative()); return result; // depends on control dependency: [try], data = [none] } finally { sFindObjectsLock.unlock(); } } }
public class class_name { @Override final public void onViewCreated(final View view, final Bundle savedInstanceState) { fragmentComesBackFromBackground = false; eventRegister.registerEventBuses(); onPreViewReady(view, savedInstanceState); final boolean restoring = savedInstanceState != null; if (restoring && isStateManagedByRootDelegateFragment) { ((MvcActivity) getActivity()).addPendingOnViewReadyActions(new Runnable() { @Override public void run() { doOnViewCreatedCallBack(view, savedInstanceState, restoring); } }); } else { doOnViewCreatedCallBack(view, savedInstanceState, restoring); } } }
public class class_name { @Override final public void onViewCreated(final View view, final Bundle savedInstanceState) { fragmentComesBackFromBackground = false; eventRegister.registerEventBuses(); onPreViewReady(view, savedInstanceState); final boolean restoring = savedInstanceState != null; if (restoring && isStateManagedByRootDelegateFragment) { ((MvcActivity) getActivity()).addPendingOnViewReadyActions(new Runnable() { @Override public void run() { doOnViewCreatedCallBack(view, savedInstanceState, restoring); } }); // depends on control dependency: [if], data = [none] } else { doOnViewCreatedCallBack(view, savedInstanceState, restoring); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(PatchFilter patchFilter, ProtocolMarshaller protocolMarshaller) { if (patchFilter == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(patchFilter.getKey(), KEY_BINDING); protocolMarshaller.marshall(patchFilter.getValues(), VALUES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(PatchFilter patchFilter, ProtocolMarshaller protocolMarshaller) { if (patchFilter == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(patchFilter.getKey(), KEY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(patchFilter.getValues(), VALUES_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public void fillActionBars(IActionBars actionBars) { actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), new DFSAction(DFSActions.DELETE)); actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), new DFSAction(DFSActions.REFRESH)); if (site == null) return; if ((site.getStructuredViewer().getSelection() instanceof IStructuredSelection) && (((IStructuredSelection) site.getStructuredViewer() .getSelection()).size() == 1) && (((IStructuredSelection) site.getStructuredViewer() .getSelection()).getFirstElement() instanceof DFSFile)) { actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, new DFSAction(DFSActions.OPEN)); } actionBars.updateActionBars(); } }
public class class_name { @Override public void fillActionBars(IActionBars actionBars) { actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), new DFSAction(DFSActions.DELETE)); actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), new DFSAction(DFSActions.REFRESH)); if (site == null) return; if ((site.getStructuredViewer().getSelection() instanceof IStructuredSelection) && (((IStructuredSelection) site.getStructuredViewer() .getSelection()).size() == 1) && (((IStructuredSelection) site.getStructuredViewer() .getSelection()).getFirstElement() instanceof DFSFile)) { actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, new DFSAction(DFSActions.OPEN)); // depends on control dependency: [if], data = [none] } actionBars.updateActionBars(); } }
public class class_name { public static boolean containsIllegalXML(String str) { assert str != null; for (int index = 0; index < str.length(); index++) { char ch = str.charAt(index); if ((ch <= 0x08) || (ch >= 0x0B && ch <= 0x0C) || (ch >= 0x0E && ch <= 0x19) || (ch >= 0xD800 && ch <= 0xDFFF) || (ch >= 0xFFFE)) { return true; } } return false; } }
public class class_name { public static boolean containsIllegalXML(String str) { assert str != null; for (int index = 0; index < str.length(); index++) { char ch = str.charAt(index); if ((ch <= 0x08) || (ch >= 0x0B && ch <= 0x0C) || (ch >= 0x0E && ch <= 0x19) || (ch >= 0xD800 && ch <= 0xDFFF) || (ch >= 0xFFFE)) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { private String getKeyPairs(String key, Object value) { if (value != null) { return "&" + key + "=" + value.toString(); } else { return ""; } } }
public class class_name { private String getKeyPairs(String key, Object value) { if (value != null) { return "&" + key + "=" + value.toString(); // depends on control dependency: [if], data = [none] } else { return ""; // depends on control dependency: [if], data = [none] } } }
public class class_name { public void buildPackageTags(XMLNode node, Content packageContentTree) { if (configuration.nocomment) { return; } packageWriter.addPackageTags(packageContentTree); } }
public class class_name { public void buildPackageTags(XMLNode node, Content packageContentTree) { if (configuration.nocomment) { return; // depends on control dependency: [if], data = [none] } packageWriter.addPackageTags(packageContentTree); } }
public class class_name { public boolean beanDoesNotExistOrHasTimedOut(TimeoutElement elt, BeanId beanId) { if (elt == null) { // Not in the reaper list, but it might be in local // failover cache if not in reaper list. So check it if // there is a local SfFailoverCache object (e.g. when SFSB // failover is enabled to use failover cache). if (ivSfFailoverCache != null) { // Not in reaper list, but SFSB failover enabled. // Have local SfFailoverCache determine if bean does not exist // or has timed out. return ivSfFailoverCache.beanDoesNotExistOrHasTimedOut(beanId); } // Return true since bean not found in reaper list // and SFSB failover is not enabled so not in failover // cache list. return true; } // SFSB found in reaper list, so return whether it // has timed out or not. return elt.isTimedOut(); // F61004.5 } }
public class class_name { public boolean beanDoesNotExistOrHasTimedOut(TimeoutElement elt, BeanId beanId) { if (elt == null) { // Not in the reaper list, but it might be in local // failover cache if not in reaper list. So check it if // there is a local SfFailoverCache object (e.g. when SFSB // failover is enabled to use failover cache). if (ivSfFailoverCache != null) { // Not in reaper list, but SFSB failover enabled. // Have local SfFailoverCache determine if bean does not exist // or has timed out. return ivSfFailoverCache.beanDoesNotExistOrHasTimedOut(beanId); // depends on control dependency: [if], data = [none] } // Return true since bean not found in reaper list // and SFSB failover is not enabled so not in failover // cache list. return true; // depends on control dependency: [if], data = [none] } // SFSB found in reaper list, so return whether it // has timed out or not. return elt.isTimedOut(); // F61004.5 } }
public class class_name { public String toJSONString() { if (context.isPretty()) { return JSON.toJSONStringWithDateFormat(this, Constant.DATE_SERIALIZE_FORMAT, SerializerFeature.PrettyFormat); } else { return JSONObject.toJSONStringWithDateFormat(this, Constant.DATE_SERIALIZE_FORMAT); } } }
public class class_name { public String toJSONString() { if (context.isPretty()) { return JSON.toJSONStringWithDateFormat(this, Constant.DATE_SERIALIZE_FORMAT, SerializerFeature.PrettyFormat); // depends on control dependency: [if], data = [none] } else { return JSONObject.toJSONStringWithDateFormat(this, Constant.DATE_SERIALIZE_FORMAT); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static RealMatrix colSubtract (RealMatrix matrix, double[] vector) { // Declare and initialize the new matrix: double[][] retval = new double[matrix.getRowDimension()][matrix.getColumnDimension()]; // Iterate over rows: for (int col = 0; col < retval.length; col++) { // Iterate over columns: for (int row = 0; row < retval[0].length; row++) { retval[row][col] = matrix.getEntry(row, col) - vector[row]; } } // Done, return a new matrix: return MatrixUtils.createRealMatrix(retval); } }
public class class_name { public static RealMatrix colSubtract (RealMatrix matrix, double[] vector) { // Declare and initialize the new matrix: double[][] retval = new double[matrix.getRowDimension()][matrix.getColumnDimension()]; // Iterate over rows: for (int col = 0; col < retval.length; col++) { // Iterate over columns: for (int row = 0; row < retval[0].length; row++) { retval[row][col] = matrix.getEntry(row, col) - vector[row]; // depends on control dependency: [for], data = [row] } } // Done, return a new matrix: return MatrixUtils.createRealMatrix(retval); } }
public class class_name { public void setDummyFactory(final DummyFactory dummyFactory) { if (entities.size() > 0) { throw new IllegalStateException("The dummy factory cannot be changed after an entity was generated!"); } if (dummyFactory == null) { this.dummyFactory = new DefaultDummyFactory(); } else { this.dummyFactory = dummyFactory; } } }
public class class_name { public void setDummyFactory(final DummyFactory dummyFactory) { if (entities.size() > 0) { throw new IllegalStateException("The dummy factory cannot be changed after an entity was generated!"); } if (dummyFactory == null) { this.dummyFactory = new DefaultDummyFactory(); // depends on control dependency: [if], data = [none] } else { this.dummyFactory = dummyFactory; // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public void exportCollectedMetrics() { lifecycleLock.readLock().lock(); try { if (!State.STARTED.equals(state)) { logger.debug("Ignore collectMetrics() command for " + state + " instance"); return; } for (Query query : getQueries()) { query.exportCollectedMetrics(); } } finally { lifecycleLock.readLock().unlock(); } } }
public class class_name { @Override public void exportCollectedMetrics() { lifecycleLock.readLock().lock(); try { if (!State.STARTED.equals(state)) { logger.debug("Ignore collectMetrics() command for " + state + " instance"); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } for (Query query : getQueries()) { query.exportCollectedMetrics(); // depends on control dependency: [for], data = [query] } } finally { lifecycleLock.readLock().unlock(); } } }
public class class_name { protected boolean isFragmentReady(StreamingTrack streamingTrack, StreamingSample next) { long ts = nextSampleStartTime.get(streamingTrack); long cfst = nextFragmentCreateStartTime.get(streamingTrack); if ((ts > cfst + 3 * streamingTrack.getTimescale())) { // mininum fragment length == 3 seconds SampleFlagsSampleExtension sfExt = next.getSampleExtension(SampleFlagsSampleExtension.class); if (sfExt == null || sfExt.isSyncSample()) { //System.err.println(streamingTrack + " ready at " + ts); // the next sample needs to be a sync sample // when there is no SampleFlagsSampleExtension we assume syncSample == true return true; } } return false; } }
public class class_name { protected boolean isFragmentReady(StreamingTrack streamingTrack, StreamingSample next) { long ts = nextSampleStartTime.get(streamingTrack); long cfst = nextFragmentCreateStartTime.get(streamingTrack); if ((ts > cfst + 3 * streamingTrack.getTimescale())) { // mininum fragment length == 3 seconds SampleFlagsSampleExtension sfExt = next.getSampleExtension(SampleFlagsSampleExtension.class); if (sfExt == null || sfExt.isSyncSample()) { //System.err.println(streamingTrack + " ready at " + ts); // the next sample needs to be a sync sample // when there is no SampleFlagsSampleExtension we assume syncSample == true return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public static int[] asIntegerTypeArray(List<Integer> input) { int[] result = new int[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); } return result; } }
public class class_name { public static int[] asIntegerTypeArray(List<Integer> input) { int[] result = new int[input.size()]; for (int i = 0; i < result.length; i++) { result[i] = input.get(i); // depends on control dependency: [for], data = [i] } return result; } }
public class class_name { public String patternToRegex(String string) { if (string != null) if (!string.contains("[")) if (!string.contains("{")) // If it has one of these, it probably is a regex already. if (!string.contains("\\.")) { string = string.replace(".", "\\."); string = string.replace("*", ".*"); } return string; } }
public class class_name { public String patternToRegex(String string) { if (string != null) if (!string.contains("[")) if (!string.contains("{")) // If it has one of these, it probably is a regex already. if (!string.contains("\\.")) { string = string.replace(".", "\\."); // depends on control dependency: [if], data = [none] string = string.replace("*", ".*"); // depends on control dependency: [if], data = [none] } return string; } }
public class class_name { @Override public E peek() { E el; while (((el = super.peek()) == null) && !isDone()) { synchronized (this) { try { wait(); } catch (InterruptedException e) { String s = "Reader has been interrupted maybe the connection is closed"; throw new RuntimeException(s); } } } if ((el == null) && isDone()) { String s = "Reader has been interrupted maybe the connection is closed"; throw new RuntimeException(s); } return el; } }
public class class_name { @Override public E peek() { E el; while (((el = super.peek()) == null) && !isDone()) { synchronized (this) { // depends on control dependency: [while], data = [none] try { wait(); // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { String s = "Reader has been interrupted maybe the connection is closed"; throw new RuntimeException(s); } // depends on control dependency: [catch], data = [none] } } if ((el == null) && isDone()) { String s = "Reader has been interrupted maybe the connection is closed"; throw new RuntimeException(s); } return el; } }
public class class_name { public void remove(final LeftTupleSinkNode node) { if ( (this.firstNode != node) && (this.lastNode != node) ) { node.getPreviousLeftTupleSinkNode().setNextLeftTupleSinkNode( node.getNextLeftTupleSinkNode() ); node.getNextLeftTupleSinkNode().setPreviousLeftTupleSinkNode( node.getPreviousLeftTupleSinkNode() ); this.size--; node.setPreviousLeftTupleSinkNode( null ); node.setNextLeftTupleSinkNode( null ); } else { if ( this.firstNode == node ) { removeFirst(); } else if ( this.lastNode == node ) { removeLast(); } } } }
public class class_name { public void remove(final LeftTupleSinkNode node) { if ( (this.firstNode != node) && (this.lastNode != node) ) { node.getPreviousLeftTupleSinkNode().setNextLeftTupleSinkNode( node.getNextLeftTupleSinkNode() ); // depends on control dependency: [if], data = [none] node.getNextLeftTupleSinkNode().setPreviousLeftTupleSinkNode( node.getPreviousLeftTupleSinkNode() ); // depends on control dependency: [if], data = [none] this.size--; // depends on control dependency: [if], data = [none] node.setPreviousLeftTupleSinkNode( null ); // depends on control dependency: [if], data = [none] node.setNextLeftTupleSinkNode( null ); // depends on control dependency: [if], data = [none] } else { if ( this.firstNode == node ) { removeFirst(); // depends on control dependency: [if], data = [none] } else if ( this.lastNode == node ) { removeLast(); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public boolean isDeleted(DbEntity dbEntity) { CachedDbEntity cachedDbEntity = getCachedEntity(dbEntity); if(cachedDbEntity == null) { return false; } else { return cachedDbEntity.getEntityState() == DELETED_MERGED || cachedDbEntity.getEntityState() == DELETED_PERSISTENT || cachedDbEntity.getEntityState() == DELETED_TRANSIENT; } } }
public class class_name { public boolean isDeleted(DbEntity dbEntity) { CachedDbEntity cachedDbEntity = getCachedEntity(dbEntity); if(cachedDbEntity == null) { return false; // depends on control dependency: [if], data = [none] } else { return cachedDbEntity.getEntityState() == DELETED_MERGED || cachedDbEntity.getEntityState() == DELETED_PERSISTENT || cachedDbEntity.getEntityState() == DELETED_TRANSIENT; // depends on control dependency: [if], data = [none] } } }
public class class_name { private ShowQueryBuilder parseShow(ShowQueryBuilder query) { Token token = scanToken(); if (token == Token.TABLE) { } else if (token == Token.IDENTIFIER && _lexeme.equalsIgnoreCase("tableinfo")) { query.method("tableinfo"); } else { throw error("Expected TABLE at {0}", token); } token = scanToken(); if (token != Token.IDENTIFIER) { throw error("Expected IDENTIFIER at {0}", token); } String pod = _lexeme; String name; if (peekToken() == Token.DOT) { scanToken(); if ((token = scanToken()) != Token.IDENTIFIER) { throw error("Expected IDENTIFIER at {0}", token); } name = _lexeme; } else { name = pod; pod = getPodName(); } query.setTableName(pod + '.' + name); return query; } }
public class class_name { private ShowQueryBuilder parseShow(ShowQueryBuilder query) { Token token = scanToken(); if (token == Token.TABLE) { } else if (token == Token.IDENTIFIER && _lexeme.equalsIgnoreCase("tableinfo")) { query.method("tableinfo"); // depends on control dependency: [if], data = [none] } else { throw error("Expected TABLE at {0}", token); } token = scanToken(); if (token != Token.IDENTIFIER) { throw error("Expected IDENTIFIER at {0}", token); } String pod = _lexeme; String name; if (peekToken() == Token.DOT) { scanToken(); // depends on control dependency: [if], data = [none] if ((token = scanToken()) != Token.IDENTIFIER) { throw error("Expected IDENTIFIER at {0}", token); } name = _lexeme; // depends on control dependency: [if], data = [none] } else { name = pod; // depends on control dependency: [if], data = [none] pod = getPodName(); // depends on control dependency: [if], data = [none] } query.setTableName(pod + '.' + name); return query; } }
public class class_name { private boolean isCurrentTimeInRange() { Splitter splitter = Splitter.on(",").omitEmptyStrings().trimResults(); if (this.props.contains(ConfigurationKeys.AZKABAN_EXECUTION_DAYS_LIST) && this.props .contains(ConfigurationKeys.AZKABAN_EXECUTION_TIME_RANGE)) { List<String> executionTimeRange = splitter.splitToList(this.props.getProperty(ConfigurationKeys.AZKABAN_EXECUTION_TIME_RANGE)); List<String> executionDays = splitter.splitToList(this.props.getProperty(ConfigurationKeys.AZKABAN_EXECUTION_DAYS_LIST)); Preconditions.checkArgument(executionTimeRange.size() == 2, "The property " + ConfigurationKeys.AZKABAN_EXECUTION_DAYS_LIST + " should be a comma separated list of two entries"); return TimeRangeChecker.isTimeInRange(executionDays, executionTimeRange.get(0), executionTimeRange.get(1), new DateTime(DateTimeZone.forID(ConfigurationKeys.PST_TIMEZONE_NAME))); } return true; } }
public class class_name { private boolean isCurrentTimeInRange() { Splitter splitter = Splitter.on(",").omitEmptyStrings().trimResults(); if (this.props.contains(ConfigurationKeys.AZKABAN_EXECUTION_DAYS_LIST) && this.props .contains(ConfigurationKeys.AZKABAN_EXECUTION_TIME_RANGE)) { List<String> executionTimeRange = splitter.splitToList(this.props.getProperty(ConfigurationKeys.AZKABAN_EXECUTION_TIME_RANGE)); List<String> executionDays = splitter.splitToList(this.props.getProperty(ConfigurationKeys.AZKABAN_EXECUTION_DAYS_LIST)); Preconditions.checkArgument(executionTimeRange.size() == 2, "The property " + ConfigurationKeys.AZKABAN_EXECUTION_DAYS_LIST + " should be a comma separated list of two entries"); // depends on control dependency: [if], data = [none] return TimeRangeChecker.isTimeInRange(executionDays, executionTimeRange.get(0), executionTimeRange.get(1), new DateTime(DateTimeZone.forID(ConfigurationKeys.PST_TIMEZONE_NAME))); // depends on control dependency: [if], data = [none] } return true; } }
public class class_name { static <T> Mono<T> convertToMono(Callable<T> supplier) { if (supplier instanceof Fuseable.ScalarCallable) { Fuseable.ScalarCallable<T> scalarCallable = (Fuseable.ScalarCallable<T>) supplier; T v; try { v = scalarCallable.call(); } catch (Exception e) { return Mono.error(e); } if (v == null) { return Mono.empty(); } return Mono.just(v); } return Mono.onAssembly(new MonoCallable<>(supplier)); } }
public class class_name { static <T> Mono<T> convertToMono(Callable<T> supplier) { if (supplier instanceof Fuseable.ScalarCallable) { Fuseable.ScalarCallable<T> scalarCallable = (Fuseable.ScalarCallable<T>) supplier; T v; try { v = scalarCallable.call(); // depends on control dependency: [try], data = [none] } catch (Exception e) { return Mono.error(e); } // depends on control dependency: [catch], data = [none] if (v == null) { return Mono.empty(); // depends on control dependency: [if], data = [none] } return Mono.just(v); // depends on control dependency: [if], data = [none] } return Mono.onAssembly(new MonoCallable<>(supplier)); } }
public class class_name { public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if (null != m_avts) { int nAttrs = m_avts.size(); for (int i = (nAttrs - 1); i >= 0; i--) { AVT avt = (AVT) m_avts.get(i); avt.fixupVariables(vnames, cstate.getGlobalsSize()); } } } }
public class class_name { public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if (null != m_avts) { int nAttrs = m_avts.size(); for (int i = (nAttrs - 1); i >= 0; i--) { AVT avt = (AVT) m_avts.get(i); avt.fixupVariables(vnames, cstate.getGlobalsSize()); // depends on control dependency: [for], data = [none] } } } }
public class class_name { public List<E> getBatchBlocking() throws InterruptedException { lock.lock(); try { while (open && elements.isEmpty()) { nonEmpty.await(); } if (open) { ArrayList<E> result = new ArrayList<>(elements); elements.clear(); return result; } else { throw new IllegalStateException("queue is closed"); } } finally { lock.unlock(); } } }
public class class_name { public List<E> getBatchBlocking() throws InterruptedException { lock.lock(); try { while (open && elements.isEmpty()) { nonEmpty.await(); // depends on control dependency: [while], data = [none] } if (open) { ArrayList<E> result = new ArrayList<>(elements); elements.clear(); // depends on control dependency: [if], data = [none] return result; // depends on control dependency: [if], data = [none] } else { throw new IllegalStateException("queue is closed"); } } finally { lock.unlock(); } } }
public class class_name { static Method getMethod(Class<?> cls, String name) throws NoSuchMethodException { NoSuchMethodException firstExc = null; for (Class<?> c = cls; c != null; c = c.getSuperclass()) { try { return c.getDeclaredMethod(name); } catch (NoSuchMethodException e) { if (firstExc == null) { firstExc = e; } } } throw firstExc; } }
public class class_name { static Method getMethod(Class<?> cls, String name) throws NoSuchMethodException { NoSuchMethodException firstExc = null; for (Class<?> c = cls; c != null; c = c.getSuperclass()) { try { return c.getDeclaredMethod(name); } catch (NoSuchMethodException e) { if (firstExc == null) { firstExc = e; // depends on control dependency: [if], data = [none] } } } throw firstExc; } }
public class class_name { public boolean isOpenInResults() { if (I_CmsGalleryProviderConstants.GalleryTabId.cms_tab_results.name().equals(m_searchObject.getTabId())) { return true; } return false; } }
public class class_name { public boolean isOpenInResults() { if (I_CmsGalleryProviderConstants.GalleryTabId.cms_tab_results.name().equals(m_searchObject.getTabId())) { return true; // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { void add(long reportingHsid, final Map<Long,Boolean> failed) { // skip if the reporting site did not belong to the pre // failure mesh if (!m_hsids.contains(reportingHsid)) return; // ship if the reporting site is reporting itself dead Boolean harakiri = failed.get(reportingHsid); if (harakiri != null && harakiri.booleanValue()) return; Set<Long> dead = Sets.newHashSet(); for (Map.Entry<Long, Boolean> e: failed.entrySet()) { // skip if the failed site did not belong to the // pre failure mesh if (!m_hsids.contains(e.getKey())) continue; m_reported.put(e.getKey(), reportingHsid); // if the failure is witnessed add it to the dead graph if (e.getValue()) { m_dead.put(e.getKey(), reportingHsid); dead.add(e.getKey()); } } // once you are witnessed dead you cannot become undead, // but it is not the case for alive nodes, as they can // die. So remove all what the reporting site thought // was alive before this invocation removeValue(m_alive, reportingHsid); for (Long alive: Sets.difference(m_hsids, dead)) { m_alive.put(alive, reportingHsid); } } }
public class class_name { void add(long reportingHsid, final Map<Long,Boolean> failed) { // skip if the reporting site did not belong to the pre // failure mesh if (!m_hsids.contains(reportingHsid)) return; // ship if the reporting site is reporting itself dead Boolean harakiri = failed.get(reportingHsid); if (harakiri != null && harakiri.booleanValue()) return; Set<Long> dead = Sets.newHashSet(); for (Map.Entry<Long, Boolean> e: failed.entrySet()) { // skip if the failed site did not belong to the // pre failure mesh if (!m_hsids.contains(e.getKey())) continue; m_reported.put(e.getKey(), reportingHsid); // depends on control dependency: [for], data = [e] // if the failure is witnessed add it to the dead graph if (e.getValue()) { m_dead.put(e.getKey(), reportingHsid); // depends on control dependency: [if], data = [none] dead.add(e.getKey()); // depends on control dependency: [if], data = [none] } } // once you are witnessed dead you cannot become undead, // but it is not the case for alive nodes, as they can // die. So remove all what the reporting site thought // was alive before this invocation removeValue(m_alive, reportingHsid); for (Long alive: Sets.difference(m_hsids, dead)) { m_alive.put(alive, reportingHsid); // depends on control dependency: [for], data = [alive] } } }
public class class_name { public Tuple<Identifier> parseOptionalLifetimeParameters(EnclosingScope scope) { if (tryAndMatch(true, LeftAngle) != null && tryAndMatch(true, RightAngle) == null) { // The if above skips an empty list of identifiers "<>"! return parseLifetimeParameters(scope); } return new Tuple<>(); } }
public class class_name { public Tuple<Identifier> parseOptionalLifetimeParameters(EnclosingScope scope) { if (tryAndMatch(true, LeftAngle) != null && tryAndMatch(true, RightAngle) == null) { // The if above skips an empty list of identifiers "<>"! return parseLifetimeParameters(scope); // depends on control dependency: [if], data = [none] } return new Tuple<>(); } }
public class class_name { private ImmutableSet<Element> safeInitByCalleeBefore( TreePath pathToRead, VisitorState state, TreePath enclosingBlockPath) { Set<Element> safeInitMethods = new LinkedHashSet<>(); Tree enclosingBlockOrMethod = enclosingBlockPath.getLeaf(); if (enclosingBlockOrMethod instanceof VariableTree) { return ImmutableSet.of(); } ImmutableSet.Builder<Element> resultBuilder = ImmutableSet.builder(); BlockTree blockTree = enclosingBlockOrMethod instanceof BlockTree ? (BlockTree) enclosingBlockOrMethod : ((MethodTree) enclosingBlockOrMethod).getBody(); List<? extends StatementTree> statements = blockTree.getStatements(); Tree readExprTree = pathToRead.getLeaf(); int readStartPos = getStartPos((JCTree) readExprTree); TreePath classTreePath = enclosingBlockPath; // look for the parent ClassTree node, which represents the enclosing class / enum / interface while (!(classTreePath.getLeaf() instanceof ClassTree)) { classTreePath = classTreePath.getParentPath(); if (classTreePath == null) { throw new IllegalStateException( "could not find enclosing class / enum / interface for " + state.getSourceForNode(enclosingBlockPath.getLeaf())); } } Symbol.ClassSymbol classSymbol = ASTHelpers.getSymbol((ClassTree) classTreePath.getLeaf()); for (int i = 0; i < statements.size(); i++) { StatementTree curStmt = statements.get(i); if (getStartPos((JCTree) curStmt) <= readStartPos) { Element privMethodElem = getInvokeOfSafeInitMethod(curStmt, classSymbol, state); if (privMethodElem != null) { safeInitMethods.add(privMethodElem); } // Hack: Handling try{...}finally{...} statement, see getSafeInitMethods if (curStmt.getKind().equals(Tree.Kind.TRY)) { TryTree tryTree = (TryTree) curStmt; // ToDo: Should we check initialization inside tryTree.getResources ? What is the scope of // that initialization? if (tryTree.getCatches().size() == 0) { if (tryTree.getBlock() != null) { resultBuilder.addAll( safeInitByCalleeBefore( pathToRead, state, new TreePath(enclosingBlockPath, tryTree.getBlock()))); } if (tryTree.getFinallyBlock() != null) { resultBuilder.addAll( safeInitByCalleeBefore( pathToRead, state, new TreePath(enclosingBlockPath, tryTree.getFinallyBlock()))); } } } } } addGuaranteedNonNullFromInvokes( state, getTreesInstance(state), safeInitMethods, getNullnessAnalysis(state), resultBuilder); return resultBuilder.build(); } }
public class class_name { private ImmutableSet<Element> safeInitByCalleeBefore( TreePath pathToRead, VisitorState state, TreePath enclosingBlockPath) { Set<Element> safeInitMethods = new LinkedHashSet<>(); Tree enclosingBlockOrMethod = enclosingBlockPath.getLeaf(); if (enclosingBlockOrMethod instanceof VariableTree) { return ImmutableSet.of(); // depends on control dependency: [if], data = [none] } ImmutableSet.Builder<Element> resultBuilder = ImmutableSet.builder(); BlockTree blockTree = enclosingBlockOrMethod instanceof BlockTree ? (BlockTree) enclosingBlockOrMethod : ((MethodTree) enclosingBlockOrMethod).getBody(); List<? extends StatementTree> statements = blockTree.getStatements(); Tree readExprTree = pathToRead.getLeaf(); int readStartPos = getStartPos((JCTree) readExprTree); TreePath classTreePath = enclosingBlockPath; // look for the parent ClassTree node, which represents the enclosing class / enum / interface while (!(classTreePath.getLeaf() instanceof ClassTree)) { classTreePath = classTreePath.getParentPath(); // depends on control dependency: [while], data = [none] if (classTreePath == null) { throw new IllegalStateException( "could not find enclosing class / enum / interface for " + state.getSourceForNode(enclosingBlockPath.getLeaf())); } } Symbol.ClassSymbol classSymbol = ASTHelpers.getSymbol((ClassTree) classTreePath.getLeaf()); for (int i = 0; i < statements.size(); i++) { StatementTree curStmt = statements.get(i); if (getStartPos((JCTree) curStmt) <= readStartPos) { Element privMethodElem = getInvokeOfSafeInitMethod(curStmt, classSymbol, state); if (privMethodElem != null) { safeInitMethods.add(privMethodElem); // depends on control dependency: [if], data = [(privMethodElem] } // Hack: Handling try{...}finally{...} statement, see getSafeInitMethods if (curStmt.getKind().equals(Tree.Kind.TRY)) { TryTree tryTree = (TryTree) curStmt; // ToDo: Should we check initialization inside tryTree.getResources ? What is the scope of // that initialization? if (tryTree.getCatches().size() == 0) { if (tryTree.getBlock() != null) { resultBuilder.addAll( safeInitByCalleeBefore( pathToRead, state, new TreePath(enclosingBlockPath, tryTree.getBlock()))); // depends on control dependency: [if], data = [none] } if (tryTree.getFinallyBlock() != null) { resultBuilder.addAll( safeInitByCalleeBefore( pathToRead, state, new TreePath(enclosingBlockPath, tryTree.getFinallyBlock()))); // depends on control dependency: [if], data = [none] } } } } } addGuaranteedNonNullFromInvokes( state, getTreesInstance(state), safeInitMethods, getNullnessAnalysis(state), resultBuilder); return resultBuilder.build(); } }
public class class_name { public void contextInitialized(ServletContextEvent servletContextEvent) { ServletContext servletContext = servletContextEvent.getServletContext(); File tempWriteDir = (File) servletContext .getAttribute("javax.servlet.context.tempdir"); servletContext.setAttribute("audioFilePath", FILE_PROTOCOL + tempWriteDir .getAbsolutePath() + File.separatorChar); for (int i = 0; i < AUDIO_FILES.length; i++) { String audioFile = AUDIO_FILES[i]; logger.info("Writing " + audioFile + " to webapp temp dir : " + tempWriteDir); InputStream is = servletContext.getResourceAsStream(AUDIO_DIR + "/" + audioFile); copyToTempDir(is, tempWriteDir, audioFile); } Enumeration<String> initParamNames = servletContext .getInitParameterNames(); logger.info("Setting init Params into application context"); while (initParamNames.hasMoreElements()) { String initParamName = (String) initParamNames.nextElement(); servletContext.setAttribute(initParamName, servletContext .getInitParameter(initParamName)); logger.info("Param key=" + initParamName + ", value = " + servletContext.getInitParameter(initParamName)); } // map acting as a registrar servletContext.setAttribute("registeredUsersMap", new HashMap<String, String>()); if(servletContextEvent.getServletContext().getAttribute(MS_CONTROL_FACTORY) == null) { DriverImpl d = new DriverImpl(); properties = new Properties(); properties.setProperty(MGCP_STACK_NAME, "SipServlets"); properties.setProperty(MGCP_PEER_IP, PEER_ADDRESS); properties.setProperty(MGCP_PEER_PORT, MGW_PORT); properties.setProperty(MGCP_STACK_IP, LOCAL_ADDRESS); properties.setProperty(MGCP_STACK_PORT, CA_PORT); try { // create the Media Session Factory final MsControlFactory msControlFactory = new DriverImpl().getFactory(properties); MsControlObjects.msControlFactory = msControlFactory; servletContextEvent.getServletContext().setAttribute(MS_CONTROL_FACTORY, msControlFactory); MMSUtil.msControlFactory = MsControlObjects.msControlFactory; String pathToAudioDirectory = (String)servletContextEvent.getServletContext().getAttribute("audioFilePath"); MMSUtil.audioFilePath = pathToAudioDirectory; logger.info("started MGCP Stack on " + LOCAL_ADDRESS + "and port " + CA_PORT + " obj: " + MsControlObjects.msControlFactory); } catch (Exception e) { logger.error("couldn't start the underlying MGCP Stack", e); } } else { logger.info("MGCP Stack already started on " + LOCAL_ADDRESS + "and port " + CA_PORT); } } }
public class class_name { public void contextInitialized(ServletContextEvent servletContextEvent) { ServletContext servletContext = servletContextEvent.getServletContext(); File tempWriteDir = (File) servletContext .getAttribute("javax.servlet.context.tempdir"); servletContext.setAttribute("audioFilePath", FILE_PROTOCOL + tempWriteDir .getAbsolutePath() + File.separatorChar); for (int i = 0; i < AUDIO_FILES.length; i++) { String audioFile = AUDIO_FILES[i]; logger.info("Writing " + audioFile + " to webapp temp dir : " + tempWriteDir); // depends on control dependency: [for], data = [none] InputStream is = servletContext.getResourceAsStream(AUDIO_DIR + "/" + audioFile); copyToTempDir(is, tempWriteDir, audioFile); // depends on control dependency: [for], data = [none] } Enumeration<String> initParamNames = servletContext .getInitParameterNames(); logger.info("Setting init Params into application context"); while (initParamNames.hasMoreElements()) { String initParamName = (String) initParamNames.nextElement(); servletContext.setAttribute(initParamName, servletContext .getInitParameter(initParamName)); // depends on control dependency: [while], data = [none] logger.info("Param key=" + initParamName + ", value = " + servletContext.getInitParameter(initParamName)); // depends on control dependency: [while], data = [none] } // map acting as a registrar servletContext.setAttribute("registeredUsersMap", new HashMap<String, String>()); if(servletContextEvent.getServletContext().getAttribute(MS_CONTROL_FACTORY) == null) { DriverImpl d = new DriverImpl(); properties = new Properties(); // depends on control dependency: [if], data = [none] properties.setProperty(MGCP_STACK_NAME, "SipServlets"); // depends on control dependency: [if], data = [none] properties.setProperty(MGCP_PEER_IP, PEER_ADDRESS); // depends on control dependency: [if], data = [none] properties.setProperty(MGCP_PEER_PORT, MGW_PORT); // depends on control dependency: [if], data = [none] properties.setProperty(MGCP_STACK_IP, LOCAL_ADDRESS); // depends on control dependency: [if], data = [none] properties.setProperty(MGCP_STACK_PORT, CA_PORT); // depends on control dependency: [if], data = [none] try { // create the Media Session Factory final MsControlFactory msControlFactory = new DriverImpl().getFactory(properties); MsControlObjects.msControlFactory = msControlFactory; // depends on control dependency: [try], data = [none] servletContextEvent.getServletContext().setAttribute(MS_CONTROL_FACTORY, msControlFactory); // depends on control dependency: [try], data = [none] MMSUtil.msControlFactory = MsControlObjects.msControlFactory; // depends on control dependency: [try], data = [none] String pathToAudioDirectory = (String)servletContextEvent.getServletContext().getAttribute("audioFilePath"); MMSUtil.audioFilePath = pathToAudioDirectory; // depends on control dependency: [try], data = [none] logger.info("started MGCP Stack on " + LOCAL_ADDRESS + "and port " + CA_PORT + " obj: " + MsControlObjects.msControlFactory); // depends on control dependency: [try], data = [none] } catch (Exception e) { logger.error("couldn't start the underlying MGCP Stack", e); } // depends on control dependency: [catch], data = [none] } else { logger.info("MGCP Stack already started on " + LOCAL_ADDRESS + "and port " + CA_PORT); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static String formatXY(List<Discrete.Pair> xy, String prefix, String innerSeparator, String suffix, String outerSeparator) { StringBuilder result = new StringBuilder(); Iterator<Pair> it = xy.iterator(); while (it.hasNext()) { Pair pair = it.next(); result.append(prefix).append(Op.str(pair.getX())) .append(innerSeparator).append(Op.str(pair.getY())) .append(suffix); if (it.hasNext()) { result.append(outerSeparator); } } return result.toString(); } }
public class class_name { public static String formatXY(List<Discrete.Pair> xy, String prefix, String innerSeparator, String suffix, String outerSeparator) { StringBuilder result = new StringBuilder(); Iterator<Pair> it = xy.iterator(); while (it.hasNext()) { Pair pair = it.next(); result.append(prefix).append(Op.str(pair.getX())) .append(innerSeparator).append(Op.str(pair.getY())) .append(suffix); // depends on control dependency: [while], data = [none] if (it.hasNext()) { result.append(outerSeparator); // depends on control dependency: [if], data = [none] } } return result.toString(); } }
public class class_name { @Override public void downgradeToPreviousVersion(OpenImmoDocument doc) { doc.setDocumentVersion(OpenImmoVersion.V1_2_2); if (doc instanceof OpenImmoTransferDocument) { try { this.removeEmailFeedbackElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't remove unsupported <email_feedback> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.removePreiseChildElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't remove unsupported children of <preise> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeFlaechenChildElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <flaechen> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.removeAusstattungChildElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't remove unsupported children of <ausstattung> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.removeZustandAngabenChildElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't remove unsupported children of <zustand_angaben> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.removeUserDefinedExtendElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't remove unsupported <user_defined_extend> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeParkenElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <parken> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeBadElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <bad> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeKuecheElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <kueche> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeBodenElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <boden> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeBefeuerungElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <befeuerung> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeAusrichtBalkonTerrasseElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <ausricht_balkon_terrasse> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeDachformElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <dachform> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeWohnungElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <wohnung> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeHausElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <haus> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeSonstigeElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <sonstige> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeZinshausRenditeobjektElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <zinshaus_renditeobjekt> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } } } }
public class class_name { @Override public void downgradeToPreviousVersion(OpenImmoDocument doc) { doc.setDocumentVersion(OpenImmoVersion.V1_2_2); if (doc instanceof OpenImmoTransferDocument) { try { this.removeEmailFeedbackElements(doc.getDocument()); // depends on control dependency: [try], data = [none] } catch (Exception ex) { LOGGER.error("Can't remove unsupported <email_feedback> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.removePreiseChildElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't remove unsupported children of <preise> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } // depends on control dependency: [catch], data = [none] try { this.downgradeFlaechenChildElements(doc.getDocument()); // depends on control dependency: [try], data = [none] } catch (Exception ex) { LOGGER.error("Can't downgrade <flaechen> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.removeAusstattungChildElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't remove unsupported children of <ausstattung> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } // depends on control dependency: [catch], data = [none] try { this.removeZustandAngabenChildElements(doc.getDocument()); // depends on control dependency: [try], data = [none] } catch (Exception ex) { LOGGER.error("Can't remove unsupported children of <zustand_angaben> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.removeUserDefinedExtendElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't remove unsupported <user_defined_extend> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } // depends on control dependency: [catch], data = [none] try { this.downgradeParkenElements(doc.getDocument()); // depends on control dependency: [try], data = [none] } catch (Exception ex) { LOGGER.error("Can't downgrade <parken> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeBadElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <bad> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } // depends on control dependency: [catch], data = [none] try { this.downgradeKuecheElements(doc.getDocument()); // depends on control dependency: [try], data = [none] } catch (Exception ex) { LOGGER.error("Can't downgrade <kueche> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeBodenElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <boden> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } // depends on control dependency: [catch], data = [none] try { this.downgradeBefeuerungElements(doc.getDocument()); // depends on control dependency: [try], data = [none] } catch (Exception ex) { LOGGER.error("Can't downgrade <befeuerung> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeAusrichtBalkonTerrasseElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <ausricht_balkon_terrasse> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } // depends on control dependency: [catch], data = [none] try { this.downgradeDachformElements(doc.getDocument()); // depends on control dependency: [try], data = [none] } catch (Exception ex) { LOGGER.error("Can't downgrade <dachform> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeWohnungElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <wohnung> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } // depends on control dependency: [catch], data = [none] try { this.downgradeHausElements(doc.getDocument()); // depends on control dependency: [try], data = [none] } catch (Exception ex) { LOGGER.error("Can't downgrade <haus> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeSonstigeElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <sonstige> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } // depends on control dependency: [catch], data = [none] try { this.downgradeZinshausRenditeobjektElements(doc.getDocument()); // depends on control dependency: [try], data = [none] } catch (Exception ex) { LOGGER.error("Can't downgrade <zinshaus_renditeobjekt> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { private JButton getHelpButton() { if (btnHelp == null) { btnHelp = new JButton(); btnHelp.setBorder(null); btnHelp.setIcon(new ImageIcon(AbstractParamContainerPanel.class.getResource("/resource/icon/16/201.png"))); // help icon btnHelp.addActionListener(getShowHelpAction()); btnHelp.setToolTipText(Constant.messages.getString("menu.help")); } return btnHelp; } }
public class class_name { private JButton getHelpButton() { if (btnHelp == null) { btnHelp = new JButton(); // depends on control dependency: [if], data = [none] btnHelp.setBorder(null); // depends on control dependency: [if], data = [null)] btnHelp.setIcon(new ImageIcon(AbstractParamContainerPanel.class.getResource("/resource/icon/16/201.png"))); // help icon // depends on control dependency: [if], data = [none] btnHelp.addActionListener(getShowHelpAction()); // depends on control dependency: [if], data = [none] btnHelp.setToolTipText(Constant.messages.getString("menu.help")); } return btnHelp; // depends on control dependency: [if], data = [none] } }
public class class_name { public void marshall(IpRouteInfo ipRouteInfo, ProtocolMarshaller protocolMarshaller) { if (ipRouteInfo == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(ipRouteInfo.getDirectoryId(), DIRECTORYID_BINDING); protocolMarshaller.marshall(ipRouteInfo.getCidrIp(), CIDRIP_BINDING); protocolMarshaller.marshall(ipRouteInfo.getIpRouteStatusMsg(), IPROUTESTATUSMSG_BINDING); protocolMarshaller.marshall(ipRouteInfo.getAddedDateTime(), ADDEDDATETIME_BINDING); protocolMarshaller.marshall(ipRouteInfo.getIpRouteStatusReason(), IPROUTESTATUSREASON_BINDING); protocolMarshaller.marshall(ipRouteInfo.getDescription(), DESCRIPTION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(IpRouteInfo ipRouteInfo, ProtocolMarshaller protocolMarshaller) { if (ipRouteInfo == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(ipRouteInfo.getDirectoryId(), DIRECTORYID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(ipRouteInfo.getCidrIp(), CIDRIP_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(ipRouteInfo.getIpRouteStatusMsg(), IPROUTESTATUSMSG_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(ipRouteInfo.getAddedDateTime(), ADDEDDATETIME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(ipRouteInfo.getIpRouteStatusReason(), IPROUTESTATUSREASON_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(ipRouteInfo.getDescription(), DESCRIPTION_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static cachepolicy_binding[] get(nitro_service service, String policyname[]) throws Exception{ if (policyname !=null && policyname.length>0) { cachepolicy_binding response[] = new cachepolicy_binding[policyname.length]; cachepolicy_binding obj[] = new cachepolicy_binding[policyname.length]; for (int i=0;i<policyname.length;i++) { obj[i] = new cachepolicy_binding(); obj[i].set_policyname(policyname[i]); response[i] = (cachepolicy_binding) obj[i].get_resource(service); } return response; } return null; } }
public class class_name { public static cachepolicy_binding[] get(nitro_service service, String policyname[]) throws Exception{ if (policyname !=null && policyname.length>0) { cachepolicy_binding response[] = new cachepolicy_binding[policyname.length]; cachepolicy_binding obj[] = new cachepolicy_binding[policyname.length]; for (int i=0;i<policyname.length;i++) { obj[i] = new cachepolicy_binding(); // depends on control dependency: [for], data = [i] obj[i].set_policyname(policyname[i]); // depends on control dependency: [for], data = [i] response[i] = (cachepolicy_binding) obj[i].get_resource(service); // depends on control dependency: [for], data = [i] } return response; } return null; } }
public class class_name { public static JComponent generateComponent(Image image) { if (image == null) { return new LabelUIResource("Image is null"); } return SwingUtils.generateComponent(new ImageIcon(image)); } }
public class class_name { public static JComponent generateComponent(Image image) { if (image == null) { return new LabelUIResource("Image is null"); // depends on control dependency: [if], data = [none] } return SwingUtils.generateComponent(new ImageIcon(image)); } }
public class class_name { public static <T, R, E extends Exception> Nullable<R> tryOrEmpty(final T init, final Try.Function<? super T, R, E> func) { try { return Nullable.of(func.apply(init)); } catch (Exception e) { return Nullable.<R> empty(); } } }
public class class_name { public static <T, R, E extends Exception> Nullable<R> tryOrEmpty(final T init, final Try.Function<? super T, R, E> func) { try { return Nullable.of(func.apply(init)); // depends on control dependency: [try], data = [none] } catch (Exception e) { return Nullable.<R> empty(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public EClass getFNO() { if (fnoEClass == null) { fnoEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(268); } return fnoEClass; } }
public class class_name { public EClass getFNO() { if (fnoEClass == null) { fnoEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(268); // depends on control dependency: [if], data = [none] } return fnoEClass; } }
public class class_name { public void setType(String typeName) { try { try { m_type = OpenCms.getResourceManager().getResourceType(typeName); } catch (CmsLoaderException e) { // TODO: what happens if the resource type is a specialized folder and is not configured?? int plainId; try { plainId = OpenCms.getResourceManager().getResourceType( CmsResourceTypePlain.getStaticTypeName()).getTypeId(); } catch (CmsLoaderException e1) { // this should really never happen plainId = CmsResourceTypePlain.getStaticTypeId(); } m_type = OpenCms.getResourceManager().getResourceType(plainId); } if (m_type.isFolder()) { // ensure folders end with a "/" if (!CmsResource.isFolder(m_destination)) { m_destination += "/"; } } } catch (Throwable e) { setThrowable(e); } } }
public class class_name { public void setType(String typeName) { try { try { m_type = OpenCms.getResourceManager().getResourceType(typeName); // depends on control dependency: [try], data = [none] } catch (CmsLoaderException e) { // TODO: what happens if the resource type is a specialized folder and is not configured?? int plainId; try { plainId = OpenCms.getResourceManager().getResourceType( CmsResourceTypePlain.getStaticTypeName()).getTypeId(); // depends on control dependency: [try], data = [none] } catch (CmsLoaderException e1) { // this should really never happen plainId = CmsResourceTypePlain.getStaticTypeId(); } // depends on control dependency: [catch], data = [none] m_type = OpenCms.getResourceManager().getResourceType(plainId); } // depends on control dependency: [catch], data = [none] if (m_type.isFolder()) { // ensure folders end with a "/" if (!CmsResource.isFolder(m_destination)) { m_destination += "/"; // depends on control dependency: [if], data = [none] } } } catch (Throwable e) { setThrowable(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public boolean addVariableAttribute(Variable v, Attribute att) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (!isValidObjectName(att.getShortName())) { String attName = createValidObjectName(att.getShortName()); log.warn("illegal netCDF-3 attribute name= " + att.getShortName() + " change to " + attName); att = new Attribute(attName, att.getValues()); } v.addAttribute(att); return true; } }
public class class_name { public boolean addVariableAttribute(Variable v, Attribute att) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); if (!isValidObjectName(att.getShortName())) { String attName = createValidObjectName(att.getShortName()); log.warn("illegal netCDF-3 attribute name= " + att.getShortName() + " change to " + attName); // depends on control dependency: [if], data = [none] att = new Attribute(attName, att.getValues()); // depends on control dependency: [if], data = [none] } v.addAttribute(att); return true; } }
public class class_name { final protected String getIdForTagId(String tagId) { HttpServletRequest req = (HttpServletRequest) getPageContext().getRequest(); ArrayList/*<String>*/ list = (ArrayList/*<String>*/) org.apache.beehive.netui.tags.RequestUtils.getOuterAttribute(req, ScriptContainer.SCOPE_ID); if (list == null) return tagId; InternalStringBuilder sb = new InternalStringBuilder(); for (int i=0;i<list.size();i++) { sb.append((String) list.get(i)); sb.append('.'); } sb.append(tagId); return sb.toString(); } }
public class class_name { final protected String getIdForTagId(String tagId) { HttpServletRequest req = (HttpServletRequest) getPageContext().getRequest(); ArrayList/*<String>*/ list = (ArrayList/*<String>*/) org.apache.beehive.netui.tags.RequestUtils.getOuterAttribute(req, ScriptContainer.SCOPE_ID); if (list == null) return tagId; InternalStringBuilder sb = new InternalStringBuilder(); for (int i=0;i<list.size();i++) { sb.append((String) list.get(i)); // depends on control dependency: [for], data = [i] sb.append('.'); // depends on control dependency: [for], data = [none] } sb.append(tagId); return sb.toString(); } }
public class class_name { private static Module getModuleFromStreamByID(ModfileInputStream input) { Iterator<Module> iter = getModulesArray().iterator(); while (iter.hasNext()) { Module mod = iter.next(); try { if (mod.checkLoadingPossible(input)) return mod; } catch (IOException ex) { /* Ignoring */ } } return null; } }
public class class_name { private static Module getModuleFromStreamByID(ModfileInputStream input) { Iterator<Module> iter = getModulesArray().iterator(); while (iter.hasNext()) { Module mod = iter.next(); try { if (mod.checkLoadingPossible(input)) return mod; } catch (IOException ex) { /* Ignoring */ } // depends on control dependency: [catch], data = [none] } return null; } }
public class class_name { public final OutHttpApp out() { OutHttpApp stream = _responseStream; if (stream == null) { stream = createOut(); _responseStream = stream; } return stream; } }
public class class_name { public final OutHttpApp out() { OutHttpApp stream = _responseStream; if (stream == null) { stream = createOut(); // depends on control dependency: [if], data = [none] _responseStream = stream; // depends on control dependency: [if], data = [none] } return stream; } }
public class class_name { public void shutdown() { if (!this.shutdownStarted.compareAndSet(false, true)) { return; } LOG.info("Shutting down TaskManager"); // first, stop the heartbeat thread and wait for it to terminate this.heartbeatThread.interrupt(); try { this.heartbeatThread.join(1000); } catch (InterruptedException e) {} // Stop RPC proxy for the task manager RPC.stopProxy(this.jobManager); // Stop RPC proxy for the global input split assigner RPC.stopProxy(this.globalInputSplitProvider); // Stop RPC proxy for the lookup service RPC.stopProxy(this.lookupService); // Stop RPC proxy for accumulator reports RPC.stopProxy(this.accumulatorProtocolProxy); // Shut down the own RPC server this.taskManagerServer.stop(); // Stop profiling if enabled if (this.profiler != null) { this.profiler.shutdown(); } // Shut down the network channel manager this.channelManager.shutdown(); // Shut down the memory manager if (this.ioManager != null) { this.ioManager.shutdown(); } if (this.memoryManager != null) { this.memoryManager.shutdown(); } this.fileCache.shutdown(); // Shut down the executor service if (this.executorService != null) { this.executorService.shutdown(); try { this.executorService.awaitTermination(5000L, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { if (LOG.isDebugEnabled()) { LOG.debug(e); } } } this.shutdownComplete = true; } }
public class class_name { public void shutdown() { if (!this.shutdownStarted.compareAndSet(false, true)) { return; // depends on control dependency: [if], data = [none] } LOG.info("Shutting down TaskManager"); // first, stop the heartbeat thread and wait for it to terminate this.heartbeatThread.interrupt(); try { this.heartbeatThread.join(1000); // depends on control dependency: [try], data = [none] } catch (InterruptedException e) {} // depends on control dependency: [catch], data = [none] // Stop RPC proxy for the task manager RPC.stopProxy(this.jobManager); // Stop RPC proxy for the global input split assigner RPC.stopProxy(this.globalInputSplitProvider); // Stop RPC proxy for the lookup service RPC.stopProxy(this.lookupService); // Stop RPC proxy for accumulator reports RPC.stopProxy(this.accumulatorProtocolProxy); // Shut down the own RPC server this.taskManagerServer.stop(); // Stop profiling if enabled if (this.profiler != null) { this.profiler.shutdown(); // depends on control dependency: [if], data = [none] } // Shut down the network channel manager this.channelManager.shutdown(); // Shut down the memory manager if (this.ioManager != null) { this.ioManager.shutdown(); // depends on control dependency: [if], data = [none] } if (this.memoryManager != null) { this.memoryManager.shutdown(); // depends on control dependency: [if], data = [none] } this.fileCache.shutdown(); // Shut down the executor service if (this.executorService != null) { this.executorService.shutdown(); // depends on control dependency: [if], data = [none] try { this.executorService.awaitTermination(5000L, TimeUnit.MILLISECONDS); // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { if (LOG.isDebugEnabled()) { LOG.debug(e); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] } this.shutdownComplete = true; } }
public class class_name { public GetRelationalDatabaseSnapshotsResult withRelationalDatabaseSnapshots(RelationalDatabaseSnapshot... relationalDatabaseSnapshots) { if (this.relationalDatabaseSnapshots == null) { setRelationalDatabaseSnapshots(new java.util.ArrayList<RelationalDatabaseSnapshot>(relationalDatabaseSnapshots.length)); } for (RelationalDatabaseSnapshot ele : relationalDatabaseSnapshots) { this.relationalDatabaseSnapshots.add(ele); } return this; } }
public class class_name { public GetRelationalDatabaseSnapshotsResult withRelationalDatabaseSnapshots(RelationalDatabaseSnapshot... relationalDatabaseSnapshots) { if (this.relationalDatabaseSnapshots == null) { setRelationalDatabaseSnapshots(new java.util.ArrayList<RelationalDatabaseSnapshot>(relationalDatabaseSnapshots.length)); // depends on control dependency: [if], data = [none] } for (RelationalDatabaseSnapshot ele : relationalDatabaseSnapshots) { this.relationalDatabaseSnapshots.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public void setToInverseL( double a[] ) { // TODO reorder these operations to avoid cache misses // inverts the lower triangular system and saves the result // in the upper triangle to minimize cache misses for( int i =0; i < n; i++ ) { double el_ii = t[i*n+i]; for( int j = 0; j <= i; j++ ) { double sum = (i==j) ? 1.0 : 0; for( int k=i-1; k >=j; k-- ) { sum -= t[i*n+k]*a[j*n+k]; } a[j*n+i] = sum / el_ii; } } // solve the system and handle the previous solution being in the upper triangle // takes advantage of symmetry for( int i=n-1; i>=0; i-- ) { double el_ii = t[i*n+i]; for( int j = 0; j <= i; j++ ) { double sum = (i<j) ? 0 : a[j*n+i]; for( int k=i+1;k<n;k++) { sum -= t[k*n+i]*a[j*n+k]; } a[i*n+j] = a[j*n+i] = sum / el_ii; } } } }
public class class_name { public void setToInverseL( double a[] ) { // TODO reorder these operations to avoid cache misses // inverts the lower triangular system and saves the result // in the upper triangle to minimize cache misses for( int i =0; i < n; i++ ) { double el_ii = t[i*n+i]; for( int j = 0; j <= i; j++ ) { double sum = (i==j) ? 1.0 : 0; for( int k=i-1; k >=j; k-- ) { sum -= t[i*n+k]*a[j*n+k]; // depends on control dependency: [for], data = [k] } a[j*n+i] = sum / el_ii; // depends on control dependency: [for], data = [j] } } // solve the system and handle the previous solution being in the upper triangle // takes advantage of symmetry for( int i=n-1; i>=0; i-- ) { double el_ii = t[i*n+i]; for( int j = 0; j <= i; j++ ) { double sum = (i<j) ? 0 : a[j*n+i]; for( int k=i+1;k<n;k++) { sum -= t[k*n+i]*a[j*n+k]; // depends on control dependency: [for], data = [k] } a[i*n+j] = a[j*n+i] = sum / el_ii; // depends on control dependency: [for], data = [j] } } } }
public class class_name { @Override public ActionInputParameter getActionInputParameter(String name) { ActionInputParameter ret = requestParams.get(name); if (ret == null) { ret = pathVariables.get(name); } if (ret == null) { for (ActionInputParameter annotatedParameter : getInputParameters()) { // TODO create ActionInputParameter for bean property at property path // TODO field access in addition to bean? PropertyDescriptor pd = getPropertyDescriptorForPropertyPath(name, annotatedParameter.getParameterType()); if (pd != null) { if (pd.getWriteMethod() != null) { Object callValue = annotatedParameter.getValue(); Object propertyValue = null; if (callValue != null) { BeanWrapper beanWrapper = PropertyAccessorFactory .forBeanPropertyAccess(callValue); propertyValue = beanWrapper.getPropertyValue(name); } ret = new SpringActionInputParameter(new MethodParameter(pd .getWriteMethod(), 0), propertyValue); } break; } } } return ret; } }
public class class_name { @Override public ActionInputParameter getActionInputParameter(String name) { ActionInputParameter ret = requestParams.get(name); if (ret == null) { ret = pathVariables.get(name); // depends on control dependency: [if], data = [none] } if (ret == null) { for (ActionInputParameter annotatedParameter : getInputParameters()) { // TODO create ActionInputParameter for bean property at property path // TODO field access in addition to bean? PropertyDescriptor pd = getPropertyDescriptorForPropertyPath(name, annotatedParameter.getParameterType()); if (pd != null) { if (pd.getWriteMethod() != null) { Object callValue = annotatedParameter.getValue(); Object propertyValue = null; if (callValue != null) { BeanWrapper beanWrapper = PropertyAccessorFactory .forBeanPropertyAccess(callValue); propertyValue = beanWrapper.getPropertyValue(name); // depends on control dependency: [if], data = [none] } ret = new SpringActionInputParameter(new MethodParameter(pd .getWriteMethod(), 0), propertyValue); // depends on control dependency: [if], data = [none] } break; } } } return ret; } }
public class class_name { public void save(File file) { try { ImageIO.write(image, "png", file); } catch (IOException e) { e.printStackTrace(); } } }
public class class_name { public void save(File file) { try { ImageIO.write(image, "png", file); // depends on control dependency: [try], data = [none] } catch (IOException e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public boolean updatePolicy(String name, String newDocument) throws PolicyIndexException { writeLock.lock(); try { logger.debug("Updating policy named: " + name); if (doDelete(name)) { doAdd(name, newDocument); return true; } else { // delete failed return false; } } finally { writeLock.unlock(); } } }
public class class_name { @Override public boolean updatePolicy(String name, String newDocument) throws PolicyIndexException { writeLock.lock(); try { logger.debug("Updating policy named: " + name); if (doDelete(name)) { doAdd(name, newDocument); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } else { // delete failed return false; // depends on control dependency: [if], data = [none] } } finally { writeLock.unlock(); } } }
public class class_name { public int calculateNodePathDistance(String nodePath1, String nodePath2) { String[] nodePathFragment1 = nodePath1.split("\\."); String[] nodePathFragment2 = nodePath2.split("\\."); int overlapBlock = 0; while (overlapBlock < nodePathFragment1.length && overlapBlock < nodePathFragment2.length && nodePathFragment1[overlapBlock].equals(nodePathFragment2[overlapBlock])) { overlapBlock++; } return nodePathFragment1.length + nodePathFragment2.length - overlapBlock * 2; } }
public class class_name { public int calculateNodePathDistance(String nodePath1, String nodePath2) { String[] nodePathFragment1 = nodePath1.split("\\."); String[] nodePathFragment2 = nodePath2.split("\\."); int overlapBlock = 0; while (overlapBlock < nodePathFragment1.length && overlapBlock < nodePathFragment2.length && nodePathFragment1[overlapBlock].equals(nodePathFragment2[overlapBlock])) { overlapBlock++; // depends on control dependency: [while], data = [none] } return nodePathFragment1.length + nodePathFragment2.length - overlapBlock * 2; } }
public class class_name { private short expectedExponent() { // since the log of 0, or the log base 0 of something, causes an // error, declare the exponent in these cases to be 0 (we also // deal with the special-rule identifiers here) if (radix == 0 || baseValue < 1) { return 0; } // we get rounding error in some cases-- for example, log 1000 / log 10 // gives us 1.9999999996 instead of 2. The extra logic here is to take // that into account short tempResult = (short)(Math.log(baseValue) / Math.log(radix)); if (power(radix, (short)(tempResult + 1)) <= baseValue) { return (short)(tempResult + 1); } else { return tempResult; } } }
public class class_name { private short expectedExponent() { // since the log of 0, or the log base 0 of something, causes an // error, declare the exponent in these cases to be 0 (we also // deal with the special-rule identifiers here) if (radix == 0 || baseValue < 1) { return 0; // depends on control dependency: [if], data = [none] } // we get rounding error in some cases-- for example, log 1000 / log 10 // gives us 1.9999999996 instead of 2. The extra logic here is to take // that into account short tempResult = (short)(Math.log(baseValue) / Math.log(radix)); if (power(radix, (short)(tempResult + 1)) <= baseValue) { return (short)(tempResult + 1); // depends on control dependency: [if], data = [none] } else { return tempResult; // depends on control dependency: [if], data = [none] } } }
public class class_name { private boolean isRtl(CharSequence text) { if (textDir == null) { textDir = getTextDirectionHeuristic(); } return textDir.isRtl(text, 0, text.length()); } }
public class class_name { private boolean isRtl(CharSequence text) { if (textDir == null) { textDir = getTextDirectionHeuristic(); // depends on control dependency: [if], data = [none] } return textDir.isRtl(text, 0, text.length()); } }
public class class_name { public WeightedItem<T> addOrVote(T item) { for (int i = 0; i < list.size(); i++) { WeightedItem<T> weightedItem = list.get(i); if (weightedItem.item.equals(item)) { voteFor(weightedItem); return weightedItem; } } return organizeAndAdd(item); } }
public class class_name { public WeightedItem<T> addOrVote(T item) { for (int i = 0; i < list.size(); i++) { WeightedItem<T> weightedItem = list.get(i); if (weightedItem.item.equals(item)) { voteFor(weightedItem); // depends on control dependency: [if], data = [none] return weightedItem; // depends on control dependency: [if], data = [none] } } return organizeAndAdd(item); } }
public class class_name { public void doDynamic(StaplerRequest request, StaplerResponse response) throws ServletException, IOException { if (("/" + originalFileName).equals(request.getRestOfPath())) { AbstractBuild build = (AbstractBuild)request.findAncestor(AbstractBuild.class).getObject(); File fileParameter = getLocationUnderBuild(build); if (!ALLOW_FOLDER_TRAVERSAL_OUTSIDE_WORKSPACE) { File fileParameterFolder = getFileParameterFolderUnderBuild(build); //TODO can be replaced by Util#isDescendant in 2.80+ Path child = fileParameter.getAbsoluteFile().toPath().normalize(); Path parent = fileParameterFolder.getAbsoluteFile().toPath().normalize(); if (!child.startsWith(parent)) { throw new IllegalStateException("The fileParameter tried to escape the expected folder: " + location); } } if (fileParameter.isFile()) { try (InputStream data = Files.newInputStream(fileParameter.toPath())) { long lastModified = fileParameter.lastModified(); long contentLength = fileParameter.length(); if (request.hasParameter("view")) { response.serveFile(request, data, lastModified, contentLength, "plain.txt"); } else { response.serveFile(request, data, lastModified, contentLength, originalFileName); } } catch (InvalidPathException e) { throw new IOException(e); } } } } }
public class class_name { public void doDynamic(StaplerRequest request, StaplerResponse response) throws ServletException, IOException { if (("/" + originalFileName).equals(request.getRestOfPath())) { AbstractBuild build = (AbstractBuild)request.findAncestor(AbstractBuild.class).getObject(); File fileParameter = getLocationUnderBuild(build); if (!ALLOW_FOLDER_TRAVERSAL_OUTSIDE_WORKSPACE) { File fileParameterFolder = getFileParameterFolderUnderBuild(build); //TODO can be replaced by Util#isDescendant in 2.80+ Path child = fileParameter.getAbsoluteFile().toPath().normalize(); Path parent = fileParameterFolder.getAbsoluteFile().toPath().normalize(); if (!child.startsWith(parent)) { throw new IllegalStateException("The fileParameter tried to escape the expected folder: " + location); } } if (fileParameter.isFile()) { try (InputStream data = Files.newInputStream(fileParameter.toPath())) { long lastModified = fileParameter.lastModified(); long contentLength = fileParameter.length(); if (request.hasParameter("view")) { response.serveFile(request, data, lastModified, contentLength, "plain.txt"); // depends on control dependency: [if], data = [none] } else { response.serveFile(request, data, lastModified, contentLength, originalFileName); // depends on control dependency: [if], data = [none] } } catch (InvalidPathException e) { throw new IOException(e); } } } } }
public class class_name { public boolean deleteObject (ObjectInfo info) { int oidx = -1; for (int ii = 0; ii < _objects.length; ii++) { if (_objects[ii].info.equals(info)) { oidx = ii; break; } } if (oidx == -1) { return false; } _objects = ArrayUtil.splice(_objects, oidx, 1); // clear out our neighbors array so that the subsequent update // causes us to recompute our coverage Arrays.fill(_neighbors, null); return true; } }
public class class_name { public boolean deleteObject (ObjectInfo info) { int oidx = -1; for (int ii = 0; ii < _objects.length; ii++) { if (_objects[ii].info.equals(info)) { oidx = ii; // depends on control dependency: [if], data = [none] break; } } if (oidx == -1) { return false; // depends on control dependency: [if], data = [none] } _objects = ArrayUtil.splice(_objects, oidx, 1); // clear out our neighbors array so that the subsequent update // causes us to recompute our coverage Arrays.fill(_neighbors, null); return true; } }
public class class_name { @Override public boolean sqlMapSelectByExampleSelectiveElementGenerated(Document document, XmlElement element, IntrospectedTable introspectedTable) { for (ISelectSelectivePluginHook plugin : this.getPlugins(ISelectSelectivePluginHook.class)) { if (!plugin.sqlMapSelectByExampleSelectiveElementGenerated(document, element, introspectedTable)) { return false; } } return true; } }
public class class_name { @Override public boolean sqlMapSelectByExampleSelectiveElementGenerated(Document document, XmlElement element, IntrospectedTable introspectedTable) { for (ISelectSelectivePluginHook plugin : this.getPlugins(ISelectSelectivePluginHook.class)) { if (!plugin.sqlMapSelectByExampleSelectiveElementGenerated(document, element, introspectedTable)) { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { protected void prepareConnection(HttpURLConnection con, int contentLength) throws IOException { super.prepareConnection(con, contentLength); Authentication auth = getAuthenticationToken(); if ((auth != null) && (auth.getName() != null) && (auth.getCredentials() != null)) { String base64 = auth.getName() + ":" + auth.getCredentials().toString(); con.setRequestProperty("Authorization", "Basic " + new String(Base64.encodeBase64(base64.getBytes()))); if (logger.isDebugEnabled()) { logger.debug("HttpInvocation now presenting via BASIC authentication with token:: " + auth); } } else { if (logger.isDebugEnabled()) { logger.debug("Unable to set BASIC authentication header as Authentication token is invalid: " + auth); } } doPrepareConnection(con, contentLength); } }
public class class_name { protected void prepareConnection(HttpURLConnection con, int contentLength) throws IOException { super.prepareConnection(con, contentLength); Authentication auth = getAuthenticationToken(); if ((auth != null) && (auth.getName() != null) && (auth.getCredentials() != null)) { String base64 = auth.getName() + ":" + auth.getCredentials().toString(); con.setRequestProperty("Authorization", "Basic " + new String(Base64.encodeBase64(base64.getBytes()))); if (logger.isDebugEnabled()) { logger.debug("HttpInvocation now presenting via BASIC authentication with token:: " + auth); // depends on control dependency: [if], data = [none] } } else { if (logger.isDebugEnabled()) { logger.debug("Unable to set BASIC authentication header as Authentication token is invalid: " + auth); // depends on control dependency: [if], data = [none] } } doPrepareConnection(con, contentLength); } }
public class class_name { public void parseStartEvents(Element parentElement, ScopeImpl scope) { List<Element> startEventElements = parentElement.elements("startEvent"); List<ActivityImpl> startEventActivities = new ArrayList<ActivityImpl>(); for (Element startEventElement : startEventElements) { ActivityImpl startEventActivity = createActivityOnScope(startEventElement, scope); parseAsynchronousContinuationForActivity(startEventElement, startEventActivity); if (scope instanceof ProcessDefinitionEntity) { parseProcessDefinitionStartEvent(startEventActivity, startEventElement, parentElement, scope); startEventActivities.add(startEventActivity); } else { parseScopeStartEvent(startEventActivity, startEventElement, parentElement, (ActivityImpl) scope); } ensureNoIoMappingDefined(startEventElement); parseExecutionListenersOnScope(startEventElement, startEventActivity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseStartEvent(startEventElement, scope, startEventActivity); } } if (scope instanceof ProcessDefinitionEntity) { selectInitial(startEventActivities, (ProcessDefinitionEntity) scope, parentElement); parseStartFormHandlers(startEventElements, (ProcessDefinitionEntity) scope); } } }
public class class_name { public void parseStartEvents(Element parentElement, ScopeImpl scope) { List<Element> startEventElements = parentElement.elements("startEvent"); List<ActivityImpl> startEventActivities = new ArrayList<ActivityImpl>(); for (Element startEventElement : startEventElements) { ActivityImpl startEventActivity = createActivityOnScope(startEventElement, scope); parseAsynchronousContinuationForActivity(startEventElement, startEventActivity); // depends on control dependency: [for], data = [startEventElement] if (scope instanceof ProcessDefinitionEntity) { parseProcessDefinitionStartEvent(startEventActivity, startEventElement, parentElement, scope); // depends on control dependency: [if], data = [none] startEventActivities.add(startEventActivity); // depends on control dependency: [if], data = [none] } else { parseScopeStartEvent(startEventActivity, startEventElement, parentElement, (ActivityImpl) scope); // depends on control dependency: [if], data = [none] } ensureNoIoMappingDefined(startEventElement); // depends on control dependency: [for], data = [startEventElement] parseExecutionListenersOnScope(startEventElement, startEventActivity); // depends on control dependency: [for], data = [startEventElement] for (BpmnParseListener parseListener : parseListeners) { parseListener.parseStartEvent(startEventElement, scope, startEventActivity); // depends on control dependency: [for], data = [parseListener] } } if (scope instanceof ProcessDefinitionEntity) { selectInitial(startEventActivities, (ProcessDefinitionEntity) scope, parentElement); // depends on control dependency: [if], data = [none] parseStartFormHandlers(startEventElements, (ProcessDefinitionEntity) scope); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static int encodeSlof( double[] data, int dataSize, byte[] result, double fixedPoint ) { int x; int ri = 8; encodeFixedPoint(fixedPoint, result); for (int i = 0; i < dataSize; i++) { x = (int) (Math.log(data[i] + 1) * fixedPoint + 0.5); result[ri++] = (byte) (0xff & x); result[ri++] = (byte) (x >> 8); } return ri; } }
public class class_name { public static int encodeSlof( double[] data, int dataSize, byte[] result, double fixedPoint ) { int x; int ri = 8; encodeFixedPoint(fixedPoint, result); for (int i = 0; i < dataSize; i++) { x = (int) (Math.log(data[i] + 1) * fixedPoint + 0.5); // depends on control dependency: [for], data = [i] result[ri++] = (byte) (0xff & x); // depends on control dependency: [for], data = [none] result[ri++] = (byte) (x >> 8); // depends on control dependency: [for], data = [none] } return ri; } }