code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { @Nonnull public static <T extends OWLObject> List<T> sortOptionally(@Nonnull Collection<T> toReturn) { List<T> list = new ArrayList<>(toReturn); try { Collections.sort(list); } catch (IllegalArgumentException e) { // catch possible sorting misbehaviour if (!e.getMessage().contains("Comparison method violates its general contract!")) { throw e; } // otherwise print a warning and leave the list unsorted } return list; } }
public class class_name { @Nonnull public static <T extends OWLObject> List<T> sortOptionally(@Nonnull Collection<T> toReturn) { List<T> list = new ArrayList<>(toReturn); try { Collections.sort(list); // depends on control dependency: [try], data = [none] } catch (IllegalArgumentException e) { // catch possible sorting misbehaviour if (!e.getMessage().contains("Comparison method violates its general contract!")) { throw e; } // otherwise print a warning and leave the list unsorted } // depends on control dependency: [catch], data = [none] return list; } }
public class class_name { public ClientConnectionTimings build() { if (socketConnectStartTimeMicros > 0 && !socketConnectEndSet) { logger.warn("Should call socketConnectEnd() if socketConnectStart() was invoked."); } if (pendingAcquisitionStartTimeMicros > 0 && !pendingAcquisitionEndSet) { logger.warn("Should call pendingAcquisitionEnd() if pendingAcquisitionStart() was invoked."); } return new ClientConnectionTimings( connectionAcquisitionStartTimeMicros, System.nanoTime() - connectionAcquisitionStartNanos, dnsResolutionEndSet ? connectionAcquisitionStartTimeMicros : -1, dnsResolutionEndSet ? dnsResolutionEndNanos - connectionAcquisitionStartNanos : -1, socketConnectEndSet ? socketConnectStartTimeMicros : -1, socketConnectEndSet ? socketConnectEndNanos - socketConnectStartNanos : -1, pendingAcquisitionEndSet ? pendingAcquisitionStartTimeMicros : -1, pendingAcquisitionEndSet ? pendingAcquisitionEndNanos - pendingAcquisitionStartNanos : -1); } }
public class class_name { public ClientConnectionTimings build() { if (socketConnectStartTimeMicros > 0 && !socketConnectEndSet) { logger.warn("Should call socketConnectEnd() if socketConnectStart() was invoked."); // depends on control dependency: [if], data = [none] } if (pendingAcquisitionStartTimeMicros > 0 && !pendingAcquisitionEndSet) { logger.warn("Should call pendingAcquisitionEnd() if pendingAcquisitionStart() was invoked."); // depends on control dependency: [if], data = [none] } return new ClientConnectionTimings( connectionAcquisitionStartTimeMicros, System.nanoTime() - connectionAcquisitionStartNanos, dnsResolutionEndSet ? connectionAcquisitionStartTimeMicros : -1, dnsResolutionEndSet ? dnsResolutionEndNanos - connectionAcquisitionStartNanos : -1, socketConnectEndSet ? socketConnectStartTimeMicros : -1, socketConnectEndSet ? socketConnectEndNanos - socketConnectStartNanos : -1, pendingAcquisitionEndSet ? pendingAcquisitionStartTimeMicros : -1, pendingAcquisitionEndSet ? pendingAcquisitionEndNanos - pendingAcquisitionStartNanos : -1); } }
public class class_name { public void set(double x, double y, double z) { assert Vector3D.isUnitVector(x, y, z) : AssertMessages.normalizedParameters(0, 1, 2); if ((x != getX() || y != getY() || z != getZ()) && !isBound()) { final Vector3dfx v = super.get(); v.set(x, y, z); fireValueChangedEvent(); } } }
public class class_name { public void set(double x, double y, double z) { assert Vector3D.isUnitVector(x, y, z) : AssertMessages.normalizedParameters(0, 1, 2); if ((x != getX() || y != getY() || z != getZ()) && !isBound()) { final Vector3dfx v = super.get(); v.set(x, y, z); // depends on control dependency: [if], data = [none] fireValueChangedEvent(); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public void visitInnerClass(String name, String outerName, String innerName, int access) { // Make sure the class is annotated. ensureAnnotated(); if (name.equals(getClassInternalName())) { StringBuilder sb = new StringBuilder(); sb.append(outerName); sb.append("$"); sb.append(innerName); isInnerClass = name.equals(sb.toString()); } super.visitInnerClass(name, outerName, innerName, access); } }
public class class_name { @Override public void visitInnerClass(String name, String outerName, String innerName, int access) { // Make sure the class is annotated. ensureAnnotated(); if (name.equals(getClassInternalName())) { StringBuilder sb = new StringBuilder(); sb.append(outerName); // depends on control dependency: [if], data = [none] sb.append("$"); // depends on control dependency: [if], data = [none] sb.append(innerName); // depends on control dependency: [if], data = [none] isInnerClass = name.equals(sb.toString()); // depends on control dependency: [if], data = [none] } super.visitInnerClass(name, outerName, innerName, access); } }
public class class_name { public void loadTopology() { if (fake) { getView().updateHosts(deriveGroups(generateFakeDomain()), hostIndex); } else { Outcome<FunctionContext> outcome = new Outcome<FunctionContext>() { @Override public void onFailure(final FunctionContext context) { Console.error("Unable to load topology", context.getErrorMessage()); // TODO i18n } @Override public void onSuccess(final FunctionContext context) { List<HostInfo> hosts = context.pop(); getView().updateHosts(deriveGroups(hosts), hostIndex); } }; new Async<FunctionContext>(Footer.PROGRESS_ELEMENT).waterfall(new FunctionContext(), outcome, new TopologyFunctions.ReadHostsAndGroups(dispatcher), new TopologyFunctions.ReadServerConfigs(dispatcher, beanFactory), new TopologyFunctions.FindRunningServerInstances(dispatcher)); } } }
public class class_name { public void loadTopology() { if (fake) { getView().updateHosts(deriveGroups(generateFakeDomain()), hostIndex); // depends on control dependency: [if], data = [none] } else { Outcome<FunctionContext> outcome = new Outcome<FunctionContext>() { @Override public void onFailure(final FunctionContext context) { Console.error("Unable to load topology", context.getErrorMessage()); // TODO i18n } @Override public void onSuccess(final FunctionContext context) { List<HostInfo> hosts = context.pop(); getView().updateHosts(deriveGroups(hosts), hostIndex); } }; new Async<FunctionContext>(Footer.PROGRESS_ELEMENT).waterfall(new FunctionContext(), outcome, new TopologyFunctions.ReadHostsAndGroups(dispatcher), new TopologyFunctions.ReadServerConfigs(dispatcher, beanFactory), new TopologyFunctions.FindRunningServerInstances(dispatcher)); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static void swap( final byte[] data, final int start, final int end, final byte[] otherData, final int otherStart ) { for (int i = end - start; --i >= 0;) { final boolean temp = get(data, i + start); set(data, i + start, get(otherData, otherStart + i)); set(otherData, otherStart + i, temp); } } }
public class class_name { public static void swap( final byte[] data, final int start, final int end, final byte[] otherData, final int otherStart ) { for (int i = end - start; --i >= 0;) { final boolean temp = get(data, i + start); set(data, i + start, get(otherData, otherStart + i)); // depends on control dependency: [for], data = [i] set(otherData, otherStart + i, temp); // depends on control dependency: [for], data = [i] } } }
public class class_name { public void setList(String fieldName, List<?> value) { if (value == null) { // list默认允许传入null return; } fieldList.add(fieldName); statementParameter.setList(value); } }
public class class_name { public void setList(String fieldName, List<?> value) { if (value == null) { // list默认允许传入null return; // depends on control dependency: [if], data = [none] } fieldList.add(fieldName); statementParameter.setList(value); } }
public class class_name { private void visitParentExpression(AbstractFunctionExpression parentExpr) { if (nextFunctionBodyStart == null) { nextFunctionBodyStart = parentExpr; } if (currentFunctionName != null) { updateCurrentFunction(parentExpr); } else { createFunctionIfNeeded(parentExpr); } if (GremlinQueryOptimizer.isOrExpression(parentExpr)) { //reset currentFunctionName = null; //don't include 'or' in generated functions nextFunctionBodyStart = null; } } }
public class class_name { private void visitParentExpression(AbstractFunctionExpression parentExpr) { if (nextFunctionBodyStart == null) { nextFunctionBodyStart = parentExpr; // depends on control dependency: [if], data = [none] } if (currentFunctionName != null) { updateCurrentFunction(parentExpr); // depends on control dependency: [if], data = [none] } else { createFunctionIfNeeded(parentExpr); // depends on control dependency: [if], data = [none] } if (GremlinQueryOptimizer.isOrExpression(parentExpr)) { //reset currentFunctionName = null; // depends on control dependency: [if], data = [none] //don't include 'or' in generated functions nextFunctionBodyStart = null; // depends on control dependency: [if], data = [none] } } }
public class class_name { public static MultivaluedMap<String, String> decodeMatrix(String pathSegment, boolean decode) { // EMODB-MODIFICATION Replaced with EmoMultivaluedMap implementation MultivaluedMap<String, String> matrixMap = EmoMultivaluedMap.create(); // Skip over path segment int s = pathSegment.indexOf(';') + 1; if (s == 0 || s == pathSegment.length()) { return matrixMap; } do { int e = pathSegment.indexOf(';', s); if (e == -1) { decodeMatrixParam(matrixMap, pathSegment.substring(s), decode); } else if (e > s) { decodeMatrixParam(matrixMap, pathSegment.substring(s, e), decode); } s = e + 1; } while (s > 0 && s < pathSegment.length()); return matrixMap; } }
public class class_name { public static MultivaluedMap<String, String> decodeMatrix(String pathSegment, boolean decode) { // EMODB-MODIFICATION Replaced with EmoMultivaluedMap implementation MultivaluedMap<String, String> matrixMap = EmoMultivaluedMap.create(); // Skip over path segment int s = pathSegment.indexOf(';') + 1; if (s == 0 || s == pathSegment.length()) { return matrixMap; // depends on control dependency: [if], data = [none] } do { int e = pathSegment.indexOf(';', s); if (e == -1) { decodeMatrixParam(matrixMap, pathSegment.substring(s), decode); // depends on control dependency: [if], data = [none] } else if (e > s) { decodeMatrixParam(matrixMap, pathSegment.substring(s, e), decode); // depends on control dependency: [if], data = [none] } s = e + 1; } while (s > 0 && s < pathSegment.length()); return matrixMap; } }
public class class_name { private static Collection difference(Collection first, Collection second){ if (first == null) { return EMPTY_LIST; } if (second == null) { return first; } Collection difference = new ArrayList<>(first); for (Object current : second){ difference.remove(current); } return difference; } }
public class class_name { private static Collection difference(Collection first, Collection second){ if (first == null) { return EMPTY_LIST; // depends on control dependency: [if], data = [none] } if (second == null) { return first; // depends on control dependency: [if], data = [none] } Collection difference = new ArrayList<>(first); for (Object current : second){ difference.remove(current); // depends on control dependency: [for], data = [current] } return difference; } }
public class class_name { @Override public AnnotationDefinition convert(BELAnnotationDefinition bad) { if (bad == null) { return null; } AnnotationDefinition ad = CommonModelFactory.getInstance() .createAnnotationDefinition(bad.getName()); switch (bad.getAnnotationType()) { case LIST: ad.setType(AnnotationType.ENUMERATION); ad.setEnums(bad.getList()); break; case PATTERN: ad.setType(AnnotationType.REGULAR_EXPRESSION); ad.setValue(bad.getValue()); break; case URL: ad.setType(null); ad.setURL(bad.getValue()); break; default: throw new InvalidArgument("BELAnnotationType '" + bad.getAnnotationType() + "' not known."); } return ad; } }
public class class_name { @Override public AnnotationDefinition convert(BELAnnotationDefinition bad) { if (bad == null) { return null; // depends on control dependency: [if], data = [none] } AnnotationDefinition ad = CommonModelFactory.getInstance() .createAnnotationDefinition(bad.getName()); switch (bad.getAnnotationType()) { case LIST: ad.setType(AnnotationType.ENUMERATION); ad.setEnums(bad.getList()); break; case PATTERN: ad.setType(AnnotationType.REGULAR_EXPRESSION); ad.setValue(bad.getValue()); break; case URL: ad.setType(null); ad.setURL(bad.getValue()); break; default: throw new InvalidArgument("BELAnnotationType '" + bad.getAnnotationType() + "' not known."); } return ad; } }
public class class_name { public final void setHeaderProperties(Properties headerProperties) { this.headerProperties=null; if(headerProperties!=null) { this.headerProperties=new Properties(); this.headerProperties.putAll(headerProperties); } } }
public class class_name { public final void setHeaderProperties(Properties headerProperties) { this.headerProperties=null; if(headerProperties!=null) { this.headerProperties=new Properties(); // depends on control dependency: [if], data = [none] this.headerProperties.putAll(headerProperties); // depends on control dependency: [if], data = [(headerProperties] } } }
public class class_name { public BufferedString toBufferedString() { if (_skipped.length == 0) return _bufferedString; byte[] buf = MemoryManager.malloc1(_bufferedString._len - _skipped.length); // Length of the buffer window minus skipped chars int copyStart = _bufferedString._off; int target = 0; for (int skippedIndex : _skipped) { for (int i = copyStart; i < skippedIndex; i++) { buf[target++] = _bufferedString._buf[i]; } copyStart = skippedIndex + 1; } int windowEnd = _bufferedString._off + _bufferedString._len; for (int i = copyStart; i < windowEnd; i++) { buf[target++] = _bufferedString._buf[i]; } assert target == buf.length; return new BufferedString(buf, 0, buf.length); } }
public class class_name { public BufferedString toBufferedString() { if (_skipped.length == 0) return _bufferedString; byte[] buf = MemoryManager.malloc1(_bufferedString._len - _skipped.length); // Length of the buffer window minus skipped chars int copyStart = _bufferedString._off; int target = 0; for (int skippedIndex : _skipped) { for (int i = copyStart; i < skippedIndex; i++) { buf[target++] = _bufferedString._buf[i]; // depends on control dependency: [for], data = [i] } copyStart = skippedIndex + 1; // depends on control dependency: [for], data = [skippedIndex] } int windowEnd = _bufferedString._off + _bufferedString._len; for (int i = copyStart; i < windowEnd; i++) { buf[target++] = _bufferedString._buf[i]; // depends on control dependency: [for], data = [i] } assert target == buf.length; return new BufferedString(buf, 0, buf.length); } }
public class class_name { public static BaseUserInfo doAuthentication(String name,String password){ BaseUserInfo userInfo = getInstance().decisionProvider.validateUser(name, password); UserSession session = getCurrentSession(false); session.update(userInfo, getInstance().decisionProvider.sessionExpireIn()); if(getInstance().decisionProvider.multiPointEnable()){ UserSession otherSession = getInstance().sessionManager.getLoginSessionByUserId(userInfo.getId()); if(otherSession != null && !otherSession.getSessionId().equals(session.getSessionId())){ getInstance().sessionManager.removeLoginSession(otherSession.getSessionId()); } } getInstance().sessionManager.storgeLoginSession(session); getInstance().resourceManager.getUserPermissionCodes(userInfo.getId()); return userInfo; } }
public class class_name { public static BaseUserInfo doAuthentication(String name,String password){ BaseUserInfo userInfo = getInstance().decisionProvider.validateUser(name, password); UserSession session = getCurrentSession(false); session.update(userInfo, getInstance().decisionProvider.sessionExpireIn()); if(getInstance().decisionProvider.multiPointEnable()){ UserSession otherSession = getInstance().sessionManager.getLoginSessionByUserId(userInfo.getId()); if(otherSession != null && !otherSession.getSessionId().equals(session.getSessionId())){ getInstance().sessionManager.removeLoginSession(otherSession.getSessionId()); // depends on control dependency: [if], data = [(otherSession] } } getInstance().sessionManager.storgeLoginSession(session); getInstance().resourceManager.getUserPermissionCodes(userInfo.getId()); return userInfo; } }
public class class_name { private boolean grow() { if (_growCapacity <= 0) return false; _tailLock.lock(); try { _headLock.lock(); try { final int head = _indexes[HEAD_OFFSET]; final int tail = _indexes[TAIL_OFFSET]; final int newTail; final int capacity = _elements.length; Object[] elements = new Object[capacity + _growCapacity]; if (head < tail) { newTail = tail - head; System.arraycopy(_elements, head, elements, 0, newTail); } else if (head > tail || _size.get() > 0) { newTail = capacity + tail - head; int cut = capacity - head; System.arraycopy(_elements, head, elements, 0, cut); System.arraycopy(_elements, 0, elements, cut, tail); } else { newTail = 0; } _elements = elements; _indexes[HEAD_OFFSET] = 0; _indexes[TAIL_OFFSET] = newTail; return true; } finally { _headLock.unlock(); } } finally { _tailLock.unlock(); } } }
public class class_name { private boolean grow() { if (_growCapacity <= 0) return false; _tailLock.lock(); try { _headLock.lock(); // depends on control dependency: [try], data = [none] try { final int head = _indexes[HEAD_OFFSET]; final int tail = _indexes[TAIL_OFFSET]; final int newTail; final int capacity = _elements.length; Object[] elements = new Object[capacity + _growCapacity]; if (head < tail) { newTail = tail - head; // depends on control dependency: [if], data = [none] System.arraycopy(_elements, head, elements, 0, newTail); // depends on control dependency: [if], data = [none] } else if (head > tail || _size.get() > 0) { newTail = capacity + tail - head; // depends on control dependency: [if], data = [none] int cut = capacity - head; System.arraycopy(_elements, head, elements, 0, cut); // depends on control dependency: [if], data = [none] System.arraycopy(_elements, 0, elements, cut, tail); // depends on control dependency: [if], data = [none] } else { newTail = 0; // depends on control dependency: [if], data = [none] } _elements = elements; // depends on control dependency: [try], data = [none] _indexes[HEAD_OFFSET] = 0; // depends on control dependency: [try], data = [none] _indexes[TAIL_OFFSET] = newTail; // depends on control dependency: [try], data = [none] return true; // depends on control dependency: [try], data = [none] } finally { _headLock.unlock(); } } finally { _tailLock.unlock(); } } }
public class class_name { private UserDetailsService getUserDetailsService(H http) { if (this.userDetailsService == null) { this.userDetailsService = http.getSharedObject(UserDetailsService.class); } if (this.userDetailsService == null) { throw new IllegalStateException("userDetailsService cannot be null. Invoke " + RememberMeConfigurer.class.getSimpleName() + "#userDetailsService(UserDetailsService) or see its javadoc for alternative approaches."); } return this.userDetailsService; } }
public class class_name { private UserDetailsService getUserDetailsService(H http) { if (this.userDetailsService == null) { this.userDetailsService = http.getSharedObject(UserDetailsService.class); // depends on control dependency: [if], data = [none] } if (this.userDetailsService == null) { throw new IllegalStateException("userDetailsService cannot be null. Invoke " + RememberMeConfigurer.class.getSimpleName() + "#userDetailsService(UserDetailsService) or see its javadoc for alternative approaches."); } return this.userDetailsService; } }
public class class_name { @Nonnull public List<OutputWriter> getEffectiveOutputWriters() { // Google Guava predicates would be nicer but we don't include guava to ease embeddability List<OutputWriter> result = new ArrayList<OutputWriter>(embeddedJmxTrans.getOutputWriters().size() + outputWriters.size()); for (OutputWriter outputWriter : embeddedJmxTrans.getOutputWriters()) { if (outputWriter.isEnabled()) { result.add(outputWriter); } } for (OutputWriter outputWriter : outputWriters) { if (outputWriter.isEnabled()) { result.add(outputWriter); } } return result; } }
public class class_name { @Nonnull public List<OutputWriter> getEffectiveOutputWriters() { // Google Guava predicates would be nicer but we don't include guava to ease embeddability List<OutputWriter> result = new ArrayList<OutputWriter>(embeddedJmxTrans.getOutputWriters().size() + outputWriters.size()); for (OutputWriter outputWriter : embeddedJmxTrans.getOutputWriters()) { if (outputWriter.isEnabled()) { result.add(outputWriter); // depends on control dependency: [if], data = [none] } } for (OutputWriter outputWriter : outputWriters) { if (outputWriter.isEnabled()) { result.add(outputWriter); // depends on control dependency: [if], data = [none] } } return result; } }
public class class_name { public DescribeRegionsRequest withRegionNames(String... regionNames) { if (this.regionNames == null) { setRegionNames(new com.amazonaws.internal.SdkInternalList<String>(regionNames.length)); } for (String ele : regionNames) { this.regionNames.add(ele); } return this; } }
public class class_name { public DescribeRegionsRequest withRegionNames(String... regionNames) { if (this.regionNames == null) { setRegionNames(new com.amazonaws.internal.SdkInternalList<String>(regionNames.length)); // depends on control dependency: [if], data = [none] } for (String ele : regionNames) { this.regionNames.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public Input withSupplementalImps(String... supplementalImps) { if (this.supplementalImps == null) { setSupplementalImps(new java.util.ArrayList<String>(supplementalImps.length)); } for (String ele : supplementalImps) { this.supplementalImps.add(ele); } return this; } }
public class class_name { public Input withSupplementalImps(String... supplementalImps) { if (this.supplementalImps == null) { setSupplementalImps(new java.util.ArrayList<String>(supplementalImps.length)); // depends on control dependency: [if], data = [none] } for (String ele : supplementalImps) { this.supplementalImps.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { protected void registerServant() { if (ivRemoteObjectWrapper != null) { // synchronized on the remote Wrapper to set the isRemoteRegistered flag synchronized (ivRemoteObjectWrapper) { if (!isRemoteRegistered) { try { if (!isZOS) // LIDB2775-23.9 { // Servant registration must be performed with the application classloader // in force. This is especially needed for JITDeploy since // the JIT pluggin will be on the application classloader. // Without the JIT pluggin the classloader will not trigger // JITDeploy to create the stub. //d521388 Object originalLoader = ThreadContextAccessor.UNCHANGED; try { if (ivBMD != null) // EJBFactories have no BMD d529446 { originalLoader = EJBThreadData.svThreadContextAccessor.pushContextClassLoaderForUnprivileged(ivBMD.classLoader); //PK83186 if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { if (originalLoader != ThreadContextAccessor.UNCHANGED) { Tr.debug(tc, "registerServant : old ClassLoader = " + originalLoader); Tr.debug(tc, "registerServant : new ClassLoader = " + ivBMD.classLoader); } else { Tr.debug(tc, "registerServant : current ClassLoader = " + ivBMD.classLoader); } } } ivRemoteObjectWrapper.container.getEJBRuntime().registerServant(ivRemoteObjectWrapper.beanId.getByteArray(), ivRemoteObjectWrapper); } finally { EJBThreadData.svThreadContextAccessor.popContextClassLoaderForUnprivileged(originalLoader); } // finally } // if( !isZOS ) isRemoteRegistered = true; } catch (Exception ex) { FFDCFilter.processException(ex, CLASS_NAME + ".registerServant", "184", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Failed to register wrapper instance", new Object[] { ivRemoteObjectWrapper, ex }); } } } // if ( !isRemoteRegistered ) } // synchronized( ivRemoteObject ) } // if ( ivRemoteObject != null ) } }
public class class_name { protected void registerServant() { if (ivRemoteObjectWrapper != null) { // synchronized on the remote Wrapper to set the isRemoteRegistered flag synchronized (ivRemoteObjectWrapper) // depends on control dependency: [if], data = [(ivRemoteObjectWrapper] { if (!isRemoteRegistered) { try { if (!isZOS) // LIDB2775-23.9 { // Servant registration must be performed with the application classloader // in force. This is especially needed for JITDeploy since // the JIT pluggin will be on the application classloader. // Without the JIT pluggin the classloader will not trigger // JITDeploy to create the stub. //d521388 Object originalLoader = ThreadContextAccessor.UNCHANGED; try { if (ivBMD != null) // EJBFactories have no BMD d529446 { originalLoader = EJBThreadData.svThreadContextAccessor.pushContextClassLoaderForUnprivileged(ivBMD.classLoader); //PK83186 // depends on control dependency: [if], data = [(ivBMD] if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { if (originalLoader != ThreadContextAccessor.UNCHANGED) { Tr.debug(tc, "registerServant : old ClassLoader = " + originalLoader); // depends on control dependency: [if], data = [none] Tr.debug(tc, "registerServant : new ClassLoader = " + ivBMD.classLoader); // depends on control dependency: [if], data = [none] } else { Tr.debug(tc, "registerServant : current ClassLoader = " + ivBMD.classLoader); // depends on control dependency: [if], data = [none] } } } ivRemoteObjectWrapper.container.getEJBRuntime().registerServant(ivRemoteObjectWrapper.beanId.getByteArray(), ivRemoteObjectWrapper); // depends on control dependency: [try], data = [none] } finally { EJBThreadData.svThreadContextAccessor.popContextClassLoaderForUnprivileged(originalLoader); } // finally } // if( !isZOS ) isRemoteRegistered = true; // depends on control dependency: [try], data = [none] } catch (Exception ex) { FFDCFilter.processException(ex, CLASS_NAME + ".registerServant", "184", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Failed to register wrapper instance", new Object[] { ivRemoteObjectWrapper, ex }); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] } // if ( !isRemoteRegistered ) } // synchronized( ivRemoteObject ) } // if ( ivRemoteObject != null ) } }
public class class_name { public void marshall(ListCertificateAuthoritiesRequest listCertificateAuthoritiesRequest, ProtocolMarshaller protocolMarshaller) { if (listCertificateAuthoritiesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listCertificateAuthoritiesRequest.getNextToken(), NEXTTOKEN_BINDING); protocolMarshaller.marshall(listCertificateAuthoritiesRequest.getMaxResults(), MAXRESULTS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ListCertificateAuthoritiesRequest listCertificateAuthoritiesRequest, ProtocolMarshaller protocolMarshaller) { if (listCertificateAuthoritiesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listCertificateAuthoritiesRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listCertificateAuthoritiesRequest.getMaxResults(), MAXRESULTS_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 void marshall(SignedObject signedObject, ProtocolMarshaller protocolMarshaller) { if (signedObject == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(signedObject.getS3(), S3_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(SignedObject signedObject, ProtocolMarshaller protocolMarshaller) { if (signedObject == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(signedObject.getS3(), S3_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 { protected void upload(final String text, final ProgressListener progressListener, ResponseListener responseListener) { if (text == null || text.length() == 0) { if (responseListener != null) { responseListener.onFailure(null, new IllegalArgumentException("Tried to upload empty text"), null); } return; } String contentTypeHeader = headers.get(CONTENT_TYPE); final String contentType = contentTypeHeader != null ? contentTypeHeader : TEXT_PLAIN_CONTENT_TYPE; RequestBody body = RequestBody.create(MediaType.parse(contentType), text); // Custom RequestBody wrapper that monitors the progress of the upload ProgressRequestBody progressBody = new ProgressRequestBody(text, body, progressListener); sendRequest(null, responseListener, progressBody); } }
public class class_name { protected void upload(final String text, final ProgressListener progressListener, ResponseListener responseListener) { if (text == null || text.length() == 0) { if (responseListener != null) { responseListener.onFailure(null, new IllegalArgumentException("Tried to upload empty text"), null); // depends on control dependency: [if], data = [null)] } return; // depends on control dependency: [if], data = [none] } String contentTypeHeader = headers.get(CONTENT_TYPE); final String contentType = contentTypeHeader != null ? contentTypeHeader : TEXT_PLAIN_CONTENT_TYPE; RequestBody body = RequestBody.create(MediaType.parse(contentType), text); // Custom RequestBody wrapper that monitors the progress of the upload ProgressRequestBody progressBody = new ProgressRequestBody(text, body, progressListener); sendRequest(null, responseListener, progressBody); } }
public class class_name { public void marshall(RenderingEngine renderingEngine, ProtocolMarshaller protocolMarshaller) { if (renderingEngine == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(renderingEngine.getName(), NAME_BINDING); protocolMarshaller.marshall(renderingEngine.getVersion(), VERSION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(RenderingEngine renderingEngine, ProtocolMarshaller protocolMarshaller) { if (renderingEngine == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(renderingEngine.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(renderingEngine.getVersion(), VERSION_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 Object getControlValue() { Container container = this.getParent(); if (container instanceof JCalendarDualField) container = container.getParent(); if (container instanceof JTable) { // Always JTable jtable = (JTable)container; int iRow = jtable.getSelectedRow(); Object value = jtable.getValueAt(iRow, m_iColumn); this.setControlValue(value); // Make sure I have the right value } Object objReturn = this.getTargetDate(); if (this.getConverter() instanceof FieldInfo) { // Always this.getConverter().setData(objReturn); objReturn = this.getConverter().getString(); // Convert to a string and fix. } return objReturn; } }
public class class_name { public Object getControlValue() { Container container = this.getParent(); if (container instanceof JCalendarDualField) container = container.getParent(); if (container instanceof JTable) { // Always JTable jtable = (JTable)container; int iRow = jtable.getSelectedRow(); Object value = jtable.getValueAt(iRow, m_iColumn); this.setControlValue(value); // Make sure I have the right value // depends on control dependency: [if], data = [none] } Object objReturn = this.getTargetDate(); if (this.getConverter() instanceof FieldInfo) { // Always this.getConverter().setData(objReturn); // depends on control dependency: [if], data = [none] objReturn = this.getConverter().getString(); // Convert to a string and fix. // depends on control dependency: [if], data = [none] } return objReturn; } }
public class class_name { @Override public DeleteMethodOutcome deleteByUrl(String theUrl, List<DeleteConflict> deleteConflicts, RequestDetails theRequest) { StopWatch w = new StopWatch(); Set<Long> resourceIds = myMatchResourceUrlService.processMatchUrl(theUrl, myResourceType); if (resourceIds.size() > 1) { if (myDaoConfig.isAllowMultipleDelete() == false) { throw new PreconditionFailedException(getContext().getLocalizer().getMessage(BaseHapiFhirDao.class, "transactionOperationWithMultipleMatchFailure", "DELETE", theUrl, resourceIds.size())); } } List<ResourceTable> deletedResources = new ArrayList<>(); for (Long pid : resourceIds) { ResourceTable entity = myEntityManager.find(ResourceTable.class, pid); deletedResources.add(entity); T resourceToDelete = toResource(myResourceType, entity, null, false); // Notify IServerOperationInterceptors about pre-action call HookParams hooks = new HookParams() .add(IBaseResource.class, resourceToDelete) .add(RequestDetails.class, theRequest) .addIfMatchesType(ServletRequestDetails.class, theRequest); myInterceptorBroadcaster.callHooks(Pointcut.STORAGE_PRESTORAGE_RESOURCE_DELETED, hooks); validateOkToDelete(deleteConflicts, entity, false); // Notify interceptors IdDt idToDelete = entity.getIdDt(); if (theRequest != null) { ActionRequestDetails requestDetails = new ActionRequestDetails(theRequest, idToDelete.getResourceType(), idToDelete); notifyInterceptors(RestOperationTypeEnum.DELETE, requestDetails); } // Perform delete updateEntityForDelete(theRequest, entity); resourceToDelete.setId(entity.getIdDt()); // Notify JPA interceptors TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { @Override public void beforeCommit(boolean readOnly) { HookParams hookParams = new HookParams() .add(IBaseResource.class, resourceToDelete) .add(RequestDetails.class, theRequest) .addIfMatchesType(ServletRequestDetails.class, theRequest); myInterceptorBroadcaster.callHooks(Pointcut.STORAGE_PRECOMMIT_RESOURCE_DELETED, hookParams); } }); } IBaseOperationOutcome oo; if (deletedResources.isEmpty()) { oo = OperationOutcomeUtil.newInstance(getContext()); String message = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "unableToDeleteNotFound", theUrl); String severity = "warning"; String code = "not-found"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); } else { oo = OperationOutcomeUtil.newInstance(getContext()); String message = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "successfulDeletes", deletedResources.size(), w.getMillis()); String severity = "information"; String code = "informational"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); } ourLog.debug("Processed delete on {} (matched {} resource(s)) in {}ms", theUrl, deletedResources.size(), w.getMillis()); DeleteMethodOutcome retVal = new DeleteMethodOutcome(); retVal.setDeletedEntities(deletedResources); retVal.setOperationOutcome(oo); return retVal; } }
public class class_name { @Override public DeleteMethodOutcome deleteByUrl(String theUrl, List<DeleteConflict> deleteConflicts, RequestDetails theRequest) { StopWatch w = new StopWatch(); Set<Long> resourceIds = myMatchResourceUrlService.processMatchUrl(theUrl, myResourceType); if (resourceIds.size() > 1) { if (myDaoConfig.isAllowMultipleDelete() == false) { throw new PreconditionFailedException(getContext().getLocalizer().getMessage(BaseHapiFhirDao.class, "transactionOperationWithMultipleMatchFailure", "DELETE", theUrl, resourceIds.size())); } } List<ResourceTable> deletedResources = new ArrayList<>(); for (Long pid : resourceIds) { ResourceTable entity = myEntityManager.find(ResourceTable.class, pid); deletedResources.add(entity); // depends on control dependency: [for], data = [none] T resourceToDelete = toResource(myResourceType, entity, null, false); // Notify IServerOperationInterceptors about pre-action call HookParams hooks = new HookParams() .add(IBaseResource.class, resourceToDelete) .add(RequestDetails.class, theRequest) .addIfMatchesType(ServletRequestDetails.class, theRequest); myInterceptorBroadcaster.callHooks(Pointcut.STORAGE_PRESTORAGE_RESOURCE_DELETED, hooks); // depends on control dependency: [for], data = [none] validateOkToDelete(deleteConflicts, entity, false); // depends on control dependency: [for], data = [none] // Notify interceptors IdDt idToDelete = entity.getIdDt(); if (theRequest != null) { ActionRequestDetails requestDetails = new ActionRequestDetails(theRequest, idToDelete.getResourceType(), idToDelete); notifyInterceptors(RestOperationTypeEnum.DELETE, requestDetails); // depends on control dependency: [if], data = [none] } // Perform delete updateEntityForDelete(theRequest, entity); // depends on control dependency: [for], data = [none] resourceToDelete.setId(entity.getIdDt()); // depends on control dependency: [for], data = [none] // Notify JPA interceptors TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { @Override public void beforeCommit(boolean readOnly) { HookParams hookParams = new HookParams() .add(IBaseResource.class, resourceToDelete) .add(RequestDetails.class, theRequest) .addIfMatchesType(ServletRequestDetails.class, theRequest); myInterceptorBroadcaster.callHooks(Pointcut.STORAGE_PRECOMMIT_RESOURCE_DELETED, hookParams); } }); // depends on control dependency: [for], data = [none] } IBaseOperationOutcome oo; if (deletedResources.isEmpty()) { oo = OperationOutcomeUtil.newInstance(getContext()); // depends on control dependency: [if], data = [none] String message = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "unableToDeleteNotFound", theUrl); String severity = "warning"; String code = "not-found"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); // depends on control dependency: [if], data = [none] } else { oo = OperationOutcomeUtil.newInstance(getContext()); // depends on control dependency: [if], data = [none] String message = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "successfulDeletes", deletedResources.size(), w.getMillis()); String severity = "information"; String code = "informational"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); // depends on control dependency: [if], data = [none] } ourLog.debug("Processed delete on {} (matched {} resource(s)) in {}ms", theUrl, deletedResources.size(), w.getMillis()); DeleteMethodOutcome retVal = new DeleteMethodOutcome(); retVal.setDeletedEntities(deletedResources); retVal.setOperationOutcome(oo); return retVal; } }
public class class_name { public static Object convertValue(final Object value, final Class<?> convertType) { if (null == value) { return convertNullValue(convertType); } if (value.getClass() == convertType) { return value; } if (value instanceof Number) { return convertNumberValue(value, convertType); } if (value instanceof Date) { return convertDateValue(value, convertType); } if (String.class.equals(convertType)) { return value.toString(); } else { return value; } } }
public class class_name { public static Object convertValue(final Object value, final Class<?> convertType) { if (null == value) { return convertNullValue(convertType); // depends on control dependency: [if], data = [none] } if (value.getClass() == convertType) { return value; // depends on control dependency: [if], data = [none] } if (value instanceof Number) { return convertNumberValue(value, convertType); // depends on control dependency: [if], data = [none] } if (value instanceof Date) { return convertDateValue(value, convertType); // depends on control dependency: [if], data = [none] } if (String.class.equals(convertType)) { return value.toString(); // depends on control dependency: [if], data = [none] } else { return value; // depends on control dependency: [if], data = [none] } } }
public class class_name { @SuppressWarnings("resource") public String getLogText() { try { String logFilePath = getLogFilePath(); byte[] logData = CmsFileUtil.readFully(new FileInputStream(logFilePath)); return new String(logData, "UTF-8"); } catch (IOException e) { return "Error reading log file: " + getLogFilePath(); } } }
public class class_name { @SuppressWarnings("resource") public String getLogText() { try { String logFilePath = getLogFilePath(); byte[] logData = CmsFileUtil.readFully(new FileInputStream(logFilePath)); return new String(logData, "UTF-8"); // depends on control dependency: [try], data = [none] } catch (IOException e) { return "Error reading log file: " + getLogFilePath(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private static Adapter tryAdapter( Class adapterClass, Object externalContext ) { try { Adapter sa = ( Adapter ) adapterClass.newInstance(); try { AdapterContext context = new AdapterContext( externalContext ); if ( sa.accept( context ) ) { _log.info( "Adapter " + adapterClass.getName() + " accepted." ); sa.setContext( context ); return sa; } else { _log.info( "Adapter " + adapterClass.getName() + " is present but did not accept." ); } } catch ( Exception e ) { _log.error( adapterClass.getName() + ".accept() threw an exception.", e ); } catch ( LinkageError e ) { _log.error( adapterClass.getName() + ".accept() caused a linkage error and may be out of date.", e ); } } catch ( InstantiationException e ) { _log.error( "Could not create instance of Adapter class " + adapterClass.getName(), e ); } catch ( IllegalAccessException e ) { _log.error( "Could not create instance of Adapter class " + adapterClass.getName(), e ); } catch ( Exception e ) { _log.error( "Error creating instance of Adapter class " + adapterClass.getName(), e ); } return null; } }
public class class_name { private static Adapter tryAdapter( Class adapterClass, Object externalContext ) { try { Adapter sa = ( Adapter ) adapterClass.newInstance(); try { AdapterContext context = new AdapterContext( externalContext ); if ( sa.accept( context ) ) { _log.info( "Adapter " + adapterClass.getName() + " accepted." ); // depends on control dependency: [if], data = [none] sa.setContext( context ); // depends on control dependency: [if], data = [none] return sa; // depends on control dependency: [if], data = [none] } else { _log.info( "Adapter " + adapterClass.getName() + " is present but did not accept." ); // depends on control dependency: [if], data = [none] } } catch ( Exception e ) { _log.error( adapterClass.getName() + ".accept() threw an exception.", e ); } // depends on control dependency: [catch], data = [none] catch ( LinkageError e ) { _log.error( adapterClass.getName() + ".accept() caused a linkage error and may be out of date.", e ); } // depends on control dependency: [catch], data = [none] } catch ( InstantiationException e ) { _log.error( "Could not create instance of Adapter class " + adapterClass.getName(), e ); } // depends on control dependency: [catch], data = [none] catch ( IllegalAccessException e ) { _log.error( "Could not create instance of Adapter class " + adapterClass.getName(), e ); } // depends on control dependency: [catch], data = [none] catch ( Exception e ) { _log.error( "Error creating instance of Adapter class " + adapterClass.getName(), e ); } // depends on control dependency: [catch], data = [none] return null; } }
public class class_name { public <A, D> Map<K, D> grouping(Collector<? super V, A, D> downstream) { Function<Entry<K, V>, K> keyMapper = Entry::getKey; Collector<Entry<K, V>, ?, D> mapping = Collectors.mapping(Entry::getValue, downstream); if (isParallel() && downstream.characteristics().contains(Characteristics.UNORDERED)) { return collect(Collectors.groupingByConcurrent(keyMapper, mapping)); } return collect(Collectors.groupingBy(keyMapper, mapping)); } }
public class class_name { public <A, D> Map<K, D> grouping(Collector<? super V, A, D> downstream) { Function<Entry<K, V>, K> keyMapper = Entry::getKey; Collector<Entry<K, V>, ?, D> mapping = Collectors.mapping(Entry::getValue, downstream); if (isParallel() && downstream.characteristics().contains(Characteristics.UNORDERED)) { return collect(Collectors.groupingByConcurrent(keyMapper, mapping)); // depends on control dependency: [if], data = [none] } return collect(Collectors.groupingBy(keyMapper, mapping)); } }
public class class_name { private static InternetHeaders getManifestProperties(File manifest) { final InternetHeaders result = new InternetHeaders(); if (null == manifest) { LOGGER.debug("Manifest file not found."); } else { try (InputStream in = new BufferedInputStream(new FileInputStream(manifest))) { result.load(in); } catch (MessagingException | FileNotFoundException e) { LOGGER.warn(e.getMessage(), e); } catch (IOException ex) { LOGGER.warn(ex.getMessage(), ex); } } return result; } }
public class class_name { private static InternetHeaders getManifestProperties(File manifest) { final InternetHeaders result = new InternetHeaders(); if (null == manifest) { LOGGER.debug("Manifest file not found."); // depends on control dependency: [if], data = [none] } else { try (InputStream in = new BufferedInputStream(new FileInputStream(manifest))) { result.load(in); } catch (MessagingException | FileNotFoundException e) { LOGGER.warn(e.getMessage(), e); } catch (IOException ex) { LOGGER.warn(ex.getMessage(), ex); } } return result; } }
public class class_name { public static String ptb2Text(String ptbText) { StringBuilder sb = new StringBuilder(ptbText.length()); // probably an overestimate PTB2TextLexer lexer = new PTB2TextLexer(new StringReader(ptbText)); try { for (String token; (token = lexer.next()) != null; ) { sb.append(token); } } catch (IOException e) { e.printStackTrace(); } return sb.toString(); } }
public class class_name { public static String ptb2Text(String ptbText) { StringBuilder sb = new StringBuilder(ptbText.length()); // probably an overestimate PTB2TextLexer lexer = new PTB2TextLexer(new StringReader(ptbText)); try { for (String token; (token = lexer.next()) != null; ) { sb.append(token); // depends on control dependency: [for], data = [none] } } catch (IOException e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] return sb.toString(); } }
public class class_name { public String findTypeWithMatchingNamespace(String prefix) { prefix = prefix + "."; // This must be sorted so that errors are deterministic, or we'll break integration tests. for (String name : getAllSortedTypeNames()) { if (name.startsWith(prefix)) { return name; } } return null; } }
public class class_name { public String findTypeWithMatchingNamespace(String prefix) { prefix = prefix + "."; // This must be sorted so that errors are deterministic, or we'll break integration tests. for (String name : getAllSortedTypeNames()) { if (name.startsWith(prefix)) { return name; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { private JCExpression bracketsOpt(JCExpression t, List<JCAnnotation> annotations) { List<JCAnnotation> nextLevelAnnotations = typeAnnotationsOpt(); if (token.kind == LBRACKET) { int pos = token.pos; nextToken(); t = bracketsOptCont(t, pos, nextLevelAnnotations); } else if (!nextLevelAnnotations.isEmpty()) { if (permitTypeAnnotationsPushBack) { this.typeAnnotationsPushedBack = nextLevelAnnotations; } else { return illegal(nextLevelAnnotations.head.pos); } } if (!annotations.isEmpty()) { t = toP(F.at(token.pos).AnnotatedType(annotations, t)); } return t; } }
public class class_name { private JCExpression bracketsOpt(JCExpression t, List<JCAnnotation> annotations) { List<JCAnnotation> nextLevelAnnotations = typeAnnotationsOpt(); if (token.kind == LBRACKET) { int pos = token.pos; nextToken(); // depends on control dependency: [if], data = [none] t = bracketsOptCont(t, pos, nextLevelAnnotations); // depends on control dependency: [if], data = [none] } else if (!nextLevelAnnotations.isEmpty()) { if (permitTypeAnnotationsPushBack) { this.typeAnnotationsPushedBack = nextLevelAnnotations; // depends on control dependency: [if], data = [none] } else { return illegal(nextLevelAnnotations.head.pos); // depends on control dependency: [if], data = [none] } } if (!annotations.isEmpty()) { t = toP(F.at(token.pos).AnnotatedType(annotations, t)); // depends on control dependency: [if], data = [none] } return t; } }
public class class_name { public ExclusionPreview withScopes(Scope... scopes) { if (this.scopes == null) { setScopes(new java.util.ArrayList<Scope>(scopes.length)); } for (Scope ele : scopes) { this.scopes.add(ele); } return this; } }
public class class_name { public ExclusionPreview withScopes(Scope... scopes) { if (this.scopes == null) { setScopes(new java.util.ArrayList<Scope>(scopes.length)); // depends on control dependency: [if], data = [none] } for (Scope ele : scopes) { this.scopes.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { private void deliverMasterYieldResponse(int fromPlayer, boolean yielded) { for (final MasterHandoffListener listener : getMasterHandoffListeners()) { try { listener.yieldResponse(fromPlayer, yielded); } catch (Throwable t) { logger.warn("Problem delivering master yield response to listener", t); } } } }
public class class_name { private void deliverMasterYieldResponse(int fromPlayer, boolean yielded) { for (final MasterHandoffListener listener : getMasterHandoffListeners()) { try { listener.yieldResponse(fromPlayer, yielded); // depends on control dependency: [try], data = [none] } catch (Throwable t) { logger.warn("Problem delivering master yield response to listener", t); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public boolean computeDirect( DMatrixRMaj A ) { initPower(A); boolean converged = false; for( int i = 0; i < maxIterations && !converged; i++ ) { // q0.print(); CommonOps_DDRM.mult(A,q0,q1); double s = NormOps_DDRM.normPInf(q1); CommonOps_DDRM.divide(q1,s,q2); converged = checkConverged(A); } return converged; } }
public class class_name { public boolean computeDirect( DMatrixRMaj A ) { initPower(A); boolean converged = false; for( int i = 0; i < maxIterations && !converged; i++ ) { // q0.print(); CommonOps_DDRM.mult(A,q0,q1); // depends on control dependency: [for], data = [none] double s = NormOps_DDRM.normPInf(q1); CommonOps_DDRM.divide(q1,s,q2); // depends on control dependency: [for], data = [none] converged = checkConverged(A); // depends on control dependency: [for], data = [none] } return converged; } }
public class class_name { private static <T> Method getGetter(Class<T> clazz, Field f){ String getterName = "get" + StringUtils.capitalize(f.getName()); Method getter = null; try { getter = clazz.getMethod(getterName); } catch (Exception e) { logger.debug(getterName + " doesn't exist!",e); } return getter; } }
public class class_name { private static <T> Method getGetter(Class<T> clazz, Field f){ String getterName = "get" + StringUtils.capitalize(f.getName()); Method getter = null; try { getter = clazz.getMethod(getterName); // depends on control dependency: [try], data = [none] } catch (Exception e) { logger.debug(getterName + " doesn't exist!",e); } // depends on control dependency: [catch], data = [none] return getter; } }
public class class_name { public static Set<Class<?>> scanForAnnotatedClassesFromSet(final File directory, final String packagePath, final Set<Class<? extends Annotation>> annotationClasses) throws ClassNotFoundException { final Set<Class<?>> foundClasses = new HashSet<>(); if (!directory.exists()) { return foundClasses; } // define the include filefilter for class files... final FileFilter includeFileFilter = new ClassFileFilter(); final File[] files = directory.listFiles(includeFileFilter); for (final File file : files) { String qualifiedClassname = null; if (file.isDirectory()) { qualifiedClassname = packagePath + "." + file.getName(); foundClasses.addAll( scanForAnnotatedClassesFromSet(file, qualifiedClassname, annotationClasses)); } else { final String filename = FilenameExtensions.getFilenameWithoutExtension(file); qualifiedClassname = packagePath + '.' + filename; Class<?> foundClass = null; try { foundClass = Class.forName(qualifiedClassname); resolveAnnotatedClasses(annotationClasses, foundClasses, foundClass); } catch (final Throwable throwable) { foundClass = Class.forName(qualifiedClassname, false, ClassExtensions.getClassLoader()); resolveAnnotatedClasses(annotationClasses, foundClasses, foundClass); } } } return foundClasses; } }
public class class_name { public static Set<Class<?>> scanForAnnotatedClassesFromSet(final File directory, final String packagePath, final Set<Class<? extends Annotation>> annotationClasses) throws ClassNotFoundException { final Set<Class<?>> foundClasses = new HashSet<>(); if (!directory.exists()) { return foundClasses; // depends on control dependency: [if], data = [none] } // define the include filefilter for class files... final FileFilter includeFileFilter = new ClassFileFilter(); final File[] files = directory.listFiles(includeFileFilter); for (final File file : files) { String qualifiedClassname = null; if (file.isDirectory()) { qualifiedClassname = packagePath + "." + file.getName(); // depends on control dependency: [if], data = [none] foundClasses.addAll( scanForAnnotatedClassesFromSet(file, qualifiedClassname, annotationClasses)); // depends on control dependency: [if], data = [none] } else { final String filename = FilenameExtensions.getFilenameWithoutExtension(file); qualifiedClassname = packagePath + '.' + filename; // depends on control dependency: [if], data = [none] Class<?> foundClass = null; // depends on control dependency: [if], data = [none] try { foundClass = Class.forName(qualifiedClassname); // depends on control dependency: [try], data = [none] resolveAnnotatedClasses(annotationClasses, foundClasses, foundClass); // depends on control dependency: [try], data = [none] } catch (final Throwable throwable) { foundClass = Class.forName(qualifiedClassname, false, ClassExtensions.getClassLoader()); resolveAnnotatedClasses(annotationClasses, foundClasses, foundClass); } // depends on control dependency: [catch], data = [none] } } return foundClasses; } }
public class class_name { private void internalUpdateJobStateAndResult(final JobInstance job) { transactionTemplate.execute(new TransactionCallbackWithoutResult() { protected void doInTransactionWithoutResult(TransactionStatus status) { jobInstanceDao.updateStateAndResult(job); if (job.isCompleted()) { buildPropertiesService.saveCruiseProperties(job); } } }); } }
public class class_name { private void internalUpdateJobStateAndResult(final JobInstance job) { transactionTemplate.execute(new TransactionCallbackWithoutResult() { protected void doInTransactionWithoutResult(TransactionStatus status) { jobInstanceDao.updateStateAndResult(job); if (job.isCompleted()) { buildPropertiesService.saveCruiseProperties(job); // depends on control dependency: [if], data = [none] } } }); } }
public class class_name { @SuppressWarnings({ "rawtypes", "unchecked" }) private GeoResults<?> buildGeoResults(final ArangoCursor<?> cursor) { final List<GeoResult<?>> list = new LinkedList<>(); cursor.forEachRemaining(o -> { final GeoResult<?> geoResult = buildGeoResult(o); if (geoResult != null) { list.add(geoResult); } }); return new GeoResults(list); } }
public class class_name { @SuppressWarnings({ "rawtypes", "unchecked" }) private GeoResults<?> buildGeoResults(final ArangoCursor<?> cursor) { final List<GeoResult<?>> list = new LinkedList<>(); cursor.forEachRemaining(o -> { final GeoResult<?> geoResult = buildGeoResult(o); if (geoResult != null) { list.add(geoResult); // depends on control dependency: [if], data = [(geoResult] } }); return new GeoResults(list); } }
public class class_name { public EClass getIfcEvaporativeCoolerType() { if (ifcEvaporativeCoolerTypeEClass == null) { ifcEvaporativeCoolerTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(211); } return ifcEvaporativeCoolerTypeEClass; } }
public class class_name { public EClass getIfcEvaporativeCoolerType() { if (ifcEvaporativeCoolerTypeEClass == null) { ifcEvaporativeCoolerTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(211); // depends on control dependency: [if], data = [none] } return ifcEvaporativeCoolerTypeEClass; } }
public class class_name { public void marshall(SamplingTargetDocument samplingTargetDocument, ProtocolMarshaller protocolMarshaller) { if (samplingTargetDocument == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(samplingTargetDocument.getRuleName(), RULENAME_BINDING); protocolMarshaller.marshall(samplingTargetDocument.getFixedRate(), FIXEDRATE_BINDING); protocolMarshaller.marshall(samplingTargetDocument.getReservoirQuota(), RESERVOIRQUOTA_BINDING); protocolMarshaller.marshall(samplingTargetDocument.getReservoirQuotaTTL(), RESERVOIRQUOTATTL_BINDING); protocolMarshaller.marshall(samplingTargetDocument.getInterval(), INTERVAL_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(SamplingTargetDocument samplingTargetDocument, ProtocolMarshaller protocolMarshaller) { if (samplingTargetDocument == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(samplingTargetDocument.getRuleName(), RULENAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(samplingTargetDocument.getFixedRate(), FIXEDRATE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(samplingTargetDocument.getReservoirQuota(), RESERVOIRQUOTA_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(samplingTargetDocument.getReservoirQuotaTTL(), RESERVOIRQUOTATTL_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(samplingTargetDocument.getInterval(), INTERVAL_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public String[] getParameterValues(String name) { if (m_escaper != null) { return m_escaper.escape(name, m_parameters.get(name)); } else { return m_parameters.get(name); } } }
public class class_name { @Override public String[] getParameterValues(String name) { if (m_escaper != null) { return m_escaper.escape(name, m_parameters.get(name)); // depends on control dependency: [if], data = [none] } else { return m_parameters.get(name); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static SoyValue minus(SoyValue operand0, SoyValue operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return IntegerData.forValue(operand0.longValue() - operand1.longValue()); } else { return FloatData.forValue(operand0.numberValue() - operand1.numberValue()); } } }
public class class_name { public static SoyValue minus(SoyValue operand0, SoyValue operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return IntegerData.forValue(operand0.longValue() - operand1.longValue()); // depends on control dependency: [if], data = [none] } else { return FloatData.forValue(operand0.numberValue() - operand1.numberValue()); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected String getFormattedNodeXml(final Node nodeToConvert, boolean formatXml) { String formattedNodeXml; try { final int numberOfBlanksToIndent = formatXml ? 2 : -1; final Transformer transformer = createXmlTransformer(numberOfBlanksToIndent); final StringWriter buffer = new StringWriter(); transformer.transform(new DOMSource(nodeToConvert), new StreamResult(buffer)); formattedNodeXml = buffer.toString(); } catch (final Exception e) { formattedNodeXml = "ERROR " + e.getMessage(); } return formattedNodeXml; } }
public class class_name { protected String getFormattedNodeXml(final Node nodeToConvert, boolean formatXml) { String formattedNodeXml; try { final int numberOfBlanksToIndent = formatXml ? 2 : -1; final Transformer transformer = createXmlTransformer(numberOfBlanksToIndent); final StringWriter buffer = new StringWriter(); transformer.transform(new DOMSource(nodeToConvert), new StreamResult(buffer)); // depends on control dependency: [try], data = [none] formattedNodeXml = buffer.toString(); // depends on control dependency: [try], data = [none] } catch (final Exception e) { formattedNodeXml = "ERROR " + e.getMessage(); } // depends on control dependency: [catch], data = [none] return formattedNodeXml; } }
public class class_name { public V remove (K key) { int hashCode = key.hashCode(); int index = hashCode & mask; if (key.equals(keyTable[index])) { keyTable[index] = null; V oldValue = valueTable[index]; valueTable[index] = null; size--; return oldValue; } index = hash2(hashCode); if (key.equals(keyTable[index])) { keyTable[index] = null; V oldValue = valueTable[index]; valueTable[index] = null; size--; return oldValue; } index = hash3(hashCode); if (key.equals(keyTable[index])) { keyTable[index] = null; V oldValue = valueTable[index]; valueTable[index] = null; size--; return oldValue; } if (bigTable) { index = hash4(hashCode); if (key.equals(keyTable[index])) { keyTable[index] = null; V oldValue = valueTable[index]; valueTable[index] = null; size--; return oldValue; } } return removeStash(key); } }
public class class_name { public V remove (K key) { int hashCode = key.hashCode(); int index = hashCode & mask; if (key.equals(keyTable[index])) { keyTable[index] = null; // depends on control dependency: [if], data = [none] V oldValue = valueTable[index]; valueTable[index] = null; // depends on control dependency: [if], data = [none] size--; // depends on control dependency: [if], data = [none] return oldValue; // depends on control dependency: [if], data = [none] } index = hash2(hashCode); if (key.equals(keyTable[index])) { keyTable[index] = null; // depends on control dependency: [if], data = [none] V oldValue = valueTable[index]; valueTable[index] = null; // depends on control dependency: [if], data = [none] size--; // depends on control dependency: [if], data = [none] return oldValue; // depends on control dependency: [if], data = [none] } index = hash3(hashCode); if (key.equals(keyTable[index])) { keyTable[index] = null; // depends on control dependency: [if], data = [none] V oldValue = valueTable[index]; valueTable[index] = null; // depends on control dependency: [if], data = [none] size--; // depends on control dependency: [if], data = [none] return oldValue; // depends on control dependency: [if], data = [none] } if (bigTable) { index = hash4(hashCode); // depends on control dependency: [if], data = [none] if (key.equals(keyTable[index])) { keyTable[index] = null; // depends on control dependency: [if], data = [none] V oldValue = valueTable[index]; valueTable[index] = null; // depends on control dependency: [if], data = [none] size--; // depends on control dependency: [if], data = [none] return oldValue; // depends on control dependency: [if], data = [none] } } return removeStash(key); } }
public class class_name { public ListVerifiedEmailAddressesResult withVerifiedEmailAddresses(String... verifiedEmailAddresses) { if (this.verifiedEmailAddresses == null) { setVerifiedEmailAddresses(new com.amazonaws.internal.SdkInternalList<String>(verifiedEmailAddresses.length)); } for (String ele : verifiedEmailAddresses) { this.verifiedEmailAddresses.add(ele); } return this; } }
public class class_name { public ListVerifiedEmailAddressesResult withVerifiedEmailAddresses(String... verifiedEmailAddresses) { if (this.verifiedEmailAddresses == null) { setVerifiedEmailAddresses(new com.amazonaws.internal.SdkInternalList<String>(verifiedEmailAddresses.length)); // depends on control dependency: [if], data = [none] } for (String ele : verifiedEmailAddresses) { this.verifiedEmailAddresses.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { private PsiClass getPsiClassFromContext(AnActionEvent e) { PsiFile psiFile = e.getData(LangDataKeys.PSI_FILE); Editor editor = e.getData(PlatformDataKeys.EDITOR); if (psiFile == null || editor == null) { return null; } int offset = editor.getCaretModel().getOffset(); PsiElement element = psiFile.findElementAt(offset); return PsiTreeUtil.getParentOfType(element, PsiClass.class); } }
public class class_name { private PsiClass getPsiClassFromContext(AnActionEvent e) { PsiFile psiFile = e.getData(LangDataKeys.PSI_FILE); Editor editor = e.getData(PlatformDataKeys.EDITOR); if (psiFile == null || editor == null) { return null; // depends on control dependency: [if], data = [none] } int offset = editor.getCaretModel().getOffset(); PsiElement element = psiFile.findElementAt(offset); return PsiTreeUtil.getParentOfType(element, PsiClass.class); } }
public class class_name { @Override public AtomicValue evaluate() { boolean satisfiesCond = false; for (AbsAxis axis : mVars) { while (axis.hasNext()) { if (mSatisfy.hasNext()) { // condition is satisfied for this item -> expression is // true satisfiesCond = true; break; } } } AtomicValue val = new AtomicValue(TypedValue.getBytes(Boolean.toString(satisfiesCond)), NamePageHash .generateHashForString("xs:boolean")); final int mItemKey = getItemList().addItem(val); moveTo(mItemKey); return val; } }
public class class_name { @Override public AtomicValue evaluate() { boolean satisfiesCond = false; for (AbsAxis axis : mVars) { while (axis.hasNext()) { if (mSatisfy.hasNext()) { // condition is satisfied for this item -> expression is // true satisfiesCond = true; // depends on control dependency: [if], data = [none] break; } } } AtomicValue val = new AtomicValue(TypedValue.getBytes(Boolean.toString(satisfiesCond)), NamePageHash .generateHashForString("xs:boolean")); final int mItemKey = getItemList().addItem(val); moveTo(mItemKey); return val; } }
public class class_name { protected String getSeparatorPlusAffinityToken(String sessId) { StringBuffer separatorPlusAffToken = new StringBuffer(); String affToken = _store.getAffinityToken(sessId, _sessCtx.getAppName()); if (affToken == null) { // store has not overridden token impl affToken = _cloneID; } if (affToken != null && affToken.length() > 0) { separatorPlusAffToken.append(SessionManagerConfig.getCloneSeparator()).append(affToken); } return separatorPlusAffToken.toString(); } }
public class class_name { protected String getSeparatorPlusAffinityToken(String sessId) { StringBuffer separatorPlusAffToken = new StringBuffer(); String affToken = _store.getAffinityToken(sessId, _sessCtx.getAppName()); if (affToken == null) { // store has not overridden token impl affToken = _cloneID; // depends on control dependency: [if], data = [none] } if (affToken != null && affToken.length() > 0) { separatorPlusAffToken.append(SessionManagerConfig.getCloneSeparator()).append(affToken); // depends on control dependency: [if], data = [(affToken] } return separatorPlusAffToken.toString(); } }
public class class_name { @Override public Promise<Void> put(@Nullable T value) { assert put == null; if (exception == null) { if (take != null) { SettablePromise<T> take = this.take; this.take = null; take.set(value); return Promise.complete(); } this.value = value; this.put = new SettablePromise<>(); return put; } else { tryRecycle(value); return Promise.ofException(exception); } } }
public class class_name { @Override public Promise<Void> put(@Nullable T value) { assert put == null; if (exception == null) { if (take != null) { SettablePromise<T> take = this.take; this.take = null; // depends on control dependency: [if], data = [none] take.set(value); // depends on control dependency: [if], data = [none] return Promise.complete(); // depends on control dependency: [if], data = [none] } this.value = value; // depends on control dependency: [if], data = [none] this.put = new SettablePromise<>(); // depends on control dependency: [if], data = [none] return put; // depends on control dependency: [if], data = [none] } else { tryRecycle(value); // depends on control dependency: [if], data = [none] return Promise.ofException(exception); // depends on control dependency: [if], data = [(exception] } } }
public class class_name { String indent(String s) { if (count > 0) { // don't bother indenting if the level is zero StringBuilder sb = new StringBuilder(); sb.append("\n"); sb.append(getIndentation()); StringBuilder r = new StringBuilder(); r.append(getIndentation()); r.append(s.replaceAll("\n", sb.toString())); return r.toString(); } else { return s; } } }
public class class_name { String indent(String s) { if (count > 0) { // don't bother indenting if the level is zero StringBuilder sb = new StringBuilder(); sb.append("\n"); // depends on control dependency: [if], data = [none] sb.append(getIndentation()); // depends on control dependency: [if], data = [none] StringBuilder r = new StringBuilder(); r.append(getIndentation()); // depends on control dependency: [if], data = [none] r.append(s.replaceAll("\n", sb.toString())); // depends on control dependency: [if], data = [none] return r.toString(); // depends on control dependency: [if], data = [none] } else { return s; // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setIdpIdentifiers(java.util.Collection<String> idpIdentifiers) { if (idpIdentifiers == null) { this.idpIdentifiers = null; return; } this.idpIdentifiers = new java.util.ArrayList<String>(idpIdentifiers); } }
public class class_name { public void setIdpIdentifiers(java.util.Collection<String> idpIdentifiers) { if (idpIdentifiers == null) { this.idpIdentifiers = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.idpIdentifiers = new java.util.ArrayList<String>(idpIdentifiers); } }
public class class_name { public static int fromBinary(boolean[] binary) { Check.notNull(binary); int number = 0; for (final boolean current : binary) { number = number << 1 | boolToInt(current); } return number; } }
public class class_name { public static int fromBinary(boolean[] binary) { Check.notNull(binary); int number = 0; for (final boolean current : binary) { number = number << 1 | boolToInt(current); // depends on control dependency: [for], data = [current] } return number; } }
public class class_name { public Object getValue(final Object targetObj) { ArgUtils.notNull(targetObj, "targetObj"); if(targetGetter.isPresent()) { try { return targetGetter.get().invoke(targetObj); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { throw new FieldAccessException(this, "fail getter value", e); } } else if(targetField.isPresent()) { try { return targetField.get().get(targetObj); } catch (IllegalArgumentException | IllegalAccessException e) { throw new FieldAccessException(this, "fail get field value", e); } } else { throw new FieldAccessException(this, "not found getter method or field."); } } }
public class class_name { public Object getValue(final Object targetObj) { ArgUtils.notNull(targetObj, "targetObj"); if(targetGetter.isPresent()) { try { return targetGetter.get().invoke(targetObj); // depends on control dependency: [try], data = [none] } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { throw new FieldAccessException(this, "fail getter value", e); } // depends on control dependency: [catch], data = [none] } else if(targetField.isPresent()) { try { return targetField.get().get(targetObj); // depends on control dependency: [try], data = [none] } catch (IllegalArgumentException | IllegalAccessException e) { throw new FieldAccessException(this, "fail get field value", e); } // depends on control dependency: [catch], data = [none] } else { throw new FieldAccessException(this, "not found getter method or field."); } } }
public class class_name { private void getStrings(HashSet<String> strHashSet, SearchCondition searchCondition, String searchConditionString, String prefixString, SimpleMDAGNode node) { int transitionSetBegin = node.getTransitionSetBeginIndex(); int onePastTransitionSetEnd = transitionSetBegin + node.getOutgoingTransitionSetSize(); //Traverse all the valid _transition paths beginning from each _transition in transitionTreeMap, inserting the //corresponding Strings in to strHashSet that have the relationship with conditionString denoted by searchCondition for (int i = transitionSetBegin; i < onePastTransitionSetEnd; i++) { SimpleMDAGNode currentNode = mdagDataArray[i]; String newPrefixString = prefixString + currentNode.getLetter(); if (currentNode.isAcceptNode() && searchCondition.satisfiesCondition(newPrefixString, searchConditionString)) strHashSet.add(newPrefixString); //Recursively call this to traverse all the valid _transition paths from currentNode getStrings(strHashSet, searchCondition, searchConditionString, newPrefixString, currentNode); } ///// } }
public class class_name { private void getStrings(HashSet<String> strHashSet, SearchCondition searchCondition, String searchConditionString, String prefixString, SimpleMDAGNode node) { int transitionSetBegin = node.getTransitionSetBeginIndex(); int onePastTransitionSetEnd = transitionSetBegin + node.getOutgoingTransitionSetSize(); //Traverse all the valid _transition paths beginning from each _transition in transitionTreeMap, inserting the //corresponding Strings in to strHashSet that have the relationship with conditionString denoted by searchCondition for (int i = transitionSetBegin; i < onePastTransitionSetEnd; i++) { SimpleMDAGNode currentNode = mdagDataArray[i]; String newPrefixString = prefixString + currentNode.getLetter(); if (currentNode.isAcceptNode() && searchCondition.satisfiesCondition(newPrefixString, searchConditionString)) strHashSet.add(newPrefixString); //Recursively call this to traverse all the valid _transition paths from currentNode getStrings(strHashSet, searchCondition, searchConditionString, newPrefixString, currentNode); // depends on control dependency: [for], data = [none] } ///// } }
public class class_name { public void marshall(OrderByElement orderByElement, ProtocolMarshaller protocolMarshaller) { if (orderByElement == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(orderByElement.getFieldName(), FIELDNAME_BINDING); protocolMarshaller.marshall(orderByElement.getSortOrder(), SORTORDER_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(OrderByElement orderByElement, ProtocolMarshaller protocolMarshaller) { if (orderByElement == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(orderByElement.getFieldName(), FIELDNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(orderByElement.getSortOrder(), SORTORDER_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 final AntlrDatatypeRuleToken ruleOpAnd() throws RecognitionException { AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); Token kw=null; enterRule(); try { // InternalPureXbase.g:1219:2: (kw= '&&' ) // InternalPureXbase.g:1220:2: kw= '&&' { kw=(Token)match(input,32,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpAndAccess().getAmpersandAmpersandKeyword()); } } if ( state.backtracking==0 ) { leaveRule(); } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; } }
public class class_name { public final AntlrDatatypeRuleToken ruleOpAnd() throws RecognitionException { AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); Token kw=null; enterRule(); try { // InternalPureXbase.g:1219:2: (kw= '&&' ) // InternalPureXbase.g:1220:2: kw= '&&' { kw=(Token)match(input,32,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpAndAccess().getAmpersandAmpersandKeyword()); // depends on control dependency: [if], data = [none] } } if ( state.backtracking==0 ) { leaveRule(); // depends on control dependency: [if], data = [none] } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; } }
public class class_name { public void marshall(DeleteProvisioningArtifactRequest deleteProvisioningArtifactRequest, ProtocolMarshaller protocolMarshaller) { if (deleteProvisioningArtifactRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteProvisioningArtifactRequest.getAcceptLanguage(), ACCEPTLANGUAGE_BINDING); protocolMarshaller.marshall(deleteProvisioningArtifactRequest.getProductId(), PRODUCTID_BINDING); protocolMarshaller.marshall(deleteProvisioningArtifactRequest.getProvisioningArtifactId(), PROVISIONINGARTIFACTID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DeleteProvisioningArtifactRequest deleteProvisioningArtifactRequest, ProtocolMarshaller protocolMarshaller) { if (deleteProvisioningArtifactRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteProvisioningArtifactRequest.getAcceptLanguage(), ACCEPTLANGUAGE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(deleteProvisioningArtifactRequest.getProductId(), PRODUCTID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(deleteProvisioningArtifactRequest.getProvisioningArtifactId(), PROVISIONINGARTIFACTID_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 void implicitDoubleStep( int x1 , int x2 ) { if( printHumps ) System.out.println("Performing implicit double step"); // compute the wilkinson shift double z11 = A.get(x2 - 1, x2 - 1); double z12 = A.get(x2 - 1, x2); double z21 = A.get(x2, x2 - 1); double z22 = A.get(x2, x2); double a11 = A.get(x1,x1); double a21 = A.get(x1+1,x1); double a12 = A.get(x1,x1+1); double a22 = A.get(x1+1,x1+1); double a32 = A.get(x1+2,x1+1); if( normalize ) { temp[0] = a11;temp[1] = a21;temp[2] = a12;temp[3] = a22;temp[4] = a32; temp[5] = z11;temp[6] = z22;temp[7] = z12;temp[8] = z21; double max = Math.abs(temp[0]); for( int j = 1; j < temp.length; j++ ) { if( Math.abs(temp[j]) > max ) max = Math.abs(temp[j]); } a11 /= max;a21 /= max;a12 /= max;a22 /= max;a32 /= max; z11 /= max;z22 /= max;z12 /= max;z21 /= max; } // these equations are derived when the eigenvalues are extracted from the lower right // 2 by 2 matrix. See page 388 of Fundamentals of Matrix Computations 2nd ed for details. double b11,b21,b31; if( useStandardEq ) { b11 = ((a11- z11)*(a11- z22)- z21 * z12)/a21 + a12; b21 = a11 + a22 - z11 - z22; b31 = a32; } else { // this is different from the version in the book and seems in my testing to be more resilient to // over flow issues b11 = ((a11- z11)*(a11- z22)- z21 * z12) + a12*a21; b21 = (a11 + a22 - z11 - z22)*a21; b31 = a32*a21; } performImplicitDoubleStep(x1, x2, b11 , b21 , b31 ); } }
public class class_name { public void implicitDoubleStep( int x1 , int x2 ) { if( printHumps ) System.out.println("Performing implicit double step"); // compute the wilkinson shift double z11 = A.get(x2 - 1, x2 - 1); double z12 = A.get(x2 - 1, x2); double z21 = A.get(x2, x2 - 1); double z22 = A.get(x2, x2); double a11 = A.get(x1,x1); double a21 = A.get(x1+1,x1); double a12 = A.get(x1,x1+1); double a22 = A.get(x1+1,x1+1); double a32 = A.get(x1+2,x1+1); if( normalize ) { temp[0] = a11;temp[1] = a21;temp[2] = a12;temp[3] = a22;temp[4] = a32; // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] temp[5] = z11;temp[6] = z22;temp[7] = z12;temp[8] = z21; // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] double max = Math.abs(temp[0]); for( int j = 1; j < temp.length; j++ ) { if( Math.abs(temp[j]) > max ) max = Math.abs(temp[j]); } a11 /= max;a21 /= max;a12 /= max;a22 /= max;a32 /= max; // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] z11 /= max;z22 /= max;z12 /= max;z21 /= max; // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] } // these equations are derived when the eigenvalues are extracted from the lower right // 2 by 2 matrix. See page 388 of Fundamentals of Matrix Computations 2nd ed for details. double b11,b21,b31; if( useStandardEq ) { b11 = ((a11- z11)*(a11- z22)- z21 * z12)/a21 + a12; // depends on control dependency: [if], data = [none] b21 = a11 + a22 - z11 - z22; // depends on control dependency: [if], data = [none] b31 = a32; // depends on control dependency: [if], data = [none] } else { // this is different from the version in the book and seems in my testing to be more resilient to // over flow issues b11 = ((a11- z11)*(a11- z22)- z21 * z12) + a12*a21; // depends on control dependency: [if], data = [none] b21 = (a11 + a22 - z11 - z22)*a21; // depends on control dependency: [if], data = [none] b31 = a32*a21; // depends on control dependency: [if], data = [none] } performImplicitDoubleStep(x1, x2, b11 , b21 , b31 ); } }
public class class_name { public Asset open(final String fileName, AccessMode mode) { synchronized (mLock) { LOG_FATAL_IF(mAssetPaths.isEmpty(), "No assets added to AssetManager"); String8 assetName = new String8(kAssetsRoot); assetName.appendPath(fileName); /* * For each top-level asset path, search for the asset. */ int i = mAssetPaths.size(); while (i > 0) { i--; ALOGV("Looking for asset '%s' in '%s'\n", assetName.string(), mAssetPaths.get(i).path.string()); Asset pAsset = openNonAssetInPathLocked(assetName.string(), mode, mAssetPaths.get(i)); if (pAsset != null) { return Objects.equals(pAsset, kExcludedAsset) ? null : pAsset; } } return null; } } }
public class class_name { public Asset open(final String fileName, AccessMode mode) { synchronized (mLock) { LOG_FATAL_IF(mAssetPaths.isEmpty(), "No assets added to AssetManager"); String8 assetName = new String8(kAssetsRoot); assetName.appendPath(fileName); /* * For each top-level asset path, search for the asset. */ int i = mAssetPaths.size(); while (i > 0) { i--; // depends on control dependency: [while], data = [none] ALOGV("Looking for asset '%s' in '%s'\n", assetName.string(), mAssetPaths.get(i).path.string()); // depends on control dependency: [while], data = [none] Asset pAsset = openNonAssetInPathLocked(assetName.string(), mode, mAssetPaths.get(i)); if (pAsset != null) { return Objects.equals(pAsset, kExcludedAsset) ? null : pAsset; // depends on control dependency: [if], data = [(pAsset] } } return null; } } }
public class class_name { public static void startLiveValidation(final Object target, final View formContainer, final IValidationCallback callback) { if (formContainer == null) { throw new IllegalArgumentException("form container view cannot be null"); } if (target == null) { throw new IllegalArgumentException("target cannot be null"); } if (sLiveValidations == null) { sLiveValidations = new HashMap<>(); } else if (sLiveValidations.containsKey(target)) { // validation is already running return; } final Map<View, FieldInfo> infoMap = FieldFinder.getFieldsForTarget(target); final ViewGlobalFocusChangeListener listener = new ViewGlobalFocusChangeListener(infoMap, formContainer, target, callback); final ViewTreeObserver observer = formContainer.getViewTreeObserver(); observer.addOnGlobalFocusChangeListener(listener); sLiveValidations.put(target, listener); } }
public class class_name { public static void startLiveValidation(final Object target, final View formContainer, final IValidationCallback callback) { if (formContainer == null) { throw new IllegalArgumentException("form container view cannot be null"); } if (target == null) { throw new IllegalArgumentException("target cannot be null"); } if (sLiveValidations == null) { sLiveValidations = new HashMap<>(); // depends on control dependency: [if], data = [none] } else if (sLiveValidations.containsKey(target)) { // validation is already running return; // depends on control dependency: [if], data = [none] } final Map<View, FieldInfo> infoMap = FieldFinder.getFieldsForTarget(target); final ViewGlobalFocusChangeListener listener = new ViewGlobalFocusChangeListener(infoMap, formContainer, target, callback); final ViewTreeObserver observer = formContainer.getViewTreeObserver(); observer.addOnGlobalFocusChangeListener(listener); sLiveValidations.put(target, listener); } }
public class class_name { public static boolean ensureZeros(ByteBuffer byteBuffer, int position, int count) throws IOException { if(count<0) throw new IllegalArgumentException("count<0: "+count); boolean modified = false; /* byte[] buff = BufferManager.getBytes(); try { while(count>BufferManager.BUFFER_SIZE) { byteBuffer.position(position); byteBuffer.get(buff, 0, BufferManager.BUFFER_SIZE); if(!Arrays.equals(buff, zeros)) { byteBuffer.position(position); byteBuffer.put(zeros, 0, BufferManager.BUFFER_SIZE); modified = true; } position += BufferManager.BUFFER_SIZE; count -= BufferManager.BUFFER_SIZE; } if(count>0) { byteBuffer.position(position); byteBuffer.get(buff, 0, count); if(!com.aoindustries.util.AoArrays.equals(buff, zeros, 0, count)) { byteBuffer.position(position); byteBuffer.put(zeros, 0, count); modified = true; } } } finally { BufferManager.release(buff); } */ ByteOrder previousByteOrder = byteBuffer.order(); ByteOrder nativeByteOrder = ByteOrder.nativeOrder(); try { if(previousByteOrder!=nativeByteOrder) byteBuffer.order(nativeByteOrder); // Align to 8-byte boundary byteBuffer.position(position); while(count>0 && (position&7)!=0) { byte b = byteBuffer.get(); if(b!=0) { byteBuffer.put(position, (byte)0); modified = true; } position++; count--; } // Read in long values to get 64 bits at a time do { int nextCount = count - 8; if(nextCount<0) break; if(byteBuffer.getLong()!=0) { byteBuffer.putLong(position, 0); modified = true; } position += 8; count = nextCount; } while(true); // Trailing bytes while(count>0) { byte b = byteBuffer.get(); if(b!=0) { byteBuffer.put(position, (byte)0); modified = true; } position++; count--; } } finally { if(previousByteOrder!=nativeByteOrder) byteBuffer.order(previousByteOrder); } return modified; } }
public class class_name { public static boolean ensureZeros(ByteBuffer byteBuffer, int position, int count) throws IOException { if(count<0) throw new IllegalArgumentException("count<0: "+count); boolean modified = false; /* byte[] buff = BufferManager.getBytes(); try { while(count>BufferManager.BUFFER_SIZE) { byteBuffer.position(position); byteBuffer.get(buff, 0, BufferManager.BUFFER_SIZE); if(!Arrays.equals(buff, zeros)) { byteBuffer.position(position); byteBuffer.put(zeros, 0, BufferManager.BUFFER_SIZE); modified = true; } position += BufferManager.BUFFER_SIZE; count -= BufferManager.BUFFER_SIZE; } if(count>0) { byteBuffer.position(position); byteBuffer.get(buff, 0, count); if(!com.aoindustries.util.AoArrays.equals(buff, zeros, 0, count)) { byteBuffer.position(position); byteBuffer.put(zeros, 0, count); modified = true; } } } finally { BufferManager.release(buff); } */ ByteOrder previousByteOrder = byteBuffer.order(); ByteOrder nativeByteOrder = ByteOrder.nativeOrder(); try { if(previousByteOrder!=nativeByteOrder) byteBuffer.order(nativeByteOrder); // Align to 8-byte boundary byteBuffer.position(position); while(count>0 && (position&7)!=0) { byte b = byteBuffer.get(); if(b!=0) { byteBuffer.put(position, (byte)0); // depends on control dependency: [if], data = [(b] modified = true; // depends on control dependency: [if], data = [none] } position++; // depends on control dependency: [while], data = [none] count--; // depends on control dependency: [while], data = [none] } // Read in long values to get 64 bits at a time do { int nextCount = count - 8; if(nextCount<0) break; if(byteBuffer.getLong()!=0) { byteBuffer.putLong(position, 0); // depends on control dependency: [if], data = [0)] modified = true; // depends on control dependency: [if], data = [none] } position += 8; count = nextCount; } while(true); // Trailing bytes while(count>0) { byte b = byteBuffer.get(); if(b!=0) { byteBuffer.put(position, (byte)0); // depends on control dependency: [if], data = [(b] modified = true; // depends on control dependency: [if], data = [none] } position++; // depends on control dependency: [while], data = [none] count--; // depends on control dependency: [while], data = [none] } } finally { if(previousByteOrder!=nativeByteOrder) byteBuffer.order(previousByteOrder); } return modified; } }
public class class_name { private void processAssignments() throws SQLException { List<Row> rows = getRows("select * from zscheduleitem where zproject=? and z_ent=? order by zorderinactivity", m_projectID, m_entityMap.get("Assignment")); for (Row row : rows) { Task task = m_project.getTaskByUniqueID(row.getInteger("ZACTIVITY_")); Resource resource = m_project.getResourceByUniqueID(row.getInteger("ZRESOURCE")); if (task != null && resource != null) { ResourceAssignment assignment = task.addResourceAssignment(resource); assignment.setGUID(row.getUUID("ZUNIQUEID")); assignment.setActualFinish(row.getTimestamp("ZGIVENACTUALENDDATE_")); assignment.setActualStart(row.getTimestamp("ZGIVENACTUALSTARTDATE_")); assignment.setWork(assignmentDuration(task, row.getWork("ZGIVENWORK_"))); assignment.setOvertimeWork(assignmentDuration(task, row.getWork("ZGIVENWORKOVERTIME_"))); assignment.setActualWork(assignmentDuration(task, row.getWork("ZGIVENACTUALWORK_"))); assignment.setActualOvertimeWork(assignmentDuration(task, row.getWork("ZGIVENACTUALWORKOVERTIME_"))); assignment.setRemainingWork(assignmentDuration(task, row.getWork("ZGIVENREMAININGWORK_"))); assignment.setLevelingDelay(row.getDuration("ZLEVELINGDELAY_")); if (assignment.getRemainingWork() == null) { assignment.setRemainingWork(assignment.getWork()); } if (resource.getType() == ResourceType.WORK) { assignment.setUnits(Double.valueOf(NumberHelper.getDouble(row.getDouble("ZRESOURCEUNITS_")) * 100.0)); } } } } }
public class class_name { private void processAssignments() throws SQLException { List<Row> rows = getRows("select * from zscheduleitem where zproject=? and z_ent=? order by zorderinactivity", m_projectID, m_entityMap.get("Assignment")); for (Row row : rows) { Task task = m_project.getTaskByUniqueID(row.getInteger("ZACTIVITY_")); Resource resource = m_project.getResourceByUniqueID(row.getInteger("ZRESOURCE")); if (task != null && resource != null) { ResourceAssignment assignment = task.addResourceAssignment(resource); assignment.setGUID(row.getUUID("ZUNIQUEID")); // depends on control dependency: [if], data = [none] assignment.setActualFinish(row.getTimestamp("ZGIVENACTUALENDDATE_")); // depends on control dependency: [if], data = [none] assignment.setActualStart(row.getTimestamp("ZGIVENACTUALSTARTDATE_")); // depends on control dependency: [if], data = [none] assignment.setWork(assignmentDuration(task, row.getWork("ZGIVENWORK_"))); // depends on control dependency: [if], data = [(task] assignment.setOvertimeWork(assignmentDuration(task, row.getWork("ZGIVENWORKOVERTIME_"))); // depends on control dependency: [if], data = [(task] assignment.setActualWork(assignmentDuration(task, row.getWork("ZGIVENACTUALWORK_"))); // depends on control dependency: [if], data = [(task] assignment.setActualOvertimeWork(assignmentDuration(task, row.getWork("ZGIVENACTUALWORKOVERTIME_"))); // depends on control dependency: [if], data = [(task] assignment.setRemainingWork(assignmentDuration(task, row.getWork("ZGIVENREMAININGWORK_"))); // depends on control dependency: [if], data = [(task] assignment.setLevelingDelay(row.getDuration("ZLEVELINGDELAY_")); // depends on control dependency: [if], data = [none] if (assignment.getRemainingWork() == null) { assignment.setRemainingWork(assignment.getWork()); // depends on control dependency: [if], data = [none] } if (resource.getType() == ResourceType.WORK) { assignment.setUnits(Double.valueOf(NumberHelper.getDouble(row.getDouble("ZRESOURCEUNITS_")) * 100.0)); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public long getSortDate() { long result = getDateLastModified(); if (m_related != null) { for (CmsPublishResource rel : m_related) { result = Math.max(result, rel.getSortDate()); } } return result; } }
public class class_name { public long getSortDate() { long result = getDateLastModified(); if (m_related != null) { for (CmsPublishResource rel : m_related) { result = Math.max(result, rel.getSortDate()); // depends on control dependency: [for], data = [rel] } } return result; } }
public class class_name { public void marshall(DescribeEC2InstanceLimitsRequest describeEC2InstanceLimitsRequest, ProtocolMarshaller protocolMarshaller) { if (describeEC2InstanceLimitsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeEC2InstanceLimitsRequest.getEC2InstanceType(), EC2INSTANCETYPE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DescribeEC2InstanceLimitsRequest describeEC2InstanceLimitsRequest, ProtocolMarshaller protocolMarshaller) { if (describeEC2InstanceLimitsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeEC2InstanceLimitsRequest.getEC2InstanceType(), EC2INSTANCETYPE_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 void process(Queue<String> argq, T state) { while (!argq.isEmpty()) { String nextArg = argq.peek(); if (nextArg.startsWith("--")) { argq.remove(); String key = nextArg.substring(2); Command<? super T> option = options.get(key); if (option != null) { option.process(argq, state); } } else if (nextArg.startsWith("-")) { argq.remove(); for (int i = 1; i < nextArg.length(); i++) { char key = nextArg.charAt(i); Command<? super T> option = options.get(shortcuts.get(key)); if (option != null) { option.process(argq, state); } } } else { Command<? super T> command = commands.get(nextArg); if (command != null) { argq.remove(); command.process(argq, state); if (enterShell && shellCommand != null) { shellCommand.process(argq, state); } return; } break; } } if (defaultCommand != null) { defaultCommand.process(argq, state); } if (shellCommand != null) { shellCommand.process(argq, state); } } }
public class class_name { public void process(Queue<String> argq, T state) { while (!argq.isEmpty()) { String nextArg = argq.peek(); if (nextArg.startsWith("--")) { argq.remove(); // depends on control dependency: [if], data = [none] String key = nextArg.substring(2); Command<? super T> option = options.get(key); // depends on control dependency: [if], data = [none] if (option != null) { option.process(argq, state); // depends on control dependency: [if], data = [none] } } else if (nextArg.startsWith("-")) { argq.remove(); // depends on control dependency: [if], data = [none] for (int i = 1; i < nextArg.length(); i++) { char key = nextArg.charAt(i); Command<? super T> option = options.get(shortcuts.get(key)); // depends on control dependency: [for], data = [none] if (option != null) { option.process(argq, state); // depends on control dependency: [if], data = [none] } } } else { Command<? super T> command = commands.get(nextArg); // depends on control dependency: [if], data = [none] if (command != null) { argq.remove(); // depends on control dependency: [if], data = [none] command.process(argq, state); // depends on control dependency: [if], data = [none] if (enterShell && shellCommand != null) { shellCommand.process(argq, state); // depends on control dependency: [if], data = [none] } return; // depends on control dependency: [if], data = [none] } break; } } if (defaultCommand != null) { defaultCommand.process(argq, state); // depends on control dependency: [if], data = [none] } if (shellCommand != null) { shellCommand.process(argq, state); // depends on control dependency: [if], data = [none] } } }
public class class_name { public EClass getIfcFlowController() { if (ifcFlowControllerEClass == null) { ifcFlowControllerEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(240); } return ifcFlowControllerEClass; } }
public class class_name { public EClass getIfcFlowController() { if (ifcFlowControllerEClass == null) { ifcFlowControllerEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(240); // depends on control dependency: [if], data = [none] } return ifcFlowControllerEClass; } }
public class class_name { public void track( T image ) { // configure the different regions based on size region0.set( region ); region1.set( region ); region2.set( region ); region0.width *= 1-scaleChange; region0.height *= 1-scaleChange; region2.width *= 1+scaleChange; region2.height *= 1+scaleChange; // distance from histogram double distance0=1,distance1,distance2=1; // perform mean-shift at the different sizes and compute their distance if( !constantScale ) { if( region0.width >= minimumWidth ) { updateLocation(image,region0); distance0 = distanceHistogram(keyHistogram, calcHistogram.getHistogram()); if( updateHistogram ) System.arraycopy(calcHistogram.getHistogram(),0,histogram0,0,histogram0.length); } updateLocation(image,region2); distance2 = distanceHistogram(keyHistogram, calcHistogram.getHistogram()); if( updateHistogram ) System.arraycopy(calcHistogram.getHistogram(),0,histogram2,0,histogram2.length); } // update the no scale change hypothesis updateLocation(image,region1); if( !constantScale ) { distance1 = distanceHistogram(keyHistogram, calcHistogram.getHistogram()); } else { // force it to select distance1 = 0; } if( updateHistogram ) System.arraycopy(calcHistogram.getHistogram(),0,histogram1,0,histogram1.length); RectangleRotate_F32 selected = null; float selectedHist[] = null; switch( selectBest(distance0,distance1,distance2)) { case 0: selected = region0; selectedHist = histogram0; break; case 1: selected = region1; selectedHist = histogram1; break; case 2: selected = region2; selectedHist = histogram2; break; default: throw new RuntimeException("Bug in selectBest"); } // Set region to the best scale, but reduce sensitivity by weighting it against the original size // equation 14 float w = selected.width*(1-gamma) + gamma*region.width; float h = selected.height*(1-gamma) + gamma*region.height; region.set(selected); region.width = w; region.height = h; if( updateHistogram ) { System.arraycopy(selectedHist,0,keyHistogram,0,keyHistogram.length); } } }
public class class_name { public void track( T image ) { // configure the different regions based on size region0.set( region ); region1.set( region ); region2.set( region ); region0.width *= 1-scaleChange; region0.height *= 1-scaleChange; region2.width *= 1+scaleChange; region2.height *= 1+scaleChange; // distance from histogram double distance0=1,distance1,distance2=1; // perform mean-shift at the different sizes and compute their distance if( !constantScale ) { if( region0.width >= minimumWidth ) { updateLocation(image,region0); // depends on control dependency: [if], data = [none] distance0 = distanceHistogram(keyHistogram, calcHistogram.getHistogram()); // depends on control dependency: [if], data = [none] if( updateHistogram ) System.arraycopy(calcHistogram.getHistogram(),0,histogram0,0,histogram0.length); } updateLocation(image,region2); // depends on control dependency: [if], data = [none] distance2 = distanceHistogram(keyHistogram, calcHistogram.getHistogram()); // depends on control dependency: [if], data = [none] if( updateHistogram ) System.arraycopy(calcHistogram.getHistogram(),0,histogram2,0,histogram2.length); } // update the no scale change hypothesis updateLocation(image,region1); if( !constantScale ) { distance1 = distanceHistogram(keyHistogram, calcHistogram.getHistogram()); // depends on control dependency: [if], data = [none] } else { // force it to select distance1 = 0; // depends on control dependency: [if], data = [none] } if( updateHistogram ) System.arraycopy(calcHistogram.getHistogram(),0,histogram1,0,histogram1.length); RectangleRotate_F32 selected = null; float selectedHist[] = null; switch( selectBest(distance0,distance1,distance2)) { case 0: selected = region0; selectedHist = histogram0; break; case 1: selected = region1; selectedHist = histogram1; break; case 2: selected = region2; selectedHist = histogram2; break; default: throw new RuntimeException("Bug in selectBest"); } // Set region to the best scale, but reduce sensitivity by weighting it against the original size // equation 14 float w = selected.width*(1-gamma) + gamma*region.width; float h = selected.height*(1-gamma) + gamma*region.height; region.set(selected); region.width = w; region.height = h; if( updateHistogram ) { System.arraycopy(selectedHist,0,keyHistogram,0,keyHistogram.length); } } }
public class class_name { private void returnScratchData(Buffer buffer) { Callback<ScratchData> callback = getFirstCallback(BeanMessageID.BT_GET_SCRATCH); if (callback != null) { callback.onResult(ScratchData.fromPayload(buffer)); } } }
public class class_name { private void returnScratchData(Buffer buffer) { Callback<ScratchData> callback = getFirstCallback(BeanMessageID.BT_GET_SCRATCH); if (callback != null) { callback.onResult(ScratchData.fromPayload(buffer)); // depends on control dependency: [if], data = [none] } } }
public class class_name { @SuppressWarnings("unchecked") static <P> LightMetaProperty<P> of( MetaBean metaBean, Field field, MethodHandles.Lookup lookup, String propertyName, int constructorIndex) { MethodHandle getter; try { getter = lookup.findGetter(field.getDeclaringClass(), field.getName(), field.getType()); } catch (IllegalArgumentException | NoSuchFieldException | IllegalAccessException ex) { throw new UnsupportedOperationException("Property cannot be read: " + propertyName, ex); } MethodHandle setter = null; if (!Modifier.isFinal(field.getModifiers())) { try { setter = lookup.findSetter(field.getDeclaringClass(), field.getName(), field.getType()); } catch (IllegalArgumentException | NoSuchFieldException | IllegalAccessException ex) { throw new UnsupportedOperationException("Property cannot be read: " + propertyName, ex); } } return new LightMetaProperty<>( metaBean, propertyName, (Class<P>) field.getType(), field.getGenericType(), Arrays.asList(field.getAnnotations()), getter, setter, constructorIndex, calculateStyle(metaBean, setter)); } }
public class class_name { @SuppressWarnings("unchecked") static <P> LightMetaProperty<P> of( MetaBean metaBean, Field field, MethodHandles.Lookup lookup, String propertyName, int constructorIndex) { MethodHandle getter; try { getter = lookup.findGetter(field.getDeclaringClass(), field.getName(), field.getType()); // depends on control dependency: [try], data = [none] } catch (IllegalArgumentException | NoSuchFieldException | IllegalAccessException ex) { throw new UnsupportedOperationException("Property cannot be read: " + propertyName, ex); } // depends on control dependency: [catch], data = [none] MethodHandle setter = null; if (!Modifier.isFinal(field.getModifiers())) { try { setter = lookup.findSetter(field.getDeclaringClass(), field.getName(), field.getType()); // depends on control dependency: [try], data = [none] } catch (IllegalArgumentException | NoSuchFieldException | IllegalAccessException ex) { throw new UnsupportedOperationException("Property cannot be read: " + propertyName, ex); } // depends on control dependency: [catch], data = [none] } return new LightMetaProperty<>( metaBean, propertyName, (Class<P>) field.getType(), field.getGenericType(), Arrays.asList(field.getAnnotations()), getter, setter, constructorIndex, calculateStyle(metaBean, setter)); } }
public class class_name { private void twoWayMergeInternal(final ReservoirItemsSketch<T> sketchIn, final boolean isModifiable) { if (sketchIn.getN() <= sketchIn.getK()) { twoWayMergeInternalStandard(sketchIn); } else if (gadget_.getN() < gadget_.getK()) { // merge into sketchIn, so swap first final ReservoirItemsSketch<T> tmpSketch = gadget_; gadget_ = (isModifiable ? sketchIn : sketchIn.copy()); twoWayMergeInternalStandard(tmpSketch); } else if (sketchIn.getImplicitSampleWeight() < (gadget_.getN() / ((double) (gadget_.getK() - 1)))) { // implicit weights in sketchIn are light enough to merge into gadget twoWayMergeInternalWeighted(sketchIn); } else { // Use next line as an assert/exception? // gadget_.getImplicitSampleWeight() < sketchIn.getN() / ((double) (sketchIn.getK() - 1))) { // implicit weights in gadget are light enough to merge into sketchIn // merge into sketchIn, so swap first final ReservoirItemsSketch<T> tmpSketch = gadget_; gadget_ = (isModifiable ? sketchIn : sketchIn.copy()); twoWayMergeInternalWeighted(tmpSketch); } } }
public class class_name { private void twoWayMergeInternal(final ReservoirItemsSketch<T> sketchIn, final boolean isModifiable) { if (sketchIn.getN() <= sketchIn.getK()) { twoWayMergeInternalStandard(sketchIn); // depends on control dependency: [if], data = [none] } else if (gadget_.getN() < gadget_.getK()) { // merge into sketchIn, so swap first final ReservoirItemsSketch<T> tmpSketch = gadget_; gadget_ = (isModifiable ? sketchIn : sketchIn.copy()); // depends on control dependency: [if], data = [none] twoWayMergeInternalStandard(tmpSketch); // depends on control dependency: [if], data = [none] } else if (sketchIn.getImplicitSampleWeight() < (gadget_.getN() / ((double) (gadget_.getK() - 1)))) { // implicit weights in sketchIn are light enough to merge into gadget twoWayMergeInternalWeighted(sketchIn); // depends on control dependency: [if], data = [none] } else { // Use next line as an assert/exception? // gadget_.getImplicitSampleWeight() < sketchIn.getN() / ((double) (sketchIn.getK() - 1))) { // implicit weights in gadget are light enough to merge into sketchIn // merge into sketchIn, so swap first final ReservoirItemsSketch<T> tmpSketch = gadget_; gadget_ = (isModifiable ? sketchIn : sketchIn.copy()); // depends on control dependency: [if], data = [none] twoWayMergeInternalWeighted(tmpSketch); // depends on control dependency: [if], data = [none] } } }
public class class_name { static public byte[] pack(byte[] unpacked) { if (unpacked == null) { return null; } int packedLen = unpacked.length - (unpacked.length / 8); //byte[] out = new byte[(int)Math.ceil((unpacked.length * 7) / 8f)]; byte[] packed = new byte[packedLen]; int len = unpacked.length; int current = 0; int bitpos = 0; for (int i = 0; i < len; i++) { byte b = (byte)(unpacked[i] & 0x7F); // remove top bit // assign first half of partial bits packed[current] |= (byte) ((b & 0xFF) << bitpos); // assign second half of partial bits (if exist) if (bitpos >= 2) packed[++current] |= (b >> (8 - bitpos)); bitpos = (bitpos + 7) % 8; if (bitpos == 0) current++; } return packed; } }
public class class_name { static public byte[] pack(byte[] unpacked) { if (unpacked == null) { return null; // depends on control dependency: [if], data = [none] } int packedLen = unpacked.length - (unpacked.length / 8); //byte[] out = new byte[(int)Math.ceil((unpacked.length * 7) / 8f)]; byte[] packed = new byte[packedLen]; int len = unpacked.length; int current = 0; int bitpos = 0; for (int i = 0; i < len; i++) { byte b = (byte)(unpacked[i] & 0x7F); // remove top bit // assign first half of partial bits packed[current] |= (byte) ((b & 0xFF) << bitpos); // depends on control dependency: [for], data = [none] // assign second half of partial bits (if exist) if (bitpos >= 2) packed[++current] |= (b >> (8 - bitpos)); bitpos = (bitpos + 7) % 8; // depends on control dependency: [for], data = [none] if (bitpos == 0) current++; } return packed; } }
public class class_name { @Override @SuppressWarnings("StringSplitter") public boolean incrementToken() throws IOException { final ArrayDeque<String> tokens = getTokens(); final CharTermAttribute termAtt = getTermAtt(); if (tokens.isEmpty() && input.incrementToken()) { final String text = new String(termAtt.buffer(), 0, termAtt.length()); if (UrlStringUtils.containsUrl(text)) { final String[] parts = text.split("\\s"); for (String part : parts) { if (UrlStringUtils.isUrl(part)) { try { final List<String> data = UrlStringUtils.extractImportantUrlData(part); tokens.addAll(data); } catch (MalformedURLException ex) { LOGGER.debug("error parsing {}", part, ex); tokens.add(part); } } else { tokens.add(part); } } } else { tokens.add(text); } } return addTerm(); } }
public class class_name { @Override @SuppressWarnings("StringSplitter") public boolean incrementToken() throws IOException { final ArrayDeque<String> tokens = getTokens(); final CharTermAttribute termAtt = getTermAtt(); if (tokens.isEmpty() && input.incrementToken()) { final String text = new String(termAtt.buffer(), 0, termAtt.length()); if (UrlStringUtils.containsUrl(text)) { final String[] parts = text.split("\\s"); for (String part : parts) { if (UrlStringUtils.isUrl(part)) { try { final List<String> data = UrlStringUtils.extractImportantUrlData(part); tokens.addAll(data); // depends on control dependency: [try], data = [none] } catch (MalformedURLException ex) { LOGGER.debug("error parsing {}", part, ex); tokens.add(part); } // depends on control dependency: [catch], data = [none] } else { tokens.add(part); // depends on control dependency: [if], data = [none] } } } else { tokens.add(text); // depends on control dependency: [if], data = [none] } } return addTerm(); } }
public class class_name { public final K getKey(int index) { if (index < 0 || index >= this.size) { return null; } @SuppressWarnings("unchecked") K result = (K) this.data[index << 1]; return result; } }
public class class_name { public final K getKey(int index) { if (index < 0 || index >= this.size) { return null; // depends on control dependency: [if], data = [none] } @SuppressWarnings("unchecked") K result = (K) this.data[index << 1]; return result; } }
public class class_name { public StorageConnector withDomains(String... domains) { if (this.domains == null) { setDomains(new java.util.ArrayList<String>(domains.length)); } for (String ele : domains) { this.domains.add(ele); } return this; } }
public class class_name { public StorageConnector withDomains(String... domains) { if (this.domains == null) { setDomains(new java.util.ArrayList<String>(domains.length)); // depends on control dependency: [if], data = [none] } for (String ele : domains) { this.domains.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { @Override public void start(final VortexThreadPool vortexThreadPool) { final Vector<Integer> inputVector = new Vector<>(); for (int i = 0; i < dimension; i++) { inputVector.add(i); } final List<VortexFuture<Integer>> futures = new ArrayList<>(); final AddOneFunction addOneFunction = new AddOneFunction(); for (final int i : inputVector) { futures.add(vortexThreadPool.submit(addOneFunction, i)); } final Vector<Integer> outputVector = new Vector<>(); for (final VortexFuture<Integer> future : futures) { try { outputVector.add(future.get()); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } } System.out.println("RESULT:"); System.out.println(outputVector); } }
public class class_name { @Override public void start(final VortexThreadPool vortexThreadPool) { final Vector<Integer> inputVector = new Vector<>(); for (int i = 0; i < dimension; i++) { inputVector.add(i); // depends on control dependency: [for], data = [i] } final List<VortexFuture<Integer>> futures = new ArrayList<>(); final AddOneFunction addOneFunction = new AddOneFunction(); for (final int i : inputVector) { futures.add(vortexThreadPool.submit(addOneFunction, i)); // depends on control dependency: [for], data = [i] } final Vector<Integer> outputVector = new Vector<>(); for (final VortexFuture<Integer> future : futures) { try { outputVector.add(future.get()); // depends on control dependency: [try], data = [none] } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } System.out.println("RESULT:"); System.out.println(outputVector); } }
public class class_name { private void addColumnFamilyToTable(String tableName, String columnFamilyName) throws IOException { HColumnDescriptor cfDesciptor = new HColumnDescriptor(columnFamilyName); try { if (admin.tableExists(tableName)) { // Before any modification to table schema, it's necessary to // disable it if (!admin.isTableEnabled(tableName)) { admin.enableTable(tableName); } HTableDescriptor descriptor = admin.getTableDescriptor(tableName.getBytes()); boolean found = false; for (HColumnDescriptor hColumnDescriptor : descriptor.getColumnFamilies()) { if (hColumnDescriptor.getNameAsString().equalsIgnoreCase(columnFamilyName)) found = true; } if (!found) { if (admin.isTableEnabled(tableName)) { admin.disableTable(tableName); } admin.addColumn(tableName, cfDesciptor); // Enable table once done admin.enableTable(tableName); } } else { log.warn("Table {} doesn't exist, so no question of adding column family {} to it!", tableName, columnFamilyName); } } catch (IOException e) { log.error("Error while adding column family {}, to table{} . ", columnFamilyName, tableName); throw e; } } }
public class class_name { private void addColumnFamilyToTable(String tableName, String columnFamilyName) throws IOException { HColumnDescriptor cfDesciptor = new HColumnDescriptor(columnFamilyName); try { if (admin.tableExists(tableName)) { // Before any modification to table schema, it's necessary to // disable it if (!admin.isTableEnabled(tableName)) { admin.enableTable(tableName); // depends on control dependency: [if], data = [none] } HTableDescriptor descriptor = admin.getTableDescriptor(tableName.getBytes()); boolean found = false; for (HColumnDescriptor hColumnDescriptor : descriptor.getColumnFamilies()) { if (hColumnDescriptor.getNameAsString().equalsIgnoreCase(columnFamilyName)) found = true; } if (!found) { if (admin.isTableEnabled(tableName)) { admin.disableTable(tableName); // depends on control dependency: [if], data = [none] } admin.addColumn(tableName, cfDesciptor); // depends on control dependency: [if], data = [none] // Enable table once done admin.enableTable(tableName); // depends on control dependency: [if], data = [none] } } else { log.warn("Table {} doesn't exist, so no question of adding column family {} to it!", tableName, columnFamilyName); // depends on control dependency: [if], data = [none] } } catch (IOException e) { log.error("Error while adding column family {}, to table{} . ", columnFamilyName, tableName); throw e; } } }
public class class_name { public boolean checkInputMessageNumbering(SccpConnectionImpl conn, SequenceNumber sendSequenceNumber, SequenceNumber receiveSequenceNumber) throws Exception { if (sendSequenceNumber != null) { if (expectingFirstMessageInputAfterInit && !sendSequenceNumber.equals(new SequenceNumberImpl(0))) { // local procedure error conn.reset(new ResetCauseImpl(ResetCauseValue.MESSAGE_OUT_OF_ORDER_INCORRECT_PS)); return false; } else if (sendSequenceNumber.equals(sendSequenceNumberExpectedAtInput) && inputWindow.contains(sendSequenceNumber)) { sendSequenceNumberExpectedAtInput = sendSequenceNumberExpectedAtInput.nextNumber(); } else { if (!inputWindow.contains(sendSequenceNumber)) { conn.reset(new ResetCauseImpl(ResetCauseValue.REMOTE_PROCEDURE_ERROR_MESSAGE_OUT_OF_WINDOW)); } else if (!sendSequenceNumber.equals(sendSequenceNumberExpectedAtInput)) { // local procedure error conn.resetSection(new ResetCauseImpl(ResetCauseValue.MESSAGE_OUT_OF_ORDER_INCORRECT_PS)); } return false; } } if (rangeContains(lastReceiveSequenceNumberReceived, this.sendSequenceNumber.nextNumber(), receiveSequenceNumber)) { outputWindow.setLowerEdge(receiveSequenceNumber); } else { conn.resetSection(new ResetCauseImpl(ResetCauseValue.MESSAGE_OUT_OF_ORDER_INCORRECT_PS)); return false; } lastReceiveSequenceNumberReceived = receiveSequenceNumber; expectingFirstMessageInputAfterInit = false; return true; } }
public class class_name { public boolean checkInputMessageNumbering(SccpConnectionImpl conn, SequenceNumber sendSequenceNumber, SequenceNumber receiveSequenceNumber) throws Exception { if (sendSequenceNumber != null) { if (expectingFirstMessageInputAfterInit && !sendSequenceNumber.equals(new SequenceNumberImpl(0))) { // local procedure error conn.reset(new ResetCauseImpl(ResetCauseValue.MESSAGE_OUT_OF_ORDER_INCORRECT_PS)); return false; } else if (sendSequenceNumber.equals(sendSequenceNumberExpectedAtInput) && inputWindow.contains(sendSequenceNumber)) { sendSequenceNumberExpectedAtInput = sendSequenceNumberExpectedAtInput.nextNumber(); } else { if (!inputWindow.contains(sendSequenceNumber)) { conn.reset(new ResetCauseImpl(ResetCauseValue.REMOTE_PROCEDURE_ERROR_MESSAGE_OUT_OF_WINDOW)); // depends on control dependency: [if], data = [none] } else if (!sendSequenceNumber.equals(sendSequenceNumberExpectedAtInput)) { // local procedure error conn.resetSection(new ResetCauseImpl(ResetCauseValue.MESSAGE_OUT_OF_ORDER_INCORRECT_PS)); // depends on control dependency: [if], data = [none] } return false; } } if (rangeContains(lastReceiveSequenceNumberReceived, this.sendSequenceNumber.nextNumber(), receiveSequenceNumber)) { outputWindow.setLowerEdge(receiveSequenceNumber); } else { conn.resetSection(new ResetCauseImpl(ResetCauseValue.MESSAGE_OUT_OF_ORDER_INCORRECT_PS)); return false; } lastReceiveSequenceNumberReceived = receiveSequenceNumber; expectingFirstMessageInputAfterInit = false; return true; } }
public class class_name { @Override public int compare(Float lhs, Float rhs) { dbc.precondition(lhs != null, "null double (lhs) on StrictOrderingFloatComparator"); dbc.precondition(rhs != null, "null double (rhs) on StrictOrderingFloatComparator"); if (lhs < rhs) { return Order.LT.order(); } if (lhs > rhs) { return Order.GT.order(); } final int lhsBits = Float.floatToIntBits(lhs); final int rhsBits = Float.floatToIntBits(rhs); if (lhsBits == rhsBits) { return 0; } return lhsBits < rhsBits ? Order.LT.order() : Order.GT.order(); } }
public class class_name { @Override public int compare(Float lhs, Float rhs) { dbc.precondition(lhs != null, "null double (lhs) on StrictOrderingFloatComparator"); dbc.precondition(rhs != null, "null double (rhs) on StrictOrderingFloatComparator"); if (lhs < rhs) { return Order.LT.order(); // depends on control dependency: [if], data = [none] } if (lhs > rhs) { return Order.GT.order(); // depends on control dependency: [if], data = [none] } final int lhsBits = Float.floatToIntBits(lhs); final int rhsBits = Float.floatToIntBits(rhs); if (lhsBits == rhsBits) { return 0; // depends on control dependency: [if], data = [none] } return lhsBits < rhsBits ? Order.LT.order() : Order.GT.order(); } }
public class class_name { private static List<String> splitVersion(String s) { //TODO improve performance by removing regex. final Pattern pattern = Pattern.compile("^([\\d]+?)(.*)$"); final String[] splitString = s.split("(\\.|:-)"); final List<String> res = new ArrayList<>(); for (String token : splitString) { if (token.matches("^[\\d]+?[A-z]+")) { final Matcher matcher = pattern.matcher(token); matcher.find(); final String g1 = matcher.group(1); final String g2 = matcher.group(2); res.add(g1); res.add(g2); } else { res.add(token); } } return res; } }
public class class_name { private static List<String> splitVersion(String s) { //TODO improve performance by removing regex. final Pattern pattern = Pattern.compile("^([\\d]+?)(.*)$"); final String[] splitString = s.split("(\\.|:-)"); final List<String> res = new ArrayList<>(); for (String token : splitString) { if (token.matches("^[\\d]+?[A-z]+")) { final Matcher matcher = pattern.matcher(token); matcher.find(); // depends on control dependency: [if], data = [none] final String g1 = matcher.group(1); final String g2 = matcher.group(2); res.add(g1); // depends on control dependency: [if], data = [none] res.add(g2); // depends on control dependency: [if], data = [none] } else { res.add(token); // depends on control dependency: [if], data = [none] } } return res; } }
public class class_name { public void accept(final SignatureVisitor v) { String signature = this.signature; int len = signature.length(); int pos; char c; if (signature.charAt(0) == '<') { pos = 2; do { int end = signature.indexOf(':', pos); v.visitFormalTypeParameter(signature.substring(pos - 1, end)); pos = end + 1; c = signature.charAt(pos); if (c == 'L' || c == '[' || c == 'T') { pos = parseType(signature, pos, v.visitClassBound()); } while ((c = signature.charAt(pos++)) == ':') { pos = parseType(signature, pos, v.visitInterfaceBound()); } } while (c != '>'); } else { pos = 0; } if (signature.charAt(pos) == '(') { pos++; while (signature.charAt(pos) != ')') { pos = parseType(signature, pos, v.visitParameterType()); } pos = parseType(signature, pos + 1, v.visitReturnType()); while (pos < len) { pos = parseType(signature, pos + 1, v.visitExceptionType()); } } else { pos = parseType(signature, pos, v.visitSuperclass()); while (pos < len) { pos = parseType(signature, pos, v.visitInterface()); } } } }
public class class_name { public void accept(final SignatureVisitor v) { String signature = this.signature; int len = signature.length(); int pos; char c; if (signature.charAt(0) == '<') { pos = 2; // depends on control dependency: [if], data = [none] do { int end = signature.indexOf(':', pos); v.visitFormalTypeParameter(signature.substring(pos - 1, end)); pos = end + 1; c = signature.charAt(pos); if (c == 'L' || c == '[' || c == 'T') { pos = parseType(signature, pos, v.visitClassBound()); // depends on control dependency: [if], data = [none] } while ((c = signature.charAt(pos++)) == ':') { pos = parseType(signature, pos, v.visitInterfaceBound()); // depends on control dependency: [while], data = [none] } } while (c != '>'); } else { pos = 0; // depends on control dependency: [if], data = [none] } if (signature.charAt(pos) == '(') { pos++; // depends on control dependency: [if], data = [none] while (signature.charAt(pos) != ')') { pos = parseType(signature, pos, v.visitParameterType()); // depends on control dependency: [while], data = [none] } pos = parseType(signature, pos + 1, v.visitReturnType()); // depends on control dependency: [if], data = [none] while (pos < len) { pos = parseType(signature, pos + 1, v.visitExceptionType()); // depends on control dependency: [while], data = [none] } } else { pos = parseType(signature, pos, v.visitSuperclass()); // depends on control dependency: [if], data = [none] while (pos < len) { pos = parseType(signature, pos, v.visitInterface()); // depends on control dependency: [while], data = [none] } } } }
public class class_name { public TranslateTextRequest withTerminologyNames(String... terminologyNames) { if (this.terminologyNames == null) { setTerminologyNames(new java.util.ArrayList<String>(terminologyNames.length)); } for (String ele : terminologyNames) { this.terminologyNames.add(ele); } return this; } }
public class class_name { public TranslateTextRequest withTerminologyNames(String... terminologyNames) { if (this.terminologyNames == null) { setTerminologyNames(new java.util.ArrayList<String>(terminologyNames.length)); // depends on control dependency: [if], data = [none] } for (String ele : terminologyNames) { this.terminologyNames.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public static INDArray max(INDArray x, INDArray y, INDArray z, int... dimensions) { if(dimensions == null) { Preconditions.checkArgument(Arrays.equals(x.shape(),y.shape()),getFormattedShapeErrorMessageXy(x,y)); Preconditions.checkArgument(Arrays.equals(x.shape(),z.shape()),getFormattedShapeErrorMessageXResult(x,z)); return Nd4j.getExecutioner().execAndReturn(new OldMax(x,y,z,x.length())); } return Nd4j.getExecutioner().execAndReturn(new BroadcastMax(x,y,z,dimensions)); } }
public class class_name { public static INDArray max(INDArray x, INDArray y, INDArray z, int... dimensions) { if(dimensions == null) { Preconditions.checkArgument(Arrays.equals(x.shape(),y.shape()),getFormattedShapeErrorMessageXy(x,y)); // depends on control dependency: [if], data = [none] Preconditions.checkArgument(Arrays.equals(x.shape(),z.shape()),getFormattedShapeErrorMessageXResult(x,z)); // depends on control dependency: [if], data = [none] return Nd4j.getExecutioner().execAndReturn(new OldMax(x,y,z,x.length())); // depends on control dependency: [if], data = [none] } return Nd4j.getExecutioner().execAndReturn(new BroadcastMax(x,y,z,dimensions)); } }
public class class_name { @Override public void eventPostCommitAdd(Transaction transaction) throws SevereMessageStoreException { super.eventPostCommitAdd(transaction); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "eventPostCommitAdd", new Object[] { transaction }); if ((getMessageItem().getRegisterForPostEvents()) || failedInitInRestore) { stream = (MessageReferenceStream) getReferenceStream(); //we can only register the listeners if we are fully initialized if ((stream instanceof DurableSubscriptionItemStream) || (stream instanceof ProxyReferenceStream)) { stream.registerListeners(this); } failedInitInRestore = false; getMessageItem().setRegisterForPostEvents(failedInitInRestore); } if (!transaction.isAutoCommit()) { try { if (POST_COMMIT_ADD_1 != null) { POST_COMMIT_ADD_1.messageEventOccurred(MessageEvents.POST_COMMIT_ADD, this, transaction); } if (POST_COMMIT_ADD_2 != null) { POST_COMMIT_ADD_2.messageEventOccurred(MessageEvents.POST_COMMIT_ADD, this, transaction); } } catch (SIException e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.store.items.MessageItemReference.eventPostCommitAdd", "1:422:1.147", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "eventPostCommitAdd", e); throw new SIErrorException(e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "eventPostCommitAdd"); } }
public class class_name { @Override public void eventPostCommitAdd(Transaction transaction) throws SevereMessageStoreException { super.eventPostCommitAdd(transaction); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "eventPostCommitAdd", new Object[] { transaction }); if ((getMessageItem().getRegisterForPostEvents()) || failedInitInRestore) { stream = (MessageReferenceStream) getReferenceStream(); //we can only register the listeners if we are fully initialized if ((stream instanceof DurableSubscriptionItemStream) || (stream instanceof ProxyReferenceStream)) { stream.registerListeners(this); // depends on control dependency: [if], data = [none] } failedInitInRestore = false; getMessageItem().setRegisterForPostEvents(failedInitInRestore); } if (!transaction.isAutoCommit()) { try { if (POST_COMMIT_ADD_1 != null) { POST_COMMIT_ADD_1.messageEventOccurred(MessageEvents.POST_COMMIT_ADD, this, transaction); // depends on control dependency: [if], data = [none] } if (POST_COMMIT_ADD_2 != null) { POST_COMMIT_ADD_2.messageEventOccurred(MessageEvents.POST_COMMIT_ADD, this, transaction); // depends on control dependency: [if], data = [none] } } catch (SIException e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.store.items.MessageItemReference.eventPostCommitAdd", "1:422:1.147", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "eventPostCommitAdd", e); throw new SIErrorException(e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "eventPostCommitAdd"); } }
public class class_name { private static Map<ColorRgba, Collection<TileRef>> convertToColorKey(Map<TileRef, ColorRgba> tiles) { final Map<ColorRgba, Collection<TileRef>> colors = new HashMap<>(); for (final Map.Entry<TileRef, ColorRgba> entry : tiles.entrySet()) { final Collection<TileRef> tilesRef = getTiles(colors, entry.getValue()); tilesRef.add(entry.getKey()); } return colors; } }
public class class_name { private static Map<ColorRgba, Collection<TileRef>> convertToColorKey(Map<TileRef, ColorRgba> tiles) { final Map<ColorRgba, Collection<TileRef>> colors = new HashMap<>(); for (final Map.Entry<TileRef, ColorRgba> entry : tiles.entrySet()) { final Collection<TileRef> tilesRef = getTiles(colors, entry.getValue()); tilesRef.add(entry.getKey()); // depends on control dependency: [for], data = [entry] } return colors; } }
public class class_name { @Override public int select(int j) { long leftover = Util.toUnsignedLong(j); for (int i = 0; i < this.highLowContainer.size(); i++) { Container c = this.highLowContainer.getContainerAtIndex(i); int thiscard = c.getCardinality(); if (thiscard > leftover) { int keycontrib = this.highLowContainer.getKeyAtIndex(i) << 16; int lowcontrib = Util.toIntUnsigned(c.select((int)leftover)); return lowcontrib + keycontrib; } leftover -= thiscard; } throw new IllegalArgumentException("You are trying to select the " + j + "th value when the cardinality is " + this.getCardinality() + "."); } }
public class class_name { @Override public int select(int j) { long leftover = Util.toUnsignedLong(j); for (int i = 0; i < this.highLowContainer.size(); i++) { Container c = this.highLowContainer.getContainerAtIndex(i); int thiscard = c.getCardinality(); if (thiscard > leftover) { int keycontrib = this.highLowContainer.getKeyAtIndex(i) << 16; int lowcontrib = Util.toIntUnsigned(c.select((int)leftover)); return lowcontrib + keycontrib; // depends on control dependency: [if], data = [none] } leftover -= thiscard; // depends on control dependency: [for], data = [none] } throw new IllegalArgumentException("You are trying to select the " + j + "th value when the cardinality is " + this.getCardinality() + "."); } }
public class class_name { public boolean exists(String id) { if (id == null) { throw new IllegalArgumentException("id cannot be null"); } if (_knownMissingIds.contains(id)) { return false; } if (documentsById.getValue(id) != null) { return true; } HeadDocumentCommand command = new HeadDocumentCommand(id, null); _requestExecutor.execute(command, sessionInfo); return command.getResult() != null; } }
public class class_name { public boolean exists(String id) { if (id == null) { throw new IllegalArgumentException("id cannot be null"); } if (_knownMissingIds.contains(id)) { return false; // depends on control dependency: [if], data = [none] } if (documentsById.getValue(id) != null) { return true; // depends on control dependency: [if], data = [none] } HeadDocumentCommand command = new HeadDocumentCommand(id, null); _requestExecutor.execute(command, sessionInfo); return command.getResult() != null; } }
public class class_name { public static MethodHandle constructorMethodHandle(StandardErrorCode errorCode, Class<?> clazz, Class<?>... parameterTypes) { try { return MethodHandles.lookup().unreflectConstructor(clazz.getConstructor(parameterTypes)); } catch (IllegalAccessException | NoSuchMethodException e) { throw new PrestoException(errorCode, e); } } }
public class class_name { public static MethodHandle constructorMethodHandle(StandardErrorCode errorCode, Class<?> clazz, Class<?>... parameterTypes) { try { return MethodHandles.lookup().unreflectConstructor(clazz.getConstructor(parameterTypes)); // depends on control dependency: [try], data = [none] } catch (IllegalAccessException | NoSuchMethodException e) { throw new PrestoException(errorCode, e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public EClass getIfcExternalSpatialElement() { if (ifcExternalSpatialElementEClass == null) { ifcExternalSpatialElementEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(246); } return ifcExternalSpatialElementEClass; } }
public class class_name { @Override public EClass getIfcExternalSpatialElement() { if (ifcExternalSpatialElementEClass == null) { ifcExternalSpatialElementEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(246); // depends on control dependency: [if], data = [none] } return ifcExternalSpatialElementEClass; } }
public class class_name { public List<IAtomType> readAtomTypes(IChemObjectBuilder builder) { List<IAtomType> isotopes = new ArrayList<IAtomType>(); try { parser.setFeature("http://xml.org/sax/features/validation", false); logger.info("Deactivated validation"); } catch (SAXException exception) { logger.warn("Cannot deactivate validation: ", exception.getMessage()); logger.debug(exception); } AtomTypeHandler handler = new AtomTypeHandler(builder); parser.setContentHandler(handler); try { parser.parse(new InputSource(input)); isotopes = handler.getAtomTypes(); } catch (IOException exception) { logger.error("IOException: ", exception.getMessage()); logger.debug(exception); } catch (SAXException saxe) { logger.error("SAXException: ", saxe.getMessage()); logger.debug(saxe); } return isotopes; } }
public class class_name { public List<IAtomType> readAtomTypes(IChemObjectBuilder builder) { List<IAtomType> isotopes = new ArrayList<IAtomType>(); try { parser.setFeature("http://xml.org/sax/features/validation", false); logger.info("Deactivated validation"); // depends on control dependency: [try], data = [none] } catch (SAXException exception) { logger.warn("Cannot deactivate validation: ", exception.getMessage()); logger.debug(exception); } // depends on control dependency: [catch], data = [none] AtomTypeHandler handler = new AtomTypeHandler(builder); parser.setContentHandler(handler); try { parser.parse(new InputSource(input)); // depends on control dependency: [try], data = [none] isotopes = handler.getAtomTypes(); // depends on control dependency: [try], data = [none] } catch (IOException exception) { logger.error("IOException: ", exception.getMessage()); logger.debug(exception); } catch (SAXException saxe) { // depends on control dependency: [catch], data = [none] logger.error("SAXException: ", saxe.getMessage()); logger.debug(saxe); } // depends on control dependency: [catch], data = [none] return isotopes; } }
public class class_name { public AnnotationMetadata buildForMethod(T element) { final AnnotationMetadata existing = MUTATED_ANNOTATION_METADATA.get(element); if (existing != null) { return existing; } else { DefaultAnnotationMetadata annotationMetadata = new DefaultAnnotationMetadata(); return buildInternal(null, element, annotationMetadata, false, false); } } }
public class class_name { public AnnotationMetadata buildForMethod(T element) { final AnnotationMetadata existing = MUTATED_ANNOTATION_METADATA.get(element); if (existing != null) { return existing; // depends on control dependency: [if], data = [none] } else { DefaultAnnotationMetadata annotationMetadata = new DefaultAnnotationMetadata(); return buildInternal(null, element, annotationMetadata, false, false); // depends on control dependency: [if], data = [none] } } }
public class class_name { @CommandArgument public void adduser( @OptionArgument("username") String username, @OptionArgument("password") String password, @OptionArgument("roles") String roles) { if (users.containsKey(username)) { System.err.println(String.format("User '%s' already exists", username)); } else { User user = new User(username); user.salt = passwd.generateSalt(); user.hash = passwd.getEncryptedPassword(password, user.salt); user.roles.addAll(Arrays.asList(roles.split(","))); users.put(username, user); } } }
public class class_name { @CommandArgument public void adduser( @OptionArgument("username") String username, @OptionArgument("password") String password, @OptionArgument("roles") String roles) { if (users.containsKey(username)) { System.err.println(String.format("User '%s' already exists", username)); // depends on control dependency: [if], data = [none] } else { User user = new User(username); user.salt = passwd.generateSalt(); // depends on control dependency: [if], data = [none] user.hash = passwd.getEncryptedPassword(password, user.salt); // depends on control dependency: [if], data = [none] user.roles.addAll(Arrays.asList(roles.split(","))); // depends on control dependency: [if], data = [none] users.put(username, user); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(DescribeEndpointRequest describeEndpointRequest, ProtocolMarshaller protocolMarshaller) { if (describeEndpointRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeEndpointRequest.getEndpointType(), ENDPOINTTYPE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DescribeEndpointRequest describeEndpointRequest, ProtocolMarshaller protocolMarshaller) { if (describeEndpointRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeEndpointRequest.getEndpointType(), ENDPOINTTYPE_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static Resource computeTotalResourceChange(TopologyAPI.Topology topology, Map<String, Integer> componentChanges, Resource defaultInstanceResources, ScalingDirection scalingDirection) { double cpu = 0; ByteAmount ram = ByteAmount.ZERO; ByteAmount disk = ByteAmount.ZERO; Map<String, ByteAmount> ramMap = TopologyUtils.getComponentRamMapConfig(topology); Map<String, Integer> componentsToScale = PackingUtils.getComponentsToScale( componentChanges, scalingDirection); for (String component : componentsToScale.keySet()) { int parallelismChange = Math.abs(componentChanges.get(component)); cpu += parallelismChange * defaultInstanceResources.getCpu(); disk = disk.plus(defaultInstanceResources.getDisk().multiply(parallelismChange)); if (ramMap.containsKey(component)) { ram = ram.plus(ramMap.get(component).multiply(parallelismChange)); } else { ram = ram.plus(defaultInstanceResources.getRam().multiply(parallelismChange)); } } return new Resource(cpu, ram, disk); } }
public class class_name { public static Resource computeTotalResourceChange(TopologyAPI.Topology topology, Map<String, Integer> componentChanges, Resource defaultInstanceResources, ScalingDirection scalingDirection) { double cpu = 0; ByteAmount ram = ByteAmount.ZERO; ByteAmount disk = ByteAmount.ZERO; Map<String, ByteAmount> ramMap = TopologyUtils.getComponentRamMapConfig(topology); Map<String, Integer> componentsToScale = PackingUtils.getComponentsToScale( componentChanges, scalingDirection); for (String component : componentsToScale.keySet()) { int parallelismChange = Math.abs(componentChanges.get(component)); cpu += parallelismChange * defaultInstanceResources.getCpu(); // depends on control dependency: [for], data = [none] disk = disk.plus(defaultInstanceResources.getDisk().multiply(parallelismChange)); // depends on control dependency: [for], data = [none] if (ramMap.containsKey(component)) { ram = ram.plus(ramMap.get(component).multiply(parallelismChange)); // depends on control dependency: [if], data = [none] } else { ram = ram.plus(defaultInstanceResources.getRam().multiply(parallelismChange)); // depends on control dependency: [if], data = [none] } } return new Resource(cpu, ram, disk); } }
public class class_name { private boolean checkChildren(JsonSimple response, JsonSimple data, String thisOid, String thisPid, boolean sendRequests, String childOid, String childId, String curatedPid) throws TransactionException { boolean isReady = true; boolean saveData = false; log.debug("Checking Children of '{}'", thisOid); JSONArray relations = data.writeArray("relationships"); for (Object relation : relations) { JsonSimple json = new JsonSimple((JsonObject) relation); String broker = json.getString(brokerUrl, "broker"); boolean localRecord = broker.equals(brokerUrl); String relatedId = json.getString(null, "identifier"); // We need to find OIDs to match IDs (only for local records) String relatedOid = json.getString(null, "oid"); if (relatedOid == null && localRecord) { String identifier = json.getString(null, "identifier"); if (identifier == null) { throw new TransactionException("NULL identifer provided!"); } relatedOid = idToOid(identifier); if (relatedOid == null) { throw new TransactionException("Cannot resolve identifer: " + identifier); } ((JsonObject) relation).put("oid", relatedOid); saveData = true; } // Are we updating a relationship... and is it this one? boolean updatingById = (childId != null && childId .equals(relatedId)); boolean updatingByOid = (childOid != null && childOid .equals(relatedOid)); if (curatedPid != null && (updatingById || updatingByOid)) { log.debug("Updating..."); ((JsonObject) relation).put("isCurated", true); ((JsonObject) relation).put("curatedPid", curatedPid); saveData = true; } // Is this relationship using a curated ID? boolean isCurated = json.getBoolean(false, "isCurated"); if (!isCurated) { log.debug(" * Needs curation '{}'", relatedId); boolean optional = json.getBoolean(false, "optional"); if (!optional) { isReady = false; } // Only send out curation requests if asked to if (sendRequests) { JsonObject task; // It is a local object if (localRecord) { task = createTask(response, relatedOid, "curation-query"); // Or remote } else { task = createTask(response, broker, relatedOid, "curation-query"); // We won't know OIDs for remote systems task.remove("oid"); task.put("identifier", relatedId); } // If this record is the authority on the relationship // make sure we tell the other object what its relationship // back to us should be. boolean authority = json.getBoolean(false, "authority"); if (authority) { // Send a full request rather then a query, we need it // to propogate through children task.put("task", "curation-request"); // Let the other object know its reverse relationship // with us and that we've already been curated. String reverseRelationship = json.getString( "hasAssociationWith", "reverseRelationship"); JsonObject relObject = new JsonObject(); relObject.put("identifier", thisPid); relObject.put("curatedPid", thisPid); relObject.put("broker", brokerUrl); relObject.put("isCurated", true); relObject.put("relationship", reverseRelationship); // Make sure we send OID to local records if (localRecord) { relObject.put("oid", thisOid); } JSONArray newRelations = new JSONArray(); newRelations.add(relObject); task.put("relationships", newRelations); } // And make sure it knows how to send us curated PIDs JsonObject msgResponse = new JsonObject(); msgResponse.put("broker", brokerUrl); msgResponse.put("oid", thisOid); msgResponse.put("task", "curation-pending"); task.put("respond", msgResponse); } } else { log.debug(" * Already curated '{}'", relatedId); } } // Save our data if we changed it if (saveData) { saveObjectData(data, thisOid); } return isReady; } }
public class class_name { private boolean checkChildren(JsonSimple response, JsonSimple data, String thisOid, String thisPid, boolean sendRequests, String childOid, String childId, String curatedPid) throws TransactionException { boolean isReady = true; boolean saveData = false; log.debug("Checking Children of '{}'", thisOid); JSONArray relations = data.writeArray("relationships"); for (Object relation : relations) { JsonSimple json = new JsonSimple((JsonObject) relation); String broker = json.getString(brokerUrl, "broker"); boolean localRecord = broker.equals(brokerUrl); String relatedId = json.getString(null, "identifier"); // We need to find OIDs to match IDs (only for local records) String relatedOid = json.getString(null, "oid"); if (relatedOid == null && localRecord) { String identifier = json.getString(null, "identifier"); if (identifier == null) { throw new TransactionException("NULL identifer provided!"); } relatedOid = idToOid(identifier); // depends on control dependency: [if], data = [none] if (relatedOid == null) { throw new TransactionException("Cannot resolve identifer: " + identifier); } ((JsonObject) relation).put("oid", relatedOid); // depends on control dependency: [if], data = [none] saveData = true; // depends on control dependency: [if], data = [none] } // Are we updating a relationship... and is it this one? boolean updatingById = (childId != null && childId .equals(relatedId)); boolean updatingByOid = (childOid != null && childOid .equals(relatedOid)); if (curatedPid != null && (updatingById || updatingByOid)) { log.debug("Updating..."); // depends on control dependency: [if], data = [none] ((JsonObject) relation).put("isCurated", true); // depends on control dependency: [if], data = [none] ((JsonObject) relation).put("curatedPid", curatedPid); // depends on control dependency: [if], data = [none] saveData = true; // depends on control dependency: [if], data = [none] } // Is this relationship using a curated ID? boolean isCurated = json.getBoolean(false, "isCurated"); if (!isCurated) { log.debug(" * Needs curation '{}'", relatedId); // depends on control dependency: [if], data = [none] boolean optional = json.getBoolean(false, "optional"); if (!optional) { isReady = false; // depends on control dependency: [if], data = [none] } // Only send out curation requests if asked to if (sendRequests) { JsonObject task; // It is a local object if (localRecord) { task = createTask(response, relatedOid, "curation-query"); // depends on control dependency: [if], data = [none] // Or remote } else { task = createTask(response, broker, relatedOid, "curation-query"); // depends on control dependency: [if], data = [none] // We won't know OIDs for remote systems task.remove("oid"); // depends on control dependency: [if], data = [none] task.put("identifier", relatedId); // depends on control dependency: [if], data = [none] } // If this record is the authority on the relationship // make sure we tell the other object what its relationship // back to us should be. boolean authority = json.getBoolean(false, "authority"); if (authority) { // Send a full request rather then a query, we need it // to propogate through children task.put("task", "curation-request"); // depends on control dependency: [if], data = [none] // Let the other object know its reverse relationship // with us and that we've already been curated. String reverseRelationship = json.getString( "hasAssociationWith", "reverseRelationship"); JsonObject relObject = new JsonObject(); relObject.put("identifier", thisPid); // depends on control dependency: [if], data = [none] relObject.put("curatedPid", thisPid); // depends on control dependency: [if], data = [none] relObject.put("broker", brokerUrl); // depends on control dependency: [if], data = [none] relObject.put("isCurated", true); // depends on control dependency: [if], data = [none] relObject.put("relationship", reverseRelationship); // depends on control dependency: [if], data = [none] // Make sure we send OID to local records if (localRecord) { relObject.put("oid", thisOid); // depends on control dependency: [if], data = [none] } JSONArray newRelations = new JSONArray(); newRelations.add(relObject); // depends on control dependency: [if], data = [none] task.put("relationships", newRelations); // depends on control dependency: [if], data = [none] } // And make sure it knows how to send us curated PIDs JsonObject msgResponse = new JsonObject(); msgResponse.put("broker", brokerUrl); // depends on control dependency: [if], data = [none] msgResponse.put("oid", thisOid); // depends on control dependency: [if], data = [none] msgResponse.put("task", "curation-pending"); // depends on control dependency: [if], data = [none] task.put("respond", msgResponse); // depends on control dependency: [if], data = [none] } } else { log.debug(" * Already curated '{}'", relatedId); // depends on control dependency: [if], data = [none] } } // Save our data if we changed it if (saveData) { saveObjectData(data, thisOid); } return isReady; } }
public class class_name { public void addProjectResource(String resourceName) { if ((m_throwable != null) || (m_projectName == null)) { return; } if (m_projectResources == null) { m_projectResources = new ArrayList<String>(); } m_projectResources.add(resourceName); } }
public class class_name { public void addProjectResource(String resourceName) { if ((m_throwable != null) || (m_projectName == null)) { return; // depends on control dependency: [if], data = [none] } if (m_projectResources == null) { m_projectResources = new ArrayList<String>(); // depends on control dependency: [if], data = [none] } m_projectResources.add(resourceName); } }
public class class_name { public final EObject ruleJvmFormalParameter() throws RecognitionException { EObject current = null; Token lv_extension_0_0=null; Token otherlv_2=null; AntlrDatatypeRuleToken lv_name_1_0 = null; EObject lv_parameterType_3_0 = null; enterRule(); try { // InternalSARL.g:8184:2: ( ( ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) ( ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) )? ) ) // InternalSARL.g:8185:2: ( ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) ( ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) )? ) { // InternalSARL.g:8185:2: ( ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) ( ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) )? ) // InternalSARL.g:8186:3: ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) ( ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) )? { // InternalSARL.g:8186:3: ( (lv_extension_0_0= 'extension' ) )? int alt225=2; int LA225_0 = input.LA(1); if ( (LA225_0==45) ) { alt225=1; } switch (alt225) { case 1 : // InternalSARL.g:8187:4: (lv_extension_0_0= 'extension' ) { // InternalSARL.g:8187:4: (lv_extension_0_0= 'extension' ) // InternalSARL.g:8188:5: lv_extension_0_0= 'extension' { lv_extension_0_0=(Token)match(input,45,FOLLOW_3); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(lv_extension_0_0, grammarAccess.getJvmFormalParameterAccess().getExtensionExtensionKeyword_0_0()); } if ( state.backtracking==0 ) { if (current==null) { current = createModelElement(grammarAccess.getJvmFormalParameterRule()); } setWithLastConsumed(current, "extension", true, "extension"); } } } break; } // InternalSARL.g:8200:3: ( (lv_name_1_0= ruleValidID ) ) // InternalSARL.g:8201:4: (lv_name_1_0= ruleValidID ) { // InternalSARL.g:8201:4: (lv_name_1_0= ruleValidID ) // InternalSARL.g:8202:5: lv_name_1_0= ruleValidID { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getJvmFormalParameterAccess().getNameValidIDParserRuleCall_1_0()); } pushFollow(FOLLOW_79); lv_name_1_0=ruleValidID(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getJvmFormalParameterRule()); } set( current, "name", lv_name_1_0, "org.eclipse.xtend.core.Xtend.ValidID"); afterParserOrEnumRuleCall(); } } } // InternalSARL.g:8219:3: ( ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) )? int alt226=2; int LA226_0 = input.LA(1); if ( (LA226_0==46) ) { int LA226_1 = input.LA(2); if ( (synpred9_InternalSARL()) ) { alt226=1; } } switch (alt226) { case 1 : // InternalSARL.g:8220:4: ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) { // InternalSARL.g:8220:4: ( ( ':' )=>otherlv_2= ':' ) // InternalSARL.g:8221:5: ( ':' )=>otherlv_2= ':' { otherlv_2=(Token)match(input,46,FOLLOW_41); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(otherlv_2, grammarAccess.getJvmFormalParameterAccess().getColonKeyword_2_0()); } } // InternalSARL.g:8227:4: ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) // InternalSARL.g:8228:5: (lv_parameterType_3_0= ruleJvmTypeReference ) { // InternalSARL.g:8228:5: (lv_parameterType_3_0= ruleJvmTypeReference ) // InternalSARL.g:8229:6: lv_parameterType_3_0= ruleJvmTypeReference { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getJvmFormalParameterAccess().getParameterTypeJvmTypeReferenceParserRuleCall_2_1_0()); } pushFollow(FOLLOW_2); lv_parameterType_3_0=ruleJvmTypeReference(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getJvmFormalParameterRule()); } set( current, "parameterType", lv_parameterType_3_0, "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); afterParserOrEnumRuleCall(); } } } } break; } } } if ( state.backtracking==0 ) { leaveRule(); } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; } }
public class class_name { public final EObject ruleJvmFormalParameter() throws RecognitionException { EObject current = null; Token lv_extension_0_0=null; Token otherlv_2=null; AntlrDatatypeRuleToken lv_name_1_0 = null; EObject lv_parameterType_3_0 = null; enterRule(); try { // InternalSARL.g:8184:2: ( ( ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) ( ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) )? ) ) // InternalSARL.g:8185:2: ( ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) ( ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) )? ) { // InternalSARL.g:8185:2: ( ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) ( ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) )? ) // InternalSARL.g:8186:3: ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) ( ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) )? { // InternalSARL.g:8186:3: ( (lv_extension_0_0= 'extension' ) )? int alt225=2; int LA225_0 = input.LA(1); if ( (LA225_0==45) ) { alt225=1; // depends on control dependency: [if], data = [none] } switch (alt225) { case 1 : // InternalSARL.g:8187:4: (lv_extension_0_0= 'extension' ) { // InternalSARL.g:8187:4: (lv_extension_0_0= 'extension' ) // InternalSARL.g:8188:5: lv_extension_0_0= 'extension' { lv_extension_0_0=(Token)match(input,45,FOLLOW_3); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(lv_extension_0_0, grammarAccess.getJvmFormalParameterAccess().getExtensionExtensionKeyword_0_0()); // depends on control dependency: [if], data = [none] } if ( state.backtracking==0 ) { if (current==null) { current = createModelElement(grammarAccess.getJvmFormalParameterRule()); // depends on control dependency: [if], data = [none] } setWithLastConsumed(current, "extension", true, "extension"); // depends on control dependency: [if], data = [none] } } } break; } // InternalSARL.g:8200:3: ( (lv_name_1_0= ruleValidID ) ) // InternalSARL.g:8201:4: (lv_name_1_0= ruleValidID ) { // InternalSARL.g:8201:4: (lv_name_1_0= ruleValidID ) // InternalSARL.g:8202:5: lv_name_1_0= ruleValidID { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getJvmFormalParameterAccess().getNameValidIDParserRuleCall_1_0()); // depends on control dependency: [if], data = [none] } pushFollow(FOLLOW_79); lv_name_1_0=ruleValidID(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getJvmFormalParameterRule()); // depends on control dependency: [if], data = [none] } set( current, "name", lv_name_1_0, "org.eclipse.xtend.core.Xtend.ValidID"); afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none] } } } // InternalSARL.g:8219:3: ( ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) )? int alt226=2; int LA226_0 = input.LA(1); if ( (LA226_0==46) ) { int LA226_1 = input.LA(2); if ( (synpred9_InternalSARL()) ) { alt226=1; // depends on control dependency: [if], data = [none] } } switch (alt226) { case 1 : // InternalSARL.g:8220:4: ( ( ':' )=>otherlv_2= ':' ) ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) { // InternalSARL.g:8220:4: ( ( ':' )=>otherlv_2= ':' ) // InternalSARL.g:8221:5: ( ':' )=>otherlv_2= ':' { otherlv_2=(Token)match(input,46,FOLLOW_41); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(otherlv_2, grammarAccess.getJvmFormalParameterAccess().getColonKeyword_2_0()); // depends on control dependency: [if], data = [none] } } // InternalSARL.g:8227:4: ( (lv_parameterType_3_0= ruleJvmTypeReference ) ) // InternalSARL.g:8228:5: (lv_parameterType_3_0= ruleJvmTypeReference ) { // InternalSARL.g:8228:5: (lv_parameterType_3_0= ruleJvmTypeReference ) // InternalSARL.g:8229:6: lv_parameterType_3_0= ruleJvmTypeReference { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getJvmFormalParameterAccess().getParameterTypeJvmTypeReferenceParserRuleCall_2_1_0()); // depends on control dependency: [if], data = [none] } pushFollow(FOLLOW_2); lv_parameterType_3_0=ruleJvmTypeReference(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getJvmFormalParameterRule()); // depends on control dependency: [if], data = [none] } set( current, "parameterType", lv_parameterType_3_0, "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); // depends on control dependency: [if], data = [none] afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none] } } } } break; } } } if ( state.backtracking==0 ) { leaveRule(); // depends on control dependency: [if], data = [none] } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; } }
public class class_name { @Override public Tuple getNext() throws IOException { try { if (reader == null || !reader.nextKeyValue()) { return null; } final Object value = reader.getCurrentValue(); if (value instanceof SmileEnvelopeEvent) { final SmileEnvelopeEvent envelope = (SmileEnvelopeEvent) value; final JsonNode data = (JsonNode) envelope.getData(); final Tuple tuple = factory.newTuple(data.size()); int i = 0; for (final GoodwillSchemaField field : schema.getSchema()) { final JsonNode node = data.get(field.getName()); tuple.set(i, getJsonValue(field.getType(), node)); i++; } return tuple; } else { throw new IOException(String.format("Expected SmileEnvelopeEvent, not %s", value.getClass())); } } catch (NullPointerException e) { String splitInfo = "<no split info>"; if(split != null) { splitInfo = split.toString(); } log.error(String.format("Corrupt Smile file (%s), ignoring the rest of the input",splitInfo), e); } catch (com.fasterxml.jackson.core.JsonParseException e) { String splitInfo = "<no split info>"; if(split != null) { splitInfo = split.toString(); } log.error(String.format("Corrupt Smile file (%s), ignoring the rest of the input",splitInfo), e); return null; } catch (InterruptedException e) { Thread.currentThread().interrupt(); } return null; } }
public class class_name { @Override public Tuple getNext() throws IOException { try { if (reader == null || !reader.nextKeyValue()) { return null; } final Object value = reader.getCurrentValue(); if (value instanceof SmileEnvelopeEvent) { final SmileEnvelopeEvent envelope = (SmileEnvelopeEvent) value; final JsonNode data = (JsonNode) envelope.getData(); final Tuple tuple = factory.newTuple(data.size()); int i = 0; for (final GoodwillSchemaField field : schema.getSchema()) { final JsonNode node = data.get(field.getName()); tuple.set(i, getJsonValue(field.getType(), node)); // depends on control dependency: [for], data = [field] i++; // depends on control dependency: [for], data = [none] } return tuple; } else { throw new IOException(String.format("Expected SmileEnvelopeEvent, not %s", value.getClass())); } } catch (NullPointerException e) { String splitInfo = "<no split info>"; if(split != null) { splitInfo = split.toString(); } log.error(String.format("Corrupt Smile file (%s), ignoring the rest of the input",splitInfo), e); } catch (com.fasterxml.jackson.core.JsonParseException e) { String splitInfo = "<no split info>"; if(split != null) { splitInfo = split.toString(); } log.error(String.format("Corrupt Smile file (%s), ignoring the rest of the input",splitInfo), e); return null; } catch (InterruptedException e) { Thread.currentThread().interrupt(); } return null; } }