code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { protected boolean isBrokenPreviousState(IParseResult previousParseResult, int offset) { if (previousParseResult.hasSyntaxErrors()) { BidiTreeIterator<AbstractNode> iterator = ((AbstractNode) previousParseResult.getRootNode()).basicIterator(); while(iterator.hasPrevious()) { AbstractNode previous = iterator.previous(); if (previous.getGrammarElement() == null) { return true; } if (previous instanceof ILeafNode && previous.getOffset() <= offset) { break; } } } return false; } }
public class class_name { protected boolean isBrokenPreviousState(IParseResult previousParseResult, int offset) { if (previousParseResult.hasSyntaxErrors()) { BidiTreeIterator<AbstractNode> iterator = ((AbstractNode) previousParseResult.getRootNode()).basicIterator(); while(iterator.hasPrevious()) { AbstractNode previous = iterator.previous(); if (previous.getGrammarElement() == null) { return true; // depends on control dependency: [if], data = [none] } if (previous instanceof ILeafNode && previous.getOffset() <= offset) { break; } } } return false; } }
public class class_name { static Field getDeclaredField(final Class<?> c, final String name) throws NoSuchFieldException { if (System.getSecurityManager() == null) return c.getDeclaredField(name); Field result = AccessController.doPrivileged(new PrivilegedAction<Field>() { public Field run() { try { return c.getDeclaredField(name); } catch (NoSuchFieldException e) { return null; } } }); if (result != null) return result; throw new NoSuchFieldException(); } }
public class class_name { static Field getDeclaredField(final Class<?> c, final String name) throws NoSuchFieldException { if (System.getSecurityManager() == null) return c.getDeclaredField(name); Field result = AccessController.doPrivileged(new PrivilegedAction<Field>() { public Field run() { try { return c.getDeclaredField(name); // depends on control dependency: [try], data = [none] } catch (NoSuchFieldException e) { return null; } // depends on control dependency: [catch], data = [none] } }); if (result != null) return result; throw new NoSuchFieldException(); } }
public class class_name { @Override public EClass getIfcPermeableCoveringProperties() { if (ifcPermeableCoveringPropertiesEClass == null) { ifcPermeableCoveringPropertiesEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(410); } return ifcPermeableCoveringPropertiesEClass; } }
public class class_name { @Override public EClass getIfcPermeableCoveringProperties() { if (ifcPermeableCoveringPropertiesEClass == null) { ifcPermeableCoveringPropertiesEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(410); // depends on control dependency: [if], data = [none] } return ifcPermeableCoveringPropertiesEClass; } }
public class class_name { @SuppressWarnings("unchecked") private Set<Class<? extends C>> findScriptClass(Set<Class<?>> clazzs) throws InstantiationException, IllegalAccessException { Set<Class<? extends C>> scriptClazzs = new HashSet<Class<? extends C>>(); for (Class<?> clazz : clazzs) { if (parentClass.isAssignableFrom(clazz)) { Class<C> scriptClazz = (Class<C>) clazz; scriptClazzs.add(scriptClazz); } } return scriptClazzs; } }
public class class_name { @SuppressWarnings("unchecked") private Set<Class<? extends C>> findScriptClass(Set<Class<?>> clazzs) throws InstantiationException, IllegalAccessException { Set<Class<? extends C>> scriptClazzs = new HashSet<Class<? extends C>>(); for (Class<?> clazz : clazzs) { if (parentClass.isAssignableFrom(clazz)) { Class<C> scriptClazz = (Class<C>) clazz; // depends on control dependency: [if], data = [none] scriptClazzs.add(scriptClazz); // depends on control dependency: [if], data = [none] } } return scriptClazzs; } }
public class class_name { public void scrollTo(double offset) { this.offset = offset; ScrollOption option = new ScrollOption(); JQueryElement target = getContainerElement(); if (containerElement != getDefaultContainer()) { offset = target.scrollTop() - target.offset().top + offset; } else { target = $("html, body"); } option.scrollTop = offset; target.animate(option, duration, easing, () -> { if (completeCallback != null) { completeCallback.call(); } }); } }
public class class_name { public void scrollTo(double offset) { this.offset = offset; ScrollOption option = new ScrollOption(); JQueryElement target = getContainerElement(); if (containerElement != getDefaultContainer()) { offset = target.scrollTop() - target.offset().top + offset; // depends on control dependency: [if], data = [none] } else { target = $("html, body"); // depends on control dependency: [if], data = [none] } option.scrollTop = offset; target.animate(option, duration, easing, () -> { if (completeCallback != null) { completeCallback.call(); } }); } }
public class class_name { private static void encodeOtherProperties(ByteArrayOutputStream baos, Map<String,Object> destProps) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "encodeOtherProperties", new Object[]{baos, destProps}); // Deal with each remaining property in turn. Iterator<Map.Entry<String, Object>> remainingProps = destProps.entrySet().iterator(); while (remainingProps.hasNext()) { // Get the name and value of the property. Map.Entry<String, Object> nextProp = remainingProps.next(); String propName = nextProp.getKey(); Object propValue = nextProp.getValue(); // If the property value is null, or it is the default, we don't encode it. if ( (propValue != null) && (!propValue.equals(getDefaultPropertyValue(propName))) ) { // Get the property's coder to encode it.... PropertyEntry propEntry = propertyMap.get(propName); if (propEntry != null) { propEntry.getPropertyCoder().encodeProperty(baos, propValue); } else { // If we have found a property we don't expect, something has gone horribly wrong throw (JMSException)JmsErrorUtils.newThrowable(JMSException.class ,"UNKNOWN_PROPERTY_CWSIA0363" ,new Object[] {propName} ,null ,"MsgDestEncodingUtilsImpl.encodeOtherProperties#1" ,null ,tc); } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "encodeOtherProperties"); } }
public class class_name { private static void encodeOtherProperties(ByteArrayOutputStream baos, Map<String,Object> destProps) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "encodeOtherProperties", new Object[]{baos, destProps}); // Deal with each remaining property in turn. Iterator<Map.Entry<String, Object>> remainingProps = destProps.entrySet().iterator(); while (remainingProps.hasNext()) { // Get the name and value of the property. Map.Entry<String, Object> nextProp = remainingProps.next(); String propName = nextProp.getKey(); Object propValue = nextProp.getValue(); // If the property value is null, or it is the default, we don't encode it. if ( (propValue != null) && (!propValue.equals(getDefaultPropertyValue(propName))) ) { // Get the property's coder to encode it.... PropertyEntry propEntry = propertyMap.get(propName); if (propEntry != null) { propEntry.getPropertyCoder().encodeProperty(baos, propValue); // depends on control dependency: [if], data = [none] } else { // If we have found a property we don't expect, something has gone horribly wrong throw (JMSException)JmsErrorUtils.newThrowable(JMSException.class ,"UNKNOWN_PROPERTY_CWSIA0363" ,new Object[] {propName} ,null ,"MsgDestEncodingUtilsImpl.encodeOtherProperties#1" ,null ,tc); } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "encodeOtherProperties"); } }
public class class_name { public void marshall(AwsS3BucketDetails awsS3BucketDetails, ProtocolMarshaller protocolMarshaller) { if (awsS3BucketDetails == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(awsS3BucketDetails.getOwnerId(), OWNERID_BINDING); protocolMarshaller.marshall(awsS3BucketDetails.getOwnerName(), OWNERNAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(AwsS3BucketDetails awsS3BucketDetails, ProtocolMarshaller protocolMarshaller) { if (awsS3BucketDetails == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(awsS3BucketDetails.getOwnerId(), OWNERID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(awsS3BucketDetails.getOwnerName(), OWNERNAME_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 String getWebServiceEndpointProxyClassName() { StringBuilder result = new StringBuilder(); // Use the package of the EJB implementation. String packageName = packageName(ivBeanClass); if (packageName != null) { result.append(packageName); result.append('.'); } result.append(endpointPrefix); // WSEJBProxy result.append(ivBeanType); // SL/SF/BMP/CMP, etc. result.append(ivBeanName); // First 32 characters result.append('_'); result.append(ivHashSuffix); // 8 digit hashcode return result.toString(); } }
public class class_name { public String getWebServiceEndpointProxyClassName() { StringBuilder result = new StringBuilder(); // Use the package of the EJB implementation. String packageName = packageName(ivBeanClass); if (packageName != null) { result.append(packageName); // depends on control dependency: [if], data = [(packageName] result.append('.'); // depends on control dependency: [if], data = [none] } result.append(endpointPrefix); // WSEJBProxy result.append(ivBeanType); // SL/SF/BMP/CMP, etc. result.append(ivBeanName); // First 32 characters result.append('_'); result.append(ivHashSuffix); // 8 digit hashcode return result.toString(); } }
public class class_name { @Api public void setGeometry(List<Geometry> geometries) { if (geometries.size() == 0) { Notify.info(messages.geometricSearchWidgetSelectionSearchNothingSelected()); } else { Integer buffer = (Integer) spiBuffer.getValue(); if (buffer != 0) { SearchCommService.mergeAndBufferGeometries(geometries, buffer, new DataCallback<Geometry[]>() { public void execute(Geometry[] result) { updateGeometry(geometry, result[1]); geometry = result[1]; } }); } else { SearchCommService.mergeGeometries(geometries, new DataCallback<Geometry>() { public void execute(Geometry result) { updateGeometry(geometry, result); geometry = result; } }); } } } }
public class class_name { @Api public void setGeometry(List<Geometry> geometries) { if (geometries.size() == 0) { Notify.info(messages.geometricSearchWidgetSelectionSearchNothingSelected()); // depends on control dependency: [if], data = [none] } else { Integer buffer = (Integer) spiBuffer.getValue(); if (buffer != 0) { SearchCommService.mergeAndBufferGeometries(geometries, buffer, new DataCallback<Geometry[]>() { public void execute(Geometry[] result) { updateGeometry(geometry, result[1]); geometry = result[1]; } }); // depends on control dependency: [if], data = [none] } else { SearchCommService.mergeGeometries(geometries, new DataCallback<Geometry>() { public void execute(Geometry result) { updateGeometry(geometry, result); geometry = result; } }); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public static <T> Iterator<T> drop(Iterator<T> self, int num) { while (num-- > 0 && self.hasNext()) { self.next(); } return self; } }
public class class_name { public static <T> Iterator<T> drop(Iterator<T> self, int num) { while (num-- > 0 && self.hasNext()) { self.next(); // depends on control dependency: [while], data = [none] } return self; } }
public class class_name { public static String getArea(String idCard) { // 用户所属省份 String province; // 用户所属地区 String area; String pre = idCard.substring(0, 6); if (AREA.get(pre) == null) { logger.warn("地区不存在或者地区已不在最新行政区划代码中"); } // 判断是否输入台湾省和特别行政区 if (Tools.contains(pre, HK)) { // 台湾省和特别行政区 area = AREA.get(pre + "0000"); } else { // 查询用户所属省份 province = AREA.get(idCard.substring(0, 2) + "0000"); // 判断用户所属地区是否是直辖市 Matcher areamM = AREA_PATTERN.matcher(province); StringBuilder sb = new StringBuilder(); if (!areamM.matches()) { // 不是直辖市,加上用户所属市区名 sb.append(AREA.get(idCard.substring(0, 4) + "00")); } sb.append(AREA.get(idCard.substring(0, 6))); // 用户的地址 area = sb.toString(); } return area; } }
public class class_name { public static String getArea(String idCard) { // 用户所属省份 String province; // 用户所属地区 String area; String pre = idCard.substring(0, 6); if (AREA.get(pre) == null) { logger.warn("地区不存在或者地区已不在最新行政区划代码中"); // depends on control dependency: [if], data = [none] } // 判断是否输入台湾省和特别行政区 if (Tools.contains(pre, HK)) { // 台湾省和特别行政区 area = AREA.get(pre + "0000"); // depends on control dependency: [if], data = [none] } else { // 查询用户所属省份 province = AREA.get(idCard.substring(0, 2) + "0000"); // depends on control dependency: [if], data = [none] // 判断用户所属地区是否是直辖市 Matcher areamM = AREA_PATTERN.matcher(province); StringBuilder sb = new StringBuilder(); if (!areamM.matches()) { // 不是直辖市,加上用户所属市区名 sb.append(AREA.get(idCard.substring(0, 4) + "00")); // depends on control dependency: [if], data = [none] } sb.append(AREA.get(idCard.substring(0, 6))); // depends on control dependency: [if], data = [none] // 用户的地址 area = sb.toString(); // depends on control dependency: [if], data = [none] } return area; } }
public class class_name { @Override public FilterReply decide(final ILoggingEvent event) { final Marker marker = event.getMarker(); if (marker == this.marker) { return FilterReply.NEUTRAL; } else { return FilterReply.DENY; } } }
public class class_name { @Override public FilterReply decide(final ILoggingEvent event) { final Marker marker = event.getMarker(); if (marker == this.marker) { return FilterReply.NEUTRAL; // depends on control dependency: [if], data = [none] } else { return FilterReply.DENY; // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public void visitCode(final Code obj) { if (sourceLines == null) { return; } if (isAbstract) { return; } if (Values.STATIC_INITIALIZER.equals(methodName) || Values.CONSTRUCTOR.equals(methodName)) { return; } int methodStart = srcLineAnnotation.getStartLine() - 2; int methodLine = methodStart; String line; while ((methodLine >= 0) && (methodLine < sourceLines.length)) { line = sourceLines[methodLine]; if (line.indexOf(methodName) >= 0) { break; } methodLine--; } if (methodLine < 0) { return; } for (int i = methodLine; i <= methodStart; i++) { if ((i < 0) || (i >= sourceLines.length)) { return; } line = sourceLines[i]; if (line.indexOf("final") >= 0) { return; } } changedParms = new BitSet(); super.visitCode(obj); BugInstance bi = null; for (int i = 0; i < firstLocalReg; i++) { if (changedParms.get(i)) { changedParms.clear(i); continue; } String parmName = getRegisterName(obj, i); if (bi == null) { bi = new BugInstance(this, BugType.FP_FINAL_PARAMETERS.name(), LOW_PRIORITY).addClass(this).addMethod(this).addSourceLine(this, 0); bugReporter.reportBug(bi); } bi.addString(parmName); } changedParms = null; } }
public class class_name { @Override public void visitCode(final Code obj) { if (sourceLines == null) { return; // depends on control dependency: [if], data = [none] } if (isAbstract) { return; // depends on control dependency: [if], data = [none] } if (Values.STATIC_INITIALIZER.equals(methodName) || Values.CONSTRUCTOR.equals(methodName)) { return; // depends on control dependency: [if], data = [none] } int methodStart = srcLineAnnotation.getStartLine() - 2; int methodLine = methodStart; String line; while ((methodLine >= 0) && (methodLine < sourceLines.length)) { line = sourceLines[methodLine]; // depends on control dependency: [while], data = [none] if (line.indexOf(methodName) >= 0) { break; } methodLine--; // depends on control dependency: [while], data = [none] } if (methodLine < 0) { return; // depends on control dependency: [if], data = [none] } for (int i = methodLine; i <= methodStart; i++) { if ((i < 0) || (i >= sourceLines.length)) { return; // depends on control dependency: [if], data = [none] } line = sourceLines[i]; // depends on control dependency: [for], data = [i] if (line.indexOf("final") >= 0) { return; // depends on control dependency: [if], data = [none] } } changedParms = new BitSet(); super.visitCode(obj); BugInstance bi = null; for (int i = 0; i < firstLocalReg; i++) { if (changedParms.get(i)) { changedParms.clear(i); // depends on control dependency: [if], data = [none] continue; } String parmName = getRegisterName(obj, i); if (bi == null) { bi = new BugInstance(this, BugType.FP_FINAL_PARAMETERS.name(), LOW_PRIORITY).addClass(this).addMethod(this).addSourceLine(this, 0); // depends on control dependency: [if], data = [none] bugReporter.reportBug(bi); // depends on control dependency: [if], data = [(bi] } bi.addString(parmName); // depends on control dependency: [for], data = [none] } changedParms = null; } }
public class class_name { public IValidator appendError(IValidator validator) { if (validator == null) return this; if (! (validator instanceof WebValidator) ) { throw new IllegalArgumentException("Must WebValidator."); } WebValidator valid = (WebValidator) validator; if (valid.isSuccess()) return this; if (this.success) { this.msg = valid.msg; this.success = valid.success; } else { msg.append("<br>").append(valid.getMsg()); } return this; } }
public class class_name { public IValidator appendError(IValidator validator) { if (validator == null) return this; if (! (validator instanceof WebValidator) ) { throw new IllegalArgumentException("Must WebValidator."); } WebValidator valid = (WebValidator) validator; if (valid.isSuccess()) return this; if (this.success) { this.msg = valid.msg; // depends on control dependency: [if], data = [none] this.success = valid.success; // depends on control dependency: [if], data = [none] } else { msg.append("<br>").append(valid.getMsg()); // depends on control dependency: [if], data = [none] } return this; } }
public class class_name { @Override public QName getWSDLService() { if (wsdl_service != null) { return new QName(wsdl_service.getNamespaceURI(), wsdl_service .getLocalPart()); } else return null; } }
public class class_name { @Override public QName getWSDLService() { if (wsdl_service != null) { return new QName(wsdl_service.getNamespaceURI(), wsdl_service .getLocalPart()); // depends on control dependency: [if], data = [(wsdl_service] } else return null; } }
public class class_name { public void init(ObjectMapper objectMapper) { if (!initialized) { this.initialized = true; this.objectMapper = objectMapper; this.objectMapper.registerModules(getJacksonModules()); applyRepositoryRegistration(resourceRegistry); for (Module module : modules) { if (module instanceof InitializingModule) { ((InitializingModule) module).init(); } } } } }
public class class_name { public void init(ObjectMapper objectMapper) { if (!initialized) { this.initialized = true; // depends on control dependency: [if], data = [none] this.objectMapper = objectMapper; // depends on control dependency: [if], data = [none] this.objectMapper.registerModules(getJacksonModules()); // depends on control dependency: [if], data = [none] applyRepositoryRegistration(resourceRegistry); // depends on control dependency: [if], data = [none] for (Module module : modules) { if (module instanceof InitializingModule) { ((InitializingModule) module).init(); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public void setMacromolecularSizes() { for (BioAssemblyInfo bioAssembly : transformationMap.values()) { bioAssembly.setMacromolecularSize(bioAssembly.getTransforms().size()); } } }
public class class_name { public void setMacromolecularSizes() { for (BioAssemblyInfo bioAssembly : transformationMap.values()) { bioAssembly.setMacromolecularSize(bioAssembly.getTransforms().size()); // depends on control dependency: [for], data = [bioAssembly] } } }
public class class_name { public static Set<Annotation> flattenInterceptorBindings(EnhancedAnnotatedType<?> clazz, BeanManagerImpl beanManager, Collection<Annotation> annotations, boolean addTopLevelInterceptorBindings, boolean addInheritedInterceptorBindings) { Set<Annotation> flattenInterceptorBindings = new InterceptorBindingSet(beanManager); MetaAnnotationStore metaAnnotationStore = beanManager.getServices().get(MetaAnnotationStore.class); if (addTopLevelInterceptorBindings) { addInterceptorBindings(clazz, annotations, flattenInterceptorBindings, metaAnnotationStore); } if (addInheritedInterceptorBindings) { for (Annotation annotation : annotations) { addInheritedInterceptorBindings(clazz, annotation.annotationType(), metaAnnotationStore, flattenInterceptorBindings); } } return flattenInterceptorBindings; } }
public class class_name { public static Set<Annotation> flattenInterceptorBindings(EnhancedAnnotatedType<?> clazz, BeanManagerImpl beanManager, Collection<Annotation> annotations, boolean addTopLevelInterceptorBindings, boolean addInheritedInterceptorBindings) { Set<Annotation> flattenInterceptorBindings = new InterceptorBindingSet(beanManager); MetaAnnotationStore metaAnnotationStore = beanManager.getServices().get(MetaAnnotationStore.class); if (addTopLevelInterceptorBindings) { addInterceptorBindings(clazz, annotations, flattenInterceptorBindings, metaAnnotationStore); // depends on control dependency: [if], data = [none] } if (addInheritedInterceptorBindings) { for (Annotation annotation : annotations) { addInheritedInterceptorBindings(clazz, annotation.annotationType(), metaAnnotationStore, flattenInterceptorBindings); // depends on control dependency: [for], data = [annotation] } } return flattenInterceptorBindings; } }
public class class_name { public static boolean algorithmEquals (@Nonnull final String sAlgURI, @Nonnull final String sAlgName) { if (sAlgName.equalsIgnoreCase ("DSA")) { return sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_DSA) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_DSA_SHA256); } if (sAlgName.equalsIgnoreCase ("RSA")) { return sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA224) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA224_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_224_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_256_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_384_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_512_MGF1); } if (sAlgName.equalsIgnoreCase ("EC")) { return sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_RIPEMD160) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA224) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA256) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA384) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA512); } LOGGER.warn ("Algorithm mismatch between JCA/JCE public key algorithm name ('" + sAlgName + "') and signature algorithm URI ('" + sAlgURI + "')"); return false; } }
public class class_name { public static boolean algorithmEquals (@Nonnull final String sAlgURI, @Nonnull final String sAlgName) { if (sAlgName.equalsIgnoreCase ("DSA")) { return sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_DSA) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_DSA_SHA256); // depends on control dependency: [if], data = [none] } if (sAlgName.equalsIgnoreCase ("RSA")) { return sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA224) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA224_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_224_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_256_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_384_MGF1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA3_512_MGF1); // depends on control dependency: [if], data = [none] } if (sAlgName.equalsIgnoreCase ("EC")) { return sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_RIPEMD160) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA1) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA224) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA256) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA384) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA512); // depends on control dependency: [if], data = [none] } LOGGER.warn ("Algorithm mismatch between JCA/JCE public key algorithm name ('" + sAlgName + "') and signature algorithm URI ('" + sAlgURI + "')"); return false; } }
public class class_name { private void addQueryParams(final Request request) { if (friendlyName != null) { request.addQueryParam("FriendlyName", friendlyName); } if (evaluateWorkerAttributes != null) { request.addQueryParam("EvaluateWorkerAttributes", evaluateWorkerAttributes); } if (workerSid != null) { request.addQueryParam("WorkerSid", workerSid); } if (getPageSize() != null) { request.addQueryParam("PageSize", Integer.toString(getPageSize())); } } }
public class class_name { private void addQueryParams(final Request request) { if (friendlyName != null) { request.addQueryParam("FriendlyName", friendlyName); // depends on control dependency: [if], data = [none] } if (evaluateWorkerAttributes != null) { request.addQueryParam("EvaluateWorkerAttributes", evaluateWorkerAttributes); // depends on control dependency: [if], data = [none] } if (workerSid != null) { request.addQueryParam("WorkerSid", workerSid); // depends on control dependency: [if], data = [none] } if (getPageSize() != null) { request.addQueryParam("PageSize", Integer.toString(getPageSize())); // depends on control dependency: [if], data = [(getPageSize()] } } }
public class class_name { private final String getUnambiguousCompletions(final List<?> candidates) { if (candidates == null || candidates.isEmpty()) { return null; } // convert to an array for speed String[] strings = candidates.toArray(new String[candidates.size()]); String first = strings[0]; StringBuilder candidate = new StringBuilder(); for (int i = 0, count = first.length(); i < count; i++) { if (startsWith(first.substring(0, i + 1), strings)) { candidate.append(first.charAt(i)); } else { break; } } return candidate.toString(); } }
public class class_name { private final String getUnambiguousCompletions(final List<?> candidates) { if (candidates == null || candidates.isEmpty()) { return null; // depends on control dependency: [if], data = [none] } // convert to an array for speed String[] strings = candidates.toArray(new String[candidates.size()]); String first = strings[0]; StringBuilder candidate = new StringBuilder(); for (int i = 0, count = first.length(); i < count; i++) { if (startsWith(first.substring(0, i + 1), strings)) { candidate.append(first.charAt(i)); // depends on control dependency: [if], data = [none] } else { break; } } return candidate.toString(); } }
public class class_name { protected byte[] getBytesInternal() { byte cached[]; if(hasNoValueCache() || (cached = valueCache.lowerBytes) == null) { valueCache.lowerBytes = cached = getBytesImpl(true); } return cached; } }
public class class_name { protected byte[] getBytesInternal() { byte cached[]; if(hasNoValueCache() || (cached = valueCache.lowerBytes) == null) { valueCache.lowerBytes = cached = getBytesImpl(true); // depends on control dependency: [if], data = [none] } return cached; } }
public class class_name { protected static void dischargeAsEmpty(final BitmapStorage32 container, final IteratingRLW32 i) { while (i.size() > 0) { container.addStreamOfEmptyWords(false, i.size()); i.next(); } } }
public class class_name { protected static void dischargeAsEmpty(final BitmapStorage32 container, final IteratingRLW32 i) { while (i.size() > 0) { container.addStreamOfEmptyWords(false, i.size()); // depends on control dependency: [while], data = [none] i.next(); // depends on control dependency: [while], data = [none] } } }
public class class_name { private void processQueue() { SoftValue<?, ?> sv; while ((sv = (SoftValue<?, ?>) queue.poll()) != null) { //noinspection SuspiciousMethodCalls map.remove(sv.key); // we can access private data! } } }
public class class_name { private void processQueue() { SoftValue<?, ?> sv; while ((sv = (SoftValue<?, ?>) queue.poll()) != null) { //noinspection SuspiciousMethodCalls map.remove(sv.key); // we can access private data! // depends on control dependency: [while], data = [none] } } }
public class class_name { private static Configuration getAppConfiguration() { if (appConfig == null) { //从freemarker 视图中获取所有配置 appConfig = (Configuration) FreeMarkerRender.getConfiguration().clone(); try { //设置模板路径 appConfig.setDirectoryForTemplateLoading( new File(PathKit.getWebRootPath() + Goja.viewPath)); appConfig.setObjectWrapper(new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build()); } catch (IOException e) { logger.error("The Freemarkers has error!", e); } } return appConfig; } }
public class class_name { private static Configuration getAppConfiguration() { if (appConfig == null) { //从freemarker 视图中获取所有配置 appConfig = (Configuration) FreeMarkerRender.getConfiguration().clone(); // depends on control dependency: [if], data = [none] try { //设置模板路径 appConfig.setDirectoryForTemplateLoading( new File(PathKit.getWebRootPath() + Goja.viewPath)); // depends on control dependency: [try], data = [none] appConfig.setObjectWrapper(new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build()); // depends on control dependency: [try], data = [none] } catch (IOException e) { logger.error("The Freemarkers has error!", e); } // depends on control dependency: [catch], data = [none] } return appConfig; } }
public class class_name { public void dispatchEvent(final ManagerEvent event) { if (logger.isDebugEnabled()) { logger.debug("dispatch=" + event.toString()); //$NON-NLS-1$ } // take a copy of the listeners so they can be modified whilst we // iterate over them // The iteration may call some long running processes. final List<FilteredManagerListenerWrapper> listenerCopy; synchronized (this.listeners) { listenerCopy = this.listeners.getCopyAsList(); } try { final LogTime totalTime = new LogTime(); CountDownLatch latch = new CountDownLatch(listenerCopy.size()); for (final FilteredManagerListenerWrapper filter : listenerCopy) { if (filter.requiredEvents.contains(event.getClass())) { dispatchEventOnThread(event, filter, latch); } else { // this listener didn't want the event, so just decrease the // countdown latch.countDown(); } } latch.await(); if (totalTime.timeTaken() > 500) { logger.warn("Too long to process event " + event + " time taken: " + totalTime.timeTaken()); //$NON-NLS-1$ //$NON-NLS-2$ } } catch (InterruptedException e) { Thread.interrupted(); } } }
public class class_name { public void dispatchEvent(final ManagerEvent event) { if (logger.isDebugEnabled()) { logger.debug("dispatch=" + event.toString()); //$NON-NLS-1$ // depends on control dependency: [if], data = [none] } // take a copy of the listeners so they can be modified whilst we // iterate over them // The iteration may call some long running processes. final List<FilteredManagerListenerWrapper> listenerCopy; synchronized (this.listeners) { listenerCopy = this.listeners.getCopyAsList(); } try { final LogTime totalTime = new LogTime(); CountDownLatch latch = new CountDownLatch(listenerCopy.size()); for (final FilteredManagerListenerWrapper filter : listenerCopy) { if (filter.requiredEvents.contains(event.getClass())) { dispatchEventOnThread(event, filter, latch); // depends on control dependency: [if], data = [none] } else { // this listener didn't want the event, so just decrease the // countdown latch.countDown(); // depends on control dependency: [if], data = [none] } } latch.await(); if (totalTime.timeTaken() > 500) { logger.warn("Too long to process event " + event + " time taken: " + totalTime.timeTaken()); //$NON-NLS-1$ //$NON-NLS-2$ } } catch (InterruptedException e) { Thread.interrupted(); } } }
public class class_name { public <T extends IBase> List<T> getAllPopulatedChildElementsOfType(IBaseResource theResource, final Class<T> theType) { final ArrayList<T> retVal = new ArrayList<T>(); BaseRuntimeElementCompositeDefinition<?> def = myContext.getResourceDefinition(theResource); visit(new IdentityHashMap<Object, Object>(), theResource, theResource, null, null, def, new IModelVisitor() { @SuppressWarnings("unchecked") @Override public void acceptElement(IBaseResource theOuterResource, IBase theElement, List<String> thePathToElement, BaseRuntimeChildDefinition theChildDefinition, BaseRuntimeElementDefinition<?> theDefinition) { if (theElement == null || theElement.isEmpty()) { return; } if (theType.isAssignableFrom(theElement.getClass())) { retVal.add((T) theElement); } } }); return retVal; } }
public class class_name { public <T extends IBase> List<T> getAllPopulatedChildElementsOfType(IBaseResource theResource, final Class<T> theType) { final ArrayList<T> retVal = new ArrayList<T>(); BaseRuntimeElementCompositeDefinition<?> def = myContext.getResourceDefinition(theResource); visit(new IdentityHashMap<Object, Object>(), theResource, theResource, null, null, def, new IModelVisitor() { @SuppressWarnings("unchecked") @Override public void acceptElement(IBaseResource theOuterResource, IBase theElement, List<String> thePathToElement, BaseRuntimeChildDefinition theChildDefinition, BaseRuntimeElementDefinition<?> theDefinition) { if (theElement == null || theElement.isEmpty()) { return; // depends on control dependency: [if], data = [none] } if (theType.isAssignableFrom(theElement.getClass())) { retVal.add((T) theElement); // depends on control dependency: [if], data = [none] } } }); return retVal; } }
public class class_name { void add(MapElement element) { final Rectangle2d r = element.getBoundingBox(); if (r != null) { if (Double.isNaN(this.minx) || this.minx > r.getMinX()) { this.minx = r.getMinX(); } if (Double.isNaN(this.maxx) || this.maxx < r.getMaxX()) { this.maxx = r.getMaxX(); } if (Double.isNaN(this.miny) || this.miny > r.getMinY()) { this.miny = r.getMinY(); } if (Double.isNaN(this.maxy) || this.maxy < r.getMaxY()) { this.maxy = r.getMaxY(); } } this.elements.add(element); } }
public class class_name { void add(MapElement element) { final Rectangle2d r = element.getBoundingBox(); if (r != null) { if (Double.isNaN(this.minx) || this.minx > r.getMinX()) { this.minx = r.getMinX(); // depends on control dependency: [if], data = [none] } if (Double.isNaN(this.maxx) || this.maxx < r.getMaxX()) { this.maxx = r.getMaxX(); // depends on control dependency: [if], data = [none] } if (Double.isNaN(this.miny) || this.miny > r.getMinY()) { this.miny = r.getMinY(); // depends on control dependency: [if], data = [none] } if (Double.isNaN(this.maxy) || this.maxy < r.getMaxY()) { this.maxy = r.getMaxY(); // depends on control dependency: [if], data = [none] } } this.elements.add(element); } }
public class class_name { private boolean isNormalized(String path) { if (path == null) { return true; } for (int j = path.length(); j > 0;) { int i = path.lastIndexOf('/', j - 1); int gap = j - i; if (gap == 2 && path.charAt(i + 1) == '.') { // ".", "/./" or "/." return false; } else if (gap == 3 && path.charAt(i + 1) == '.' && path.charAt(i + 2) == '.') { return false; } j = i; } return true; } }
public class class_name { private boolean isNormalized(String path) { if (path == null) { return true; // depends on control dependency: [if], data = [none] } for (int j = path.length(); j > 0;) { int i = path.lastIndexOf('/', j - 1); int gap = j - i; if (gap == 2 && path.charAt(i + 1) == '.') { // ".", "/./" or "/." return false; // depends on control dependency: [if], data = [none] } else if (gap == 3 && path.charAt(i + 1) == '.' && path.charAt(i + 2) == '.') { return false; // depends on control dependency: [if], data = [none] } j = i; // depends on control dependency: [for], data = [j] } return true; } }
public class class_name { public CalendarYear minus(Years<CalendarUnit> years) { if (years.isEmpty()) { return this; } return CalendarYear.of(MathUtils.safeSubtract(this.year, years.getAmount())); } }
public class class_name { public CalendarYear minus(Years<CalendarUnit> years) { if (years.isEmpty()) { return this; // depends on control dependency: [if], data = [none] } return CalendarYear.of(MathUtils.safeSubtract(this.year, years.getAmount())); } }
public class class_name { public TreeSet<String> getAllPOS() { TreeSet<String> set = new TreeSet<String>(); Iterator<FNLPDoc> it1 = docs.iterator(); while(it1.hasNext()){ FNLPDoc doc = it1.next(); Iterator<FNLPSent> it2 = doc.sentences.iterator(); while(it2.hasNext()){ FNLPSent sent = it2.next(); if(!sent.hasTag()) continue; for(int i=0;i<sent.size();i++){ set.add(sent.tags[i]); } } } return set; } }
public class class_name { public TreeSet<String> getAllPOS() { TreeSet<String> set = new TreeSet<String>(); Iterator<FNLPDoc> it1 = docs.iterator(); while(it1.hasNext()){ FNLPDoc doc = it1.next(); Iterator<FNLPSent> it2 = doc.sentences.iterator(); while(it2.hasNext()){ FNLPSent sent = it2.next(); if(!sent.hasTag()) continue; for(int i=0;i<sent.size();i++){ set.add(sent.tags[i]); // depends on control dependency: [for], data = [i] } } } return set; } }
public class class_name { protected void callInvalidateFromInternalInvalidate() { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "callInvalidateFromInternalInvalidate", "calling invalidate"); } this.invalidate(); } }
public class class_name { protected void callInvalidateFromInternalInvalidate() { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "callInvalidateFromInternalInvalidate", "calling invalidate"); // depends on control dependency: [if], data = [none] } this.invalidate(); } }
public class class_name { @Override public Result<Void> addAdminToNS(AuthzTrans trans, HttpServletResponse resp, String ns, String id) { TimeTaken tt = trans.start(ADD_NS_ADMIN + ' ' + ns + ' ' + id, Env.SUB|Env.ALWAYS); try { Result<Void> rp = service.addAdminNS(trans,ns,id); switch(rp.status) { case OK: //TODO Perms?? setContentType(resp,nsRequestDF.getOutType()); resp.getOutputStream().println(); return Result.ok(); default: return Result.err(rp); } } catch (Exception e) { trans.error().log(e,IN,ADD_NS_ADMIN); return Result.err(e); } finally { tt.done(); } } }
public class class_name { @Override public Result<Void> addAdminToNS(AuthzTrans trans, HttpServletResponse resp, String ns, String id) { TimeTaken tt = trans.start(ADD_NS_ADMIN + ' ' + ns + ' ' + id, Env.SUB|Env.ALWAYS); try { Result<Void> rp = service.addAdminNS(trans,ns,id); switch(rp.status) { case OK: //TODO Perms?? setContentType(resp,nsRequestDF.getOutType()); resp.getOutputStream().println(); return Result.ok(); default: return Result.err(rp); } } catch (Exception e) { trans.error().log(e,IN,ADD_NS_ADMIN); return Result.err(e); } finally { // depends on control dependency: [catch], data = [none] tt.done(); } } }
public class class_name { public Collection<String> getVariableNames() { ImmutableSet.Builder<String> builder = ImmutableSet.builder(); for ( ConfigurationKeyPart p : parts ) { if ( p.isVariable() ) { builder.add(p.getValue()); } } return builder.build(); } }
public class class_name { public Collection<String> getVariableNames() { ImmutableSet.Builder<String> builder = ImmutableSet.builder(); for ( ConfigurationKeyPart p : parts ) { if ( p.isVariable() ) { builder.add(p.getValue()); // depends on control dependency: [if], data = [none] } } return builder.build(); } }
public class class_name { public void setBindPose(GVRPose pose) { if (pose != mBindPose) { pose.sync(); mBindPose.copy(pose); } if (mInverseBindPose == null) { mInverseBindPose = new GVRPose(this); } mInverseBindPose.inverse(mBindPose); mPose.copy(mBindPose); updateBonePose(); } }
public class class_name { public void setBindPose(GVRPose pose) { if (pose != mBindPose) { pose.sync(); // depends on control dependency: [if], data = [none] mBindPose.copy(pose); // depends on control dependency: [if], data = [(pose] } if (mInverseBindPose == null) { mInverseBindPose = new GVRPose(this); // depends on control dependency: [if], data = [none] } mInverseBindPose.inverse(mBindPose); mPose.copy(mBindPose); updateBonePose(); } }
public class class_name { ServerContext setCommitIndex(long commitIndex) { Assert.argNot(commitIndex < 0, "commit index must be positive"); long previousCommitIndex = this.commitIndex; if (commitIndex > previousCommitIndex) { this.commitIndex = commitIndex; log.commit(Math.min(commitIndex, log.lastIndex())); long configurationIndex = cluster.getConfiguration().index(); if (configurationIndex > previousCommitIndex && configurationIndex <= commitIndex) { cluster.commit(); } } return this; } }
public class class_name { ServerContext setCommitIndex(long commitIndex) { Assert.argNot(commitIndex < 0, "commit index must be positive"); long previousCommitIndex = this.commitIndex; if (commitIndex > previousCommitIndex) { this.commitIndex = commitIndex; // depends on control dependency: [if], data = [none] log.commit(Math.min(commitIndex, log.lastIndex())); // depends on control dependency: [if], data = [(commitIndex] long configurationIndex = cluster.getConfiguration().index(); if (configurationIndex > previousCommitIndex && configurationIndex <= commitIndex) { cluster.commit(); // depends on control dependency: [if], data = [none] } } return this; } }
public class class_name { public static void agentmain(String options, Instrumentation instrumentation) { if (Config.X_ENABLED_V) { init(instrumentation); instrumentation.addTransformer(new MavenCFT(), true); instrumentMaven(instrumentation); } } }
public class class_name { public static void agentmain(String options, Instrumentation instrumentation) { if (Config.X_ENABLED_V) { init(instrumentation); // depends on control dependency: [if], data = [none] instrumentation.addTransformer(new MavenCFT(), true); // depends on control dependency: [if], data = [none] instrumentMaven(instrumentation); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public List<Statement> expand(Term term) { List<Statement> statements = new ArrayList<Statement>(); // first argument of a protein mod term is the protein parameter BELObject proteinArgument = term.getFunctionArguments().get(0); Parameter pp = (Parameter) proteinArgument; // second argument of a protein mod term is the modification BELObject modArgument = term.getFunctionArguments().get(1); Term mt = (Term) modArgument; FunctionEnum fx = mt.getFunctionEnum(); Term proteinTrm = new Term(PROTEIN_ABUNDANCE); proteinTrm.addFunctionArgument(pp); Statement stmt = null; final Object obj = new Object(term); if (isMutation(fx)) { // mutation // protein term connects to its mutation with HAS_VARIANT // relationship stmt = new Statement(proteinTrm, null, null, obj, HAS_VARIANT); } else { // modified protein // protein term connects to its modification with HAS_MODIFICATION // relationship stmt = new Statement(proteinTrm, null, null, obj, HAS_MODIFICATION); } attachExpansionRuleCitation(stmt); statements.add(stmt); return statements; } }
public class class_name { @Override public List<Statement> expand(Term term) { List<Statement> statements = new ArrayList<Statement>(); // first argument of a protein mod term is the protein parameter BELObject proteinArgument = term.getFunctionArguments().get(0); Parameter pp = (Parameter) proteinArgument; // second argument of a protein mod term is the modification BELObject modArgument = term.getFunctionArguments().get(1); Term mt = (Term) modArgument; FunctionEnum fx = mt.getFunctionEnum(); Term proteinTrm = new Term(PROTEIN_ABUNDANCE); proteinTrm.addFunctionArgument(pp); Statement stmt = null; final Object obj = new Object(term); if (isMutation(fx)) { // mutation // protein term connects to its mutation with HAS_VARIANT // relationship stmt = new Statement(proteinTrm, null, null, obj, HAS_VARIANT); // depends on control dependency: [if], data = [none] } else { // modified protein // protein term connects to its modification with HAS_MODIFICATION // relationship stmt = new Statement(proteinTrm, null, null, obj, HAS_MODIFICATION); // depends on control dependency: [if], data = [none] } attachExpansionRuleCitation(stmt); statements.add(stmt); return statements; } }
public class class_name { private void notifyOnPreferenceFragmentHidden(@NonNull final Fragment fragment) { for (PreferenceFragmentListener listener : preferenceFragmentListeners) { listener.onPreferenceFragmentHidden(fragment); } } }
public class class_name { private void notifyOnPreferenceFragmentHidden(@NonNull final Fragment fragment) { for (PreferenceFragmentListener listener : preferenceFragmentListeners) { listener.onPreferenceFragmentHidden(fragment); // depends on control dependency: [for], data = [listener] } } }
public class class_name { @Override public EClass getIfcFrequencyMeasure() { if (ifcFrequencyMeasureEClass == null) { ifcFrequencyMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(810); } return ifcFrequencyMeasureEClass; } }
public class class_name { @Override public EClass getIfcFrequencyMeasure() { if (ifcFrequencyMeasureEClass == null) { ifcFrequencyMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(810); // depends on control dependency: [if], data = [none] } return ifcFrequencyMeasureEClass; } }
public class class_name { protected void resumeSession (AuthRequest req, PresentsConnection conn) { // check to see if we've already got a connection object, in which case it's probably stale Connection oldconn = getConnection(); if (oldconn != null && !oldconn.isClosed()) { log.info("Closing stale connection", "old", oldconn, "new", conn); // close the old connection (which results in everything being properly unregistered) oldconn.close(); } // note our new auth request (so that we can deliver the proper bootstrap services) _areq = req; // start using the new connection setConnection(conn); // if a client connects, drops the connection and reconnects within the span of a very // short period of time, we'll find ourselves in resumeSession() before their client object // was resolved from the initial connection; in such a case, we can simply bail out here // and let the original session establishment code take care of initializing this resumed // session if (_clobj == null) { log.info("Rapid-fire reconnect caused us to arrive in resumeSession() before the " + "original session resolved its client object " + this + "."); return; } // we need to get onto the dobj thread so that we can finalize resumption of the session _omgr.postRunnable(new Runnable() { public void run () { // now that we're on the dobjmgr thread we can resume our session resumption finishResumeSession(); } }); } }
public class class_name { protected void resumeSession (AuthRequest req, PresentsConnection conn) { // check to see if we've already got a connection object, in which case it's probably stale Connection oldconn = getConnection(); if (oldconn != null && !oldconn.isClosed()) { log.info("Closing stale connection", "old", oldconn, "new", conn); // depends on control dependency: [if], data = [none] // close the old connection (which results in everything being properly unregistered) oldconn.close(); // depends on control dependency: [if], data = [none] } // note our new auth request (so that we can deliver the proper bootstrap services) _areq = req; // start using the new connection setConnection(conn); // if a client connects, drops the connection and reconnects within the span of a very // short period of time, we'll find ourselves in resumeSession() before their client object // was resolved from the initial connection; in such a case, we can simply bail out here // and let the original session establishment code take care of initializing this resumed // session if (_clobj == null) { log.info("Rapid-fire reconnect caused us to arrive in resumeSession() before the " + "original session resolved its client object " + this + "."); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } // we need to get onto the dobj thread so that we can finalize resumption of the session _omgr.postRunnable(new Runnable() { public void run () { // now that we're on the dobjmgr thread we can resume our session resumption finishResumeSession(); } }); } }
public class class_name { @SuppressWarnings("PMD.AvoidArrayLoops") private static byte[] salt(final byte[] text) { final byte size = (byte) CcSalted.RND.nextInt(Tv.TEN); final byte[] output = new byte[text.length + (int) size + 2]; output[0] = size; byte sum = (byte) 0; for (int idx = 0; idx < (int) size; ++idx) { output[idx + 1] = (byte) CcSalted.RND.nextInt(); sum += output[idx + 1]; } System.arraycopy(text, 0, output, (int) size + 1, text.length); output[output.length - 1] = sum; return output; } }
public class class_name { @SuppressWarnings("PMD.AvoidArrayLoops") private static byte[] salt(final byte[] text) { final byte size = (byte) CcSalted.RND.nextInt(Tv.TEN); final byte[] output = new byte[text.length + (int) size + 2]; output[0] = size; byte sum = (byte) 0; for (int idx = 0; idx < (int) size; ++idx) { output[idx + 1] = (byte) CcSalted.RND.nextInt(); // depends on control dependency: [for], data = [idx] sum += output[idx + 1]; // depends on control dependency: [for], data = [idx] } System.arraycopy(text, 0, output, (int) size + 1, text.length); output[output.length - 1] = sum; return output; } }
public class class_name { public java.util.List<String> getStringSetValue() { if (stringSetValue == null) { stringSetValue = new com.amazonaws.internal.SdkInternalList<String>(); } return stringSetValue; } }
public class class_name { public java.util.List<String> getStringSetValue() { if (stringSetValue == null) { stringSetValue = new com.amazonaws.internal.SdkInternalList<String>(); // depends on control dependency: [if], data = [none] } return stringSetValue; } }
public class class_name { private static Scriptable js_reverse(Context cx, Scriptable thisObj, Object[] args) { if (thisObj instanceof NativeArray) { NativeArray na = (NativeArray) thisObj; if (na.denseOnly) { for (int i=0, j=((int)na.length)-1; i < j; i++,j--) { Object temp = na.dense[i]; na.dense[i] = na.dense[j]; na.dense[j] = temp; } return thisObj; } } long len = getLengthProperty(cx, thisObj, false); long half = len / 2; for(long i=0; i < half; i++) { long j = len - i - 1; Object temp1 = getRawElem(thisObj, i); Object temp2 = getRawElem(thisObj, j); setRawElem(cx, thisObj, i, temp2); setRawElem(cx, thisObj, j, temp1); } return thisObj; } }
public class class_name { private static Scriptable js_reverse(Context cx, Scriptable thisObj, Object[] args) { if (thisObj instanceof NativeArray) { NativeArray na = (NativeArray) thisObj; if (na.denseOnly) { for (int i=0, j=((int)na.length)-1; i < j; i++,j--) { Object temp = na.dense[i]; na.dense[i] = na.dense[j]; // depends on control dependency: [for], data = [i] na.dense[j] = temp; // depends on control dependency: [for], data = [none] } return thisObj; // depends on control dependency: [if], data = [none] } } long len = getLengthProperty(cx, thisObj, false); long half = len / 2; for(long i=0; i < half; i++) { long j = len - i - 1; Object temp1 = getRawElem(thisObj, i); Object temp2 = getRawElem(thisObj, j); setRawElem(cx, thisObj, i, temp2); // depends on control dependency: [for], data = [i] setRawElem(cx, thisObj, j, temp1); // depends on control dependency: [for], data = [none] } return thisObj; } }
public class class_name { private synchronized void onRemovedMbean(ObjectName obj) { if (!detected_groups_.keySet().contains(obj)) { LOG.log(Level.WARNING, "skipping de-registration of {0}: not present", obj); return; } MBeanGroup instance = detected_groups_.get(obj); detected_groups_.remove(obj); LOG.log(Level.FINE, "de-registered metrics for {0}: {1}", new Object[]{obj, instance}); } }
public class class_name { private synchronized void onRemovedMbean(ObjectName obj) { if (!detected_groups_.keySet().contains(obj)) { LOG.log(Level.WARNING, "skipping de-registration of {0}: not present", obj); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } MBeanGroup instance = detected_groups_.get(obj); detected_groups_.remove(obj); LOG.log(Level.FINE, "de-registered metrics for {0}: {1}", new Object[]{obj, instance}); } }
public class class_name { public static void invokeMain(String className, String[] args) { try { Class<?> clazz = null; if (ClassServiceUtility.getClassService().getClassFinder(null) != null) clazz = ClassServiceUtility.getClassService().getClassFinder(null).findClass(className, null); if (clazz == null) clazz = Class.forName(className); Method method = clazz.getMethod("main", PARAMS); Object[] objArgs = new Object[] {args}; method.invoke(null, objArgs); } catch (Exception e) { e.printStackTrace(); } } }
public class class_name { public static void invokeMain(String className, String[] args) { try { Class<?> clazz = null; // depends on control dependency: [try], data = [none] if (ClassServiceUtility.getClassService().getClassFinder(null) != null) clazz = ClassServiceUtility.getClassService().getClassFinder(null).findClass(className, null); if (clazz == null) clazz = Class.forName(className); Method method = clazz.getMethod("main", PARAMS); Object[] objArgs = new Object[] {args}; method.invoke(null, objArgs); // depends on control dependency: [try], data = [none] } catch (Exception e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void setCreatedAt(java.util.Collection<DateFilter> createdAt) { if (createdAt == null) { this.createdAt = null; return; } this.createdAt = new java.util.ArrayList<DateFilter>(createdAt); } }
public class class_name { public void setCreatedAt(java.util.Collection<DateFilter> createdAt) { if (createdAt == null) { this.createdAt = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.createdAt = new java.util.ArrayList<DateFilter>(createdAt); } }
public class class_name { private boolean isExpired(CacheEntry entry) { if (ttl == 0) { return false; } return entry.getTimestamp() + ttl < System.currentTimeMillis(); } }
public class class_name { private boolean isExpired(CacheEntry entry) { if (ttl == 0) { return false; // depends on control dependency: [if], data = [none] } return entry.getTimestamp() + ttl < System.currentTimeMillis(); } }
public class class_name { public java.util.List<PropagatingVgw> getPropagatingVgws() { if (propagatingVgws == null) { propagatingVgws = new com.amazonaws.internal.SdkInternalList<PropagatingVgw>(); } return propagatingVgws; } }
public class class_name { public java.util.List<PropagatingVgw> getPropagatingVgws() { if (propagatingVgws == null) { propagatingVgws = new com.amazonaws.internal.SdkInternalList<PropagatingVgw>(); // depends on control dependency: [if], data = [none] } return propagatingVgws; } }
public class class_name { private String createMessage(ServiceReference sr, String message) { StringBuilder output = new StringBuilder(); if (sr != null) { output.append('[').append(sr.toString()).append(']'); } else { output.append(UNKNOWN); } output.append(message); return output.toString(); } }
public class class_name { private String createMessage(ServiceReference sr, String message) { StringBuilder output = new StringBuilder(); if (sr != null) { output.append('[').append(sr.toString()).append(']'); // depends on control dependency: [if], data = [(sr] } else { output.append(UNKNOWN); // depends on control dependency: [if], data = [none] } output.append(message); return output.toString(); } }
public class class_name { @Override public void notifyResult(T result) { if (logger.isDebugEnabled() == true) { logger.debug(this.header + result.toString()); } } }
public class class_name { @Override public void notifyResult(T result) { if (logger.isDebugEnabled() == true) { logger.debug(this.header + result.toString()); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setCancelledSpotInstanceRequests(java.util.Collection<CancelledSpotInstanceRequest> cancelledSpotInstanceRequests) { if (cancelledSpotInstanceRequests == null) { this.cancelledSpotInstanceRequests = null; return; } this.cancelledSpotInstanceRequests = new com.amazonaws.internal.SdkInternalList<CancelledSpotInstanceRequest>(cancelledSpotInstanceRequests); } }
public class class_name { public void setCancelledSpotInstanceRequests(java.util.Collection<CancelledSpotInstanceRequest> cancelledSpotInstanceRequests) { if (cancelledSpotInstanceRequests == null) { this.cancelledSpotInstanceRequests = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.cancelledSpotInstanceRequests = new com.amazonaws.internal.SdkInternalList<CancelledSpotInstanceRequest>(cancelledSpotInstanceRequests); } }
public class class_name { private Method findHandlerMethod(Object target, Class<? extends IEvents> eventsClass, String eventName, Object[] params) { // Use cached method if available. Note: no further type checking is done if the // method has been cached. It will be checked by JRE when the method is invoked. Method cachedMethod = getCachedMethod(target, eventName); if (cachedMethod != null) { return cachedMethod; } // Check the event and params against the eventsClass interface object. Method nameMatch = null; Method signatureMatch = null; for (Method method : eventsClass.getMethods()) { // Match method name and event name if (method.getName().equals(eventName)) { nameMatch = method; // Check number of parameters Class<?>[] types = method.getParameterTypes(); if (types.length != params.length) continue; // Check parameter types int i = 0; boolean foundMatchedMethod = true; for (Class<?> type : types) { Object param = params[i++]; if (!isInstanceWithAutoboxing(type, param)) { foundMatchedMethod = false; break; } } if (foundMatchedMethod) { signatureMatch = method; break; } } } // Error if (nameMatch == null) { throw new RuntimeException(String.format("The interface contains no method %s", eventName)); } else if (signatureMatch == null ){ throw new RuntimeException(String.format("The interface contains a method %s but " + "parameters don't match", eventName)); } // Cache the method for the target, even if it doesn't implement the interface. This is // to avoid always verifying the event. addCachedMethod(target, eventName, signatureMatch); return signatureMatch; } }
public class class_name { private Method findHandlerMethod(Object target, Class<? extends IEvents> eventsClass, String eventName, Object[] params) { // Use cached method if available. Note: no further type checking is done if the // method has been cached. It will be checked by JRE when the method is invoked. Method cachedMethod = getCachedMethod(target, eventName); if (cachedMethod != null) { return cachedMethod; // depends on control dependency: [if], data = [none] } // Check the event and params against the eventsClass interface object. Method nameMatch = null; Method signatureMatch = null; for (Method method : eventsClass.getMethods()) { // Match method name and event name if (method.getName().equals(eventName)) { nameMatch = method; // depends on control dependency: [if], data = [none] // Check number of parameters Class<?>[] types = method.getParameterTypes(); if (types.length != params.length) continue; // Check parameter types int i = 0; boolean foundMatchedMethod = true; for (Class<?> type : types) { Object param = params[i++]; if (!isInstanceWithAutoboxing(type, param)) { foundMatchedMethod = false; // depends on control dependency: [if], data = [none] break; } } if (foundMatchedMethod) { signatureMatch = method; // depends on control dependency: [if], data = [none] break; } } } // Error if (nameMatch == null) { throw new RuntimeException(String.format("The interface contains no method %s", eventName)); } else if (signatureMatch == null ){ throw new RuntimeException(String.format("The interface contains a method %s but " + "parameters don't match", eventName)); } // Cache the method for the target, even if it doesn't implement the interface. This is // to avoid always verifying the event. addCachedMethod(target, eventName, signatureMatch); return signatureMatch; } }
public class class_name { @Override public ConsumerSession createConsumerSessionForDurableSubscription(String subscriptionName, boolean enableReadAhead, Reliability unrecoverableReliability, boolean bifurcatable) throws SIConnectionUnavailableException, SIConnectionDroppedException, SIErrorException, SIDurableSubscriptionNotFoundException, SIDurableSubscriptionMismatchException, SIDestinationLockedException, SIIncorrectCallException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled()) SibTr.entry( CoreSPIConnection.tc, "createConsumerSessionForDurableSubscription", new Object[] { this, subscriptionName, Boolean.valueOf(enableReadAhead), unrecoverableReliability, Boolean.valueOf(bifurcatable) }); // Do not need to check that the destination information is correct. // As we are using the subscription data straight from the named subscription // Find the ConsumerDispatcher for this subscription // Note that it must be homed on this ME HashMap durableSubs = _destinationManager.getDurableSubscriptionsTable(); ConsumerDispatcher cd = null; synchronized (durableSubs) { //Look up the consumer dispatcher for this subId in the system durable subs list cd = (ConsumerDispatcher) durableSubs.get(subscriptionName); // Check that the durable subscription exists if (cd == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createConsumerSessionForDurableSubscription"); throw new SIDurableSubscriptionNotFoundException( nls.getFormattedMessage( "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072", new Object[] { subscriptionName, _messageProcessor.getMessagingEngineName() }, null)); } } //Get the destinationHandler from the ConsumerDispatcher //Note that we know it is PubSub DestinationHandler destination = cd.getDestination(); SIDestinationAddress destinationAddress = SIMPUtils.createJsDestinationAddress( destination.getName(), _messageProcessor.getMessagingEngineUuid()); //Get the state object representing the subscription from the ConsumerDispatcher ConsumerDispatcherState subState = cd.getConsumerDispatcherState(); ConsumerSessionImpl consumer = null; // Synchronize on the close object, we don't want the connection closing // while we try to add the subscription. synchronized (this) { // See if this connection has been closed checkNotClosed(); //create the consumer session for this subscription try { consumer = new ConsumerSessionImpl(destination, destinationAddress, subState, this, enableReadAhead, false, unrecoverableReliability, bifurcatable, true, false); } catch (SINotPossibleInCurrentConfigurationException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createConsumerSessionForDurableSubscription", "SIErrorException"); throw new SIErrorException(e); } catch (SISessionUnavailableException e) { // FFDC FFDCFilter .processException( e, "com.ibm.ws.sib.processor.impl.ConnectionImpl.createConsumerSessionForDurableSubscription", "1:2129:1.347.1.25", this); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:1809:1.285", e }); // This should never be thrown if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createConsumerSessionForDurableSubscription", "SIErrorException"); throw new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:2146:1.347.1.25", e }, null), e); } catch (SITemporaryDestinationNotFoundException e) { // FFDC FFDCFilter .processException( e, "com.ibm.ws.sib.processor.impl.ConnectionImpl.createConsumerSessionForDurableSubscription", "1:2159:1.347.1.25", this); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:2165:1.347.1.25", e }); // This should never be thrown if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createConsumerSessionForDurableSubscription", "SIErrorException"); throw new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:2176:1.347.1.25", e }, null), e); } catch (SINonDurableSubscriptionMismatchException e) { SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:1953:1.347.1.25", e }); // This should never be thrown if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createConsumerSessionForDurableSubscription", "SIErrorException"); throw new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:1964:1.347.1.25", e }, null), e); } synchronized (_consumers) { //store a reference _consumers.add(consumer); } _messageProcessor.addConsumer(consumer); } if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled()) SibTr.exit(CoreSPIConnection.tc, "createConsumerSessionForDurableSubscription", consumer); return consumer; } }
public class class_name { @Override public ConsumerSession createConsumerSessionForDurableSubscription(String subscriptionName, boolean enableReadAhead, Reliability unrecoverableReliability, boolean bifurcatable) throws SIConnectionUnavailableException, SIConnectionDroppedException, SIErrorException, SIDurableSubscriptionNotFoundException, SIDurableSubscriptionMismatchException, SIDestinationLockedException, SIIncorrectCallException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled()) SibTr.entry( CoreSPIConnection.tc, "createConsumerSessionForDurableSubscription", new Object[] { this, subscriptionName, Boolean.valueOf(enableReadAhead), unrecoverableReliability, Boolean.valueOf(bifurcatable) }); // Do not need to check that the destination information is correct. // As we are using the subscription data straight from the named subscription // Find the ConsumerDispatcher for this subscription // Note that it must be homed on this ME HashMap durableSubs = _destinationManager.getDurableSubscriptionsTable(); ConsumerDispatcher cd = null; synchronized (durableSubs) { //Look up the consumer dispatcher for this subId in the system durable subs list cd = (ConsumerDispatcher) durableSubs.get(subscriptionName); // Check that the durable subscription exists if (cd == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createConsumerSessionForDurableSubscription"); throw new SIDurableSubscriptionNotFoundException( nls.getFormattedMessage( "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072", new Object[] { subscriptionName, _messageProcessor.getMessagingEngineName() }, null)); } } //Get the destinationHandler from the ConsumerDispatcher //Note that we know it is PubSub DestinationHandler destination = cd.getDestination(); SIDestinationAddress destinationAddress = SIMPUtils.createJsDestinationAddress( destination.getName(), _messageProcessor.getMessagingEngineUuid()); //Get the state object representing the subscription from the ConsumerDispatcher ConsumerDispatcherState subState = cd.getConsumerDispatcherState(); ConsumerSessionImpl consumer = null; // Synchronize on the close object, we don't want the connection closing // while we try to add the subscription. synchronized (this) { // See if this connection has been closed checkNotClosed(); //create the consumer session for this subscription try { consumer = new ConsumerSessionImpl(destination, destinationAddress, subState, this, enableReadAhead, false, unrecoverableReliability, bifurcatable, true, false); // depends on control dependency: [try], data = [none] } catch (SINotPossibleInCurrentConfigurationException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createConsumerSessionForDurableSubscription", "SIErrorException"); throw new SIErrorException(e); } catch (SISessionUnavailableException e) // depends on control dependency: [catch], data = [none] { // FFDC FFDCFilter .processException( e, "com.ibm.ws.sib.processor.impl.ConnectionImpl.createConsumerSessionForDurableSubscription", "1:2129:1.347.1.25", this); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:1809:1.285", e }); // This should never be thrown if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createConsumerSessionForDurableSubscription", "SIErrorException"); throw new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:2146:1.347.1.25", e }, null), e); } catch (SITemporaryDestinationNotFoundException e) // depends on control dependency: [catch], data = [none] { // FFDC FFDCFilter .processException( e, "com.ibm.ws.sib.processor.impl.ConnectionImpl.createConsumerSessionForDurableSubscription", "1:2159:1.347.1.25", this); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:2165:1.347.1.25", e }); // This should never be thrown if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createConsumerSessionForDurableSubscription", "SIErrorException"); throw new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:2176:1.347.1.25", e }, null), e); } catch (SINonDurableSubscriptionMismatchException e) // depends on control dependency: [catch], data = [none] { SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:1953:1.347.1.25", e }); // This should never be thrown if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createConsumerSessionForDurableSubscription", "SIErrorException"); throw new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.ConnectionImpl", "1:1964:1.347.1.25", e }, null), e); } // depends on control dependency: [catch], data = [none] synchronized (_consumers) { //store a reference _consumers.add(consumer); } _messageProcessor.addConsumer(consumer); } if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled()) SibTr.exit(CoreSPIConnection.tc, "createConsumerSessionForDurableSubscription", consumer); return consumer; } }
public class class_name { @SuppressWarnings("unchecked") public static <T, X extends Exception> T retry( CheckedCallable<T, X> callable, BackOff backoff, RetryDeterminer<? super X> retryDet, Class<X> classType, Sleeper sleeper) throws X, InterruptedException { checkNotNull(backoff, "Must provide a non-null BackOff."); checkNotNull(retryDet, "Must provide a non-null RetryDeterminer."); checkNotNull(sleeper, "Must provide a non-null Sleeper."); checkNotNull(callable, "Must provide a non-null Executable object."); X currentException; do { try { return callable.call(); } catch (Exception e) { if (classType.isInstance(e)) { // e is something that extends X currentException = (X) e; if (!retryDet.shouldRetry(currentException)) { throw currentException; } } else { if (e instanceof RuntimeException) { throw (RuntimeException) e; } throw new RuntimeException( "Retrying with unchecked exceptions that are not RuntimeExceptions is not supported.", e); } } } while (nextSleep(backoff, sleeper, currentException)); throw currentException; } }
public class class_name { @SuppressWarnings("unchecked") public static <T, X extends Exception> T retry( CheckedCallable<T, X> callable, BackOff backoff, RetryDeterminer<? super X> retryDet, Class<X> classType, Sleeper sleeper) throws X, InterruptedException { checkNotNull(backoff, "Must provide a non-null BackOff."); checkNotNull(retryDet, "Must provide a non-null RetryDeterminer."); checkNotNull(sleeper, "Must provide a non-null Sleeper."); checkNotNull(callable, "Must provide a non-null Executable object."); X currentException; do { try { return callable.call(); // depends on control dependency: [try], data = [none] } catch (Exception e) { if (classType.isInstance(e)) { // e is something that extends X currentException = (X) e; // depends on control dependency: [if], data = [none] if (!retryDet.shouldRetry(currentException)) { throw currentException; } } else { if (e instanceof RuntimeException) { throw (RuntimeException) e; } throw new RuntimeException( "Retrying with unchecked exceptions that are not RuntimeExceptions is not supported.", e); } } // depends on control dependency: [catch], data = [none] } while (nextSleep(backoff, sleeper, currentException)); throw currentException; } }
public class class_name { @Override public XMLEvent peek() throws XMLStreamException { final long currNodeKey = mAxis.getNode().getDataKey(); try { if (mCloseElements) { mRtx.moveTo(mStack.peek()); emitEndTag(); } else { final int nodeKind = mRtx.getNode().getKind(); if (((ITreeStructData)mRtx.getNode()).hasFirstChild()) { mRtx.moveTo(((ITreeStructData)mRtx.getNode()).getFirstChildKey()); emitNode(); } else if (((ITreeStructData)mRtx.getNode()).hasRightSibling()) { mRtx.moveTo(((ITreeStructData)mRtx.getNode()).getRightSiblingKey()); processNode(nodeKind); } else if (((ITreeStructData)mRtx.getNode()).hasParent()) { mRtx.moveTo(mRtx.getNode().getParentKey()); emitEndTag(); } } mRtx.moveTo(currNodeKey); } catch (final TTIOException exc) { throw new XMLStreamException(exc); } return mEvent; } }
public class class_name { @Override public XMLEvent peek() throws XMLStreamException { final long currNodeKey = mAxis.getNode().getDataKey(); try { if (mCloseElements) { mRtx.moveTo(mStack.peek()); // depends on control dependency: [if], data = [none] emitEndTag(); // depends on control dependency: [if], data = [none] } else { final int nodeKind = mRtx.getNode().getKind(); if (((ITreeStructData)mRtx.getNode()).hasFirstChild()) { mRtx.moveTo(((ITreeStructData)mRtx.getNode()).getFirstChildKey()); // depends on control dependency: [if], data = [none] emitNode(); // depends on control dependency: [if], data = [none] } else if (((ITreeStructData)mRtx.getNode()).hasRightSibling()) { mRtx.moveTo(((ITreeStructData)mRtx.getNode()).getRightSiblingKey()); // depends on control dependency: [if], data = [none] processNode(nodeKind); // depends on control dependency: [if], data = [none] } else if (((ITreeStructData)mRtx.getNode()).hasParent()) { mRtx.moveTo(mRtx.getNode().getParentKey()); // depends on control dependency: [if], data = [none] emitEndTag(); // depends on control dependency: [if], data = [none] } } mRtx.moveTo(currNodeKey); } catch (final TTIOException exc) { throw new XMLStreamException(exc); } return mEvent; } }
public class class_name { public static void subQuad (double[] coef, double t0, boolean left) { if (left) { coef[2] = (1 - t0) * coef[0] + t0 * coef[2]; coef[3] = (1 - t0) * coef[1] + t0 * coef[3]; } else { coef[2] = (1 - t0) * coef[2] + t0 * coef[4]; coef[3] = (1 - t0) * coef[3] + t0 * coef[5]; } } }
public class class_name { public static void subQuad (double[] coef, double t0, boolean left) { if (left) { coef[2] = (1 - t0) * coef[0] + t0 * coef[2]; // depends on control dependency: [if], data = [none] coef[3] = (1 - t0) * coef[1] + t0 * coef[3]; // depends on control dependency: [if], data = [none] } else { coef[2] = (1 - t0) * coef[2] + t0 * coef[4]; // depends on control dependency: [if], data = [none] coef[3] = (1 - t0) * coef[3] + t0 * coef[5]; // depends on control dependency: [if], data = [none] } } }
public class class_name { public static boolean isValid(AppIdToken appIdToken, String appId, String token) { if (appIdToken == null || StringUtil.isEmpty(appId) || StringUtil.isEmpty(token)) { return false; } return appIdToken.appId.equals(appId) && appIdToken.token.equals(token); } }
public class class_name { public static boolean isValid(AppIdToken appIdToken, String appId, String token) { if (appIdToken == null || StringUtil.isEmpty(appId) || StringUtil.isEmpty(token)) { return false; // depends on control dependency: [if], data = [none] } return appIdToken.appId.equals(appId) && appIdToken.token.equals(token); } }
public class class_name { public Task<T> batchable(final String desc, final K key) { Task<T> batchableTask = Task.async(desc, ctx -> { final BatchPromise<T> result = new BatchPromise<>(); final Long planId = ctx.getPlanId(); final GroupBatchBuilder builder = _batches.computeIfAbsent(planId, k -> new GroupBatchBuilder()); final G group = classify(key); Batch<K, T> fullBatch = builder.add(group, key, ctx.getShallowTraceBuilder(), result); if (fullBatch != null) { try { ctx.run(taskForBatch(group, fullBatch, true)); } catch (Throwable t) { //we don't care if some of promises have already been completed //all we care is that all remaining promises have been failed fullBatch.failAll(t); } } return result; }); batchableTask.getShallowTraceBuilder().setTaskType("batched"); return batchableTask; } }
public class class_name { public Task<T> batchable(final String desc, final K key) { Task<T> batchableTask = Task.async(desc, ctx -> { final BatchPromise<T> result = new BatchPromise<>(); final Long planId = ctx.getPlanId(); final GroupBatchBuilder builder = _batches.computeIfAbsent(planId, k -> new GroupBatchBuilder()); final G group = classify(key); Batch<K, T> fullBatch = builder.add(group, key, ctx.getShallowTraceBuilder(), result); if (fullBatch != null) { try { ctx.run(taskForBatch(group, fullBatch, true)); // depends on control dependency: [try], data = [none] } catch (Throwable t) { //we don't care if some of promises have already been completed //all we care is that all remaining promises have been failed fullBatch.failAll(t); } // depends on control dependency: [catch], data = [none] } return result; }); batchableTask.getShallowTraceBuilder().setTaskType("batched"); return batchableTask; } }
public class class_name { protected <A> A getTypedParam(String paramName, String errorMessage, Class<A> clazz, Map<String, Object> mapToUse) throws IOException { Object o = mapToUse.get(paramName); if (o != null && clazz.isAssignableFrom(o.getClass())) { return (A) o; } else { if (errorMessage != null) { throw new IOException(errorMessage); } else { return null; } } } }
public class class_name { protected <A> A getTypedParam(String paramName, String errorMessage, Class<A> clazz, Map<String, Object> mapToUse) throws IOException { Object o = mapToUse.get(paramName); if (o != null && clazz.isAssignableFrom(o.getClass())) { return (A) o; } else { if (errorMessage != null) { throw new IOException(errorMessage); } else { return null; // depends on control dependency: [if], data = [none] } } } }
public class class_name { @Override public void delete() { for(Trainable t : bundle.values()) { if(t != null) { t.delete(); } } bundle.clear(); } }
public class class_name { @Override public void delete() { for(Trainable t : bundle.values()) { if(t != null) { t.delete(); // depends on control dependency: [if], data = [none] } } bundle.clear(); } }
public class class_name { private static String getWorkerMetricName(String name) { String result = CACHED_METRICS.get(name); if (result != null) { return result; } return CACHED_METRICS.computeIfAbsent(name, n -> getMetricNameWithUniqueId(InstanceType.WORKER, name)); } }
public class class_name { private static String getWorkerMetricName(String name) { String result = CACHED_METRICS.get(name); if (result != null) { return result; // depends on control dependency: [if], data = [none] } return CACHED_METRICS.computeIfAbsent(name, n -> getMetricNameWithUniqueId(InstanceType.WORKER, name)); } }
public class class_name { protected Collection<Response> findPossibleResponses(Rule rule) { Collection<Response> possibleResponses = new ArrayList<Response>(); for (Rule configuredRule : appSensorServer.getConfiguration().getRules()) { if (configuredRule.equals(rule)) { possibleResponses = configuredRule.getResponses(); break; } } return possibleResponses; } }
public class class_name { protected Collection<Response> findPossibleResponses(Rule rule) { Collection<Response> possibleResponses = new ArrayList<Response>(); for (Rule configuredRule : appSensorServer.getConfiguration().getRules()) { if (configuredRule.equals(rule)) { possibleResponses = configuredRule.getResponses(); // depends on control dependency: [if], data = [none] break; } } return possibleResponses; } }
public class class_name { public int activeGroupCount() { int ngroupsSnapshot; ThreadGroup[] groupsSnapshot; synchronized (this) { if (destroyed) { return 0; } ngroupsSnapshot = ngroups; if (groups != null) { groupsSnapshot = Arrays.copyOf(groups, ngroupsSnapshot); } else { groupsSnapshot = null; } } int n = ngroupsSnapshot; for (int i = 0 ; i < ngroupsSnapshot ; i++) { n += groupsSnapshot[i].activeGroupCount(); } return n; } }
public class class_name { public int activeGroupCount() { int ngroupsSnapshot; ThreadGroup[] groupsSnapshot; synchronized (this) { if (destroyed) { return 0; // depends on control dependency: [if], data = [none] } ngroupsSnapshot = ngroups; if (groups != null) { groupsSnapshot = Arrays.copyOf(groups, ngroupsSnapshot); // depends on control dependency: [if], data = [(groups] } else { groupsSnapshot = null; // depends on control dependency: [if], data = [none] } } int n = ngroupsSnapshot; for (int i = 0 ; i < ngroupsSnapshot ; i++) { n += groupsSnapshot[i].activeGroupCount(); // depends on control dependency: [for], data = [i] } return n; } }
public class class_name { public CreateUserPoolClientRequest withLogoutURLs(String... logoutURLs) { if (this.logoutURLs == null) { setLogoutURLs(new java.util.ArrayList<String>(logoutURLs.length)); } for (String ele : logoutURLs) { this.logoutURLs.add(ele); } return this; } }
public class class_name { public CreateUserPoolClientRequest withLogoutURLs(String... logoutURLs) { if (this.logoutURLs == null) { setLogoutURLs(new java.util.ArrayList<String>(logoutURLs.length)); // depends on control dependency: [if], data = [none] } for (String ele : logoutURLs) { this.logoutURLs.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { @Override public byte[] toBytes(Object object) { if (object == null) { return null; } Character data = null; if (object.getClass().isAssignableFrom(String.class)) { data = ((String) object).charAt(0); } else { data = (Character) object; } return new byte[] { (byte) ((data >> 8) & 0xff), (byte) ((data >> 0) & 0xff), }; } }
public class class_name { @Override public byte[] toBytes(Object object) { if (object == null) { return null; // depends on control dependency: [if], data = [none] } Character data = null; if (object.getClass().isAssignableFrom(String.class)) { data = ((String) object).charAt(0); // depends on control dependency: [if], data = [none] } else { data = (Character) object; // depends on control dependency: [if], data = [none] } return new byte[] { (byte) ((data >> 8) & 0xff), (byte) ((data >> 0) & 0xff), }; } }
public class class_name { public int drainTo(Collection<? super T> c, int max_elements) { int num=Math.min(count, max_elements); // count may increase in the mean time, but that's ok if(num == 0) return num; int read_index=ri; // no lock as we're the only reader for(int i=0; i < num; i++) { int real_index=realIndex(read_index +i); c.add(buf[real_index]); buf[real_index]=null; } publishReadIndex(num); return num; } }
public class class_name { public int drainTo(Collection<? super T> c, int max_elements) { int num=Math.min(count, max_elements); // count may increase in the mean time, but that's ok if(num == 0) return num; int read_index=ri; // no lock as we're the only reader for(int i=0; i < num; i++) { int real_index=realIndex(read_index +i); c.add(buf[real_index]); // depends on control dependency: [for], data = [none] buf[real_index]=null; // depends on control dependency: [for], data = [none] } publishReadIndex(num); return num; } }
public class class_name { public void invalidateAll(final String sessionId) { // tell all contexts that may have a session object with this id to // get rid of them Handler[] contexts = _server.getChildHandlersByClass(ContextHandler.class); for (int i = 0; contexts != null && i < contexts.length; i++) { SessionHandler sessionHandler = ((ContextHandler) contexts[i]).getChildHandlerByClass(SessionHandler.class); if (sessionHandler != null) { SessionManager manager = sessionHandler.getSessionManager(); if (manager != null && manager instanceof KeyValueStoreSessionManager) { ((KeyValueStoreSessionManager) manager).invalidateSession(sessionId); } } } } }
public class class_name { public void invalidateAll(final String sessionId) { // tell all contexts that may have a session object with this id to // get rid of them Handler[] contexts = _server.getChildHandlersByClass(ContextHandler.class); for (int i = 0; contexts != null && i < contexts.length; i++) { SessionHandler sessionHandler = ((ContextHandler) contexts[i]).getChildHandlerByClass(SessionHandler.class); if (sessionHandler != null) { SessionManager manager = sessionHandler.getSessionManager(); if (manager != null && manager instanceof KeyValueStoreSessionManager) { ((KeyValueStoreSessionManager) manager).invalidateSession(sessionId); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public static Xpp3Dom getBuildPluginConfiguration(AbstractWisdomMojo mojo, String artifactId, String goal) { List<Plugin> plugins = mojo.project.getBuildPlugins(); Plugin plugin = null; for (Plugin plug : plugins) { if (plug.getArtifactId().equals(artifactId)) { plugin = plug; } } if (plugin == null) { // Not found return null; } if (goal != null) { // Check main execution List<String> globalGoals = (List<String>) plugin.getGoals(); if (globalGoals != null && globalGoals.contains(goal)) { return (Xpp3Dom) plugin.getConfiguration(); } // Check executions for (PluginExecution execution : plugin.getExecutions()) { if (execution.getGoals().contains(goal)) { return (Xpp3Dom) execution.getConfiguration(); } } } // Global configuration. return (Xpp3Dom) plugin.getConfiguration(); } }
public class class_name { public static Xpp3Dom getBuildPluginConfiguration(AbstractWisdomMojo mojo, String artifactId, String goal) { List<Plugin> plugins = mojo.project.getBuildPlugins(); Plugin plugin = null; for (Plugin plug : plugins) { if (plug.getArtifactId().equals(artifactId)) { plugin = plug; // depends on control dependency: [if], data = [none] } } if (plugin == null) { // Not found return null; // depends on control dependency: [if], data = [none] } if (goal != null) { // Check main execution List<String> globalGoals = (List<String>) plugin.getGoals(); if (globalGoals != null && globalGoals.contains(goal)) { return (Xpp3Dom) plugin.getConfiguration(); // depends on control dependency: [if], data = [none] } // Check executions for (PluginExecution execution : plugin.getExecutions()) { if (execution.getGoals().contains(goal)) { return (Xpp3Dom) execution.getConfiguration(); // depends on control dependency: [if], data = [none] } } } // Global configuration. return (Xpp3Dom) plugin.getConfiguration(); } }
public class class_name { public <V extends Comparable<? super V>> OptionalLong maxBy(LongFunction<V> keyExtractor) { ObjLongBox<V> result = collect(() -> new ObjLongBox<>(null, 0), (box, i) -> { V val = Objects.requireNonNull(keyExtractor.apply(i)); if (box.a == null || box.a.compareTo(val) < 0) { box.a = val; box.b = i; } }, (box1, box2) -> { if (box2.a != null && (box1.a == null || box1.a.compareTo(box2.a) < 0)) { box1.a = box2.a; box1.b = box2.b; } }); return result.a == null ? OptionalLong.empty() : OptionalLong.of(result.b); } }
public class class_name { public <V extends Comparable<? super V>> OptionalLong maxBy(LongFunction<V> keyExtractor) { ObjLongBox<V> result = collect(() -> new ObjLongBox<>(null, 0), (box, i) -> { V val = Objects.requireNonNull(keyExtractor.apply(i)); if (box.a == null || box.a.compareTo(val) < 0) { box.a = val; // depends on control dependency: [if], data = [none] box.b = i; // depends on control dependency: [if], data = [none] } }, (box1, box2) -> { if (box2.a != null && (box1.a == null || box1.a.compareTo(box2.a) < 0)) { box1.a = box2.a; box1.b = box2.b; } }); return result.a == null ? OptionalLong.empty() : OptionalLong.of(result.b); } }
public class class_name { public ListRetirableGrantsResult withGrants(GrantListEntry... grants) { if (this.grants == null) { setGrants(new com.amazonaws.internal.SdkInternalList<GrantListEntry>(grants.length)); } for (GrantListEntry ele : grants) { this.grants.add(ele); } return this; } }
public class class_name { public ListRetirableGrantsResult withGrants(GrantListEntry... grants) { if (this.grants == null) { setGrants(new com.amazonaws.internal.SdkInternalList<GrantListEntry>(grants.length)); // depends on control dependency: [if], data = [none] } for (GrantListEntry ele : grants) { this.grants.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { private static int componentSize(Component component, FormSpec formSpec, int cellSize, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure) { if (formSpec == null) { return prefMeasure.sizeOf(component); } else if (formSpec.getSize() == Sizes.MINIMUM) { return minMeasure.sizeOf(component); } else if (formSpec.getSize() == Sizes.PREFERRED) { return prefMeasure.sizeOf(component); } else { // default mode return Math.min(cellSize, prefMeasure.sizeOf(component)); } } }
public class class_name { private static int componentSize(Component component, FormSpec formSpec, int cellSize, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure) { if (formSpec == null) { return prefMeasure.sizeOf(component); // depends on control dependency: [if], data = [none] } else if (formSpec.getSize() == Sizes.MINIMUM) { return minMeasure.sizeOf(component); // depends on control dependency: [if], data = [none] } else if (formSpec.getSize() == Sizes.PREFERRED) { return prefMeasure.sizeOf(component); // depends on control dependency: [if], data = [none] } else { // default mode return Math.min(cellSize, prefMeasure.sizeOf(component)); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static JSONObject getWidgetConfigurationAsJSON(String widgetConfiguration) { JSONObject result = new JSONObject(); if (CmsStringUtil.isEmptyOrWhitespaceOnly(widgetConfiguration)) { return result; } Map<String, String> confEntries = CmsStringUtil.splitAsMap( widgetConfiguration, CONF_PARAM_SEPARATOR, CONF_KEYVALUE_SEPARATOR); for (Map.Entry<String, String> entry : confEntries.entrySet()) { try { result.put(entry.getKey(), entry.getValue()); } catch (JSONException e) { // should never happen LOG.error( Messages.get().container(Messages.ERR_XMLCONTENT_UNKNOWN_ELEM_PATH_SCHEMA_1, widgetConfiguration), e); } } return result; } }
public class class_name { public static JSONObject getWidgetConfigurationAsJSON(String widgetConfiguration) { JSONObject result = new JSONObject(); if (CmsStringUtil.isEmptyOrWhitespaceOnly(widgetConfiguration)) { return result; // depends on control dependency: [if], data = [none] } Map<String, String> confEntries = CmsStringUtil.splitAsMap( widgetConfiguration, CONF_PARAM_SEPARATOR, CONF_KEYVALUE_SEPARATOR); for (Map.Entry<String, String> entry : confEntries.entrySet()) { try { result.put(entry.getKey(), entry.getValue()); // depends on control dependency: [try], data = [none] } catch (JSONException e) { // should never happen LOG.error( Messages.get().container(Messages.ERR_XMLCONTENT_UNKNOWN_ELEM_PATH_SCHEMA_1, widgetConfiguration), e); } // depends on control dependency: [catch], data = [none] } return result; } }
public class class_name { private boolean shouldCreateExternalURLForService(Service service, String id) { if ("kubernetes".equals(id) || "kubernetes-ro".equals(id)) { return false; } Set<Integer> ports = getPorts(service); log.debug("Service " + id + " has ports: " + ports); if (ports.size() == 1) { String type = null; ServiceSpec spec = service.getSpec(); if (spec != null) { type = spec.getType(); if (Objects.equals(type, "LoadBalancer")) { return true; } } log.info("Not generating route for service " + id + " type is not LoadBalancer: " + type); return false; } else { log.info("Not generating route for service " + id + " as only single port services are supported. Has ports: " + ports); return false; } } }
public class class_name { private boolean shouldCreateExternalURLForService(Service service, String id) { if ("kubernetes".equals(id) || "kubernetes-ro".equals(id)) { return false; // depends on control dependency: [if], data = [none] } Set<Integer> ports = getPorts(service); log.debug("Service " + id + " has ports: " + ports); if (ports.size() == 1) { String type = null; ServiceSpec spec = service.getSpec(); if (spec != null) { type = spec.getType(); // depends on control dependency: [if], data = [none] if (Objects.equals(type, "LoadBalancer")) { return true; // depends on control dependency: [if], data = [none] } } log.info("Not generating route for service " + id + " type is not LoadBalancer: " + type); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } else { log.info("Not generating route for service " + id + " as only single port services are supported. Has ports: " + ports); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { public void process() { // are we ready to process yet, or have we had an error, and are // waiting a bit longer in the hope that it will resolve itself? if (error_skips > 0) { error_skips--; return; } try { if (logger != null) logger.debug("Starting processing"); status = "Processing"; lastCheck = System.currentTimeMillis(); // FIXME: how to break off processing if we don't want to keep going? processor.deduplicate(batch_size); status = "Sleeping"; if (logger != null) logger.debug("Finished processing"); } catch (Throwable e) { status = "Thread blocked on error: " + e; if (logger != null) logger.error("Error in processing; waiting", e); error_skips = error_factor; } } }
public class class_name { public void process() { // are we ready to process yet, or have we had an error, and are // waiting a bit longer in the hope that it will resolve itself? if (error_skips > 0) { error_skips--; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } try { if (logger != null) logger.debug("Starting processing"); status = "Processing"; // depends on control dependency: [try], data = [none] lastCheck = System.currentTimeMillis(); // depends on control dependency: [try], data = [none] // FIXME: how to break off processing if we don't want to keep going? processor.deduplicate(batch_size); // depends on control dependency: [try], data = [none] status = "Sleeping"; // depends on control dependency: [try], data = [none] if (logger != null) logger.debug("Finished processing"); } catch (Throwable e) { status = "Thread blocked on error: " + e; if (logger != null) logger.error("Error in processing; waiting", e); error_skips = error_factor; } // depends on control dependency: [catch], data = [none] } }
public class class_name { @SuppressWarnings("unchecked") private void decorateCanInvoke(Map<String, Object> mBeanInfo, String method, boolean canInvoke) { LOG.trace("decorateCanInvoke: {} - {}", method, canInvoke); // op String[] methodNameAndArgs = method.split("[()]"); Object op = ((Map<String, Object>) mBeanInfo.get("op")).get(methodNameAndArgs[0]); if (op instanceof List) { // for method overloading List<Map<String, Object>> overloaded = (List<Map<String, Object>>) op; for (Map<String, Object> m : overloaded) { String args = argsToString((List<Map<String, String>>) m.get("args")); if ((methodNameAndArgs.length == 1 && args.equals("")) || (methodNameAndArgs.length > 1 && args.equals(methodNameAndArgs[1]))) { m.put("canInvoke", canInvoke); LOG.trace(" op: {}({}) - {}", methodNameAndArgs[0], args, m.get("canInvoke")); break; } } } else { ((Map<String, Object>) op).put("canInvoke", canInvoke); LOG.trace(" op: {} - {}", method, ((Map<String, Object>) op).get("canInvoke")); } // opByString Map<String, Object> opByString = (Map<String, Object>) mBeanInfo.get("opByString"); Map<String, Object> opByStringMethod = (Map<String, Object>) opByString.get(method); opByStringMethod.put("canInvoke", canInvoke); LOG.trace(" opByString: {} - {}", method, opByStringMethod.get("canInvoke")); } }
public class class_name { @SuppressWarnings("unchecked") private void decorateCanInvoke(Map<String, Object> mBeanInfo, String method, boolean canInvoke) { LOG.trace("decorateCanInvoke: {} - {}", method, canInvoke); // op String[] methodNameAndArgs = method.split("[()]"); Object op = ((Map<String, Object>) mBeanInfo.get("op")).get(methodNameAndArgs[0]); if (op instanceof List) { // for method overloading List<Map<String, Object>> overloaded = (List<Map<String, Object>>) op; for (Map<String, Object> m : overloaded) { String args = argsToString((List<Map<String, String>>) m.get("args")); if ((methodNameAndArgs.length == 1 && args.equals("")) || (methodNameAndArgs.length > 1 && args.equals(methodNameAndArgs[1]))) { m.put("canInvoke", canInvoke); // depends on control dependency: [if], data = [none] LOG.trace(" op: {}({}) - {}", methodNameAndArgs[0], args, m.get("canInvoke")); // depends on control dependency: [if], data = [none] break; } } } else { ((Map<String, Object>) op).put("canInvoke", canInvoke); // depends on control dependency: [if], data = [none] LOG.trace(" op: {} - {}", method, ((Map<String, Object>) op).get("canInvoke")); // depends on control dependency: [if], data = [none] } // opByString Map<String, Object> opByString = (Map<String, Object>) mBeanInfo.get("opByString"); Map<String, Object> opByStringMethod = (Map<String, Object>) opByString.get(method); opByStringMethod.put("canInvoke", canInvoke); LOG.trace(" opByString: {} - {}", method, opByStringMethod.get("canInvoke")); } }
public class class_name { public ClassDocImpl loadClass(String name) { try { ClassSymbol c = reader.loadClass(names.fromString(name)); return getClassDoc(c); } catch (CompletionFailure ex) { chk.completionError(null, ex); return null; } } }
public class class_name { public ClassDocImpl loadClass(String name) { try { ClassSymbol c = reader.loadClass(names.fromString(name)); return getClassDoc(c); // depends on control dependency: [try], data = [none] } catch (CompletionFailure ex) { chk.completionError(null, ex); return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static void setCloseConnection(Stub stub, boolean close) { Hashtable headers = getRequestHeaders(stub); if (close) { headers.put(HTTPConstants.HEADER_CONNECTION, HTTPConstants.HEADER_CONNECTION_CLOSE); } else { headers.remove(HTTPConstants.HEADER_CONNECTION); } } }
public class class_name { public static void setCloseConnection(Stub stub, boolean close) { Hashtable headers = getRequestHeaders(stub); if (close) { headers.put(HTTPConstants.HEADER_CONNECTION, HTTPConstants.HEADER_CONNECTION_CLOSE); // depends on control dependency: [if], data = [none] } else { headers.remove(HTTPConstants.HEADER_CONNECTION); // depends on control dependency: [if], data = [none] } } }
public class class_name { public java.util.List<AccountQuota> getAccountQuotas() { if (accountQuotas == null) { accountQuotas = new com.amazonaws.internal.SdkInternalList<AccountQuota>(); } return accountQuotas; } }
public class class_name { public java.util.List<AccountQuota> getAccountQuotas() { if (accountQuotas == null) { accountQuotas = new com.amazonaws.internal.SdkInternalList<AccountQuota>(); // depends on control dependency: [if], data = [none] } return accountQuotas; } }
public class class_name { static void assign(ManyValueAttributeValue v1, AttributeValue v2) { if (v2 != null) { v1.setTopType(v2.getType()); } if (v2 == null || !v2.isAssigned()) { v1.setMultipleValues(true); } else { assert v2.isAssigned(); if (!v1.isAssigned()) { v1.setValue(v2); } else if (!v2.equals(v1)) { v1.setMultipleValues(true); if (!v1.isAssignableFrom(v2)) { if (!v2.isAssignableFrom(v1)) { v1.setInternalValue(null, AttributeType.OBJECT); } else { v1.setInternalValue(null, v2.getType()); } } } } } }
public class class_name { static void assign(ManyValueAttributeValue v1, AttributeValue v2) { if (v2 != null) { v1.setTopType(v2.getType()); // depends on control dependency: [if], data = [(v2] } if (v2 == null || !v2.isAssigned()) { v1.setMultipleValues(true); // depends on control dependency: [if], data = [none] } else { assert v2.isAssigned(); if (!v1.isAssigned()) { v1.setValue(v2); // depends on control dependency: [if], data = [none] } else if (!v2.equals(v1)) { v1.setMultipleValues(true); // depends on control dependency: [if], data = [none] if (!v1.isAssignableFrom(v2)) { if (!v2.isAssignableFrom(v1)) { v1.setInternalValue(null, AttributeType.OBJECT); // depends on control dependency: [if], data = [none] } else { v1.setInternalValue(null, v2.getType()); // depends on control dependency: [if], data = [none] } } } } } }
public class class_name { protected Rectangle pushScissorState (int x, int y, int width, int height) { // grow the scissors buffer if necessary if (scissorDepth == scissors.size()) { scissors.add(new Rectangle()); } Rectangle r = scissors.get(scissorDepth); if (scissorDepth == 0) { r.setBounds(x, y, width, height); } else { // intersect current with previous Rectangle pr = scissors.get(scissorDepth - 1); r.setLocation(Math.max(pr.x, x), Math.max(pr.y, y)); r.setSize(Math.min(pr.maxX(), x + width - 1) - r.x, Math.min(pr.maxY(), y + height - 1) - r.y); } scissorDepth++; return r; } }
public class class_name { protected Rectangle pushScissorState (int x, int y, int width, int height) { // grow the scissors buffer if necessary if (scissorDepth == scissors.size()) { scissors.add(new Rectangle()); // depends on control dependency: [if], data = [none] } Rectangle r = scissors.get(scissorDepth); if (scissorDepth == 0) { r.setBounds(x, y, width, height); // depends on control dependency: [if], data = [none] } else { // intersect current with previous Rectangle pr = scissors.get(scissorDepth - 1); r.setLocation(Math.max(pr.x, x), Math.max(pr.y, y)); // depends on control dependency: [if], data = [none] r.setSize(Math.min(pr.maxX(), x + width - 1) - r.x, Math.min(pr.maxY(), y + height - 1) - r.y); // depends on control dependency: [if], data = [none] } scissorDepth++; return r; } }
public class class_name { Map<Integer, Integer> initParentMap() { Map<Integer, Integer> parentMap = new LinkedHashMap<>(numWorkers); for(int r = 0; r < numWorkers; r++) { parentMap.put(r, ((r + 1) / 2 - 1) ); } return parentMap; } }
public class class_name { Map<Integer, Integer> initParentMap() { Map<Integer, Integer> parentMap = new LinkedHashMap<>(numWorkers); for(int r = 0; r < numWorkers; r++) { parentMap.put(r, ((r + 1) / 2 - 1) ); // depends on control dependency: [for], data = [r] } return parentMap; } }
public class class_name { protected void callInvalidateFromInternalInvalidate() { if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "callInvalidateFromInternalInvalidate", "calling this.invalidate( false )"); } invalidate(false); } }
public class class_name { protected void callInvalidateFromInternalInvalidate() { if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "callInvalidateFromInternalInvalidate", "calling this.invalidate( false )"); // depends on control dependency: [if], data = [none] } invalidate(false); } }
public class class_name { protected void processPOTopicInjections(final POBuildData buildData, final SpecTopic specTopic, final Map<String, TranslationDetails> translations) { // Prerequisites addStringsFromTopicRelationships(buildData, specTopic.getPrerequisiteRelationships(), DocBookXMLPreProcessor.PREREQUISITE_PROPERTY, DocBookXMLPreProcessor.ROLE_PREREQUISITE, translations); // See also addStringsFromTopicRelationships(buildData, specTopic.getRelatedRelationships(), DocBookXMLPreProcessor.SEE_ALSO_PROPERTY, DocBookXMLPreProcessor.ROLE_SEE_ALSO, translations); // Link List addStringsFromTopicRelationships(buildData, specTopic.getLinkListRelationships(), null, DocBookXMLPreProcessor.ROLE_LINK_LIST, translations); // Previous final List<Relationship> prevRelationships = specTopic.getPreviousRelationships(); if (prevRelationships.size() > 1) { addStringsFromProcessRelationships(buildData, specTopic, prevRelationships, DocBookXMLPreProcessor.PREVIOUS_STEPS_PROPERTY, DocBookXMLPreProcessor.ROLE_PROCESS_PREVIOUS_LINK, DocBookXMLPreProcessor.ROLE_PROCESS_PREVIOUS_TITLE_LINK, translations); } else { addStringsFromProcessRelationships(buildData, specTopic, prevRelationships, DocBookXMLPreProcessor.PREVIOUS_STEP_PROPERTY, DocBookXMLPreProcessor.ROLE_PROCESS_PREVIOUS_LINK, DocBookXMLPreProcessor.ROLE_PROCESS_PREVIOUS_TITLE_LINK, translations); } // Next final List<Relationship> nextRelationships = specTopic.getNextRelationships(); if (nextRelationships.size() > 1) { addStringsFromProcessRelationships(buildData, specTopic, nextRelationships, DocBookXMLPreProcessor.NEXT_STEPS_PROPERTY, DocBookXMLPreProcessor.ROLE_PROCESS_NEXT_LINK, DocBookXMLPreProcessor.ROLE_PROCESS_NEXT_TITLE_LINK, translations); } else { addStringsFromProcessRelationships(buildData, specTopic, nextRelationships, DocBookXMLPreProcessor.NEXT_STEP_PROPERTY, DocBookXMLPreProcessor.ROLE_PROCESS_NEXT_LINK, DocBookXMLPreProcessor.ROLE_PROCESS_NEXT_TITLE_LINK, translations); } } }
public class class_name { protected void processPOTopicInjections(final POBuildData buildData, final SpecTopic specTopic, final Map<String, TranslationDetails> translations) { // Prerequisites addStringsFromTopicRelationships(buildData, specTopic.getPrerequisiteRelationships(), DocBookXMLPreProcessor.PREREQUISITE_PROPERTY, DocBookXMLPreProcessor.ROLE_PREREQUISITE, translations); // See also addStringsFromTopicRelationships(buildData, specTopic.getRelatedRelationships(), DocBookXMLPreProcessor.SEE_ALSO_PROPERTY, DocBookXMLPreProcessor.ROLE_SEE_ALSO, translations); // Link List addStringsFromTopicRelationships(buildData, specTopic.getLinkListRelationships(), null, DocBookXMLPreProcessor.ROLE_LINK_LIST, translations); // Previous final List<Relationship> prevRelationships = specTopic.getPreviousRelationships(); if (prevRelationships.size() > 1) { addStringsFromProcessRelationships(buildData, specTopic, prevRelationships, DocBookXMLPreProcessor.PREVIOUS_STEPS_PROPERTY, DocBookXMLPreProcessor.ROLE_PROCESS_PREVIOUS_LINK, DocBookXMLPreProcessor.ROLE_PROCESS_PREVIOUS_TITLE_LINK, translations); // depends on control dependency: [if], data = [none] } else { addStringsFromProcessRelationships(buildData, specTopic, prevRelationships, DocBookXMLPreProcessor.PREVIOUS_STEP_PROPERTY, DocBookXMLPreProcessor.ROLE_PROCESS_PREVIOUS_LINK, DocBookXMLPreProcessor.ROLE_PROCESS_PREVIOUS_TITLE_LINK, translations); // depends on control dependency: [if], data = [none] } // Next final List<Relationship> nextRelationships = specTopic.getNextRelationships(); if (nextRelationships.size() > 1) { addStringsFromProcessRelationships(buildData, specTopic, nextRelationships, DocBookXMLPreProcessor.NEXT_STEPS_PROPERTY, DocBookXMLPreProcessor.ROLE_PROCESS_NEXT_LINK, DocBookXMLPreProcessor.ROLE_PROCESS_NEXT_TITLE_LINK, translations); // depends on control dependency: [if], data = [none] } else { addStringsFromProcessRelationships(buildData, specTopic, nextRelationships, DocBookXMLPreProcessor.NEXT_STEP_PROPERTY, DocBookXMLPreProcessor.ROLE_PROCESS_NEXT_LINK, DocBookXMLPreProcessor.ROLE_PROCESS_NEXT_TITLE_LINK, translations); // depends on control dependency: [if], data = [none] } } }
public class class_name { private final void step1(boolean y) { if (b[k] == 's') { if (endWith("sses")) { k -= 2; } else if (endWith("ies")) { if (y && k-3 >= 0 && isConsonant(k-3)) { setto("y"); } else { setto("i"); } } else if (b[k - 1] != 's') { k--; } } if (endWith("eed")) { if (m() > 0) { k--; } } else if ((endWith("ed") || endWith("ing")) && vowelinstem()) { k = j; if (endWith("at")) { setto("ate"); } else if (endWith("bl")) { setto("ble"); } else if (endWith("iz")) { setto("ize"); } else if (y && endWith("i") && k-1 >= 0 && isConsonant(k-1)) { setto("y"); } else if (doublec(k)) { k--; { int ch = b[k]; if (ch == 'l' || ch == 's' || ch == 'z') { k++; } } } else if (m() == 1 && cvc(k)) { setto("e"); } } } }
public class class_name { private final void step1(boolean y) { if (b[k] == 's') { if (endWith("sses")) { k -= 2; // depends on control dependency: [if], data = [none] } else if (endWith("ies")) { if (y && k-3 >= 0 && isConsonant(k-3)) { setto("y"); // depends on control dependency: [if], data = [none] } else { setto("i"); // depends on control dependency: [if], data = [none] } } else if (b[k - 1] != 's') { k--; // depends on control dependency: [if], data = [none] } } if (endWith("eed")) { if (m() > 0) { k--; // depends on control dependency: [if], data = [none] } } else if ((endWith("ed") || endWith("ing")) && vowelinstem()) { k = j; // depends on control dependency: [if], data = [none] if (endWith("at")) { setto("ate"); // depends on control dependency: [if], data = [none] } else if (endWith("bl")) { setto("ble"); // depends on control dependency: [if], data = [none] } else if (endWith("iz")) { setto("ize"); // depends on control dependency: [if], data = [none] } else if (y && endWith("i") && k-1 >= 0 && isConsonant(k-1)) { setto("y"); // depends on control dependency: [if], data = [none] } else if (doublec(k)) { k--; // depends on control dependency: [if], data = [none] { int ch = b[k]; if (ch == 'l' || ch == 's' || ch == 'z') { k++; // depends on control dependency: [if], data = [none] } } } else if (m() == 1 && cvc(k)) { setto("e"); // depends on control dependency: [if], data = [none] } } } }
public class class_name { protected boolean extractPublicData(final Application pApplication) throws CommunicationException { boolean ret = false; // Select AID byte[] data = selectAID(pApplication.getAid()); // check response // Add SW_6285 to fix Interact issue if (ResponseUtils.contains(data, SwEnum.SW_9000, SwEnum.SW_6285)) { // Update reading state pApplication.setReadingStep(ApplicationStepEnum.SELECTED); // Parse select response ret = parse(data, pApplication); if (ret) { // Get AID String aid = BytesUtils.bytesToStringNoSpace(TlvUtil.getValue(data, EmvTags.DEDICATED_FILE_NAME)); String applicationLabel = extractApplicationLabel(data); if (applicationLabel == null) { applicationLabel = pApplication.getApplicationLabel(); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Application label:" + applicationLabel + " with Aid:" + aid); } template.get().getCard().setType(findCardScheme(aid, template.get().getCard().getCardNumber())); pApplication.setAid(BytesUtils.fromString(aid)); pApplication.setApplicationLabel(applicationLabel); pApplication.setLeftPinTry(getLeftPinTry()); pApplication.setTransactionCounter(getTransactionCounter()); template.get().getCard().setState(CardStateEnum.ACTIVE); } } return ret; } }
public class class_name { protected boolean extractPublicData(final Application pApplication) throws CommunicationException { boolean ret = false; // Select AID byte[] data = selectAID(pApplication.getAid()); // check response // Add SW_6285 to fix Interact issue if (ResponseUtils.contains(data, SwEnum.SW_9000, SwEnum.SW_6285)) { // Update reading state pApplication.setReadingStep(ApplicationStepEnum.SELECTED); // Parse select response ret = parse(data, pApplication); if (ret) { // Get AID String aid = BytesUtils.bytesToStringNoSpace(TlvUtil.getValue(data, EmvTags.DEDICATED_FILE_NAME)); String applicationLabel = extractApplicationLabel(data); if (applicationLabel == null) { applicationLabel = pApplication.getApplicationLabel(); // depends on control dependency: [if], data = [none] } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Application label:" + applicationLabel + " with Aid:" + aid); // depends on control dependency: [if], data = [none] } template.get().getCard().setType(findCardScheme(aid, template.get().getCard().getCardNumber())); // depends on control dependency: [if], data = [none] pApplication.setAid(BytesUtils.fromString(aid)); // depends on control dependency: [if], data = [none] pApplication.setApplicationLabel(applicationLabel); // depends on control dependency: [if], data = [none] pApplication.setLeftPinTry(getLeftPinTry()); // depends on control dependency: [if], data = [none] pApplication.setTransactionCounter(getTransactionCounter()); // depends on control dependency: [if], data = [none] template.get().getCard().setState(CardStateEnum.ACTIVE); // depends on control dependency: [if], data = [none] } } return ret; } }
public class class_name { public static Stream<String> propertiesReferenced( ICondition condition) { if( condition == null) { return Stream.empty(); } PropertyVisitor propertyVisitor = new PropertyVisitor(); condition.accept( propertyVisitor); return propertyVisitor.propertiesVisited(); } }
public class class_name { public static Stream<String> propertiesReferenced( ICondition condition) { if( condition == null) { return Stream.empty(); // depends on control dependency: [if], data = [none] } PropertyVisitor propertyVisitor = new PropertyVisitor(); condition.accept( propertyVisitor); return propertyVisitor.propertiesVisited(); } }
public class class_name { public static String getPostfixFromValue(String value) { String postfix = ""; Matcher m = patternPrePostFix.matcher(value); if (m.find()) { postfix = m.group(2); } return postfix; } }
public class class_name { public static String getPostfixFromValue(String value) { String postfix = ""; Matcher m = patternPrePostFix.matcher(value); if (m.find()) { postfix = m.group(2); // depends on control dependency: [if], data = [none] } return postfix; } }
public class class_name { public Token lookahead() { Token current = token; if (current.next == null) { current.next = token_source.getNextToken(); } return current.next; } }
public class class_name { public Token lookahead() { Token current = token; if (current.next == null) { current.next = token_source.getNextToken(); // depends on control dependency: [if], data = [none] } return current.next; } }
public class class_name { public Observable<ServiceResponse<OperationsListResultsInner>> listWithServiceResponseAsync() { if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<OperationsListResultsInner>>>() { @Override public Observable<ServiceResponse<OperationsListResultsInner>> call(Response<ResponseBody> response) { try { ServiceResponse<OperationsListResultsInner> clientResponse = listDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponse<OperationsListResultsInner>> listWithServiceResponseAsync() { if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<OperationsListResultsInner>>>() { @Override public Observable<ServiceResponse<OperationsListResultsInner>> call(Response<ResponseBody> response) { try { ServiceResponse<OperationsListResultsInner> clientResponse = listDelegate(response); return Observable.just(clientResponse); // depends on control dependency: [try], data = [none] } catch (Throwable t) { return Observable.error(t); } // depends on control dependency: [catch], data = [none] } }); } }
public class class_name { public PhotoList<Photo> getPhotos(String galleryId, Set<String> extras, int perPage, int page) throws FlickrException { PhotoList<Photo> photos = new PhotoList<Photo>(); Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_PHOTOS); parameters.put("gallery_id", galleryId); if (extras != null) { StringBuffer sb = new StringBuffer(); Iterator<String> it = extras.iterator(); for (int i = 0; it.hasNext(); i++) { if (i > 0) { sb.append(","); } sb.append(it.next()); } parameters.put(Extras.KEY_EXTRAS, sb.toString()); } if (perPage > 0) { parameters.put("per_page", String.valueOf(perPage)); } if (page > 0) { parameters.put("page", String.valueOf(page)); } Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element photosElement = response.getPayload(); photos.setPage(photosElement.getAttribute("page")); photos.setPages(photosElement.getAttribute("pages")); photos.setPerPage(photosElement.getAttribute("perpage")); photos.setTotal(photosElement.getAttribute("total")); NodeList photoNodes = photosElement.getElementsByTagName("photo"); for (int i = 0; i < photoNodes.getLength(); i++) { Element photoElement = (Element) photoNodes.item(i); Photo photo = new Photo(); photo.setId(photoElement.getAttribute("id")); photo.setSecret(photoElement.getAttribute("secret")); User owner = new User(); owner.setId(photoElement.getAttribute("owner")); photo.setOwner(owner); photo.setUrl("https://flickr.com/photos/" + owner.getId() + "/" + photo.getId()); photo.setServer(photoElement.getAttribute("server")); photo.setFarm(photoElement.getAttribute("farm")); photo.setTitle(photoElement.getAttribute("title")); photo.setPublicFlag("1".equals(photoElement.getAttribute("ispublic"))); photo.setFriendFlag("1".equals(photoElement.getAttribute("isfriend"))); photo.setFamilyFlag("1".equals(photoElement.getAttribute("isfamily"))); photo.setPrimary("1".equals(photoElement.getAttribute("is_primary"))); photo.setComments(photoElement.getAttribute("has_comment")); photos.add(photo); } return photos; } }
public class class_name { public PhotoList<Photo> getPhotos(String galleryId, Set<String> extras, int perPage, int page) throws FlickrException { PhotoList<Photo> photos = new PhotoList<Photo>(); Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_PHOTOS); parameters.put("gallery_id", galleryId); if (extras != null) { StringBuffer sb = new StringBuffer(); Iterator<String> it = extras.iterator(); for (int i = 0; it.hasNext(); i++) { if (i > 0) { sb.append(","); // depends on control dependency: [if], data = [none] } sb.append(it.next()); } parameters.put(Extras.KEY_EXTRAS, sb.toString()); } if (perPage > 0) { parameters.put("per_page", String.valueOf(perPage)); } if (page > 0) { parameters.put("page", String.valueOf(page)); } Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element photosElement = response.getPayload(); photos.setPage(photosElement.getAttribute("page")); photos.setPages(photosElement.getAttribute("pages")); photos.setPerPage(photosElement.getAttribute("perpage")); photos.setTotal(photosElement.getAttribute("total")); NodeList photoNodes = photosElement.getElementsByTagName("photo"); for (int i = 0; i < photoNodes.getLength(); i++) { Element photoElement = (Element) photoNodes.item(i); Photo photo = new Photo(); photo.setId(photoElement.getAttribute("id")); photo.setSecret(photoElement.getAttribute("secret")); User owner = new User(); owner.setId(photoElement.getAttribute("owner")); photo.setOwner(owner); photo.setUrl("https://flickr.com/photos/" + owner.getId() + "/" + photo.getId()); photo.setServer(photoElement.getAttribute("server")); photo.setFarm(photoElement.getAttribute("farm")); photo.setTitle(photoElement.getAttribute("title")); photo.setPublicFlag("1".equals(photoElement.getAttribute("ispublic"))); photo.setFriendFlag("1".equals(photoElement.getAttribute("isfriend"))); photo.setFamilyFlag("1".equals(photoElement.getAttribute("isfamily"))); photo.setPrimary("1".equals(photoElement.getAttribute("is_primary"))); photo.setComments(photoElement.getAttribute("has_comment")); photos.add(photo); } return photos; } }
public class class_name { public static Timestamp toSqlTimestamp(Instant instant) { try { Timestamp ts = new Timestamp(instant.getEpochSecond() * 1000); ts.setNanos(instant.getNano()); return ts; } catch (ArithmeticException ex) { throw new IllegalArgumentException(ex); } } }
public class class_name { public static Timestamp toSqlTimestamp(Instant instant) { try { Timestamp ts = new Timestamp(instant.getEpochSecond() * 1000); ts.setNanos(instant.getNano()); // depends on control dependency: [try], data = [none] return ts; // depends on control dependency: [try], data = [none] } catch (ArithmeticException ex) { throw new IllegalArgumentException(ex); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void expand(final BoundingBox rhs) { if (rhs != null && rhs != this) { mVertices = appendArrays(mVertices, rhs.mVertices); mMinCorner.min(rhs.mMinCorner); mMaxCorner.max(rhs.mMaxCorner); Vector3f temp = new Vector3f(mMinCorner); mCenter = new Vector3f(mMinCorner.x + (mMaxCorner.x - mMinCorner.x) * .5f, mMinCorner.y + (mMaxCorner.y - mMinCorner.y) * .5f, mMinCorner.z + (mMaxCorner.z - mMinCorner.z) * .5f); temp.set(mMaxCorner); mRadius = temp.sub(mMinCorner).length() * .5f; } } }
public class class_name { public void expand(final BoundingBox rhs) { if (rhs != null && rhs != this) { mVertices = appendArrays(mVertices, rhs.mVertices); // depends on control dependency: [if], data = [none] mMinCorner.min(rhs.mMinCorner); // depends on control dependency: [if], data = [(rhs] mMaxCorner.max(rhs.mMaxCorner); // depends on control dependency: [if], data = [(rhs] Vector3f temp = new Vector3f(mMinCorner); mCenter = new Vector3f(mMinCorner.x + (mMaxCorner.x - mMinCorner.x) * .5f, mMinCorner.y + (mMaxCorner.y - mMinCorner.y) * .5f, mMinCorner.z + (mMaxCorner.z - mMinCorner.z) * .5f); // depends on control dependency: [if], data = [none] temp.set(mMaxCorner); // depends on control dependency: [if], data = [none] mRadius = temp.sub(mMinCorner).length() * .5f; // depends on control dependency: [if], data = [none] } } }
public class class_name { public void unlock(Locker locker) { // All access to the lockTable must be synchronized, even just checking // the size. Since this method is for a transaction and not a bean // type, it is difficult to tell when no Option A caching has been // involved. The performance impact should be minimal. d114715 synchronized (lockTable) { // If there are not locks, then don't do anything, including trace // entry/exit. Either there are no Option A beans, or there just // don't happen to be any locks. if (lockTable.size() == 0) { return; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "unlock", locker); // Loop through all of the locks in the table, and unlock any // locks held by the locker (containerTx). The containerTx // holds the lock if it is the locker or if it is the holder // on a true Lock object. Enumeration lockNames = lockTable.keys(); while (lockNames.hasMoreElements()) { Object lockName = lockNames.nextElement(); Object o = lockTable.get(lockName); if (o == locker) { unlock(lockName, locker); } else if (((LockProxy) o).isLock()) { if (((Lock) o).isHolder(locker)) { unlock(lockName, locker); } } // if isLock() } // while lockNames if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "unlock"); } // synchronized } }
public class class_name { public void unlock(Locker locker) { // All access to the lockTable must be synchronized, even just checking // the size. Since this method is for a transaction and not a bean // type, it is difficult to tell when no Option A caching has been // involved. The performance impact should be minimal. d114715 synchronized (lockTable) { // If there are not locks, then don't do anything, including trace // entry/exit. Either there are no Option A beans, or there just // don't happen to be any locks. if (lockTable.size() == 0) { return; // depends on control dependency: [if], data = [none] } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "unlock", locker); // Loop through all of the locks in the table, and unlock any // locks held by the locker (containerTx). The containerTx // holds the lock if it is the locker or if it is the holder // on a true Lock object. Enumeration lockNames = lockTable.keys(); while (lockNames.hasMoreElements()) { Object lockName = lockNames.nextElement(); Object o = lockTable.get(lockName); if (o == locker) { unlock(lockName, locker); // depends on control dependency: [if], data = [locker)] } else if (((LockProxy) o).isLock()) { if (((Lock) o).isHolder(locker)) { unlock(lockName, locker); // depends on control dependency: [if], data = [none] } } // if isLock() } // while lockNames if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "unlock"); } // synchronized } }
public class class_name { @Override public void recordProcessInstanceEnd(String processInstanceId, String deleteReason, String activityId) { if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) { HistoricProcessInstanceEntity historicProcessInstance = getHistoricProcessInstanceEntityManager().findById(processInstanceId); if (historicProcessInstance != null) { historicProcessInstance.markEnded(deleteReason); historicProcessInstance.setEndActivityId(activityId); // Fire event ActivitiEventDispatcher activitiEventDispatcher = getEventDispatcher(); if (activitiEventDispatcher != null && activitiEventDispatcher.isEnabled()) { activitiEventDispatcher.dispatchEvent( ActivitiEventBuilder.createEntityEvent(ActivitiEventType.HISTORIC_PROCESS_INSTANCE_ENDED, historicProcessInstance)); } } } } }
public class class_name { @Override public void recordProcessInstanceEnd(String processInstanceId, String deleteReason, String activityId) { if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) { HistoricProcessInstanceEntity historicProcessInstance = getHistoricProcessInstanceEntityManager().findById(processInstanceId); if (historicProcessInstance != null) { historicProcessInstance.markEnded(deleteReason); // depends on control dependency: [if], data = [none] historicProcessInstance.setEndActivityId(activityId); // depends on control dependency: [if], data = [none] // Fire event ActivitiEventDispatcher activitiEventDispatcher = getEventDispatcher(); if (activitiEventDispatcher != null && activitiEventDispatcher.isEnabled()) { activitiEventDispatcher.dispatchEvent( ActivitiEventBuilder.createEntityEvent(ActivitiEventType.HISTORIC_PROCESS_INSTANCE_ENDED, historicProcessInstance)); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public static void setPrivateField(final Object obj, final String name, final Object value) { try { final Field field = obj.getClass().getDeclaredField(name); field.setAccessible(true); field.set(obj, value); } catch (final Exception ex) { throw new RuntimeException("Couldn't set field '" + name + "' in class '" + obj.getClass() + "'", ex); } } }
public class class_name { public static void setPrivateField(final Object obj, final String name, final Object value) { try { final Field field = obj.getClass().getDeclaredField(name); field.setAccessible(true); // depends on control dependency: [try], data = [none] field.set(obj, value); // depends on control dependency: [try], data = [none] } catch (final Exception ex) { throw new RuntimeException("Couldn't set field '" + name + "' in class '" + obj.getClass() + "'", ex); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static String readUTF( DataInput dis, int len ) throws IOException { CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder(); BufferCache bufferCache = getBufferCache(); ByteBuffer byteBuf = bufferCache.getByteBuffer(BufferCache.MINIMUM_SIZE); CharBuffer charBuf = bufferCache.getCharBuffer(BufferCache.MINIMUM_SIZE); try { byte[] bytes = byteBuf.array(); while (len != 0 || byteBuf.position() > 0) { // Need to read more bytes ... if (len < 0) { // Read until we come across the zero-byte (or until we fill up 'byteBuf') ... while (byteBuf.remaining() != 0) { byte b = dis.readByte(); if (b == 0x0) { len = 0; // no more bytes to read ... break; } byteBuf.put(b); } // Prepare byteBuf for reading ... byteBuf.flip(); } else if (len == 0) { // Don't read anything, but prepare the byteBuf for reading ... byteBuf.flip(); } else { // We know exactly how much we should read ... int amountToRead = Math.min(len, Math.min(byteBuf.remaining(), charBuf.remaining())); int offset = byteBuf.position(); // may have already read some bytes ... dis.readFully(bytes, offset, amountToRead); // take into account the offset because we might have carry-over bytes from a previous compaction // this happens when decoding multi-byte UTF8 chars byteBuf.limit(amountToRead + offset); byteBuf.rewind(); // Adjust the number of bytes to read ... len -= amountToRead; } // We've either read all we need to or as much as we can (given the buffer's limited size), // so decode what we've read ... boolean endOfInput = len == 0; CoderResult result = decoder.decode(byteBuf, charBuf, endOfInput); if (result.isError()) { result.throwException(); } else if (result.isUnderflow()) { // We've not read enough bytes yet, so move the bytes that weren't read to the beginning of the buffer byteBuf.compact(); // and try again ... } if (len > 0 && (charBuf.remaining() == 0 || result.isOverflow())) { // the output buffer was too small or is at its end. // allocate a new one which need to have enough capacity to hold the current one (we're appending buffers) and also to hold // the data from the new iteration. int newBufferIncrement = (len > BufferCache.MINIMUM_SIZE) ? BufferCache.MINIMUM_SIZE : len; CharBuffer newBuffer = bufferCache.getCharBuffer(charBuf.capacity() + newBufferIncrement); // prepare the old buffer for reading ... charBuf.flip(); // and copy the contents ... newBuffer.put(charBuf); // and use the new buffer ... charBuf = newBuffer; } } // We're done, so prepare the character buffer for reading and then convert to a String ... charBuf.flip(); return charBuf.toString(); } finally { // Return the buffers to the cache ... bufferCache.checkin(byteBuf); bufferCache.checkin(charBuf); } } }
public class class_name { public static String readUTF( DataInput dis, int len ) throws IOException { CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder(); BufferCache bufferCache = getBufferCache(); ByteBuffer byteBuf = bufferCache.getByteBuffer(BufferCache.MINIMUM_SIZE); CharBuffer charBuf = bufferCache.getCharBuffer(BufferCache.MINIMUM_SIZE); try { byte[] bytes = byteBuf.array(); while (len != 0 || byteBuf.position() > 0) { // Need to read more bytes ... if (len < 0) { // Read until we come across the zero-byte (or until we fill up 'byteBuf') ... while (byteBuf.remaining() != 0) { byte b = dis.readByte(); if (b == 0x0) { len = 0; // no more bytes to read ... // depends on control dependency: [if], data = [none] break; } byteBuf.put(b); // depends on control dependency: [while], data = [none] } // Prepare byteBuf for reading ... byteBuf.flip(); // depends on control dependency: [if], data = [none] } else if (len == 0) { // Don't read anything, but prepare the byteBuf for reading ... byteBuf.flip(); // depends on control dependency: [if], data = [none] } else { // We know exactly how much we should read ... int amountToRead = Math.min(len, Math.min(byteBuf.remaining(), charBuf.remaining())); int offset = byteBuf.position(); // may have already read some bytes ... dis.readFully(bytes, offset, amountToRead); // depends on control dependency: [if], data = [none] // take into account the offset because we might have carry-over bytes from a previous compaction // this happens when decoding multi-byte UTF8 chars byteBuf.limit(amountToRead + offset); // depends on control dependency: [if], data = [none] byteBuf.rewind(); // depends on control dependency: [if], data = [none] // Adjust the number of bytes to read ... len -= amountToRead; // depends on control dependency: [if], data = [none] } // We've either read all we need to or as much as we can (given the buffer's limited size), // so decode what we've read ... boolean endOfInput = len == 0; CoderResult result = decoder.decode(byteBuf, charBuf, endOfInput); if (result.isError()) { result.throwException(); // depends on control dependency: [if], data = [none] } else if (result.isUnderflow()) { // We've not read enough bytes yet, so move the bytes that weren't read to the beginning of the buffer byteBuf.compact(); // depends on control dependency: [if], data = [none] // and try again ... } if (len > 0 && (charBuf.remaining() == 0 || result.isOverflow())) { // the output buffer was too small or is at its end. // allocate a new one which need to have enough capacity to hold the current one (we're appending buffers) and also to hold // the data from the new iteration. int newBufferIncrement = (len > BufferCache.MINIMUM_SIZE) ? BufferCache.MINIMUM_SIZE : len; CharBuffer newBuffer = bufferCache.getCharBuffer(charBuf.capacity() + newBufferIncrement); // prepare the old buffer for reading ... charBuf.flip(); // depends on control dependency: [if], data = [none] // and copy the contents ... newBuffer.put(charBuf); // depends on control dependency: [if], data = [none] // and use the new buffer ... charBuf = newBuffer; // depends on control dependency: [if], data = [none] } } // We're done, so prepare the character buffer for reading and then convert to a String ... charBuf.flip(); return charBuf.toString(); } finally { // Return the buffers to the cache ... bufferCache.checkin(byteBuf); bufferCache.checkin(charBuf); } } }
public class class_name { public static Document parse(Reader reader) { DocumentBuilder documentBuilder = getDocumentBuilder(); try { return documentBuilder.parse(new InputSource(reader)); } catch (SAXException | IOException e) { throw new IllegalArgumentException("Failed to parse XML document", e); } finally { documentBuilder.reset(); } } }
public class class_name { public static Document parse(Reader reader) { DocumentBuilder documentBuilder = getDocumentBuilder(); try { return documentBuilder.parse(new InputSource(reader)); // depends on control dependency: [try], data = [none] } catch (SAXException | IOException e) { throw new IllegalArgumentException("Failed to parse XML document", e); } finally { // depends on control dependency: [catch], data = [none] documentBuilder.reset(); } } }
public class class_name { private String getCacheKey(String[] keys, CmsDbContext dbc) { if (!dbc.getProjectId().isNullUUID()) { return ""; } StringBuffer b = new StringBuffer(64); int len = keys.length; if (len > 0) { for (int i = 0; i < len; i++) { b.append(keys[i]); b.append('_'); } } if (dbc.currentProject().isOnlineProject()) { b.append("+"); } else { b.append("-"); } return b.toString(); } }
public class class_name { private String getCacheKey(String[] keys, CmsDbContext dbc) { if (!dbc.getProjectId().isNullUUID()) { return ""; // depends on control dependency: [if], data = [none] } StringBuffer b = new StringBuffer(64); int len = keys.length; if (len > 0) { for (int i = 0; i < len; i++) { b.append(keys[i]); // depends on control dependency: [for], data = [i] b.append('_'); // depends on control dependency: [for], data = [none] } } if (dbc.currentProject().isOnlineProject()) { b.append("+"); // depends on control dependency: [if], data = [none] } else { b.append("-"); // depends on control dependency: [if], data = [none] } return b.toString(); } }
public class class_name { private Object writeOnly(CacheAopProxyChain pjp, Cache cache) throws Throwable { DataLoaderFactory factory = DataLoaderFactory.getInstance(); DataLoader dataLoader = factory.getDataLoader(); CacheWrapper<Object> cacheWrapper; try { cacheWrapper = dataLoader.init(pjp, cache, this).getData().getCacheWrapper(); } catch (Throwable e) { throw e; } finally { factory.returnObject(dataLoader); } Object result = cacheWrapper.getCacheObject(); Object[] arguments = pjp.getArgs(); if (scriptParser.isCacheable(cache, pjp.getTarget(), arguments, result)) { CacheKeyTO cacheKey = getCacheKey(pjp, cache, result); // 注意:这里只能获取AutoloadTO,不能生成AutoloadTO AutoLoadTO autoLoadTO = autoLoadHandler.getAutoLoadTO(cacheKey); try { writeCache(pjp, pjp.getArgs(), cache, cacheKey, cacheWrapper); if (null != autoLoadTO) { // 同步加载时间 autoLoadTO.setLastLoadTime(cacheWrapper.getLastLoadTime()) // 同步过期时间 .setExpire(cacheWrapper.getExpire()); } } catch (Exception ex) { log.error(ex.getMessage(), ex); } } return result; } }
public class class_name { private Object writeOnly(CacheAopProxyChain pjp, Cache cache) throws Throwable { DataLoaderFactory factory = DataLoaderFactory.getInstance(); DataLoader dataLoader = factory.getDataLoader(); CacheWrapper<Object> cacheWrapper; try { cacheWrapper = dataLoader.init(pjp, cache, this).getData().getCacheWrapper(); } catch (Throwable e) { throw e; } finally { factory.returnObject(dataLoader); } Object result = cacheWrapper.getCacheObject(); Object[] arguments = pjp.getArgs(); if (scriptParser.isCacheable(cache, pjp.getTarget(), arguments, result)) { CacheKeyTO cacheKey = getCacheKey(pjp, cache, result); // 注意:这里只能获取AutoloadTO,不能生成AutoloadTO AutoLoadTO autoLoadTO = autoLoadHandler.getAutoLoadTO(cacheKey); try { writeCache(pjp, pjp.getArgs(), cache, cacheKey, cacheWrapper); // depends on control dependency: [try], data = [none] if (null != autoLoadTO) { // 同步加载时间 autoLoadTO.setLastLoadTime(cacheWrapper.getLastLoadTime()) // 同步过期时间 .setExpire(cacheWrapper.getExpire()); // depends on control dependency: [if], data = [none] } } catch (Exception ex) { log.error(ex.getMessage(), ex); } // depends on control dependency: [catch], data = [none] } return result; } }