code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public final AbstractExecutor.Get getJadeGetExecutor(Object obj, Object identifier) { final Class<?> claz = obj.getClass(); final String property = toString(identifier); AbstractExecutor.Get executor; // let's see if we are a map... executor = new MapGetExecutor(this, claz, identifier); if (executor.isAlive()) { return executor; } // first try for a getFoo() type of property (also getfoo() ) if (property != null) { executor = new PropertyGetExecutor(this, claz, property); if (executor.isAlive()) { return executor; } // } // look for boolean isFoo() // if (property != null) { executor = new BooleanGetExecutor(this, claz, property); if (executor.isAlive()) { return executor; } } // let's see if we can convert the identifier to an int, // if obj is an array or a list, we can still do something Integer index = toInteger(identifier); if (index != null) { executor = new ListGetExecutor(this, claz, index); if (executor.isAlive()) { return executor; } } // if that didn't work, look for set("foo") executor = new DuckGetExecutor(this, claz, identifier); if (executor.isAlive()) { return executor; } // if that didn't work, look for set("foo") executor = new DuckGetExecutor(this, claz, property); if (executor.isAlive()) { return executor; } return null; } }
public class class_name { public final AbstractExecutor.Get getJadeGetExecutor(Object obj, Object identifier) { final Class<?> claz = obj.getClass(); final String property = toString(identifier); AbstractExecutor.Get executor; // let's see if we are a map... executor = new MapGetExecutor(this, claz, identifier); if (executor.isAlive()) { return executor; // depends on control dependency: [if], data = [none] } // first try for a getFoo() type of property (also getfoo() ) if (property != null) { executor = new PropertyGetExecutor(this, claz, property); // depends on control dependency: [if], data = [none] if (executor.isAlive()) { return executor; // depends on control dependency: [if], data = [none] } // } // look for boolean isFoo() // if (property != null) { executor = new BooleanGetExecutor(this, claz, property); // depends on control dependency: [if], data = [none] if (executor.isAlive()) { return executor; // depends on control dependency: [if], data = [none] } } // let's see if we can convert the identifier to an int, // if obj is an array or a list, we can still do something Integer index = toInteger(identifier); if (index != null) { executor = new ListGetExecutor(this, claz, index); // depends on control dependency: [if], data = [none] if (executor.isAlive()) { return executor; // depends on control dependency: [if], data = [none] } } // if that didn't work, look for set("foo") executor = new DuckGetExecutor(this, claz, identifier); if (executor.isAlive()) { return executor; // depends on control dependency: [if], data = [none] } // if that didn't work, look for set("foo") executor = new DuckGetExecutor(this, claz, property); if (executor.isAlive()) { return executor; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public static <T> T from(final long pointer) { if (pointer == 0L) { return null; } return (T) MAPPED_OBJECTS.get(pointer); } }
public class class_name { public static <T> T from(final long pointer) { if (pointer == 0L) { return null; // depends on control dependency: [if], data = [none] } return (T) MAPPED_OBJECTS.get(pointer); } }
public class class_name { private <T> Set<Class<? extends T>> load(Class<T> serviceClass) { String serviceFile = SERVICES + "/" + serviceClass.getName(); LinkedHashSet<Class<? extends T>> providers = new LinkedHashSet<Class<? extends T>>(); try { Enumeration<URL> enumeration = classLoader.getResources(serviceFile); while (enumeration.hasMoreElements()) { final URL url = enumeration.nextElement(); final InputStream is = url.openStream(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); String line = reader.readLine(); while (null != line) { line = skipCommentAndTrim(line); if (line.length() > 0) { try { Class<? extends T> provider = classLoader.loadClass(line).asSubclass(serviceClass); providers.add(provider); } catch (ClassCastException e) { ClassLoader other = serviceClass.getClassLoader(); if (!classLoader.getClass().equals(serviceClass.getClassLoader())) { throw new IllegalStateException("Service " + line + " was loaded by different classloader (" + (other == null ? "bootstrap" : other.getClass().getName()) + ") then service interface " + serviceClass.getName() + " (" + classLoader.getClass().getName() + "), unable to cast classes"); } throw new IllegalStateException("Service " + line + " does not implement expected type " + serviceClass.getName()); } } line = reader.readLine(); } } finally { if (reader != null) { reader.close(); } } } } catch (Exception e) { throw new RuntimeException("Could not load services for " + serviceClass.getName(), e); } return providers; } }
public class class_name { private <T> Set<Class<? extends T>> load(Class<T> serviceClass) { String serviceFile = SERVICES + "/" + serviceClass.getName(); LinkedHashSet<Class<? extends T>> providers = new LinkedHashSet<Class<? extends T>>(); try { Enumeration<URL> enumeration = classLoader.getResources(serviceFile); while (enumeration.hasMoreElements()) { final URL url = enumeration.nextElement(); final InputStream is = url.openStream(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); // depends on control dependency: [try], data = [none] String line = reader.readLine(); while (null != line) { line = skipCommentAndTrim(line); // depends on control dependency: [while], data = [line)] if (line.length() > 0) { try { Class<? extends T> provider = classLoader.loadClass(line).asSubclass(serviceClass); providers.add(provider); } catch (ClassCastException e) { ClassLoader other = serviceClass.getClassLoader(); if (!classLoader.getClass().equals(serviceClass.getClassLoader())) { throw new IllegalStateException("Service " + line + " was loaded by different classloader (" + (other == null ? "bootstrap" : other.getClass().getName()) + ") then service interface " + serviceClass.getName() + " (" + classLoader.getClass().getName() + "), unable to cast classes"); } throw new IllegalStateException("Service " + line + " does not implement expected type " + serviceClass.getName()); } // depends on control dependency: [catch], data = [none] } line = reader.readLine(); // depends on control dependency: [while], data = [none] } } finally { if (reader != null) { reader.close(); // depends on control dependency: [if], data = [none] } } } } catch (Exception e) { throw new RuntimeException("Could not load services for " + serviceClass.getName(), e); } // depends on control dependency: [catch], data = [none] return providers; } }
public class class_name { @Override public Node delete(ArchivePath path) { Validate.notNull(path, "No path was specified"); ArchivePath safePath = path; NodeImpl node = content.get(safePath); if (node == null) { if (path.get().endsWith("/")) { safePath = ArchivePaths.create(path.get().substring(0, path.get().length() - 1)); node = content.get(safePath); } if (node == null) { return null; } } return removeNodeRecursively(node, safePath); } }
public class class_name { @Override public Node delete(ArchivePath path) { Validate.notNull(path, "No path was specified"); ArchivePath safePath = path; NodeImpl node = content.get(safePath); if (node == null) { if (path.get().endsWith("/")) { safePath = ArchivePaths.create(path.get().substring(0, path.get().length() - 1)); // depends on control dependency: [if], data = [none] node = content.get(safePath); // depends on control dependency: [if], data = [none] } if (node == null) { return null; // depends on control dependency: [if], data = [none] } } return removeNodeRecursively(node, safePath); } }
public class class_name { protected void initSettings(Element root, CmsXmlContentDefinition contentDefinition) { Iterator<Element> itProperties = CmsXmlGenericWrapper.elementIterator(root, APPINFO_SETTING); while (itProperties.hasNext()) { Element element = itProperties.next(); CmsXmlContentProperty setting = new CmsXmlContentProperty( element.attributeValue(APPINFO_ATTR_NAME), element.attributeValue(APPINFO_ATTR_TYPE), element.attributeValue(APPINFO_ATTR_WIDGET), element.attributeValue(APPINFO_ATTR_WIDGET_CONFIG), element.attributeValue(APPINFO_ATTR_RULE_REGEX), element.attributeValue(APPINFO_ATTR_RULE_TYPE), element.attributeValue(APPINFO_ATTR_DEFAULT), element.attributeValue(APPINFO_ATTR_NICE_NAME), element.attributeValue(APPINFO_ATTR_DESCRIPTION), element.attributeValue(APPINFO_ATTR_ERROR), element.attributeValue(APPINFO_ATTR_PREFERFOLDER)); String name = setting.getName(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(name)) { m_settings.put(name, setting); } } } }
public class class_name { protected void initSettings(Element root, CmsXmlContentDefinition contentDefinition) { Iterator<Element> itProperties = CmsXmlGenericWrapper.elementIterator(root, APPINFO_SETTING); while (itProperties.hasNext()) { Element element = itProperties.next(); CmsXmlContentProperty setting = new CmsXmlContentProperty( element.attributeValue(APPINFO_ATTR_NAME), element.attributeValue(APPINFO_ATTR_TYPE), element.attributeValue(APPINFO_ATTR_WIDGET), element.attributeValue(APPINFO_ATTR_WIDGET_CONFIG), element.attributeValue(APPINFO_ATTR_RULE_REGEX), element.attributeValue(APPINFO_ATTR_RULE_TYPE), element.attributeValue(APPINFO_ATTR_DEFAULT), element.attributeValue(APPINFO_ATTR_NICE_NAME), element.attributeValue(APPINFO_ATTR_DESCRIPTION), element.attributeValue(APPINFO_ATTR_ERROR), element.attributeValue(APPINFO_ATTR_PREFERFOLDER)); String name = setting.getName(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(name)) { m_settings.put(name, setting); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void complete(VirtualConnection vc, TCPReadRequestContext rsc) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "complete() called: vc=" + vc); } HttpOutboundServiceContextImpl mySC = (HttpOutboundServiceContextImpl) vc.getStateMap().get(CallbackIDs.CALLBACK_HTTPOSC); // keep reading and handling new data until either we're done // parsing headers or until we're waiting on a read to finish // Note: parseMessage will allocate the read buffers boolean rc = false; while (!rc && null != vc) { rc = handleNewData(mySC, vc); // if we're not done parsing, then read more data if (!rc) { // read whatever is available vc = rsc.read(1, this, false, mySC.getReadTimeout()); } } // if rc is false, then this callback will be used later on when // the read completes, otherwise check the status code from the // response message if (rc) { StatusCodes status = mySC.getResponse().getStatusCode(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "100-continue scenario received " + status); } if (status.equals(StatusCodes.CONTINUE)) { // got the 100-continue mySC.resetRead(); mySC.getAppWriteCallback().complete(vc); } else { // anything else, pass along the ExpectationFailedException mySC.setPersistent(false); mySC.getAppWriteCallback().error(vc, new ExpectationFailedException(status.getIntCode() + " " + mySC.getResponse().getReasonPhrase())); } } } }
public class class_name { public void complete(VirtualConnection vc, TCPReadRequestContext rsc) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "complete() called: vc=" + vc); // depends on control dependency: [if], data = [none] } HttpOutboundServiceContextImpl mySC = (HttpOutboundServiceContextImpl) vc.getStateMap().get(CallbackIDs.CALLBACK_HTTPOSC); // keep reading and handling new data until either we're done // parsing headers or until we're waiting on a read to finish // Note: parseMessage will allocate the read buffers boolean rc = false; while (!rc && null != vc) { rc = handleNewData(mySC, vc); // depends on control dependency: [while], data = [vc)] // if we're not done parsing, then read more data if (!rc) { // read whatever is available vc = rsc.read(1, this, false, mySC.getReadTimeout()); // depends on control dependency: [if], data = [none] } } // if rc is false, then this callback will be used later on when // the read completes, otherwise check the status code from the // response message if (rc) { StatusCodes status = mySC.getResponse().getStatusCode(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "100-continue scenario received " + status); // depends on control dependency: [if], data = [none] } if (status.equals(StatusCodes.CONTINUE)) { // got the 100-continue mySC.resetRead(); // depends on control dependency: [if], data = [none] mySC.getAppWriteCallback().complete(vc); // depends on control dependency: [if], data = [none] } else { // anything else, pass along the ExpectationFailedException mySC.setPersistent(false); // depends on control dependency: [if], data = [none] mySC.getAppWriteCallback().error(vc, new ExpectationFailedException(status.getIntCode() + " " + mySC.getResponse().getReasonPhrase())); // depends on control dependency: [if], data = [none] } } } }
public class class_name { private void inflateTitleView() { titleContainer = rootView.findViewById(R.id.title_container); titleContainer.removeAllViews(); if (customTitleView != null) { titleContainer.addView(customTitleView); } else if (customTitleViewId != -1) { LayoutInflater layoutInflater = LayoutInflater.from(getContext()); View view = layoutInflater.inflate(customTitleViewId, titleContainer, false); titleContainer.addView(view); } else { LayoutInflater layoutInflater = LayoutInflater.from(getContext()); View view = layoutInflater.inflate(R.layout.bottom_sheet_title, titleContainer, false); titleContainer.addView(view); } if (getStyle() == Style.LIST) { int padding = getContext().getResources() .getDimensionPixelSize(R.dimen.bottom_sheet_list_item_horizontal_padding); titleContainer.setPadding(padding, 0, padding, 0); } else { int padding = getContext().getResources() .getDimensionPixelSize(R.dimen.bottom_sheet_grid_item_horizontal_padding); titleContainer.setPadding(padding, 0, padding, 0); } View titleView = titleContainer.findViewById(android.R.id.title); titleTextView = titleView instanceof TextView ? (TextView) titleView : null; } }
public class class_name { private void inflateTitleView() { titleContainer = rootView.findViewById(R.id.title_container); titleContainer.removeAllViews(); if (customTitleView != null) { titleContainer.addView(customTitleView); // depends on control dependency: [if], data = [(customTitleView] } else if (customTitleViewId != -1) { LayoutInflater layoutInflater = LayoutInflater.from(getContext()); View view = layoutInflater.inflate(customTitleViewId, titleContainer, false); titleContainer.addView(view); // depends on control dependency: [if], data = [none] } else { LayoutInflater layoutInflater = LayoutInflater.from(getContext()); View view = layoutInflater.inflate(R.layout.bottom_sheet_title, titleContainer, false); titleContainer.addView(view); // depends on control dependency: [if], data = [none] } if (getStyle() == Style.LIST) { int padding = getContext().getResources() .getDimensionPixelSize(R.dimen.bottom_sheet_list_item_horizontal_padding); titleContainer.setPadding(padding, 0, padding, 0); // depends on control dependency: [if], data = [none] } else { int padding = getContext().getResources() .getDimensionPixelSize(R.dimen.bottom_sheet_grid_item_horizontal_padding); titleContainer.setPadding(padding, 0, padding, 0); // depends on control dependency: [if], data = [none] } View titleView = titleContainer.findViewById(android.R.id.title); titleTextView = titleView instanceof TextView ? (TextView) titleView : null; } }
public class class_name { public static boolean match(final String stringToMatch, final String suffixes[]) { for (final String suffix : suffixes) { final int suffixesLength = suffix.length(); final int stringToMatchLength = stringToMatch.length(); final int result = stringToMatchLength - suffixesLength; final String extensionToMatch = stringToMatch.substring(result, stringToMatchLength); final boolean equals = extensionToMatch.equalsIgnoreCase(suffix); if (stringToMatchLength >= suffixesLength && equals) { return true; } } return false; } }
public class class_name { public static boolean match(final String stringToMatch, final String suffixes[]) { for (final String suffix : suffixes) { final int suffixesLength = suffix.length(); final int stringToMatchLength = stringToMatch.length(); final int result = stringToMatchLength - suffixesLength; final String extensionToMatch = stringToMatch.substring(result, stringToMatchLength); final boolean equals = extensionToMatch.equalsIgnoreCase(suffix); if (stringToMatchLength >= suffixesLength && equals) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public boolean process(DMatrixRMaj A , int numSingularValues, DMatrixRMaj nullspace ) { decomposition.decompose(A); if( A.numRows > A.numCols ) { Q.reshape(A.numCols,Math.min(A.numRows,A.numCols)); decomposition.getQ(Q, true); } else { Q.reshape(A.numCols, A.numCols); decomposition.getQ(Q, false); } nullspace.reshape(Q.numRows,numSingularValues); CommonOps_DDRM.extract(Q,0,Q.numRows,Q.numCols-numSingularValues,Q.numCols,nullspace,0,0); return true; } }
public class class_name { public boolean process(DMatrixRMaj A , int numSingularValues, DMatrixRMaj nullspace ) { decomposition.decompose(A); if( A.numRows > A.numCols ) { Q.reshape(A.numCols,Math.min(A.numRows,A.numCols)); // depends on control dependency: [if], data = [none] decomposition.getQ(Q, true); // depends on control dependency: [if], data = [none] } else { Q.reshape(A.numCols, A.numCols); // depends on control dependency: [if], data = [none] decomposition.getQ(Q, false); // depends on control dependency: [if], data = [none] } nullspace.reshape(Q.numRows,numSingularValues); CommonOps_DDRM.extract(Q,0,Q.numRows,Q.numCols-numSingularValues,Q.numCols,nullspace,0,0); return true; } }
public class class_name { protected final PdfContentByte getPreparedCanvas(float opacity) { needRestore = false; PdfContentByte canvas = (tableForeground != null) ? tableForeground : (isBg()) ? getWriter().getDirectContentUnder() : getWriter().getDirectContent(); String layerName = getLayerName(); BLENDMODE blend = getBlend(); if (getWriter().getPDFXConformance() == PdfWriter.PDFX1A2001) { // check blend, opacity, layers if (!PdfGState.BM_NORMAL.equals(blend.getBlend()) && !PdfGState.BM_COMPATIBLE.equals(blend.getBlend())) { throw new VectorPrintRuntimeException("blend not supported in PDF/X-1a: " + blend); } if (layerName != null) { throw new VectorPrintRuntimeException("layers not supported in PDF/X-1a: " + layerName); } if (opacity < 1) { throw new VectorPrintRuntimeException("opacity not supported in PDF/X-1a: " + opacity); } } if (layerName != null) { layerManager.startLayerInGroup(layerName, canvas); } // pgs.setAlphaIsShape(true); if (opacity <= 1) { // PdfShading shading = PdfShading.simpleAxial(getWriter(), 0, 0, getDocument().right() - getDocument().getPageSize().getWidth() * 0.6f, getDocument().top() - getDocument().getPageSize().getHeight() * 0.6f, Color.green, Color.orange,true,true); // canvas.paintShading(shading); canvas.saveState(); needRestore = true; PdfGState pgs = new PdfGState(); pgs.setFillOpacity(opacity); pgs.setStrokeOpacity(opacity); canvas.setGState(pgs); } if (!BLENDMODE.NORMAL.equals(blend)) { if (!needRestore) { canvas.saveState(); needRestore = true; } PdfGState pgs = new PdfGState(); pgs.setBlendMode(blend.getBlend()); canvas.setGState(pgs); } if (getTransform() != null && !(this instanceof Image)) { canvas.transform(new AffineTransform(getTransform())); } return canvas; } }
public class class_name { protected final PdfContentByte getPreparedCanvas(float opacity) { needRestore = false; PdfContentByte canvas = (tableForeground != null) ? tableForeground : (isBg()) ? getWriter().getDirectContentUnder() : getWriter().getDirectContent(); String layerName = getLayerName(); BLENDMODE blend = getBlend(); if (getWriter().getPDFXConformance() == PdfWriter.PDFX1A2001) { // check blend, opacity, layers if (!PdfGState.BM_NORMAL.equals(blend.getBlend()) && !PdfGState.BM_COMPATIBLE.equals(blend.getBlend())) { throw new VectorPrintRuntimeException("blend not supported in PDF/X-1a: " + blend); } if (layerName != null) { throw new VectorPrintRuntimeException("layers not supported in PDF/X-1a: " + layerName); } if (opacity < 1) { throw new VectorPrintRuntimeException("opacity not supported in PDF/X-1a: " + opacity); } } if (layerName != null) { layerManager.startLayerInGroup(layerName, canvas); // depends on control dependency: [if], data = [(layerName] } // pgs.setAlphaIsShape(true); if (opacity <= 1) { // PdfShading shading = PdfShading.simpleAxial(getWriter(), 0, 0, getDocument().right() - getDocument().getPageSize().getWidth() * 0.6f, getDocument().top() - getDocument().getPageSize().getHeight() * 0.6f, Color.green, Color.orange,true,true); // canvas.paintShading(shading); canvas.saveState(); // depends on control dependency: [if], data = [none] needRestore = true; // depends on control dependency: [if], data = [none] PdfGState pgs = new PdfGState(); pgs.setFillOpacity(opacity); // depends on control dependency: [if], data = [(opacity] pgs.setStrokeOpacity(opacity); // depends on control dependency: [if], data = [(opacity] canvas.setGState(pgs); // depends on control dependency: [if], data = [none] } if (!BLENDMODE.NORMAL.equals(blend)) { if (!needRestore) { canvas.saveState(); // depends on control dependency: [if], data = [none] needRestore = true; // depends on control dependency: [if], data = [none] } PdfGState pgs = new PdfGState(); pgs.setBlendMode(blend.getBlend()); // depends on control dependency: [if], data = [none] canvas.setGState(pgs); // depends on control dependency: [if], data = [none] } if (getTransform() != null && !(this instanceof Image)) { canvas.transform(new AffineTransform(getTransform())); // depends on control dependency: [if], data = [(getTransform()] } return canvas; } }
public class class_name { @Override public List<String> getInboundTrustedRealms(String realmName) throws WSSecurityException { final String METHOD = "getInboundTrustedRealms"; List<String> trustedRealmList = new ArrayList<String>(); UserRegistry userRegistry = getActiveUserRegistry(); if (userRegistry != null) { try { if (realmName != null && !realmName.equals(userRegistry.getRealm())) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, METHOD + " Supplied realm not valid: " + realmName); } } else { trustedRealmList.add(userRegistry.getRealm()); } } catch (RemoteException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, METHOD + " Internal error getting current registry realm", e); } throw new WSSecurityException("Internal error getting realm", e); } } return trustedRealmList; } }
public class class_name { @Override public List<String> getInboundTrustedRealms(String realmName) throws WSSecurityException { final String METHOD = "getInboundTrustedRealms"; List<String> trustedRealmList = new ArrayList<String>(); UserRegistry userRegistry = getActiveUserRegistry(); if (userRegistry != null) { try { if (realmName != null && !realmName.equals(userRegistry.getRealm())) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, METHOD + " Supplied realm not valid: " + realmName); // depends on control dependency: [if], data = [none] } } else { trustedRealmList.add(userRegistry.getRealm()); } } catch (RemoteException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, METHOD + " Internal error getting current registry realm", e); } throw new WSSecurityException("Internal error getting realm", e); } } return trustedRealmList; } }
public class class_name { @Override public EClass getIfcRelConnectsStructuralActivity() { if (ifcRelConnectsStructuralActivityEClass == null) { ifcRelConnectsStructuralActivityEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc4Package.eNS_URI).getEClassifiers().get(538); } return ifcRelConnectsStructuralActivityEClass; } }
public class class_name { @Override public EClass getIfcRelConnectsStructuralActivity() { if (ifcRelConnectsStructuralActivityEClass == null) { ifcRelConnectsStructuralActivityEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc4Package.eNS_URI).getEClassifiers().get(538); // depends on control dependency: [if], data = [none] } return ifcRelConnectsStructuralActivityEClass; } }
public class class_name { public static void sort( List list, String sortBy, Map<String, FieldAccess> fields, boolean ascending, boolean nullsFirst) { try { /* If this list is null or empty, we have nothing to do so return. */ if ( list == null || list.size() == 0 ) { return; } /* Grab the first item in the list and see what it is. */ Object o = list.get( 0 ); /* if the sort by string is is this, and the object is comparable then use the objects themselves for the sort. */ if ( sortBy.equals( "this" ) ) { Collections.sort(list, thisUniversalComparator(ascending, nullsFirst)); return; } /* If you did not sort by "this", then sort by the field. */ final FieldAccess field = fields.get( sortBy ); if ( field != null ) { Collections.sort( list, Sorting.universalComparator(field, ascending, nullsFirst) ); } } catch (Exception ex) { Exceptions.handle(ex, "list", list, "\nsortBy", sortBy, "fields", fields, "ascending", ascending, "nullFirst", nullsFirst); } } }
public class class_name { public static void sort( List list, String sortBy, Map<String, FieldAccess> fields, boolean ascending, boolean nullsFirst) { try { /* If this list is null or empty, we have nothing to do so return. */ if ( list == null || list.size() == 0 ) { return; // depends on control dependency: [if], data = [none] } /* Grab the first item in the list and see what it is. */ Object o = list.get( 0 ); /* if the sort by string is is this, and the object is comparable then use the objects themselves for the sort. */ if ( sortBy.equals( "this" ) ) { Collections.sort(list, thisUniversalComparator(ascending, nullsFirst)); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } /* If you did not sort by "this", then sort by the field. */ final FieldAccess field = fields.get( sortBy ); if ( field != null ) { Collections.sort( list, Sorting.universalComparator(field, ascending, nullsFirst) ); // depends on control dependency: [if], data = [none] } } catch (Exception ex) { Exceptions.handle(ex, "list", list, "\nsortBy", sortBy, "fields", fields, "ascending", ascending, "nullFirst", nullsFirst); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public Observable<ServiceResponse<List<DatabasePrincipalInner>>> listPrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); } if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.listPrincipals(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<DatabasePrincipalInner>>>>() { @Override public Observable<ServiceResponse<List<DatabasePrincipalInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DatabasePrincipalInner>> result = listPrincipalsDelegate(response); List<DatabasePrincipalInner> items = null; if (result.body() != null) { items = result.body().items(); } ServiceResponse<List<DatabasePrincipalInner>> clientResponse = new ServiceResponse<List<DatabasePrincipalInner>>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponse<List<DatabasePrincipalInner>>> listPrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); } if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.listPrincipals(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<DatabasePrincipalInner>>>>() { @Override public Observable<ServiceResponse<List<DatabasePrincipalInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<DatabasePrincipalInner>> result = listPrincipalsDelegate(response); List<DatabasePrincipalInner> items = null; if (result.body() != null) { items = result.body().items(); // depends on control dependency: [if], data = [none] } ServiceResponse<List<DatabasePrincipalInner>> clientResponse = new ServiceResponse<List<DatabasePrincipalInner>>(items, result.response()); return Observable.just(clientResponse); // depends on control dependency: [try], data = [none] } catch (Throwable t) { return Observable.error(t); } // depends on control dependency: [catch], data = [none] } }); } }
public class class_name { private boolean _createDeltas(Serializable key) { if (isInitialStateMarked()) { if (_copyFullInitialState && _initialFullState == null) { if (_initialState == null) { // Copy it directly _initialFullState = new HashMap<Serializable, Object>(); copyMap(_component.getFacesContext(), _fullState, _initialFullState); } else { // Create only if the passed key is not part of the defined initial state boolean keyInInitialState = false; for (int i = 0; i < _initialState.length; i+=2) { Serializable key2 = (Serializable) _initialState[i]; if (key.equals(key2)) { keyInInitialState = true; break; } } if (!keyInInitialState) { // Copy it directly, but note in this case if the initialFullState map // contains some key already defined in initialState, this key must be // overriden. It is better to do in that way, because it is possible // to skip resetState() if the view cannot be recycled. _initialFullState = new HashMap<Serializable, Object>(); copyMap(_component.getFacesContext(), _fullState, _initialFullState); /* for (int i = 0; i < _initialState.length; i+=2) { Serializable key2 = (Serializable) _initialState[i]; Object defaultValue = _initialState[i+1]; _initialFullState.put(key2, defaultValue); }*/ } } } if (_deltas == null) { _deltas = new HashMap<Serializable, Object>(2); } return true; } return false; } }
public class class_name { private boolean _createDeltas(Serializable key) { if (isInitialStateMarked()) { if (_copyFullInitialState && _initialFullState == null) { if (_initialState == null) { // Copy it directly _initialFullState = new HashMap<Serializable, Object>(); // depends on control dependency: [if], data = [none] copyMap(_component.getFacesContext(), _fullState, _initialFullState); // depends on control dependency: [if], data = [none] } else { // Create only if the passed key is not part of the defined initial state boolean keyInInitialState = false; for (int i = 0; i < _initialState.length; i+=2) { Serializable key2 = (Serializable) _initialState[i]; if (key.equals(key2)) { keyInInitialState = true; // depends on control dependency: [if], data = [none] break; } } if (!keyInInitialState) { // Copy it directly, but note in this case if the initialFullState map // contains some key already defined in initialState, this key must be // overriden. It is better to do in that way, because it is possible // to skip resetState() if the view cannot be recycled. _initialFullState = new HashMap<Serializable, Object>(); // depends on control dependency: [if], data = [none] copyMap(_component.getFacesContext(), _fullState, _initialFullState); // depends on control dependency: [if], data = [none] /* for (int i = 0; i < _initialState.length; i+=2) { Serializable key2 = (Serializable) _initialState[i]; Object defaultValue = _initialState[i+1]; _initialFullState.put(key2, defaultValue); }*/ } } } if (_deltas == null) { _deltas = new HashMap<Serializable, Object>(2); // depends on control dependency: [if], data = [none] } return true; // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { public void marshall(AddCommunicationToCaseRequest addCommunicationToCaseRequest, ProtocolMarshaller protocolMarshaller) { if (addCommunicationToCaseRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(addCommunicationToCaseRequest.getCaseId(), CASEID_BINDING); protocolMarshaller.marshall(addCommunicationToCaseRequest.getCommunicationBody(), COMMUNICATIONBODY_BINDING); protocolMarshaller.marshall(addCommunicationToCaseRequest.getCcEmailAddresses(), CCEMAILADDRESSES_BINDING); protocolMarshaller.marshall(addCommunicationToCaseRequest.getAttachmentSetId(), ATTACHMENTSETID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(AddCommunicationToCaseRequest addCommunicationToCaseRequest, ProtocolMarshaller protocolMarshaller) { if (addCommunicationToCaseRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(addCommunicationToCaseRequest.getCaseId(), CASEID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(addCommunicationToCaseRequest.getCommunicationBody(), COMMUNICATIONBODY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(addCommunicationToCaseRequest.getCcEmailAddresses(), CCEMAILADDRESSES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(addCommunicationToCaseRequest.getAttachmentSetId(), ATTACHMENTSETID_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 String objectToJson(Object item, Map<String, Object> optionalArgs) { try { ByteArrayOutputStream stream = new ByteArrayOutputStream(); JsonWriter writer = new JsonWriter(stream, optionalArgs); writer.write(item); writer.close(); return new String(stream.toByteArray(), "UTF-8"); } catch (Exception e) { throw new JsonIoException("Unable to convert object to JSON", e); } } }
public class class_name { public static String objectToJson(Object item, Map<String, Object> optionalArgs) { try { ByteArrayOutputStream stream = new ByteArrayOutputStream(); JsonWriter writer = new JsonWriter(stream, optionalArgs); writer.write(item); // depends on control dependency: [try], data = [none] writer.close(); // depends on control dependency: [try], data = [none] return new String(stream.toByteArray(), "UTF-8"); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new JsonIoException("Unable to convert object to JSON", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public final synchronized void handleNewAccountEntry( final Map<String, Object> pAddParam, final Account pAcc, final Long pSubaccId, final Date pDateAt) throws Exception { if (lazyGetBalanceAtAllDirtyCheck(pAddParam).getLeastAccountingEntryDate() .getTime() > pDateAt.getTime()) { boolean isDbgSh = getLogger().getDbgSh(this.getClass()) && getLogger().getDbgFl() < 11011 && getLogger().getDbgCl() > 11013; if (isDbgSh) { getLogger().debug(null, SrvBalanceStd.class, "changing least last entry date from " + this.balanceAtAllDirtyCheck .getLeastAccountingEntryDate() + " to " + pDateAt); } this.balanceAtAllDirtyCheck .setLeastAccountingEntryDate(pDateAt); getSrvOrm() .updateEntity(pAddParam, this.balanceAtAllDirtyCheck); } } }
public class class_name { @Override public final synchronized void handleNewAccountEntry( final Map<String, Object> pAddParam, final Account pAcc, final Long pSubaccId, final Date pDateAt) throws Exception { if (lazyGetBalanceAtAllDirtyCheck(pAddParam).getLeastAccountingEntryDate() .getTime() > pDateAt.getTime()) { boolean isDbgSh = getLogger().getDbgSh(this.getClass()) && getLogger().getDbgFl() < 11011 && getLogger().getDbgCl() > 11013; if (isDbgSh) { getLogger().debug(null, SrvBalanceStd.class, "changing least last entry date from " + this.balanceAtAllDirtyCheck .getLeastAccountingEntryDate() + " to " + pDateAt); // depends on control dependency: [if], data = [none] } this.balanceAtAllDirtyCheck .setLeastAccountingEntryDate(pDateAt); getSrvOrm() .updateEntity(pAddParam, this.balanceAtAllDirtyCheck); } } }
public class class_name { public static <K, V> void putIntoListMap(K key, V value, Map<? super K, List<V>> map) { List<V> list = map.get(key); if (list == null) { list = Lists.newArrayListWithCapacity(2); map.put(key, list); } list.add(value); } }
public class class_name { public static <K, V> void putIntoListMap(K key, V value, Map<? super K, List<V>> map) { List<V> list = map.get(key); if (list == null) { list = Lists.newArrayListWithCapacity(2); // depends on control dependency: [if], data = [none] map.put(key, list); // depends on control dependency: [if], data = [none] } list.add(value); } }
public class class_name { public final DSLMapParser.variable_definition_return variable_definition() throws RecognitionException { DSLMapParser.variable_definition_return retval = new DSLMapParser.variable_definition_return(); retval.start = input.LT(1); Object root_0 = null; Token lc=null; Token name=null; Token q=null; Token rc=null; Token COLON25=null; Token COLON26=null; ParserRuleReturnScope pat =null; Object lc_tree=null; Object name_tree=null; Object q_tree=null; Object rc_tree=null; Object COLON25_tree=null; Object COLON26_tree=null; RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON"); RewriteRuleTokenStream stream_LITERAL=new RewriteRuleTokenStream(adaptor,"token LITERAL"); RewriteRuleTokenStream stream_RIGHT_CURLY=new RewriteRuleTokenStream(adaptor,"token RIGHT_CURLY"); RewriteRuleTokenStream stream_LEFT_CURLY=new RewriteRuleTokenStream(adaptor,"token LEFT_CURLY"); RewriteRuleSubtreeStream stream_pattern=new RewriteRuleSubtreeStream(adaptor,"rule pattern"); String text = ""; boolean hasSpaceBefore = false; boolean hasSpaceAfter = false; try { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:196:5: (lc= LEFT_CURLY name= LITERAL ( ( COLON q= LITERAL )? COLON pat= pattern )? rc= RIGHT_CURLY -> { hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) -> { hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) -> { hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE -> { hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE -> ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) ) // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:196:7: lc= LEFT_CURLY name= LITERAL ( ( COLON q= LITERAL )? COLON pat= pattern )? rc= RIGHT_CURLY { lc=(Token)match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_definition809); if (state.failed) return retval; if ( state.backtracking==0 ) stream_LEFT_CURLY.add(lc); if ( state.backtracking==0 ) { CommonToken back2 = (CommonToken)input.LT(-2); if( back2!=null && back2.getStopIndex() < ((CommonToken)lc).getStartIndex() -1 ) hasSpaceBefore = true; } name=(Token)match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition827); if (state.failed) return retval; if ( state.backtracking==0 ) stream_LITERAL.add(name); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:201:18: ( ( COLON q= LITERAL )? COLON pat= pattern )? int alt15=2; int LA15_0 = input.LA(1); if ( (LA15_0==COLON) ) { alt15=1; } switch (alt15) { case 1 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:201:20: ( COLON q= LITERAL )? COLON pat= pattern { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:201:20: ( COLON q= LITERAL )? int alt14=2; int LA14_0 = input.LA(1); if ( (LA14_0==COLON) ) { int LA14_1 = input.LA(2); if ( (LA14_1==LITERAL) ) { int LA14_2 = input.LA(3); if ( (LA14_2==COLON) ) { int LA14_4 = input.LA(4); if ( (synpred22_DSLMap()) ) { alt14=1; } } } } switch (alt14) { case 1 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:201:21: COLON q= LITERAL { COLON25=(Token)match(input,COLON,FOLLOW_COLON_in_variable_definition832); if (state.failed) return retval; if ( state.backtracking==0 ) stream_COLON.add(COLON25); q=(Token)match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition836); if (state.failed) return retval; if ( state.backtracking==0 ) stream_LITERAL.add(q); } break; } COLON26=(Token)match(input,COLON,FOLLOW_COLON_in_variable_definition840); if (state.failed) return retval; if ( state.backtracking==0 ) stream_COLON.add(COLON26); pushFollow(FOLLOW_pattern_in_variable_definition844); pat=pattern(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) stream_pattern.add(pat.getTree()); if ( state.backtracking==0 ) {text = (pat!=null?input.toString(pat.start,pat.stop):null);} } break; } rc=(Token)match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_definition853); if (state.failed) return retval; if ( state.backtracking==0 ) stream_RIGHT_CURLY.add(rc); if ( state.backtracking==0 ) { CommonToken rc1 = (CommonToken)input.LT(1); if(!"=".equals(rc1.getText()) && ((CommonToken)rc).getStopIndex() < rc1.getStartIndex() - 1) hasSpaceAfter = true; isIdentifier( name ); } // AST REWRITE // elements: name, name, q, q, name, name, q, q, name, name, name, q, name, q, q, q, q, name // token labels: q, name // rule labels: retval // token list labels: // rule list labels: // wildcard labels: if ( state.backtracking==0 ) { retval.tree = root_0; RewriteRuleTokenStream stream_q=new RewriteRuleTokenStream(adaptor,"token q",q); RewriteRuleTokenStream stream_name=new RewriteRuleTokenStream(adaptor,"token name",name); RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); root_0 = (Object)adaptor.nil(); // 208:5: -> { hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) if ( hasSpaceBefore && !"".equals(text) && !hasSpaceAfter) { adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:208:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:208:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:208:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_1, (Object)adaptor.create(VT_PATTERN, (pat!=null?(pat.start):null), text)); adaptor.addChild(root_0, root_1); } } else // 209:5: -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) if (!hasSpaceBefore && !"".equals(text) && !hasSpaceAfter) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:209:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:209:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:209:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_1, (Object)adaptor.create(VT_PATTERN, (pat!=null?(pat.start):null), text)); adaptor.addChild(root_0, root_1); } } else // 210:5: -> { hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) if ( hasSpaceBefore && !hasSpaceAfter) { adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:210:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:210:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:210:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_0, root_1); } } else // 211:5: -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) if (!hasSpaceBefore && !hasSpaceAfter) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:211:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:211:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:211:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_0, root_1); } } else // 212:5: -> { hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE if ( hasSpaceBefore && !"".equals(text) && hasSpaceAfter) { adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:212:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:212:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:212:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_1, (Object)adaptor.create(VT_PATTERN, (pat!=null?(pat.start):null), text)); adaptor.addChild(root_0, root_1); } adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); } else // 213:5: -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE if (!hasSpaceBefore && !"".equals(text) && hasSpaceAfter) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:213:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:213:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:213:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_1, (Object)adaptor.create(VT_PATTERN, (pat!=null?(pat.start):null), text)); adaptor.addChild(root_0, root_1); } adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); } else // 214:5: -> { hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE if ( hasSpaceBefore && hasSpaceAfter) { adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:214:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:214:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:214:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_0, root_1); } adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); } else // 215:5: -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE if (!hasSpaceBefore && hasSpaceAfter) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:215:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:215:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:215:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_0, root_1); } adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); } else // 216:5: -> ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:216:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:216:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:216:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_0, root_1); } } retval.tree = root_0; } } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (Object)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; } }
public class class_name { public final DSLMapParser.variable_definition_return variable_definition() throws RecognitionException { DSLMapParser.variable_definition_return retval = new DSLMapParser.variable_definition_return(); retval.start = input.LT(1); Object root_0 = null; Token lc=null; Token name=null; Token q=null; Token rc=null; Token COLON25=null; Token COLON26=null; ParserRuleReturnScope pat =null; Object lc_tree=null; Object name_tree=null; Object q_tree=null; Object rc_tree=null; Object COLON25_tree=null; Object COLON26_tree=null; RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON"); RewriteRuleTokenStream stream_LITERAL=new RewriteRuleTokenStream(adaptor,"token LITERAL"); RewriteRuleTokenStream stream_RIGHT_CURLY=new RewriteRuleTokenStream(adaptor,"token RIGHT_CURLY"); RewriteRuleTokenStream stream_LEFT_CURLY=new RewriteRuleTokenStream(adaptor,"token LEFT_CURLY"); RewriteRuleSubtreeStream stream_pattern=new RewriteRuleSubtreeStream(adaptor,"rule pattern"); String text = ""; boolean hasSpaceBefore = false; boolean hasSpaceAfter = false; try { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:196:5: (lc= LEFT_CURLY name= LITERAL ( ( COLON q= LITERAL )? COLON pat= pattern )? rc= RIGHT_CURLY -> { hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) -> { hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) -> { hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE -> { hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE -> ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) ) // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:196:7: lc= LEFT_CURLY name= LITERAL ( ( COLON q= LITERAL )? COLON pat= pattern )? rc= RIGHT_CURLY { lc=(Token)match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_definition809); if (state.failed) return retval; if ( state.backtracking==0 ) stream_LEFT_CURLY.add(lc); if ( state.backtracking==0 ) { CommonToken back2 = (CommonToken)input.LT(-2); if( back2!=null && back2.getStopIndex() < ((CommonToken)lc).getStartIndex() -1 ) hasSpaceBefore = true; } name=(Token)match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition827); if (state.failed) return retval; if ( state.backtracking==0 ) stream_LITERAL.add(name); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:201:18: ( ( COLON q= LITERAL )? COLON pat= pattern )? int alt15=2; int LA15_0 = input.LA(1); if ( (LA15_0==COLON) ) { alt15=1; // depends on control dependency: [if], data = [none] } switch (alt15) { case 1 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:201:20: ( COLON q= LITERAL )? COLON pat= pattern { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:201:20: ( COLON q= LITERAL )? int alt14=2; int LA14_0 = input.LA(1); if ( (LA14_0==COLON) ) { int LA14_1 = input.LA(2); if ( (LA14_1==LITERAL) ) { int LA14_2 = input.LA(3); if ( (LA14_2==COLON) ) { int LA14_4 = input.LA(4); if ( (synpred22_DSLMap()) ) { alt14=1; // depends on control dependency: [if], data = [none] } } } } switch (alt14) { case 1 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:201:21: COLON q= LITERAL { COLON25=(Token)match(input,COLON,FOLLOW_COLON_in_variable_definition832); if (state.failed) return retval; if ( state.backtracking==0 ) stream_COLON.add(COLON25); q=(Token)match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition836); if (state.failed) return retval; if ( state.backtracking==0 ) stream_LITERAL.add(q); } break; } COLON26=(Token)match(input,COLON,FOLLOW_COLON_in_variable_definition840); if (state.failed) return retval; if ( state.backtracking==0 ) stream_COLON.add(COLON26); pushFollow(FOLLOW_pattern_in_variable_definition844); pat=pattern(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) stream_pattern.add(pat.getTree()); if ( state.backtracking==0 ) {text = (pat!=null?input.toString(pat.start,pat.stop):null);} // depends on control dependency: [if], data = [none] } break; } rc=(Token)match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_definition853); if (state.failed) return retval; if ( state.backtracking==0 ) stream_RIGHT_CURLY.add(rc); if ( state.backtracking==0 ) { CommonToken rc1 = (CommonToken)input.LT(1); if(!"=".equals(rc1.getText()) && ((CommonToken)rc).getStopIndex() < rc1.getStartIndex() - 1) hasSpaceAfter = true; isIdentifier( name ); // depends on control dependency: [if], data = [none] } // AST REWRITE // elements: name, name, q, q, name, name, q, q, name, name, name, q, name, q, q, q, q, name // token labels: q, name // rule labels: retval // token list labels: // rule list labels: // wildcard labels: if ( state.backtracking==0 ) { retval.tree = root_0; // depends on control dependency: [if], data = [none] RewriteRuleTokenStream stream_q=new RewriteRuleTokenStream(adaptor,"token q",q); RewriteRuleTokenStream stream_name=new RewriteRuleTokenStream(adaptor,"token name",name); RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); root_0 = (Object)adaptor.nil(); // depends on control dependency: [if], data = [none] // 208:5: -> { hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) if ( hasSpaceBefore && !"".equals(text) && !hasSpaceAfter) { adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // depends on control dependency: [if], data = [none] // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:208:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:208:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:208:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); // depends on control dependency: [if], data = [none] } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_1, (Object)adaptor.create(VT_PATTERN, (pat!=null?(pat.start):null), text)); adaptor.addChild(root_0, root_1); } } else // 209:5: -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) if (!hasSpaceBefore && !"".equals(text) && !hasSpaceAfter) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:209:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:209:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:209:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); // depends on control dependency: [if], data = [none] } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_1, (Object)adaptor.create(VT_PATTERN, (pat!=null?(pat.start):null), text)); adaptor.addChild(root_0, root_1); } } else // 210:5: -> { hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) if ( hasSpaceBefore && !hasSpaceAfter) { adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // depends on control dependency: [if], data = [none] // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:210:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:210:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:210:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); // depends on control dependency: [if], data = [none] } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_0, root_1); } } else // 211:5: -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) if (!hasSpaceBefore && !hasSpaceAfter) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:211:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:211:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:211:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); // depends on control dependency: [if], data = [none] } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_0, root_1); } } else // 212:5: -> { hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE if ( hasSpaceBefore && !"".equals(text) && hasSpaceAfter) { adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // depends on control dependency: [if], data = [none] // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:212:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:212:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:212:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); // depends on control dependency: [if], data = [none] } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_1, (Object)adaptor.create(VT_PATTERN, (pat!=null?(pat.start):null), text)); adaptor.addChild(root_0, root_1); } adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // depends on control dependency: [if], data = [none] } else // 213:5: -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE if (!hasSpaceBefore && !"".equals(text) && hasSpaceAfter) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:213:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:213:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:213:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); // depends on control dependency: [if], data = [none] } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_1, (Object)adaptor.create(VT_PATTERN, (pat!=null?(pat.start):null), text)); adaptor.addChild(root_0, root_1); } adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // depends on control dependency: [if], data = [none] } else // 214:5: -> { hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE if ( hasSpaceBefore && hasSpaceAfter) { adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // depends on control dependency: [if], data = [none] // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:214:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:214:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:214:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); // depends on control dependency: [if], data = [none] } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_0, root_1); } adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // depends on control dependency: [if], data = [none] } else // 215:5: -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE if (!hasSpaceBefore && hasSpaceAfter) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:215:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:215:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:215:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); // depends on control dependency: [if], data = [none] } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_0, root_1); } adaptor.addChild(root_0, (Object)adaptor.create(VT_SPACE, "VT_SPACE")); // depends on control dependency: [if], data = [none] } else // 216:5: -> ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:216:74: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1); adaptor.addChild(root_1, stream_name.nextNode()); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:216:93: ^( VT_QUAL ( $q)? ) { Object root_2 = (Object)adaptor.nil(); root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_QUAL, "VT_QUAL"), root_2); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:216:104: ( $q)? if ( stream_q.hasNext() ) { adaptor.addChild(root_2, stream_q.nextNode()); // depends on control dependency: [if], data = [none] } stream_q.reset(); adaptor.addChild(root_1, root_2); } adaptor.addChild(root_0, root_1); } } retval.tree = root_0; // depends on control dependency: [if], data = [none] } } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (Object)adaptor.rulePostProcessing(root_0); // depends on control dependency: [if], data = [none] adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); // depends on control dependency: [if], data = [none] } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; } }
public class class_name { public void marshall(Job job, ProtocolMarshaller protocolMarshaller) { if (job == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(job.getId(), ID_BINDING); protocolMarshaller.marshall(job.getArn(), ARN_BINDING); protocolMarshaller.marshall(job.getPipelineId(), PIPELINEID_BINDING); protocolMarshaller.marshall(job.getInput(), INPUT_BINDING); protocolMarshaller.marshall(job.getInputs(), INPUTS_BINDING); protocolMarshaller.marshall(job.getOutput(), OUTPUT_BINDING); protocolMarshaller.marshall(job.getOutputs(), OUTPUTS_BINDING); protocolMarshaller.marshall(job.getOutputKeyPrefix(), OUTPUTKEYPREFIX_BINDING); protocolMarshaller.marshall(job.getPlaylists(), PLAYLISTS_BINDING); protocolMarshaller.marshall(job.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(job.getUserMetadata(), USERMETADATA_BINDING); protocolMarshaller.marshall(job.getTiming(), TIMING_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(Job job, ProtocolMarshaller protocolMarshaller) { if (job == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(job.getId(), ID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(job.getArn(), ARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(job.getPipelineId(), PIPELINEID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(job.getInput(), INPUT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(job.getInputs(), INPUTS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(job.getOutput(), OUTPUT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(job.getOutputs(), OUTPUTS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(job.getOutputKeyPrefix(), OUTPUTKEYPREFIX_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(job.getPlaylists(), PLAYLISTS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(job.getStatus(), STATUS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(job.getUserMetadata(), USERMETADATA_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(job.getTiming(), TIMING_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 { JsonObject toJsonObject() { JsonObjectBuilder ob = Json.createObjectBuilder(); ob.add("id", enrollmentID); ob.add("type", type); if (this.secret != null) { ob.add("secret", secret); } if (null != maxEnrollments) { ob.add("max_enrollments", maxEnrollments); } if (affiliation != null) { ob.add("affiliation", affiliation); } JsonArrayBuilder ab = Json.createArrayBuilder(); for (Attribute attr : attrs) { ab.add(attr.toJsonObject()); } if (caName != null) { ob.add(HFCAClient.FABRIC_CA_REQPROP, caName); } ob.add("attrs", ab.build()); return ob.build(); } }
public class class_name { JsonObject toJsonObject() { JsonObjectBuilder ob = Json.createObjectBuilder(); ob.add("id", enrollmentID); ob.add("type", type); if (this.secret != null) { ob.add("secret", secret); // depends on control dependency: [if], data = [none] } if (null != maxEnrollments) { ob.add("max_enrollments", maxEnrollments); // depends on control dependency: [if], data = [maxEnrollments)] } if (affiliation != null) { ob.add("affiliation", affiliation); // depends on control dependency: [if], data = [none] } JsonArrayBuilder ab = Json.createArrayBuilder(); for (Attribute attr : attrs) { ab.add(attr.toJsonObject()); // depends on control dependency: [for], data = [attr] } if (caName != null) { ob.add(HFCAClient.FABRIC_CA_REQPROP, caName); // depends on control dependency: [if], data = [none] } ob.add("attrs", ab.build()); return ob.build(); } }
public class class_name { @Deactivate protected void deactivate(int reason) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "File monitor service deactivated", "reason=" + reason, fileMonitors); } for (Map.Entry<ServiceReference<FileMonitor>, MonitorHolder> entry : fileMonitors.entrySet()) { entry.getValue().destroy(); } fileMonitors.clear(); this.cContext = null; } }
public class class_name { @Deactivate protected void deactivate(int reason) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "File monitor service deactivated", "reason=" + reason, fileMonitors); // depends on control dependency: [if], data = [none] } for (Map.Entry<ServiceReference<FileMonitor>, MonitorHolder> entry : fileMonitors.entrySet()) { entry.getValue().destroy(); // depends on control dependency: [for], data = [entry] } fileMonitors.clear(); this.cContext = null; } }
public class class_name { public String getNodeId(final String clusterId, final HttpServletRequest request) { if (clusterId == null) { return null; } if (_workerName != null) { return clusterId + '.' + _workerName; } return clusterId; } }
public class class_name { public String getNodeId(final String clusterId, final HttpServletRequest request) { if (clusterId == null) { return null; // depends on control dependency: [if], data = [none] } if (_workerName != null) { return clusterId + '.' + _workerName; // depends on control dependency: [if], data = [none] } return clusterId; } }
public class class_name { private List createPoints(int numberOfSegments, float radius, float cx, float cy, float start, float end) { ArrayList tempPoints = new ArrayList(); int step = 360 / numberOfSegments; for (float a=start;a<=end+step;a+=step) { float ang = a; if (ang > end) { ang = end; } float x = (float) (cx + (FastTrig.cos(Math.toRadians(ang)) * radius)); float y = (float) (cy + (FastTrig.sin(Math.toRadians(ang)) * radius)); tempPoints.add(new Float(x)); tempPoints.add(new Float(y)); } return tempPoints; } }
public class class_name { private List createPoints(int numberOfSegments, float radius, float cx, float cy, float start, float end) { ArrayList tempPoints = new ArrayList(); int step = 360 / numberOfSegments; for (float a=start;a<=end+step;a+=step) { float ang = a; if (ang > end) { ang = end; // depends on control dependency: [if], data = [none] } float x = (float) (cx + (FastTrig.cos(Math.toRadians(ang)) * radius)); float y = (float) (cy + (FastTrig.sin(Math.toRadians(ang)) * radius)); tempPoints.add(new Float(x)); // depends on control dependency: [for], data = [none] tempPoints.add(new Float(y)); // depends on control dependency: [for], data = [none] } return tempPoints; } }
public class class_name { public TemplateBean getTemplate() { TemplateBean templateBean = getRequestAttribute(CmsTemplateContextManager.ATTR_TEMPLATE_BEAN); if (templateBean == null) { templateBean = new TemplateBean("", ""); } return templateBean; } }
public class class_name { public TemplateBean getTemplate() { TemplateBean templateBean = getRequestAttribute(CmsTemplateContextManager.ATTR_TEMPLATE_BEAN); if (templateBean == null) { templateBean = new TemplateBean("", ""); // depends on control dependency: [if], data = [none] } return templateBean; } }
public class class_name { @SuppressWarnings("SimplifiableIfStatement") private boolean isMatchingType(JsonNode node, Class<?> type) { if (node.isNull()) { return true; } if (node.isTextual()) { return String.class.isAssignableFrom(type); } if (node.isNumber()) { return isNumericAssignable(type); } if (node.isArray() && type.isArray()) { return node.size() > 0 && isMatchingType(node.get(0), type.getComponentType()); } if (node.isArray()) { return type.isArray() || Collection.class.isAssignableFrom(type); } if (node.isBinary()) { return byteOrCharAssignable(type); } if (node.isBoolean()) { return boolean.class.isAssignableFrom(type) || Boolean.class.isAssignableFrom(type); } if (node.isObject() || node.isPojo()) { return !type.isPrimitive() && !String.class.isAssignableFrom(type) && !Number.class.isAssignableFrom(type) && !Boolean.class.isAssignableFrom(type); } return false; } }
public class class_name { @SuppressWarnings("SimplifiableIfStatement") private boolean isMatchingType(JsonNode node, Class<?> type) { if (node.isNull()) { return true; // depends on control dependency: [if], data = [none] } if (node.isTextual()) { return String.class.isAssignableFrom(type); // depends on control dependency: [if], data = [none] } if (node.isNumber()) { return isNumericAssignable(type); // depends on control dependency: [if], data = [none] } if (node.isArray() && type.isArray()) { return node.size() > 0 && isMatchingType(node.get(0), type.getComponentType()); // depends on control dependency: [if], data = [none] } if (node.isArray()) { return type.isArray() || Collection.class.isAssignableFrom(type); // depends on control dependency: [if], data = [none] } if (node.isBinary()) { return byteOrCharAssignable(type); // depends on control dependency: [if], data = [none] } if (node.isBoolean()) { return boolean.class.isAssignableFrom(type) || Boolean.class.isAssignableFrom(type); // depends on control dependency: [if], data = [none] } if (node.isObject() || node.isPojo()) { return !type.isPrimitive() && !String.class.isAssignableFrom(type) && !Number.class.isAssignableFrom(type) && !Boolean.class.isAssignableFrom(type); // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { @Override public final IProcessor lazyGet(//NOPMD final Map<String, Object> pAddParam, final String pBeanName) throws Exception { IProcessor proc = this.processorsMap.get(pBeanName); if (proc == null) { // locking: synchronized (this.processorsMap) { // make sure again whether it's null after locking: proc = this.processorsMap.get(pBeanName); if (proc == null) { if (pBeanName.equals(PrcRefreshItemsInList .class.getSimpleName())) { proc = lazyGetPrcRefreshItemsInList(pAddParam); } else if (pBeanName.equals(PrcRefreshCatalog .class.getSimpleName())) { proc = lazyGetPrcRefreshCatalog(pAddParam); } else if (pBeanName.equals(PrcCsvSampleDataRow .class.getSimpleName())) { //only web-store proc = lazyGetPrcCsvSampleDataRow(pAddParam); } else if (pBeanName.equals(PrcAssignItemsToCatalog .class.getSimpleName())) { proc = lazyGetPrcAssignItemsToCatalog(pAddParam); } else if (pBeanName.equals("waPrcEntitiesPage")) { proc = createPutPrcWaEntitiesPage(); } } } } if (proc == null) { throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE, pBeanName + " not found!"); } return proc; } }
public class class_name { @Override public final IProcessor lazyGet(//NOPMD final Map<String, Object> pAddParam, final String pBeanName) throws Exception { IProcessor proc = this.processorsMap.get(pBeanName); if (proc == null) { // locking: synchronized (this.processorsMap) { // make sure again whether it's null after locking: proc = this.processorsMap.get(pBeanName); if (proc == null) { if (pBeanName.equals(PrcRefreshItemsInList .class.getSimpleName())) { proc = lazyGetPrcRefreshItemsInList(pAddParam); // depends on control dependency: [if], data = [none] } else if (pBeanName.equals(PrcRefreshCatalog .class.getSimpleName())) { proc = lazyGetPrcRefreshCatalog(pAddParam); // depends on control dependency: [if], data = [none] } else if (pBeanName.equals(PrcCsvSampleDataRow .class.getSimpleName())) { //only web-store proc = lazyGetPrcCsvSampleDataRow(pAddParam); // depends on control dependency: [if], data = [none] } else if (pBeanName.equals(PrcAssignItemsToCatalog .class.getSimpleName())) { proc = lazyGetPrcAssignItemsToCatalog(pAddParam); // depends on control dependency: [if], data = [none] } else if (pBeanName.equals("waPrcEntitiesPage")) { proc = createPutPrcWaEntitiesPage(); // depends on control dependency: [if], data = [none] } } } } if (proc == null) { throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE, pBeanName + " not found!"); } return proc; } }
public class class_name { public void analyzeExecuteArg(Method executeMethod, ExecuteArgBox box) { List<Class<?>> pathParamTypeList = null; // lazy loaded Parameter formParam = null; final Parameter[] parameters = executeMethod.getParameters(); if (parameters.length > 0) { boolean formEnd = false; for (Parameter parameter : parameters) { if (formEnd) { throwActionFormNotLastParameterException(executeMethod); } checkNonGenericParameter(executeMethod, parameter); if (isActionFormParameter(parameter)) { formParam = parameter; formEnd = true; } else { if (pathParamTypeList == null) { pathParamTypeList = new ArrayList<Class<?>>(4); } pathParamTypeList.add(parameter.getType()); } } } box.setPathParamTypeList(preparePathParamTypeList(pathParamTypeList)); box.setOptionalGenericTypeMap(prepareOptionalGenericTypeMap(executeMethod)); box.setRootFormType(prepareRootFormType(formParam)); box.setListFormParameter(prepareListFormParameter(formParam)); } }
public class class_name { public void analyzeExecuteArg(Method executeMethod, ExecuteArgBox box) { List<Class<?>> pathParamTypeList = null; // lazy loaded Parameter formParam = null; final Parameter[] parameters = executeMethod.getParameters(); if (parameters.length > 0) { boolean formEnd = false; for (Parameter parameter : parameters) { if (formEnd) { throwActionFormNotLastParameterException(executeMethod); // depends on control dependency: [if], data = [none] } checkNonGenericParameter(executeMethod, parameter); // depends on control dependency: [for], data = [parameter] if (isActionFormParameter(parameter)) { formParam = parameter; // depends on control dependency: [if], data = [none] formEnd = true; // depends on control dependency: [if], data = [none] } else { if (pathParamTypeList == null) { pathParamTypeList = new ArrayList<Class<?>>(4); // depends on control dependency: [if], data = [none] } pathParamTypeList.add(parameter.getType()); // depends on control dependency: [if], data = [none] } } } box.setPathParamTypeList(preparePathParamTypeList(pathParamTypeList)); box.setOptionalGenericTypeMap(prepareOptionalGenericTypeMap(executeMethod)); box.setRootFormType(prepareRootFormType(formParam)); box.setListFormParameter(prepareListFormParameter(formParam)); } }
public class class_name { @Override public boolean logModified(Logger log) { if (_dependencyList.logModified(log)) { return true; } else if (isModified()) { log.info(this + " has modified jar files"); return true; } else { return false; } } }
public class class_name { @Override public boolean logModified(Logger log) { if (_dependencyList.logModified(log)) { return true; // depends on control dependency: [if], data = [none] } else if (isModified()) { log.info(this + " has modified jar files"); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public Iterable<String> getDependencyNames() throws ProcessingDependenciesException { Iterable<String> result = null; try { getReadLock(); try { result = depMap.keySet(); } finally { releaseReadLock(); } } catch (InterruptedException e) { if (log.isLoggable(Level.SEVERE)) { log.log(Level.SEVERE, e.getMessage(), e); } } return result; } }
public class class_name { @Override public Iterable<String> getDependencyNames() throws ProcessingDependenciesException { Iterable<String> result = null; try { getReadLock(); try { result = depMap.keySet(); // depends on control dependency: [try], data = [none] } finally { releaseReadLock(); } } catch (InterruptedException e) { if (log.isLoggable(Level.SEVERE)) { log.log(Level.SEVERE, e.getMessage(), e); // depends on control dependency: [if], data = [none] } } return result; } }
public class class_name { public void marshall(TransactWriteItem transactWriteItem, ProtocolMarshaller protocolMarshaller) { if (transactWriteItem == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(transactWriteItem.getConditionCheck(), CONDITIONCHECK_BINDING); protocolMarshaller.marshall(transactWriteItem.getPut(), PUT_BINDING); protocolMarshaller.marshall(transactWriteItem.getDelete(), DELETE_BINDING); protocolMarshaller.marshall(transactWriteItem.getUpdate(), UPDATE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(TransactWriteItem transactWriteItem, ProtocolMarshaller protocolMarshaller) { if (transactWriteItem == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(transactWriteItem.getConditionCheck(), CONDITIONCHECK_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(transactWriteItem.getPut(), PUT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(transactWriteItem.getDelete(), DELETE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(transactWriteItem.getUpdate(), UPDATE_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 start() { if (waterMarkEventGenerator != null) { LOG.debug("Starting waterMarkEventGenerator"); waterMarkEventGenerator.start(); } LOG.debug("Starting trigger policy"); triggerPolicy.start(); } }
public class class_name { protected void start() { if (waterMarkEventGenerator != null) { LOG.debug("Starting waterMarkEventGenerator"); // depends on control dependency: [if], data = [none] waterMarkEventGenerator.start(); // depends on control dependency: [if], data = [none] } LOG.debug("Starting trigger policy"); triggerPolicy.start(); } }
public class class_name { @Nullable public ExecutableElement concreteConstructorFor(TypeElement classElement, AnnotationUtils annotationUtils) { List<ExecutableElement> constructors = findNonPrivateConstructors(classElement); if (constructors.isEmpty()) { return null; } if (constructors.size() == 1) { return constructors.get(0); } Optional<ExecutableElement> element = constructors.stream().filter(ctor -> { final AnnotationMetadata annotationMetadata = annotationUtils.getAnnotationMetadata(ctor); return annotationMetadata.hasStereotype(Inject.class) || annotationMetadata.hasStereotype(Creator.class); } ).findFirst(); if (!element.isPresent()) { element = constructors.stream().filter(ctor -> ctor.getModifiers().contains(PUBLIC) ).findFirst(); } return element.orElse(null); } }
public class class_name { @Nullable public ExecutableElement concreteConstructorFor(TypeElement classElement, AnnotationUtils annotationUtils) { List<ExecutableElement> constructors = findNonPrivateConstructors(classElement); if (constructors.isEmpty()) { return null; // depends on control dependency: [if], data = [none] } if (constructors.size() == 1) { return constructors.get(0); // depends on control dependency: [if], data = [none] } Optional<ExecutableElement> element = constructors.stream().filter(ctor -> { final AnnotationMetadata annotationMetadata = annotationUtils.getAnnotationMetadata(ctor); return annotationMetadata.hasStereotype(Inject.class) || annotationMetadata.hasStereotype(Creator.class); } ).findFirst(); if (!element.isPresent()) { element = constructors.stream().filter(ctor -> ctor.getModifiers().contains(PUBLIC) ).findFirst(); } return element.orElse(null); } }
public class class_name { private void initFieldsValues(TypeElement component, MethodSpec.Builder createdMethodBuilder) { // Do not init instance fields for abstract components if (component.getModifiers().contains(Modifier.ABSTRACT)) { return; } createdMethodBuilder.addStatement( "$T.initComponentInstanceFields(this, new $T())", VueGWTTools.class, component); } }
public class class_name { private void initFieldsValues(TypeElement component, MethodSpec.Builder createdMethodBuilder) { // Do not init instance fields for abstract components if (component.getModifiers().contains(Modifier.ABSTRACT)) { return; // depends on control dependency: [if], data = [none] } createdMethodBuilder.addStatement( "$T.initComponentInstanceFields(this, new $T())", VueGWTTools.class, component); } }
public class class_name { public static <T> T fromJson(String json, Class<T> clazz) { Objects.requireNonNull(json, Required.JSON.toString()); Objects.requireNonNull(clazz, Required.CLASS.toString()); T object = null; try { object = mapper.readValue(json, clazz); } catch (IOException e) { LOG.error("Failed to convert json to object class", e); } return object; } }
public class class_name { public static <T> T fromJson(String json, Class<T> clazz) { Objects.requireNonNull(json, Required.JSON.toString()); Objects.requireNonNull(clazz, Required.CLASS.toString()); T object = null; try { object = mapper.readValue(json, clazz); // depends on control dependency: [try], data = [none] } catch (IOException e) { LOG.error("Failed to convert json to object class", e); } // depends on control dependency: [catch], data = [none] return object; } }
public class class_name { @Override public Activity getActivity() { Context context = getContext(); if(context instanceof Activity) { return (Activity) context; } return null; } }
public class class_name { @Override public Activity getActivity() { Context context = getContext(); if(context instanceof Activity) { return (Activity) context; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { private static void modifyAccountBySettingClient() { try { AccountUpdateResponse response = Account.updater() .city("Test city") .client(client) .update(); System.out.println(response); } catch (PlivoRestException | IOException e) { e.printStackTrace(); } } }
public class class_name { private static void modifyAccountBySettingClient() { try { AccountUpdateResponse response = Account.updater() .city("Test city") .client(client) .update(); System.out.println(response); // depends on control dependency: [try], data = [none] } catch (PlivoRestException | IOException e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static ClassLoader getClassLoader(TypeToken<?> type) { Set<ClassLoader> classLoaders = Sets.newIdentityHashSet(); // Breath first traversal into the Type. Queue<TypeToken<?>> queue = Lists.newLinkedList(); queue.add(type); while (!queue.isEmpty()) { type = queue.remove(); ClassLoader classLoader = type.getRawType().getClassLoader(); if (classLoader != null) { classLoaders.add(classLoader); } if (type.getType() instanceof ParameterizedType) { for (Type typeArg : ((ParameterizedType) type.getType()).getActualTypeArguments()) { queue.add(TypeToken.of(typeArg)); } } } // Determine the parent classloader ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); ClassLoader parent = (contextClassLoader == null) ? ClassLoader.getSystemClassLoader() : contextClassLoader; if (classLoaders.isEmpty()) { return parent; } return new CombineClassLoader(parent, classLoaders); } }
public class class_name { public static ClassLoader getClassLoader(TypeToken<?> type) { Set<ClassLoader> classLoaders = Sets.newIdentityHashSet(); // Breath first traversal into the Type. Queue<TypeToken<?>> queue = Lists.newLinkedList(); queue.add(type); while (!queue.isEmpty()) { type = queue.remove(); // depends on control dependency: [while], data = [none] ClassLoader classLoader = type.getRawType().getClassLoader(); if (classLoader != null) { classLoaders.add(classLoader); // depends on control dependency: [if], data = [(classLoader] } if (type.getType() instanceof ParameterizedType) { for (Type typeArg : ((ParameterizedType) type.getType()).getActualTypeArguments()) { queue.add(TypeToken.of(typeArg)); // depends on control dependency: [for], data = [typeArg] } } } // Determine the parent classloader ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); ClassLoader parent = (contextClassLoader == null) ? ClassLoader.getSystemClassLoader() : contextClassLoader; if (classLoaders.isEmpty()) { return parent; // depends on control dependency: [if], data = [none] } return new CombineClassLoader(parent, classLoaders); } }
public class class_name { public static boolean isAsciiPrintable(String str) { if (str == null) { return false; } int sz = str.length(); for (int i = 0; i < sz; i++) { if (CharUtils.isAsciiPrintable(str.charAt(i)) == false) { return false; } } return true; } }
public class class_name { public static boolean isAsciiPrintable(String str) { if (str == null) { return false; // depends on control dependency: [if], data = [none] } int sz = str.length(); for (int i = 0; i < sz; i++) { if (CharUtils.isAsciiPrintable(str.charAt(i)) == false) { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { protected void load() { Logger bootLogger = LoggerFactory.getBootLogger(); // first we check whether the system property // org.apache.ojb.broker.util.logging.Logger // is set (or its alias LoggerClass which is deprecated) ClassLoader contextLoader = ClassHelper.getClassLoader(); String loggerClassName; _loggerClass = null; properties = new Properties(); loggerClassName = getLoggerClass(System.getProperties()); _loggerConfigFile = getLoggerConfigFile(System.getProperties()); InputStream ojbLogPropFile; if (loggerClassName == null) { // now we're trying to load the OJB-logging.properties file String ojbLogPropFilePath = System.getProperty(OJB_LOGGING_PROPERTIES_FILE, OJB_LOGGING_PROPERTIES_FILE); try { URL ojbLoggingURL = ClassHelper.getResource(ojbLogPropFilePath); if (ojbLoggingURL == null) { ojbLoggingURL = (new File(ojbLogPropFilePath)).toURL(); } ojbLogPropFile = ojbLoggingURL.openStream(); try { bootLogger.info("Found logging properties file: " + ojbLogPropFilePath); properties.load(ojbLogPropFile); _loggerConfigFile = getLoggerConfigFile(properties); loggerClassName = getLoggerClass(properties); } finally { ojbLogPropFile.close(); } } catch (Exception ex) { if(loggerClassName == null) { bootLogger.warn("Can't read logging properties file using path '" + ojbLogPropFilePath + "', message is: " + SystemUtils.LINE_SEPARATOR + ex.getMessage() + SystemUtils.LINE_SEPARATOR + "Will try to load logging properties from OJB.properties file"); } else { bootLogger.info("Problems while closing resources for path '" + ojbLogPropFilePath + "', message is: " + SystemUtils.LINE_SEPARATOR + ex.getMessage(), ex); } } } if (loggerClassName == null) { // deprecated: load the OJB.properties file // this is not good because we have all OJB properties in this config String ojbPropFile = System.getProperty("OJB.properties", "OJB.properties"); try { ojbLogPropFile = contextLoader.getResourceAsStream(ojbPropFile); if (ojbLogPropFile != null) { try { properties.load(ojbLogPropFile); loggerClassName = getLoggerClass(properties); _loggerConfigFile = getLoggerConfigFile(properties); if (loggerClassName != null) { // deprecation warning for after 1.0 bootLogger.warn("Please use a separate '"+OJB_LOGGING_PROPERTIES_FILE+"' file to specify your logging settings"); } } finally { ojbLogPropFile.close(); } } } catch (Exception ex) {} } if (loggerClassName != null) { try { _loggerClass = ClassHelper.getClass(loggerClassName); bootLogger.info("Logging: Found logger class '" + loggerClassName); } catch (ClassNotFoundException ex) { _loggerClass = PoorMansLoggerImpl.class; bootLogger.warn("Could not load logger class "+loggerClassName+", defaulting to "+_loggerClass.getName(), ex); } } else { // still no logger configured - lets check whether commons-logging is configured if ((System.getProperty(PROPERTY_COMMONS_LOGGING_LOG) != null) || (System.getProperty(PROPERTY_COMMONS_LOGGING_LOGFACTORY) != null)) { // yep, so use commons-logging _loggerClass = CommonsLoggerImpl.class; bootLogger.info("Logging: Found commons logging properties, use " + _loggerClass); } else { // but perhaps there is a log4j.properties file ? try { ojbLogPropFile = contextLoader.getResourceAsStream("log4j.properties"); if (ojbLogPropFile != null) { // yep, so use log4j _loggerClass = Log4jLoggerImpl.class; _loggerConfigFile = "log4j.properties"; bootLogger.info("Logging: Found 'log4j.properties' file, use " + _loggerClass); ojbLogPropFile.close(); } } catch (Exception ex) {} if (_loggerClass == null) { // or a commons-logging.properties file ? try { ojbLogPropFile = contextLoader.getResourceAsStream("commons-logging.properties"); if (ojbLogPropFile != null) { // yep, so use commons-logging _loggerClass = CommonsLoggerImpl.class; _loggerConfigFile = "commons-logging.properties"; bootLogger.info("Logging: Found 'commons-logging.properties' file, use " + _loggerClass); ojbLogPropFile.close(); } } catch (Exception ex) {} if (_loggerClass == null) { // no, so default to poor man's logging bootLogger.info("** Can't find logging configuration file, use default logger **"); _loggerClass = PoorMansLoggerImpl.class; } } } } } }
public class class_name { protected void load() { Logger bootLogger = LoggerFactory.getBootLogger(); // first we check whether the system property // org.apache.ojb.broker.util.logging.Logger // is set (or its alias LoggerClass which is deprecated) ClassLoader contextLoader = ClassHelper.getClassLoader(); String loggerClassName; _loggerClass = null; properties = new Properties(); loggerClassName = getLoggerClass(System.getProperties()); _loggerConfigFile = getLoggerConfigFile(System.getProperties()); InputStream ojbLogPropFile; if (loggerClassName == null) { // now we're trying to load the OJB-logging.properties file String ojbLogPropFilePath = System.getProperty(OJB_LOGGING_PROPERTIES_FILE, OJB_LOGGING_PROPERTIES_FILE); try { URL ojbLoggingURL = ClassHelper.getResource(ojbLogPropFilePath); if (ojbLoggingURL == null) { ojbLoggingURL = (new File(ojbLogPropFilePath)).toURL(); // depends on control dependency: [if], data = [none] } ojbLogPropFile = ojbLoggingURL.openStream(); // depends on control dependency: [try], data = [none] try { bootLogger.info("Found logging properties file: " + ojbLogPropFilePath); // depends on control dependency: [try], data = [none] properties.load(ojbLogPropFile); // depends on control dependency: [try], data = [none] _loggerConfigFile = getLoggerConfigFile(properties); // depends on control dependency: [try], data = [none] loggerClassName = getLoggerClass(properties); // depends on control dependency: [try], data = [none] } finally { ojbLogPropFile.close(); } } catch (Exception ex) { if(loggerClassName == null) { bootLogger.warn("Can't read logging properties file using path '" + ojbLogPropFilePath + "', message is: " + SystemUtils.LINE_SEPARATOR + ex.getMessage() + SystemUtils.LINE_SEPARATOR + "Will try to load logging properties from OJB.properties file"); // depends on control dependency: [if], data = [none] } else { bootLogger.info("Problems while closing resources for path '" + ojbLogPropFilePath + "', message is: " + SystemUtils.LINE_SEPARATOR + ex.getMessage(), ex); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] } if (loggerClassName == null) { // deprecated: load the OJB.properties file // this is not good because we have all OJB properties in this config String ojbPropFile = System.getProperty("OJB.properties", "OJB.properties"); try { ojbLogPropFile = contextLoader.getResourceAsStream(ojbPropFile); // depends on control dependency: [try], data = [none] if (ojbLogPropFile != null) { try { properties.load(ojbLogPropFile); // depends on control dependency: [try], data = [none] loggerClassName = getLoggerClass(properties); // depends on control dependency: [try], data = [none] _loggerConfigFile = getLoggerConfigFile(properties); // depends on control dependency: [try], data = [none] if (loggerClassName != null) { // deprecation warning for after 1.0 bootLogger.warn("Please use a separate '"+OJB_LOGGING_PROPERTIES_FILE+"' file to specify your logging settings"); // depends on control dependency: [if], data = [none] } } finally { ojbLogPropFile.close(); } } } catch (Exception ex) {} // depends on control dependency: [catch], data = [none] } if (loggerClassName != null) { try { _loggerClass = ClassHelper.getClass(loggerClassName); // depends on control dependency: [try], data = [none] bootLogger.info("Logging: Found logger class '" + loggerClassName); // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException ex) { _loggerClass = PoorMansLoggerImpl.class; bootLogger.warn("Could not load logger class "+loggerClassName+", defaulting to "+_loggerClass.getName(), ex); } // depends on control dependency: [catch], data = [none] } else { // still no logger configured - lets check whether commons-logging is configured if ((System.getProperty(PROPERTY_COMMONS_LOGGING_LOG) != null) || (System.getProperty(PROPERTY_COMMONS_LOGGING_LOGFACTORY) != null)) { // yep, so use commons-logging _loggerClass = CommonsLoggerImpl.class; // depends on control dependency: [if], data = [none] bootLogger.info("Logging: Found commons logging properties, use " + _loggerClass); // depends on control dependency: [if], data = [none] } else { // but perhaps there is a log4j.properties file ? try { ojbLogPropFile = contextLoader.getResourceAsStream("log4j.properties"); // depends on control dependency: [try], data = [none] if (ojbLogPropFile != null) { // yep, so use log4j _loggerClass = Log4jLoggerImpl.class; // depends on control dependency: [if], data = [none] _loggerConfigFile = "log4j.properties"; // depends on control dependency: [if], data = [none] bootLogger.info("Logging: Found 'log4j.properties' file, use " + _loggerClass); // depends on control dependency: [if], data = [none] ojbLogPropFile.close(); // depends on control dependency: [if], data = [none] } } catch (Exception ex) {} // depends on control dependency: [catch], data = [none] if (_loggerClass == null) { // or a commons-logging.properties file ? try { ojbLogPropFile = contextLoader.getResourceAsStream("commons-logging.properties"); // depends on control dependency: [try], data = [none] if (ojbLogPropFile != null) { // yep, so use commons-logging _loggerClass = CommonsLoggerImpl.class; // depends on control dependency: [if], data = [none] _loggerConfigFile = "commons-logging.properties"; // depends on control dependency: [if], data = [none] bootLogger.info("Logging: Found 'commons-logging.properties' file, use " + _loggerClass); // depends on control dependency: [if], data = [none] ojbLogPropFile.close(); // depends on control dependency: [if], data = [none] } } catch (Exception ex) {} // depends on control dependency: [catch], data = [none] if (_loggerClass == null) { // no, so default to poor man's logging bootLogger.info("** Can't find logging configuration file, use default logger **"); // depends on control dependency: [if], data = [none] _loggerClass = PoorMansLoggerImpl.class; // depends on control dependency: [if], data = [none] } } } } } }
public class class_name { @Nullable public static PaymentMethodNonce parsePaymentMethodNonces(JSONObject json, String type) throws JSONException { switch (type) { case CardNonce.TYPE: if (json.has(CardNonce.API_RESOURCE_KEY) || json.has(CardNonce.DATA_KEY)) { return CardNonce.fromJson(json.toString()); } else { CardNonce cardNonce = new CardNonce(); cardNonce.fromJson(json); return cardNonce; } case PayPalAccountNonce.TYPE: if (json.has(PayPalAccountNonce.API_RESOURCE_KEY)) { return PayPalAccountNonce.fromJson(json.toString()); } else { PayPalAccountNonce payPalAccountNonce = new PayPalAccountNonce(); payPalAccountNonce.fromJson(json); return payPalAccountNonce; } case VenmoAccountNonce.TYPE: if (json.has(VenmoAccountNonce.API_RESOURCE_KEY)) { return VenmoAccountNonce.fromJson(json.toString()); } else { VenmoAccountNonce venmoAccountNonce = new VenmoAccountNonce(); venmoAccountNonce.fromJson(json); return venmoAccountNonce; } case VisaCheckoutNonce.TYPE: if (json.has(VisaCheckoutNonce.API_RESOURCE_KEY)) { return VisaCheckoutNonce.fromJson(json.toString()); } else { VisaCheckoutNonce visaCheckoutNonce = new VisaCheckoutNonce(); visaCheckoutNonce.fromJson(json); return visaCheckoutNonce; } default: return null; } } }
public class class_name { @Nullable public static PaymentMethodNonce parsePaymentMethodNonces(JSONObject json, String type) throws JSONException { switch (type) { case CardNonce.TYPE: if (json.has(CardNonce.API_RESOURCE_KEY) || json.has(CardNonce.DATA_KEY)) { return CardNonce.fromJson(json.toString()); // depends on control dependency: [if], data = [none] } else { CardNonce cardNonce = new CardNonce(); cardNonce.fromJson(json); // depends on control dependency: [if], data = [none] return cardNonce; // depends on control dependency: [if], data = [none] } case PayPalAccountNonce.TYPE: if (json.has(PayPalAccountNonce.API_RESOURCE_KEY)) { return PayPalAccountNonce.fromJson(json.toString()); // depends on control dependency: [if], data = [none] } else { PayPalAccountNonce payPalAccountNonce = new PayPalAccountNonce(); payPalAccountNonce.fromJson(json); // depends on control dependency: [if], data = [none] return payPalAccountNonce; // depends on control dependency: [if], data = [none] } case VenmoAccountNonce.TYPE: if (json.has(VenmoAccountNonce.API_RESOURCE_KEY)) { return VenmoAccountNonce.fromJson(json.toString()); // depends on control dependency: [if], data = [none] } else { VenmoAccountNonce venmoAccountNonce = new VenmoAccountNonce(); venmoAccountNonce.fromJson(json); // depends on control dependency: [if], data = [none] return venmoAccountNonce; // depends on control dependency: [if], data = [none] } case VisaCheckoutNonce.TYPE: if (json.has(VisaCheckoutNonce.API_RESOURCE_KEY)) { return VisaCheckoutNonce.fromJson(json.toString()); // depends on control dependency: [if], data = [none] } else { VisaCheckoutNonce visaCheckoutNonce = new VisaCheckoutNonce(); visaCheckoutNonce.fromJson(json); // depends on control dependency: [if], data = [none] return visaCheckoutNonce; // depends on control dependency: [if], data = [none] } default: return null; } } }
public class class_name { public com.google.appengine.v1.ApiEndpointHandlerOrBuilder getApiEndpointOrBuilder() { if (handlerTypeCase_ == 4) { return (com.google.appengine.v1.ApiEndpointHandler) handlerType_; } return com.google.appengine.v1.ApiEndpointHandler.getDefaultInstance(); } }
public class class_name { public com.google.appengine.v1.ApiEndpointHandlerOrBuilder getApiEndpointOrBuilder() { if (handlerTypeCase_ == 4) { return (com.google.appengine.v1.ApiEndpointHandler) handlerType_; // depends on control dependency: [if], data = [none] } return com.google.appengine.v1.ApiEndpointHandler.getDefaultInstance(); } }
public class class_name { public void quitOpera() { // running opera under the launcher if (runner != null) { if (runner.isOperaRunning() || runner.hasOperaCrashed()) { // Cut off the services connection to free the port getScopeServices().shutdown(); // Quit Opera runner.stopOpera(); } } else { // Quit with action as opera wasn't started with the launcher String operaPath = desktopUtils.getOperaPath(); logger.info("OperaBinaryLocation retrieved from Opera: " + operaPath); if (operaPath.length() > 0) { settings.setBinary(new File(operaPath)); } // Now create the OperaLauncherRunner that we have the binary path // So we can control the shutdown runner = new OperaLauncherRunner(settings); // Quit and wait for opera to quit properly (calls getScopeServices().shutdown) try { getScopeServices().quit(runner); } catch (IOException e) { throw new WebDriverException(e); } } } }
public class class_name { public void quitOpera() { // running opera under the launcher if (runner != null) { if (runner.isOperaRunning() || runner.hasOperaCrashed()) { // Cut off the services connection to free the port getScopeServices().shutdown(); // depends on control dependency: [if], data = [none] // Quit Opera runner.stopOpera(); // depends on control dependency: [if], data = [none] } } else { // Quit with action as opera wasn't started with the launcher String operaPath = desktopUtils.getOperaPath(); logger.info("OperaBinaryLocation retrieved from Opera: " + operaPath); // depends on control dependency: [if], data = [none] if (operaPath.length() > 0) { settings.setBinary(new File(operaPath)); // depends on control dependency: [if], data = [none] } // Now create the OperaLauncherRunner that we have the binary path // So we can control the shutdown runner = new OperaLauncherRunner(settings); // depends on control dependency: [if], data = [none] // Quit and wait for opera to quit properly (calls getScopeServices().shutdown) try { getScopeServices().quit(runner); // depends on control dependency: [try], data = [none] } catch (IOException e) { throw new WebDriverException(e); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { protected Level getDefaultLogLevel() { String levelStr = getProperty(LOG_LEVEL); Level level = null; if (levelStr != null) { level = Level.parse(levelStr); } if (level == null) level = Level.INFO; return level; } }
public class class_name { protected Level getDefaultLogLevel() { String levelStr = getProperty(LOG_LEVEL); Level level = null; if (levelStr != null) { level = Level.parse(levelStr); // depends on control dependency: [if], data = [(levelStr] } if (level == null) level = Level.INFO; return level; } }
public class class_name { public static OrderBook adaptOrderBook( CoinsuperResponse<CoinsuperOrderbook> coinsuperOrderbook, CurrencyPair currencyPair) { List<LimitOrder> asks = new ArrayList<LimitOrder>(); List<LimitOrder> bids = new ArrayList<LimitOrder>(); for (Ask coinsuperAsk : coinsuperOrderbook.getData().getResult().getAsks()) { asks.add( new LimitOrder( OrderType.ASK, new BigDecimal(coinsuperAsk.getQuantity()), currencyPair, null, null, new BigDecimal(coinsuperAsk.getLimitPrice()))); } for (Bid coinsuperBid : coinsuperOrderbook.getData().getResult().getBids()) { bids.add( new LimitOrder( OrderType.BID, new BigDecimal(coinsuperBid.getQuantity()), currencyPair, null, null, new BigDecimal(coinsuperBid.getLimitPrice()))); } return new OrderBook(new Date(), asks, bids); } }
public class class_name { public static OrderBook adaptOrderBook( CoinsuperResponse<CoinsuperOrderbook> coinsuperOrderbook, CurrencyPair currencyPair) { List<LimitOrder> asks = new ArrayList<LimitOrder>(); List<LimitOrder> bids = new ArrayList<LimitOrder>(); for (Ask coinsuperAsk : coinsuperOrderbook.getData().getResult().getAsks()) { asks.add( new LimitOrder( OrderType.ASK, new BigDecimal(coinsuperAsk.getQuantity()), currencyPair, null, null, new BigDecimal(coinsuperAsk.getLimitPrice()))); // depends on control dependency: [for], data = [none] } for (Bid coinsuperBid : coinsuperOrderbook.getData().getResult().getBids()) { bids.add( new LimitOrder( OrderType.BID, new BigDecimal(coinsuperBid.getQuantity()), currencyPair, null, null, new BigDecimal(coinsuperBid.getLimitPrice()))); // depends on control dependency: [for], data = [none] } return new OrderBook(new Date(), asks, bids); } }
public class class_name { public java.util.List<DescribeDBLogFilesDetails> getDescribeDBLogFiles() { if (describeDBLogFiles == null) { describeDBLogFiles = new com.amazonaws.internal.SdkInternalList<DescribeDBLogFilesDetails>(); } return describeDBLogFiles; } }
public class class_name { public java.util.List<DescribeDBLogFilesDetails> getDescribeDBLogFiles() { if (describeDBLogFiles == null) { describeDBLogFiles = new com.amazonaws.internal.SdkInternalList<DescribeDBLogFilesDetails>(); // depends on control dependency: [if], data = [none] } return describeDBLogFiles; } }
public class class_name { public void check(String checkId, Status status, String note) { final URI uri = createURI("/check/" + status.getUri() + "/" + checkId); final HTTP.Response httpResponse = Str.isEmpty(note) ? HTTP.getResponse(uri.toString()) : HTTP.getResponse(uri.toString() + "?note=" + note); if (httpResponse.code() != 200) { notRegistered("Unable to perform check", uri, httpResponse.code(), httpResponse.statusMessageAsString(), httpResponse.body()); } } }
public class class_name { public void check(String checkId, Status status, String note) { final URI uri = createURI("/check/" + status.getUri() + "/" + checkId); final HTTP.Response httpResponse = Str.isEmpty(note) ? HTTP.getResponse(uri.toString()) : HTTP.getResponse(uri.toString() + "?note=" + note); if (httpResponse.code() != 200) { notRegistered("Unable to perform check", uri, httpResponse.code(), httpResponse.statusMessageAsString(), httpResponse.body()); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected void skipInternalSubset() throws XMLStreamException { while (true) { int i = getNextAfterWS(); if (i < 0) { // Error for internal subset throwUnexpectedEOF(SUFFIX_IN_DTD_INTERNAL); } if (i == '%') { // parameter entity skipPE(); continue; } if (i == '<') { /* Let's determine type here, and call appropriate skip * methods. */ char c = getNextSkippingPEs(); if (c == '?') { // xml decl? /* Not sure if PIs are really allowed in DTDs, but let's * just allow them until proven otherwise. XML declaration * is legal in the beginning, anyhow */ skipPI(); } else if (c == '!') { // ignore/include, comment, declaration? c = getNextSkippingPEs(); if (c == '[') { /* Shouldn't really get these, as they are not allowed * in the internal subset? So let's just leave it * as is, and see what happens. :-) */ ; } else if (c == '-') { // plain comment skipComment(); } else if (c >= 'A' && c <= 'Z') { skipDeclaration(c); } else { /* Hmmh, let's not care too much; but we need to try * to match the closing gt-char nonetheless? */ skipDeclaration(c); } } else { /* Shouldn't fail (since we are to completely ignore * subset); let's just push it back and continue. */ --mInputPtr; } continue; } if (i == ']') { // Int. subset has no conditional sections, has to be the end... /* 18-Jul-2004, TSa: Let's just make sure it happened * in the main input source, not at external entity... */ if (mInput != mRootInput) { throwParseError("Encountered int. subset end marker ']]>' in an expanded entity; has to be at main level."); } // End of internal subset break; } throwUnexpectedChar(i, SUFFIX_IN_DTD_INTERNAL+"; expected a '<' to start a directive, or \"]>\" to end internal subset."); } } }
public class class_name { protected void skipInternalSubset() throws XMLStreamException { while (true) { int i = getNextAfterWS(); if (i < 0) { // Error for internal subset throwUnexpectedEOF(SUFFIX_IN_DTD_INTERNAL); // depends on control dependency: [if], data = [none] } if (i == '%') { // parameter entity skipPE(); // depends on control dependency: [if], data = [none] continue; } if (i == '<') { /* Let's determine type here, and call appropriate skip * methods. */ char c = getNextSkippingPEs(); if (c == '?') { // xml decl? /* Not sure if PIs are really allowed in DTDs, but let's * just allow them until proven otherwise. XML declaration * is legal in the beginning, anyhow */ skipPI(); // depends on control dependency: [if], data = [none] } else if (c == '!') { // ignore/include, comment, declaration? c = getNextSkippingPEs(); // depends on control dependency: [if], data = [none] if (c == '[') { /* Shouldn't really get these, as they are not allowed * in the internal subset? So let's just leave it * as is, and see what happens. :-) */ ; } else if (c == '-') { // plain comment skipComment(); // depends on control dependency: [if], data = [none] } else if (c >= 'A' && c <= 'Z') { skipDeclaration(c); // depends on control dependency: [if], data = [(c] } else { /* Hmmh, let's not care too much; but we need to try * to match the closing gt-char nonetheless? */ skipDeclaration(c); // depends on control dependency: [if], data = [(c] } } else { /* Shouldn't fail (since we are to completely ignore * subset); let's just push it back and continue. */ --mInputPtr; // depends on control dependency: [if], data = [none] } continue; } if (i == ']') { // Int. subset has no conditional sections, has to be the end... /* 18-Jul-2004, TSa: Let's just make sure it happened * in the main input source, not at external entity... */ if (mInput != mRootInput) { throwParseError("Encountered int. subset end marker ']]>' in an expanded entity; has to be at main level."); // depends on control dependency: [if], data = [none] } // End of internal subset break; } throwUnexpectedChar(i, SUFFIX_IN_DTD_INTERNAL+"; expected a '<' to start a directive, or \"]>\" to end internal subset."); } } }
public class class_name { @Override public String getExtension() { // some strings you just can't help if(this.path == null || this.path.isEmpty()) { return ""; } // chop string String ext = this.path.substring(this.path.lastIndexOf('.')+1); // return return ext; } }
public class class_name { @Override public String getExtension() { // some strings you just can't help if(this.path == null || this.path.isEmpty()) { return ""; // depends on control dependency: [if], data = [none] } // chop string String ext = this.path.substring(this.path.lastIndexOf('.')+1); // return return ext; } }
public class class_name { @RequestMapping(value = "/userSession", method = RequestMethod.GET) @ResponseBody public JsonObject<?> session(HttpServletRequest request) { JsonObject<?> ret = JsonObject.create(); String cookieValueUsername = CookieUtils.getCookieValue(request, UserWebConstant.CookieKey.USERNAME.getValue()); String cookieValuePwd = CookieUtils.getCookieValue(request, UserWebConstant.CookieKey.PWDMD5.getValue()); if (LoginValidator.isValid(cookieValueUsername, cookieValuePwd)) { LOG.info("Already logon with username=" + cookieValueUsername); ret.addData("id", UserWebConstant.USERMAP.get(cookieValueUsername).getUserId()); ret.addData("name", cookieValueUsername); return ret; } else { ret.setStatus(GlobalResponseStatusMsg.NOT_LOGIN.getCode()); ret.addStatusInfo(GlobalResponseStatusMsg.NOT_LOGIN.getMessage().getMessage()); } return ret; } }
public class class_name { @RequestMapping(value = "/userSession", method = RequestMethod.GET) @ResponseBody public JsonObject<?> session(HttpServletRequest request) { JsonObject<?> ret = JsonObject.create(); String cookieValueUsername = CookieUtils.getCookieValue(request, UserWebConstant.CookieKey.USERNAME.getValue()); String cookieValuePwd = CookieUtils.getCookieValue(request, UserWebConstant.CookieKey.PWDMD5.getValue()); if (LoginValidator.isValid(cookieValueUsername, cookieValuePwd)) { LOG.info("Already logon with username=" + cookieValueUsername); // depends on control dependency: [if], data = [none] ret.addData("id", UserWebConstant.USERMAP.get(cookieValueUsername).getUserId()); // depends on control dependency: [if], data = [none] ret.addData("name", cookieValueUsername); // depends on control dependency: [if], data = [none] return ret; // depends on control dependency: [if], data = [none] } else { ret.setStatus(GlobalResponseStatusMsg.NOT_LOGIN.getCode()); // depends on control dependency: [if], data = [none] ret.addStatusInfo(GlobalResponseStatusMsg.NOT_LOGIN.getMessage().getMessage()); // depends on control dependency: [if], data = [none] } return ret; } }
public class class_name { public Observable<ServiceResponse<List<IntentClassifier>>> listCustomPrebuiltIntentsWithServiceResponseAsync(UUID appId, String versionId) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); return service.listCustomPrebuiltIntents(appId, versionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<IntentClassifier>>>>() { @Override public Observable<ServiceResponse<List<IntentClassifier>>> call(Response<ResponseBody> response) { try { ServiceResponse<List<IntentClassifier>> clientResponse = listCustomPrebuiltIntentsDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponse<List<IntentClassifier>>> listCustomPrebuiltIntentsWithServiceResponseAsync(UUID appId, String versionId) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); return service.listCustomPrebuiltIntents(appId, versionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<IntentClassifier>>>>() { @Override public Observable<ServiceResponse<List<IntentClassifier>>> call(Response<ResponseBody> response) { try { ServiceResponse<List<IntentClassifier>> clientResponse = listCustomPrebuiltIntentsDelegate(response); return Observable.just(clientResponse); // depends on control dependency: [try], data = [none] } catch (Throwable t) { return Observable.error(t); } // depends on control dependency: [catch], data = [none] } }); } }
public class class_name { private boolean isRetryable(SdkBaseException e) { if (e.getCause() instanceof IOException) { return true; } else if (e instanceof HttpException) { // Only retry on 500s. return ((HttpException) e).getStatusCode() / 100 == 5; } else { return false; } } }
public class class_name { private boolean isRetryable(SdkBaseException e) { if (e.getCause() instanceof IOException) { return true; // depends on control dependency: [if], data = [none] } else if (e instanceof HttpException) { // Only retry on 500s. return ((HttpException) e).getStatusCode() / 100 == 5; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { public final void loadWorkSheet(final String tabName) { prepareWorkShee(tabName); parent.getValidationHandler().validateCurrentPage(); createDynamicColumns(tabName); // reset datatable current page to 1 setDataTablePage(0); parent.getCurrent().setCurrentDataContextName(null); saveObjs(); if ((RequestContext.getCurrentInstance() != null) && (parent.getClientId() != null)) { RequestContext.getCurrentInstance().update(parent.getClientId() + ":websheettab"); } } }
public class class_name { public final void loadWorkSheet(final String tabName) { prepareWorkShee(tabName); parent.getValidationHandler().validateCurrentPage(); createDynamicColumns(tabName); // reset datatable current page to 1 setDataTablePage(0); parent.getCurrent().setCurrentDataContextName(null); saveObjs(); if ((RequestContext.getCurrentInstance() != null) && (parent.getClientId() != null)) { RequestContext.getCurrentInstance().update(parent.getClientId() + ":websheettab"); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public CommerceSubscriptionEntry fetchBySubscriptionStatus_Last( int subscriptionStatus, OrderByComparator<CommerceSubscriptionEntry> orderByComparator) { int count = countBySubscriptionStatus(subscriptionStatus); if (count == 0) { return null; } List<CommerceSubscriptionEntry> list = findBySubscriptionStatus(subscriptionStatus, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } }
public class class_name { @Override public CommerceSubscriptionEntry fetchBySubscriptionStatus_Last( int subscriptionStatus, OrderByComparator<CommerceSubscriptionEntry> orderByComparator) { int count = countBySubscriptionStatus(subscriptionStatus); if (count == 0) { return null; // depends on control dependency: [if], data = [none] } List<CommerceSubscriptionEntry> list = findBySubscriptionStatus(subscriptionStatus, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { private List<ReportRecord> inMemoryPagination(final List<ReportRecord> recordList, QueryParameterEnvelope queryParameterEnvelope) { final QueryParameterAware pageSize = queryParameterEnvelope.getPageSize(); final QueryParameterAware pageNumber = queryParameterEnvelope.getPageNumber(); if (pageSize != null && pageNumber != null) { final Integer pageSizeValue = ((PageSizeConstraint) pageSize).getPageSizeValue(); final Integer pageValue = ((PageNumberConstraint) pageNumber).getPageNumberValue() - 1; int offset = pageValue * pageSizeValue; return recordList.subList(offset > recordList.size() ? recordList.size() : offset, offset + pageSizeValue > recordList.size() ? recordList.size() : offset + pageSizeValue); } return recordList; } }
public class class_name { private List<ReportRecord> inMemoryPagination(final List<ReportRecord> recordList, QueryParameterEnvelope queryParameterEnvelope) { final QueryParameterAware pageSize = queryParameterEnvelope.getPageSize(); final QueryParameterAware pageNumber = queryParameterEnvelope.getPageNumber(); if (pageSize != null && pageNumber != null) { final Integer pageSizeValue = ((PageSizeConstraint) pageSize).getPageSizeValue(); final Integer pageValue = ((PageNumberConstraint) pageNumber).getPageNumberValue() - 1; int offset = pageValue * pageSizeValue; return recordList.subList(offset > recordList.size() ? recordList.size() : offset, offset + pageSizeValue > recordList.size() ? recordList.size() : offset + pageSizeValue); // depends on control dependency: [if], data = [none] } return recordList; } }
public class class_name { public List<Map<String, String>> pipelinePossibleStates(NWiseAction action, List<Map<String, String>> possibleStateList) { String[] coVariables = action.getCoVariables().split(","); int n = Integer.valueOf(action.getN()); List<Map<String, String>> newPossibleStateList = new ArrayList<>(); for (Map<String, String> possibleState : possibleStateList) { Map<String, String[]> variableDomains = new HashMap<>(); Map<String, String> defaultVariableValues = new HashMap<>(); for (String variable : coVariables) { String variableMetaInfo = possibleState.get(variable); String[] variableDomain = variableMetaInfo.split(","); variableDomains.put(variable, variableDomain); defaultVariableValues.put(variable, variableDomain[0]); } List<Map<String, String>> nWiseCombinations = produceNWise(n, coVariables, variableDomains); for (Map<String, String> nWiseCombination : nWiseCombinations) { Map<String, String> newPossibleState = new HashMap<>(possibleState); newPossibleState.putAll(defaultVariableValues); newPossibleState.putAll(nWiseCombination); newPossibleStateList.add(newPossibleState); } } return newPossibleStateList; } }
public class class_name { public List<Map<String, String>> pipelinePossibleStates(NWiseAction action, List<Map<String, String>> possibleStateList) { String[] coVariables = action.getCoVariables().split(","); int n = Integer.valueOf(action.getN()); List<Map<String, String>> newPossibleStateList = new ArrayList<>(); for (Map<String, String> possibleState : possibleStateList) { Map<String, String[]> variableDomains = new HashMap<>(); Map<String, String> defaultVariableValues = new HashMap<>(); for (String variable : coVariables) { String variableMetaInfo = possibleState.get(variable); String[] variableDomain = variableMetaInfo.split(","); variableDomains.put(variable, variableDomain); // depends on control dependency: [for], data = [variable] defaultVariableValues.put(variable, variableDomain[0]); // depends on control dependency: [for], data = [variable] } List<Map<String, String>> nWiseCombinations = produceNWise(n, coVariables, variableDomains); for (Map<String, String> nWiseCombination : nWiseCombinations) { Map<String, String> newPossibleState = new HashMap<>(possibleState); newPossibleState.putAll(defaultVariableValues); // depends on control dependency: [for], data = [none] newPossibleState.putAll(nWiseCombination); // depends on control dependency: [for], data = [nWiseCombination] newPossibleStateList.add(newPossibleState); // depends on control dependency: [for], data = [none] } } return newPossibleStateList; } }
public class class_name { @Deprecated public static boolean writeObjectIfChanged(Object obj, String filepath) { try { return writeObjectIfChangedOrDie(obj, filepath, LOGGER); } catch (Exception e) { LOGGER.error(e.getClass() + ": writeObjectIfChanged(" + filepath + ") encountered exception: " + e.getMessage(), e); return false; } } }
public class class_name { @Deprecated public static boolean writeObjectIfChanged(Object obj, String filepath) { try { return writeObjectIfChangedOrDie(obj, filepath, LOGGER); // depends on control dependency: [try], data = [none] } catch (Exception e) { LOGGER.error(e.getClass() + ": writeObjectIfChanged(" + filepath + ") encountered exception: " + e.getMessage(), e); return false; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public ProcessDefinitionEntity parseProcess(Element processElement) { // reset all mappings that are related to one process definition sequenceFlows = new HashMap<String, TransitionImpl>(); ProcessDefinitionEntity processDefinition = new ProcessDefinitionEntity(); /* * Mapping object model - bpmn xml: processDefinition.id -> generated by * processDefinition.key -> bpmn id (required) processDefinition.name -> * bpmn name (optional) */ processDefinition.setKey(processElement.attribute("id")); processDefinition.setName(processElement.attribute("name")); processDefinition.setCategory(rootElement.attribute("targetNamespace")); processDefinition.setProperty(PROPERTYNAME_DOCUMENTATION, parseDocumentation(processElement)); processDefinition.setTaskDefinitions(new HashMap<String, TaskDefinition>()); processDefinition.setDeploymentId(deployment.getId()); processDefinition.setProperty(PROPERTYNAME_JOB_PRIORITY, parsePriority(processElement, PROPERTYNAME_JOB_PRIORITY)); processDefinition.setProperty(PROPERTYNAME_TASK_PRIORITY, parsePriority(processElement, PROPERTYNAME_TASK_PRIORITY)); processDefinition.setVersionTag(processElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "versionTag")); try { String historyTimeToLive = processElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "historyTimeToLive", Context.getProcessEngineConfiguration().getHistoryTimeToLive()); processDefinition.setHistoryTimeToLive(ParseUtil.parseHistoryTimeToLive(historyTimeToLive)); } catch (Exception e) { addError(new BpmnParseException(e.getMessage(), processElement, e)); } boolean isStartableInTasklist = isStartable(processElement); processDefinition.setStartableInTasklist(isStartableInTasklist); LOG.parsingElement("process", processDefinition.getKey()); parseScope(processElement, processDefinition); // Parse any laneSets defined for this process parseLaneSets(processElement, processDefinition); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseProcess(processElement, processDefinition); } // now we have parsed anything we can validate some stuff validateActivities(processDefinition.getActivities()); //unregister delegates for (ActivityImpl activity : processDefinition.getActivities()) { activity.setDelegateAsyncAfterUpdate(null); activity.setDelegateAsyncBeforeUpdate(null); } return processDefinition; } }
public class class_name { public ProcessDefinitionEntity parseProcess(Element processElement) { // reset all mappings that are related to one process definition sequenceFlows = new HashMap<String, TransitionImpl>(); ProcessDefinitionEntity processDefinition = new ProcessDefinitionEntity(); /* * Mapping object model - bpmn xml: processDefinition.id -> generated by * processDefinition.key -> bpmn id (required) processDefinition.name -> * bpmn name (optional) */ processDefinition.setKey(processElement.attribute("id")); processDefinition.setName(processElement.attribute("name")); processDefinition.setCategory(rootElement.attribute("targetNamespace")); processDefinition.setProperty(PROPERTYNAME_DOCUMENTATION, parseDocumentation(processElement)); processDefinition.setTaskDefinitions(new HashMap<String, TaskDefinition>()); processDefinition.setDeploymentId(deployment.getId()); processDefinition.setProperty(PROPERTYNAME_JOB_PRIORITY, parsePriority(processElement, PROPERTYNAME_JOB_PRIORITY)); processDefinition.setProperty(PROPERTYNAME_TASK_PRIORITY, parsePriority(processElement, PROPERTYNAME_TASK_PRIORITY)); processDefinition.setVersionTag(processElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "versionTag")); try { String historyTimeToLive = processElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "historyTimeToLive", Context.getProcessEngineConfiguration().getHistoryTimeToLive()); processDefinition.setHistoryTimeToLive(ParseUtil.parseHistoryTimeToLive(historyTimeToLive)); // depends on control dependency: [try], data = [none] } catch (Exception e) { addError(new BpmnParseException(e.getMessage(), processElement, e)); } // depends on control dependency: [catch], data = [none] boolean isStartableInTasklist = isStartable(processElement); processDefinition.setStartableInTasklist(isStartableInTasklist); LOG.parsingElement("process", processDefinition.getKey()); parseScope(processElement, processDefinition); // Parse any laneSets defined for this process parseLaneSets(processElement, processDefinition); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseProcess(processElement, processDefinition); // depends on control dependency: [for], data = [parseListener] } // now we have parsed anything we can validate some stuff validateActivities(processDefinition.getActivities()); //unregister delegates for (ActivityImpl activity : processDefinition.getActivities()) { activity.setDelegateAsyncAfterUpdate(null); // depends on control dependency: [for], data = [activity] activity.setDelegateAsyncBeforeUpdate(null); // depends on control dependency: [for], data = [activity] } return processDefinition; } }
public class class_name { public int[] add(int[] p, int[] q) { int len = Math.max(p.length, q.length); int[] result = new int[len]; for (int i = 0; i < len; i++) { if (i < p.length && i < q.length) { result[i] = add(p[i], q[i]); } else if (i < p.length) { result[i] = p[i]; } else { result[i] = q[i]; } } return result; } }
public class class_name { public int[] add(int[] p, int[] q) { int len = Math.max(p.length, q.length); int[] result = new int[len]; for (int i = 0; i < len; i++) { if (i < p.length && i < q.length) { result[i] = add(p[i], q[i]); // depends on control dependency: [if], data = [none] } else if (i < p.length) { result[i] = p[i]; // depends on control dependency: [if], data = [none] } else { result[i] = q[i]; // depends on control dependency: [if], data = [none] } } return result; } }
public class class_name { private void _buildLimit( final Limit limit, final StringBuilder stmt ) { if (limit == null) { return; } stmt.append( _LIMIT_ ); stmt.append( limit.getCount() ); stmt.append( _OFFSET_ ); stmt.append( limit.getOffset() ); } }
public class class_name { private void _buildLimit( final Limit limit, final StringBuilder stmt ) { if (limit == null) { return; // depends on control dependency: [if], data = [none] } stmt.append( _LIMIT_ ); stmt.append( limit.getCount() ); stmt.append( _OFFSET_ ); stmt.append( limit.getOffset() ); } }
public class class_name { private void exportSchema(PrintWriter out) { List<String> indexes = exportIndexes(); if (indexes.isEmpty() && artificialUniques == 0) return; begin(out); for (String index : indexes) { out.println(index); } if (artificialUniques > 0) { String cypher = this.cypherFormat.statementForConstraint(UNIQUE_ID_LABEL, Collections.singleton(UNIQUE_ID_PROP)); if (cypher != null && !"".equals(cypher)) { out.println(cypher); } } commit(out); List<String> indexesAwait = indexesAwait(); for (String indexAwait : indexesAwait) { out.print(indexAwait); } schemaAwait(out); out.flush(); } }
public class class_name { private void exportSchema(PrintWriter out) { List<String> indexes = exportIndexes(); if (indexes.isEmpty() && artificialUniques == 0) return; begin(out); for (String index : indexes) { out.println(index); // depends on control dependency: [for], data = [index] } if (artificialUniques > 0) { String cypher = this.cypherFormat.statementForConstraint(UNIQUE_ID_LABEL, Collections.singleton(UNIQUE_ID_PROP)); if (cypher != null && !"".equals(cypher)) { out.println(cypher); // depends on control dependency: [if], data = [(cypher] } } commit(out); List<String> indexesAwait = indexesAwait(); for (String indexAwait : indexesAwait) { out.print(indexAwait); // depends on control dependency: [for], data = [indexAwait] } schemaAwait(out); out.flush(); } }
public class class_name { public void registerBall(final BallModel ballModel) { if (!this.ballMap.containsKey(ballModel.getEventModel().target())) { this.ballMap.put(ballModel.getEventModel().target(), ballModel); view().getPanel().getChildren().add(ballModel.node()); } } }
public class class_name { public void registerBall(final BallModel ballModel) { if (!this.ballMap.containsKey(ballModel.getEventModel().target())) { this.ballMap.put(ballModel.getEventModel().target(), ballModel); // depends on control dependency: [if], data = [none] view().getPanel().getChildren().add(ballModel.node()); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setHostHeader(String newHost, int id) { PreparedStatement statement = null; try (Connection sqlConnection = sqlService.getConnection()) { statement = sqlConnection.prepareStatement( "UPDATE " + Constants.DB_TABLE_SERVERS + " SET " + Constants.SERVER_REDIRECT_HOST_HEADER + " = ?" + " WHERE " + Constants.GENERIC_ID + " = ?" ); statement.setString(1, newHost); statement.setInt(2, id); statement.executeUpdate(); statement.close(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (statement != null) { statement.close(); } } catch (Exception e) { } } } }
public class class_name { public void setHostHeader(String newHost, int id) { PreparedStatement statement = null; try (Connection sqlConnection = sqlService.getConnection()) { statement = sqlConnection.prepareStatement( "UPDATE " + Constants.DB_TABLE_SERVERS + " SET " + Constants.SERVER_REDIRECT_HOST_HEADER + " = ?" + " WHERE " + Constants.GENERIC_ID + " = ?" ); statement.setString(1, newHost); statement.setInt(2, id); statement.executeUpdate(); statement.close(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (statement != null) { statement.close(); // depends on control dependency: [if], data = [none] } } catch (Exception e) { } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public double[][] diff_y(double maty[][]) { mat3 = new double[width][height]; double mat1, mat2; for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { if (i == 0) { mat1 = maty[i][j]; mat2 = maty[i + 1][j]; } else if (i == width - 1) { mat1 = maty[i - 1][j]; mat2 = maty[i][j]; } else { mat1 = maty[i - 1][j]; mat2 = maty[i + 1][j]; } mat3[i][j] = (mat2 - mat1) / 2; } } // maty= subMatrix(mat2,mat1,width,height); return mat3; } }
public class class_name { public double[][] diff_y(double maty[][]) { mat3 = new double[width][height]; double mat1, mat2; for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { if (i == 0) { mat1 = maty[i][j]; // depends on control dependency: [if], data = [none] mat2 = maty[i + 1][j]; // depends on control dependency: [if], data = [none] } else if (i == width - 1) { mat1 = maty[i - 1][j]; // depends on control dependency: [if], data = [none] mat2 = maty[i][j]; // depends on control dependency: [if], data = [none] } else { mat1 = maty[i - 1][j]; // depends on control dependency: [if], data = [none] mat2 = maty[i + 1][j]; // depends on control dependency: [if], data = [none] } mat3[i][j] = (mat2 - mat1) / 2; // depends on control dependency: [for], data = [j] } } // maty= subMatrix(mat2,mat1,width,height); return mat3; } }
public class class_name { public void drawFrame(int textureId, float[] texMatrix) { // Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport. synchronized (mDrawLock) { if (mCorrectVerticalVideo && !mScaleToFit && (requestedOrientation == SCREEN_ROTATION.VERTICAL || requestedOrientation == SCREEN_ROTATION.UPSIDEDOWN_VERTICAL)) { Matrix.scaleM(texMatrix, 0, 0.316f, 1.0f, 1f); } mProgram.draw(IDENTITY_MATRIX, mRectDrawable.getVertexArray(), 0, mRectDrawable.getVertexCount(), mRectDrawable.getCoordsPerVertex(), mRectDrawable.getVertexStride(), texMatrix, TEX_COORDS_BUF, textureId, TEX_COORDS_STRIDE); } } }
public class class_name { public void drawFrame(int textureId, float[] texMatrix) { // Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport. synchronized (mDrawLock) { if (mCorrectVerticalVideo && !mScaleToFit && (requestedOrientation == SCREEN_ROTATION.VERTICAL || requestedOrientation == SCREEN_ROTATION.UPSIDEDOWN_VERTICAL)) { Matrix.scaleM(texMatrix, 0, 0.316f, 1.0f, 1f); // depends on control dependency: [if], data = [none] } mProgram.draw(IDENTITY_MATRIX, mRectDrawable.getVertexArray(), 0, mRectDrawable.getVertexCount(), mRectDrawable.getCoordsPerVertex(), mRectDrawable.getVertexStride(), texMatrix, TEX_COORDS_BUF, textureId, TEX_COORDS_STRIDE); } } }
public class class_name { public int getProperty(String name) { checkNotNull(name); try { // tty properties are cached so we don't have to worry too much about getting term widht/height if (config == null || System.currentTimeMillis() - configLastFetched > 1000 ) { config = get("-a"); configLastFetched = System.currentTimeMillis(); } return this.getProperty(name, config); } catch (Exception e) { return -1; } } }
public class class_name { public int getProperty(String name) { checkNotNull(name); try { // tty properties are cached so we don't have to worry too much about getting term widht/height if (config == null || System.currentTimeMillis() - configLastFetched > 1000 ) { config = get("-a"); // depends on control dependency: [if], data = [none] configLastFetched = System.currentTimeMillis(); // depends on control dependency: [if], data = [none] } return this.getProperty(name, config); // depends on control dependency: [try], data = [none] } catch (Exception e) { return -1; } // depends on control dependency: [catch], data = [none] } }
public class class_name { private static int partition(int[] intArray, int start, int end) { int pivot = intArray[end]; int index = start - 1; for(int j = start; j < end; j++) { if(intArray[j] <= pivot) { index++; XORSwap.swap(intArray, index, j); } } XORSwap.swap(intArray, index + 1, end); return index + 1; } }
public class class_name { private static int partition(int[] intArray, int start, int end) { int pivot = intArray[end]; int index = start - 1; for(int j = start; j < end; j++) { if(intArray[j] <= pivot) { index++; // depends on control dependency: [if], data = [none] XORSwap.swap(intArray, index, j); // depends on control dependency: [if], data = [none] } } XORSwap.swap(intArray, index + 1, end); return index + 1; } }
public class class_name { private static void addOrderPossiblyNested(CriteriaQuery query, From queryRoot, CriteriaBuilder criteriaBuilder, PersistentEntity entity, String sort, String order, boolean ignoreCase) { int firstDotPos = sort.indexOf("."); if (firstDotPos == -1) { addOrder(entity, query, queryRoot, criteriaBuilder, sort, order, ignoreCase); } else { // nested property String sortHead = sort.substring(0, firstDotPos); String sortTail = sort.substring(firstDotPos + 1); PersistentProperty property = entity.getPropertyByName(sortHead); if (property instanceof Embedded) { // embedded objects cannot reference entities (at time of writing), so no more recursion needed addOrder(entity, query, queryRoot, criteriaBuilder, sort, order, ignoreCase); } else if (property instanceof Association) { Association a = (Association) property; final Join join = queryRoot.join(sortHead); PersistentEntity associatedEntity = a.getAssociatedEntity(); Class<?> propertyTargetClass = associatedEntity.getJavaClass(); addOrderPossiblyNested(query, join, criteriaBuilder, associatedEntity, sortTail, order, ignoreCase); // Recurse on nested sort } } } }
public class class_name { private static void addOrderPossiblyNested(CriteriaQuery query, From queryRoot, CriteriaBuilder criteriaBuilder, PersistentEntity entity, String sort, String order, boolean ignoreCase) { int firstDotPos = sort.indexOf("."); if (firstDotPos == -1) { addOrder(entity, query, queryRoot, criteriaBuilder, sort, order, ignoreCase); // depends on control dependency: [if], data = [none] } else { // nested property String sortHead = sort.substring(0, firstDotPos); String sortTail = sort.substring(firstDotPos + 1); PersistentProperty property = entity.getPropertyByName(sortHead); if (property instanceof Embedded) { // embedded objects cannot reference entities (at time of writing), so no more recursion needed addOrder(entity, query, queryRoot, criteriaBuilder, sort, order, ignoreCase); // depends on control dependency: [if], data = [none] } else if (property instanceof Association) { Association a = (Association) property; final Join join = queryRoot.join(sortHead); PersistentEntity associatedEntity = a.getAssociatedEntity(); Class<?> propertyTargetClass = associatedEntity.getJavaClass(); addOrderPossiblyNested(query, join, criteriaBuilder, associatedEntity, sortTail, order, ignoreCase); // Recurse on nested sort } } } }
public class class_name { public static StunMessage decode(byte binMessage[], char offset, char arrayLen) throws StunException { int originalOffset = offset; arrayLen = (char) Math.min(binMessage.length, arrayLen); if (binMessage == null || arrayLen - offset < StunMessage.HEADER_LENGTH) { throw new StunException(StunException.ILLEGAL_ARGUMENT, "The given binary array is not a valid StunMessage"); } char messageType = (char) ((binMessage[offset++] << 8) | (binMessage[offset++] & 0xFF)); StunMessage message; /* 0x0115 is a old TURN DATA indication message type */ if (StunMessage.isResponseType(messageType) && messageType != OLD_DATA_INDICATION) { message = new StunResponse(); } else if (StunMessage.isRequestType(messageType)) { message = new StunRequest(); } else { message = new StunIndication(); } message.setMessageType(messageType); int length = (char) ((binMessage[offset++] << 8) | (binMessage[offset++] & 0xFF)); /* copy the cookie */ byte cookie[] = new byte[4]; System.arraycopy(binMessage, offset, cookie, 0, 4); offset += 4; boolean rfc3489Compat = false; if (!Arrays.equals(MAGIC_COOKIE, cookie)) { rfc3489Compat = true; } if (arrayLen - offset - TRANSACTION_ID_LENGTH < length) { throw new StunException(StunException.ILLEGAL_ARGUMENT, "The given binary array does not seem to contain" + " a whole StunMessage: given " + ((int) arrayLen) + " bytes of " + message.getName() + " but expecting " + (offset + TRANSACTION_ID_LENGTH + length)); } byte tranID[] = new byte[TRANSACTION_ID_LENGTH]; System.arraycopy(binMessage, offset, tranID, 0, TRANSACTION_ID_LENGTH); try { if (rfc3489Compat) { byte rfc3489TranID[] = new byte[TRANSACTION_ID_LENGTH + 4]; System.arraycopy(cookie, 0, rfc3489TranID, 0, 4); System.arraycopy(tranID, 0, rfc3489TranID, 4, TRANSACTION_ID_LENGTH); message.setTransactionID(rfc3489TranID); } else { message.setTransactionID(tranID); } } catch (StunException exc) { throw new StunException(StunException.ILLEGAL_ARGUMENT, "The given binary array does not seem to " + "contain a whole StunMessage", exc); } offset += TRANSACTION_ID_LENGTH; while (offset - StunMessage.HEADER_LENGTH < length) { StunAttribute att = StunAttributeDecoder.decode(binMessage, offset, (char) (length - offset)); performAttributeSpecificActions(att, binMessage, originalOffset, offset); message.addAttribute(att); offset += att.getDataLength() + StunAttribute.HEADER_LENGTH; // now also skip any potential padding that might have come with // this attribute. if ((att.getDataLength() % 4) > 0) { offset += (4 - (att.getDataLength() % 4)); } } return message; } }
public class class_name { public static StunMessage decode(byte binMessage[], char offset, char arrayLen) throws StunException { int originalOffset = offset; arrayLen = (char) Math.min(binMessage.length, arrayLen); if (binMessage == null || arrayLen - offset < StunMessage.HEADER_LENGTH) { throw new StunException(StunException.ILLEGAL_ARGUMENT, "The given binary array is not a valid StunMessage"); } char messageType = (char) ((binMessage[offset++] << 8) | (binMessage[offset++] & 0xFF)); StunMessage message; /* 0x0115 is a old TURN DATA indication message type */ if (StunMessage.isResponseType(messageType) && messageType != OLD_DATA_INDICATION) { message = new StunResponse(); } else if (StunMessage.isRequestType(messageType)) { message = new StunRequest(); } else { message = new StunIndication(); } message.setMessageType(messageType); int length = (char) ((binMessage[offset++] << 8) | (binMessage[offset++] & 0xFF)); /* copy the cookie */ byte cookie[] = new byte[4]; System.arraycopy(binMessage, offset, cookie, 0, 4); offset += 4; boolean rfc3489Compat = false; if (!Arrays.equals(MAGIC_COOKIE, cookie)) { rfc3489Compat = true; } if (arrayLen - offset - TRANSACTION_ID_LENGTH < length) { throw new StunException(StunException.ILLEGAL_ARGUMENT, "The given binary array does not seem to contain" + " a whole StunMessage: given " + ((int) arrayLen) + " bytes of " + message.getName() + " but expecting " + (offset + TRANSACTION_ID_LENGTH + length)); } byte tranID[] = new byte[TRANSACTION_ID_LENGTH]; System.arraycopy(binMessage, offset, tranID, 0, TRANSACTION_ID_LENGTH); try { if (rfc3489Compat) { byte rfc3489TranID[] = new byte[TRANSACTION_ID_LENGTH + 4]; System.arraycopy(cookie, 0, rfc3489TranID, 0, 4); // depends on control dependency: [if], data = [none] System.arraycopy(tranID, 0, rfc3489TranID, 4, TRANSACTION_ID_LENGTH); // depends on control dependency: [if], data = [none] message.setTransactionID(rfc3489TranID); // depends on control dependency: [if], data = [none] } else { message.setTransactionID(tranID); // depends on control dependency: [if], data = [none] } } catch (StunException exc) { throw new StunException(StunException.ILLEGAL_ARGUMENT, "The given binary array does not seem to " + "contain a whole StunMessage", exc); } offset += TRANSACTION_ID_LENGTH; while (offset - StunMessage.HEADER_LENGTH < length) { StunAttribute att = StunAttributeDecoder.decode(binMessage, offset, (char) (length - offset)); performAttributeSpecificActions(att, binMessage, originalOffset, offset); message.addAttribute(att); offset += att.getDataLength() + StunAttribute.HEADER_LENGTH; // now also skip any potential padding that might have come with // this attribute. if ((att.getDataLength() % 4) > 0) { offset += (4 - (att.getDataLength() % 4)); } } return message; } }
public class class_name { @Override public int compareTo(Timestamp other) { if (unixSec < other.unixSec) { return -1; } else if (unixSec == other.unixSec) { if (nanoSec < other.nanoSec) { return -1; } else if (nanoSec == other.nanoSec) { return 0; } else { return 1; } } else { return 1; } } }
public class class_name { @Override public int compareTo(Timestamp other) { if (unixSec < other.unixSec) { return -1; // depends on control dependency: [if], data = [none] } else if (unixSec == other.unixSec) { if (nanoSec < other.nanoSec) { return -1; // depends on control dependency: [if], data = [none] } else if (nanoSec == other.nanoSec) { return 0; // depends on control dependency: [if], data = [none] } else { return 1; // depends on control dependency: [if], data = [none] } } else { return 1; // depends on control dependency: [if], data = [none] } } }
public class class_name { public static RuntimeException wrapOrThrow(Throwable error) { if (error instanceof Error) { throw (Error)error; } if (error instanceof RuntimeException) { return (RuntimeException)error; } return new RuntimeException(error); } }
public class class_name { public static RuntimeException wrapOrThrow(Throwable error) { if (error instanceof Error) { throw (Error)error; } if (error instanceof RuntimeException) { return (RuntimeException)error; // depends on control dependency: [if], data = [none] } return new RuntimeException(error); } }
public class class_name { public Map/*<Signature, Signature>*/resolveAll() { Map resolved = new HashMap(); for (Iterator entryIter = declToBridge.entrySet().iterator(); entryIter.hasNext(); ) { Map.Entry entry = (Map.Entry) entryIter.next(); Class owner = (Class) entry.getKey(); Set bridges = (Set) entry.getValue(); try { InputStream is = classLoader.getResourceAsStream(owner.getName().replace('.', '/') + ".class"); if (is == null) { return resolved; } try { new ClassReader(is) .accept(new BridgedFinder(bridges, resolved), ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG); } finally { is.close(); } } catch (IOException ignored) {} } return resolved; } }
public class class_name { public Map/*<Signature, Signature>*/resolveAll() { Map resolved = new HashMap(); for (Iterator entryIter = declToBridge.entrySet().iterator(); entryIter.hasNext(); ) { Map.Entry entry = (Map.Entry) entryIter.next(); Class owner = (Class) entry.getKey(); // depends on control dependency: [for], data = [none] Set bridges = (Set) entry.getValue(); try { InputStream is = classLoader.getResourceAsStream(owner.getName().replace('.', '/') + ".class"); if (is == null) { return resolved; // depends on control dependency: [if], data = [none] } try { new ClassReader(is) .accept(new BridgedFinder(bridges, resolved), ClassReader.SKIP_FRAMES | ClassReader.SKIP_DEBUG); // depends on control dependency: [try], data = [none] } finally { is.close(); } } catch (IOException ignored) {} // depends on control dependency: [catch], data = [none] } return resolved; } }
public class class_name { public Container lazyOR(Container x) { if (this instanceof ArrayContainer) { if (x instanceof ArrayContainer) { return ((ArrayContainer)this).lazyor((ArrayContainer) x); } else if (x instanceof BitmapContainer) { return ((BitmapContainer) x).lazyor((ArrayContainer) this); } return ((RunContainer) x).lazyor((ArrayContainer) this); } else if (this instanceof RunContainer) { if (x instanceof ArrayContainer) { return ((RunContainer) this).lazyor((ArrayContainer) x); } else if (x instanceof BitmapContainer) { return ((BitmapContainer) x).lazyor((RunContainer) this); } return or((RunContainer) x); } else { if (x instanceof ArrayContainer) { return ((BitmapContainer) this).lazyor((ArrayContainer) x); } else if (x instanceof BitmapContainer) { return ((BitmapContainer) this).lazyor((BitmapContainer) x); } return ((BitmapContainer) this).lazyor((RunContainer) x); } } }
public class class_name { public Container lazyOR(Container x) { if (this instanceof ArrayContainer) { if (x instanceof ArrayContainer) { return ((ArrayContainer)this).lazyor((ArrayContainer) x); // depends on control dependency: [if], data = [none] } else if (x instanceof BitmapContainer) { return ((BitmapContainer) x).lazyor((ArrayContainer) this); // depends on control dependency: [if], data = [none] } return ((RunContainer) x).lazyor((ArrayContainer) this); // depends on control dependency: [if], data = [none] } else if (this instanceof RunContainer) { if (x instanceof ArrayContainer) { return ((RunContainer) this).lazyor((ArrayContainer) x); // depends on control dependency: [if], data = [none] } else if (x instanceof BitmapContainer) { return ((BitmapContainer) x).lazyor((RunContainer) this); // depends on control dependency: [if], data = [none] } return or((RunContainer) x); // depends on control dependency: [if], data = [none] } else { if (x instanceof ArrayContainer) { return ((BitmapContainer) this).lazyor((ArrayContainer) x); // depends on control dependency: [if], data = [none] } else if (x instanceof BitmapContainer) { return ((BitmapContainer) this).lazyor((BitmapContainer) x); // depends on control dependency: [if], data = [none] } return ((BitmapContainer) this).lazyor((RunContainer) x); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static int parseNumber(String value) { int k = 1; int n = 0; for (int i = value.length() - 1; i >= 0; i--) { char ch = value.charAt(i); if (Character.isDigit(ch) == false) { break; } n += (ch - '0') * k; k *= 10; } return n; } }
public class class_name { public static int parseNumber(String value) { int k = 1; int n = 0; for (int i = value.length() - 1; i >= 0; i--) { char ch = value.charAt(i); if (Character.isDigit(ch) == false) { break; } n += (ch - '0') * k; // depends on control dependency: [for], data = [none] k *= 10; // depends on control dependency: [for], data = [none] } return n; } }
public class class_name { private boolean isApplicationError(Throwable rootEx, String pkgRoot) { if (rootEx != null) { StackTraceElement[] stackTrace = rootEx.getStackTrace(); if (stackTrace != null && stackTrace.length > 0) { StackTraceElement rootThrower = stackTrace[0]; String className = rootThrower.getClassName(); if (className != null && !!!className.startsWith(pkgRoot)) { return true; } } } return false; } }
public class class_name { private boolean isApplicationError(Throwable rootEx, String pkgRoot) { if (rootEx != null) { StackTraceElement[] stackTrace = rootEx.getStackTrace(); if (stackTrace != null && stackTrace.length > 0) { StackTraceElement rootThrower = stackTrace[0]; String className = rootThrower.getClassName(); if (className != null && !!!className.startsWith(pkgRoot)) { return true; // depends on control dependency: [if], data = [none] } } } return false; } }
public class class_name { public static double calculateScore(FlatDataList errorList) { double DWdeltasquare=0; double DWetsquare=0; int n = errorList.size(); for(int i=0;i<n;++i) { Double error = errorList.getDouble(i); if(i>=1) { Double errorPrevious = errorList.getDouble(i-1); if(errorPrevious!=null) { DWdeltasquare+=Math.pow(error - errorPrevious,2); } } DWetsquare+=error*error; } double DW=DWdeltasquare/DWetsquare; return DW; } }
public class class_name { public static double calculateScore(FlatDataList errorList) { double DWdeltasquare=0; double DWetsquare=0; int n = errorList.size(); for(int i=0;i<n;++i) { Double error = errorList.getDouble(i); if(i>=1) { Double errorPrevious = errorList.getDouble(i-1); if(errorPrevious!=null) { DWdeltasquare+=Math.pow(error - errorPrevious,2); // depends on control dependency: [if], data = [none] } } DWetsquare+=error*error; // depends on control dependency: [for], data = [none] } double DW=DWdeltasquare/DWetsquare; return DW; } }
public class class_name { private void fireProcessAnnotatedType(ProcessAnnotatedTypeImpl<?> event, BeanManagerImpl beanManager) { final Resolvable resolvable = ProcessAnnotatedTypeEventResolvable.of(event, discovery); try { beanManager.getGlobalLenientObserverNotifier().fireEvent(event, resolvable); } catch (Exception e) { throw new DefinitionException(e); } } }
public class class_name { private void fireProcessAnnotatedType(ProcessAnnotatedTypeImpl<?> event, BeanManagerImpl beanManager) { final Resolvable resolvable = ProcessAnnotatedTypeEventResolvable.of(event, discovery); try { beanManager.getGlobalLenientObserverNotifier().fireEvent(event, resolvable); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new DefinitionException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void read(final long address, final byte[] data) throws Exception { if (data.length % getBlockSize() != 0) { throw new IllegalArgumentException( "Number of bytes is not a multiple of the blocksize!"); } final long extentSize = data.length / getBlockSize(); final long minAddress = address - (extentSize << PREFETCH_LENGTH_EXPONENT); final long maxAddress = address + (extentSize << PREFETCH_LENGTH_EXPONENT); byte[] prefetchedData = (byte[]) buffer.get(address); if (prefetchedData == null || prefetchedData.length != data.length) { if (lastBlockAddress == (address - extentSize) && maxAddress < getBlockCount()) { prefetchedData = new byte[(data.length << PREFETCH_LENGTH_EXPONENT) + data.length]; device.read(address, prefetchedData); // copy first part to out parameter System.arraycopy(prefetchedData, 0, data, 0, data.length); // split prefetched data to store into buffer byte[] chunkedPrefetchedData; for (int i = 1; i <= (1 << PREFETCH_LENGTH_EXPONENT); i++) { chunkedPrefetchedData = new byte[data.length]; System.arraycopy(prefetchedData, i * data.length, chunkedPrefetchedData, 0, data.length); buffer.put((address + i * extentSize), chunkedPrefetchedData); } } else if (lastBlockAddress == (address + extentSize) && minAddress >= 0) { prefetchedData = new byte[(data.length << PREFETCH_LENGTH_EXPONENT) + data.length]; device.read(minAddress, prefetchedData); // copy first part to out parameter System.arraycopy(prefetchedData, prefetchedData.length - data.length, data, 0, data.length); // split prefetched data to store into buffer byte[] chunkedPrefetchedData; for (int i = 0; i < (1 << PREFETCH_LENGTH_EXPONENT); i++) { chunkedPrefetchedData = new byte[data.length]; System.arraycopy(prefetchedData, i * data.length, chunkedPrefetchedData, 0, data.length); buffer.put((minAddress + i * extentSize), chunkedPrefetchedData); } } else { device.read(address, data); } } else { System.arraycopy(prefetchedData, 0, data, 0, data.length); } lastBlockAddress = address; } }
public class class_name { public void read(final long address, final byte[] data) throws Exception { if (data.length % getBlockSize() != 0) { throw new IllegalArgumentException( "Number of bytes is not a multiple of the blocksize!"); } final long extentSize = data.length / getBlockSize(); final long minAddress = address - (extentSize << PREFETCH_LENGTH_EXPONENT); final long maxAddress = address + (extentSize << PREFETCH_LENGTH_EXPONENT); byte[] prefetchedData = (byte[]) buffer.get(address); if (prefetchedData == null || prefetchedData.length != data.length) { if (lastBlockAddress == (address - extentSize) && maxAddress < getBlockCount()) { prefetchedData = new byte[(data.length << PREFETCH_LENGTH_EXPONENT) + data.length]; // depends on control dependency: [if], data = [none] device.read(address, prefetchedData); // depends on control dependency: [if], data = [none] // copy first part to out parameter System.arraycopy(prefetchedData, 0, data, 0, data.length); // depends on control dependency: [if], data = [none] // split prefetched data to store into buffer byte[] chunkedPrefetchedData; for (int i = 1; i <= (1 << PREFETCH_LENGTH_EXPONENT); i++) { chunkedPrefetchedData = new byte[data.length]; // depends on control dependency: [for], data = [none] System.arraycopy(prefetchedData, i * data.length, chunkedPrefetchedData, 0, data.length); // depends on control dependency: [for], data = [i] buffer.put((address + i * extentSize), chunkedPrefetchedData); // depends on control dependency: [for], data = [i] } } else if (lastBlockAddress == (address + extentSize) && minAddress >= 0) { prefetchedData = new byte[(data.length << PREFETCH_LENGTH_EXPONENT) + data.length]; // depends on control dependency: [if], data = [none] device.read(minAddress, prefetchedData); // depends on control dependency: [if], data = [none] // copy first part to out parameter System.arraycopy(prefetchedData, prefetchedData.length - data.length, data, 0, data.length); // depends on control dependency: [if], data = [none] // split prefetched data to store into buffer byte[] chunkedPrefetchedData; for (int i = 0; i < (1 << PREFETCH_LENGTH_EXPONENT); i++) { chunkedPrefetchedData = new byte[data.length]; // depends on control dependency: [for], data = [none] System.arraycopy(prefetchedData, i * data.length, chunkedPrefetchedData, 0, data.length); // depends on control dependency: [for], data = [i] buffer.put((minAddress + i * extentSize), chunkedPrefetchedData); // depends on control dependency: [for], data = [i] } } else { device.read(address, data); // depends on control dependency: [if], data = [none] } } else { System.arraycopy(prefetchedData, 0, data, 0, data.length); } lastBlockAddress = address; } }
public class class_name { public static List<Expression> transformArgsToList(String operator, Val<Expression>[] args) { List<Expression> et = Lists.newArrayListWithCapacity(args.length); for (Val<Expression> e : args) { if (e.object() instanceof Expression) { et.add(e.expr()); } else { throw new QuerySyntaxException(Messages.get("dsl.arguments.error3", operator)); } } return et; } }
public class class_name { public static List<Expression> transformArgsToList(String operator, Val<Expression>[] args) { List<Expression> et = Lists.newArrayListWithCapacity(args.length); for (Val<Expression> e : args) { if (e.object() instanceof Expression) { et.add(e.expr()); // depends on control dependency: [if], data = [none] } else { throw new QuerySyntaxException(Messages.get("dsl.arguments.error3", operator)); } } return et; } }
public class class_name { static PhynixxXADataRecorder recoverDataRecorder(XADataLogger xaDataLogger, IXADataRecorderLifecycleListener dataRecorderLifycycleListner) { try { PhynixxXADataRecorder dataRecorder = new PhynixxXADataRecorder(-1, xaDataLogger, dataRecorderLifycycleListner); dataRecorder.recover(); return dataRecorder; } catch (Exception e) { throw new DelegatedRuntimeException(e); } } }
public class class_name { static PhynixxXADataRecorder recoverDataRecorder(XADataLogger xaDataLogger, IXADataRecorderLifecycleListener dataRecorderLifycycleListner) { try { PhynixxXADataRecorder dataRecorder = new PhynixxXADataRecorder(-1, xaDataLogger, dataRecorderLifycycleListner); dataRecorder.recover(); // depends on control dependency: [try], data = [none] return dataRecorder; // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new DelegatedRuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public String print(ReadableInstant instant) { StringBuilder buf = new StringBuilder(requirePrinter().estimatePrintedLength()); try { printTo((Appendable) buf, instant); } catch (IOException ex) { // StringBuilder does not throw IOException } return buf.toString(); } }
public class class_name { public String print(ReadableInstant instant) { StringBuilder buf = new StringBuilder(requirePrinter().estimatePrintedLength()); try { printTo((Appendable) buf, instant); // depends on control dependency: [try], data = [none] } catch (IOException ex) { // StringBuilder does not throw IOException } // depends on control dependency: [catch], data = [none] return buf.toString(); } }
public class class_name { public static GuacamoleConfiguration getConfiguration(String uri) throws GuacamoleException { // Parse the provided String into a URI object. URI qcUri; try { qcUri = new URI(uri); if (!qcUri.isAbsolute()) throw new QuickConnectException("URI must be absolute.", "QUICKCONNECT.ERROR_NOT_ABSOLUTE_URI"); } catch (URISyntaxException e) { throw new QuickConnectException("Invalid URI Syntax", "QUICKCONNECT.ERROR_INVALID_URI"); } // Break out individual components of the URI. String protocol = qcUri.getScheme(); String host = qcUri.getHost(); int port = qcUri.getPort(); String userInfo = qcUri.getUserInfo(); String query = qcUri.getQuery(); // Generate a new GuacamoleConfiguration GuacamoleConfiguration qcConfig = new GuacamoleConfiguration(); // Check for protocol and set it, or throw an error if not present if (protocol != null && !protocol.isEmpty()) qcConfig.setProtocol(protocol); else throw new QuickConnectException("No protocol specified.", "QUICKCONNECT.ERROR_NO_PROTOCOL"); // Check for provided port number if (port > 0) qcConfig.setParameter("port", Integer.toString(port)); // Check for provided host, or throw an error if not present if (host != null && !host.isEmpty()) qcConfig.setParameter("hostname", host); else throw new QuickConnectException("No host specified.", "QUICKCONNECT.ERROR_NO_HOST"); // Look for extra query parameters and parse them out. if (query != null && !query.isEmpty()) { try { Map<String, String> queryParams = parseQueryString(query); if (queryParams != null) for (Map.Entry<String, String> entry: queryParams.entrySet()) qcConfig.setParameter(entry.getKey(), entry.getValue()); } catch (UnsupportedEncodingException e) { throw new GuacamoleServerException("Unexpected lack of UTF-8 encoding support.", e); } } // Look for the username and password and parse them out. if (userInfo != null && !userInfo.isEmpty()) { try { parseUserInfo(userInfo, qcConfig); } catch (UnsupportedEncodingException e) { throw new GuacamoleServerException("Unexpected lack of UTF-8 encoding support.", e); } } return qcConfig; } }
public class class_name { public static GuacamoleConfiguration getConfiguration(String uri) throws GuacamoleException { // Parse the provided String into a URI object. URI qcUri; try { qcUri = new URI(uri); if (!qcUri.isAbsolute()) throw new QuickConnectException("URI must be absolute.", "QUICKCONNECT.ERROR_NOT_ABSOLUTE_URI"); } catch (URISyntaxException e) { throw new QuickConnectException("Invalid URI Syntax", "QUICKCONNECT.ERROR_INVALID_URI"); } // Break out individual components of the URI. String protocol = qcUri.getScheme(); String host = qcUri.getHost(); int port = qcUri.getPort(); String userInfo = qcUri.getUserInfo(); String query = qcUri.getQuery(); // Generate a new GuacamoleConfiguration GuacamoleConfiguration qcConfig = new GuacamoleConfiguration(); // Check for protocol and set it, or throw an error if not present if (protocol != null && !protocol.isEmpty()) qcConfig.setProtocol(protocol); else throw new QuickConnectException("No protocol specified.", "QUICKCONNECT.ERROR_NO_PROTOCOL"); // Check for provided port number if (port > 0) qcConfig.setParameter("port", Integer.toString(port)); // Check for provided host, or throw an error if not present if (host != null && !host.isEmpty()) qcConfig.setParameter("hostname", host); else throw new QuickConnectException("No host specified.", "QUICKCONNECT.ERROR_NO_HOST"); // Look for extra query parameters and parse them out. if (query != null && !query.isEmpty()) { try { Map<String, String> queryParams = parseQueryString(query); if (queryParams != null) for (Map.Entry<String, String> entry: queryParams.entrySet()) qcConfig.setParameter(entry.getKey(), entry.getValue()); } catch (UnsupportedEncodingException e) { throw new GuacamoleServerException("Unexpected lack of UTF-8 encoding support.", e); } // depends on control dependency: [catch], data = [none] } // Look for the username and password and parse them out. if (userInfo != null && !userInfo.isEmpty()) { try { parseUserInfo(userInfo, qcConfig); // depends on control dependency: [try], data = [none] } catch (UnsupportedEncodingException e) { throw new GuacamoleServerException("Unexpected lack of UTF-8 encoding support.", e); } // depends on control dependency: [catch], data = [none] } return qcConfig; } }
public class class_name { private String getCData(final Node n) { StringBuffer buf = new StringBuffer(); NodeList nl = n.getChildNodes(); for (int x = 0; x < nl.getLength(); x++) { Node innerNode = nl.item(x); if ( (innerNode.getNodeType() == Node.TEXT_NODE) || (innerNode.getNodeType() == Node.CDATA_SECTION_NODE)) { buf.append(innerNode.getNodeValue()); } } return buf.toString(); } }
public class class_name { private String getCData(final Node n) { StringBuffer buf = new StringBuffer(); NodeList nl = n.getChildNodes(); for (int x = 0; x < nl.getLength(); x++) { Node innerNode = nl.item(x); if ( (innerNode.getNodeType() == Node.TEXT_NODE) || (innerNode.getNodeType() == Node.CDATA_SECTION_NODE)) { buf.append(innerNode.getNodeValue()); // depends on control dependency: [if], data = [(] } } return buf.toString(); } }
public class class_name { public Observable<ServiceResponse<JobExecutionInner>> beginCreateWithServiceResponseAsync(String resourceGroupName, String serverName, String jobAgentName, String jobName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } if (jobAgentName == null) { throw new IllegalArgumentException("Parameter jobAgentName is required and cannot be null."); } if (jobName == null) { throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.beginCreate(resourceGroupName, serverName, jobAgentName, jobName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<JobExecutionInner>>>() { @Override public Observable<ServiceResponse<JobExecutionInner>> call(Response<ResponseBody> response) { try { ServiceResponse<JobExecutionInner> clientResponse = beginCreateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponse<JobExecutionInner>> beginCreateWithServiceResponseAsync(String resourceGroupName, String serverName, String jobAgentName, String jobName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } if (jobAgentName == null) { throw new IllegalArgumentException("Parameter jobAgentName is required and cannot be null."); } if (jobName == null) { throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.beginCreate(resourceGroupName, serverName, jobAgentName, jobName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<JobExecutionInner>>>() { @Override public Observable<ServiceResponse<JobExecutionInner>> call(Response<ResponseBody> response) { try { ServiceResponse<JobExecutionInner> clientResponse = beginCreateDelegate(response); return Observable.just(clientResponse); // depends on control dependency: [try], data = [none] } catch (Throwable t) { return Observable.error(t); } // depends on control dependency: [catch], data = [none] } }); } }
public class class_name { public void close() throws SIResourceException, SIConnectionLostException, SIErrorException, SIConnectionDroppedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "close"); // Have we already been closed? if (!isClosed()) { try { closeLock.writeLock().lockInterruptibly(); try { CommsByteBuffer request = getCommsByteBuffer(); // Build Message Header request.putShort(getConnectionObjectID()); request.putShort(getProxyID()); // Pass on call to server CommsByteBuffer reply = jfapExchange(request, JFapChannelConstants.SEG_CLOSE_PRODUCER_SESS, lowestPriority, true); try { short err = reply.getCommandCompletionCode(JFapChannelConstants.SEG_CLOSE_PRODUCER_SESS_R); if (err != CommsConstants.SI_NO_EXCEPTION) { checkFor_SIConnectionDroppedException(reply, err); checkFor_SIResourceException(reply, err); checkFor_SIConnectionLostException(reply, err); checkFor_SIErrorException(reply, err); defaultChecker(reply, err); } } finally { if (reply != null) reply.release(); } setClosed(); if (oc != null) oc.decrementUseCount(); } finally { closeLock.writeLock().unlock(); } } catch (InterruptedException e) { // No FFDC code needed } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "close"); } }
public class class_name { public void close() throws SIResourceException, SIConnectionLostException, SIErrorException, SIConnectionDroppedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "close"); // Have we already been closed? if (!isClosed()) { try { closeLock.writeLock().lockInterruptibly(); try { CommsByteBuffer request = getCommsByteBuffer(); // Build Message Header request.putShort(getConnectionObjectID()); request.putShort(getProxyID()); // Pass on call to server CommsByteBuffer reply = jfapExchange(request, JFapChannelConstants.SEG_CLOSE_PRODUCER_SESS, lowestPriority, true); try { short err = reply.getCommandCompletionCode(JFapChannelConstants.SEG_CLOSE_PRODUCER_SESS_R); if (err != CommsConstants.SI_NO_EXCEPTION) { checkFor_SIConnectionDroppedException(reply, err); // depends on control dependency: [if], data = [none] checkFor_SIResourceException(reply, err); // depends on control dependency: [if], data = [none] checkFor_SIConnectionLostException(reply, err); // depends on control dependency: [if], data = [none] checkFor_SIErrorException(reply, err); // depends on control dependency: [if], data = [none] defaultChecker(reply, err); // depends on control dependency: [if], data = [none] } } finally { if (reply != null) reply.release(); } setClosed(); if (oc != null) oc.decrementUseCount(); } finally { closeLock.writeLock().unlock(); } } catch (InterruptedException e) { // No FFDC code needed } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "close"); } }
public class class_name { public Request createGetRequest(String url, String commonKey, String[] values, String apiKey, String accessToken) { HttpUrl.Builder httpBuilder = HttpUrl.parse(url).newBuilder(); for(int i = 0; i < values.length; i++) { httpBuilder.addQueryParameter(commonKey, values[i]); } return new Request.Builder().url(httpBuilder.build()).header("User-Agent", USER_AGENT).header("X-Kite-Version", "3").header("Authorization", "token "+apiKey+":"+accessToken).build(); } }
public class class_name { public Request createGetRequest(String url, String commonKey, String[] values, String apiKey, String accessToken) { HttpUrl.Builder httpBuilder = HttpUrl.parse(url).newBuilder(); for(int i = 0; i < values.length; i++) { httpBuilder.addQueryParameter(commonKey, values[i]); // depends on control dependency: [for], data = [i] } return new Request.Builder().url(httpBuilder.build()).header("User-Agent", USER_AGENT).header("X-Kite-Version", "3").header("Authorization", "token "+apiKey+":"+accessToken).build(); } }
public class class_name { public static void addEquals(DMatrixD1 a , double beta, DMatrixD1 b ) { if( a.numCols != b.numCols || a.numRows != b.numRows ) { throw new MatrixDimensionException("The 'a' and 'b' matrices do not have compatible dimensions"); } final int length = a.getNumElements(); for( int i = 0; i < length; i++ ) { a.plus(i, beta * b.get(i)); } } }
public class class_name { public static void addEquals(DMatrixD1 a , double beta, DMatrixD1 b ) { if( a.numCols != b.numCols || a.numRows != b.numRows ) { throw new MatrixDimensionException("The 'a' and 'b' matrices do not have compatible dimensions"); } final int length = a.getNumElements(); for( int i = 0; i < length; i++ ) { a.plus(i, beta * b.get(i)); // depends on control dependency: [for], data = [i] } } }
public class class_name { @Override public boolean matches(T member) { String name = member.getName(); if(names.contains(name)) { return true; } names.add(name); return false; } }
public class class_name { @Override public boolean matches(T member) { String name = member.getName(); if(names.contains(name)) { return true; // depends on control dependency: [if], data = [none] } names.add(name); return false; } }
public class class_name { private void read() { // define the specification format final int key = 0; final int description = 1; final int offset = 2; final int length = 3; SpecificationFormat format = new SpecificationFormat(key, description, offset, length); // read the header data try { data = IOUtil.readHeaderEntries(COFFHeaderKey.class, format, COFF_SPEC_FILE, headerbytes, getOffset()); } catch (IOException e) { logger.error("unable to read coff specification: " + e.getMessage()); } } }
public class class_name { private void read() { // define the specification format final int key = 0; final int description = 1; final int offset = 2; final int length = 3; SpecificationFormat format = new SpecificationFormat(key, description, offset, length); // read the header data try { data = IOUtil.readHeaderEntries(COFFHeaderKey.class, format, COFF_SPEC_FILE, headerbytes, getOffset()); // depends on control dependency: [try], data = [none] } catch (IOException e) { logger.error("unable to read coff specification: " + e.getMessage()); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override protected void onPersist(EntityMetadata entityMetadata, Object entity, Object id, List<RelationHolder> rlHolders) { HttpResponse response = null; try { JsonObject object = CouchDBObjectMapper.getJsonOfEntity(entityMetadata, entity, id, rlHolders, kunderaMetadata); String _id = object.get("_id").getAsString(); URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(), CouchDBConstants.URL_SEPARATOR + entityMetadata.getSchema().toLowerCase() + CouchDBConstants.URL_SEPARATOR + _id, null, null); HttpPut put = new HttpPut(uri); StringEntity stringEntity = null; if (isUpdate) { HttpGet get = new HttpGet(uri); get.addHeader("Accept", "application/json"); response = httpClient.execute(httpHost, get, CouchDBUtils.getContext(httpHost)); try { InputStream content = response.getEntity().getContent(); Reader reader = new InputStreamReader(content); JsonObject jsonObject = gson.fromJson(reader, JsonObject.class); JsonElement rev = jsonObject.get("_rev"); object.add("_rev", rev); } finally { closeContent(response); } } object.addProperty("_id", entityMetadata.getTableName() + id); stringEntity = new StringEntity(object.toString(), Constants.CHARSET_UTF8); stringEntity.setContentType("application/json"); put.setEntity(stringEntity); response = httpClient.execute(httpHost, put, CouchDBUtils.getContext(httpHost)); } catch (Exception e) { log.error("Error while persisting entity with id {}, caused by {}. ", id, e); throw new KunderaException(e); } finally { closeContent(response); } } }
public class class_name { @Override protected void onPersist(EntityMetadata entityMetadata, Object entity, Object id, List<RelationHolder> rlHolders) { HttpResponse response = null; try { JsonObject object = CouchDBObjectMapper.getJsonOfEntity(entityMetadata, entity, id, rlHolders, kunderaMetadata); String _id = object.get("_id").getAsString(); URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(), CouchDBConstants.URL_SEPARATOR + entityMetadata.getSchema().toLowerCase() + CouchDBConstants.URL_SEPARATOR + _id, null, null); HttpPut put = new HttpPut(uri); StringEntity stringEntity = null; if (isUpdate) { HttpGet get = new HttpGet(uri); get.addHeader("Accept", "application/json"); // depends on control dependency: [if], data = [none] response = httpClient.execute(httpHost, get, CouchDBUtils.getContext(httpHost)); // depends on control dependency: [if], data = [none] try { InputStream content = response.getEntity().getContent(); Reader reader = new InputStreamReader(content); JsonObject jsonObject = gson.fromJson(reader, JsonObject.class); JsonElement rev = jsonObject.get("_rev"); object.add("_rev", rev); // depends on control dependency: [try], data = [none] } finally { closeContent(response); } } object.addProperty("_id", entityMetadata.getTableName() + id); // depends on control dependency: [try], data = [none] stringEntity = new StringEntity(object.toString(), Constants.CHARSET_UTF8); // depends on control dependency: [try], data = [none] stringEntity.setContentType("application/json"); // depends on control dependency: [try], data = [none] put.setEntity(stringEntity); // depends on control dependency: [try], data = [none] response = httpClient.execute(httpHost, put, CouchDBUtils.getContext(httpHost)); // depends on control dependency: [try], data = [none] } catch (Exception e) { log.error("Error while persisting entity with id {}, caused by {}. ", id, e); throw new KunderaException(e); } // depends on control dependency: [catch], data = [none] finally { closeContent(response); } } }
public class class_name { public static float[] floatArrayWrappedOrCopy(CollectionNumber coll) { float[] array = wrappedFloatArray(coll); if (array != null) { return array; } return floatArrayCopyOf(coll); } }
public class class_name { public static float[] floatArrayWrappedOrCopy(CollectionNumber coll) { float[] array = wrappedFloatArray(coll); if (array != null) { return array; // depends on control dependency: [if], data = [none] } return floatArrayCopyOf(coll); } }
public class class_name { void stat(char[] fmt, String src) throws IOException { Path srcPath = new Path(src); FileSystem srcFs = srcPath.getFileSystem(getConf()); FileStatus glob[] = srcFs.globStatus(srcPath); if (null == glob) throw new IOException("cannot stat `" + src + "': No such file or directory"); for (FileStatus f : glob) { StringBuilder buf = new StringBuilder(); for (int i = 0; i < fmt.length; ++i) { if (fmt[i] != '%') { buf.append(fmt[i]); } else { if (i + 1 == fmt.length) break; switch(fmt[++i]) { case 'b': buf.append(f.getLen()); break; case 'F': buf.append(f.isDir() ? "directory" : "regular file"); break; case 'n': buf.append(f.getPath().getName()); break; case 'o': buf.append(f.getBlockSize()); break; case 'r': buf.append(f.getReplication()); break; case 'y': buf.append(modifFmt.format(new Date(f.getModificationTime()))); break; case 'Y': buf.append(f.getModificationTime()); break; default: buf.append(fmt[i]); break; } } } System.out.println(buf.toString()); } } }
public class class_name { void stat(char[] fmt, String src) throws IOException { Path srcPath = new Path(src); FileSystem srcFs = srcPath.getFileSystem(getConf()); FileStatus glob[] = srcFs.globStatus(srcPath); if (null == glob) throw new IOException("cannot stat `" + src + "': No such file or directory"); for (FileStatus f : glob) { StringBuilder buf = new StringBuilder(); for (int i = 0; i < fmt.length; ++i) { if (fmt[i] != '%') { buf.append(fmt[i]); // depends on control dependency: [if], data = [(fmt[i]] } else { if (i + 1 == fmt.length) break; switch(fmt[++i]) { // depends on control dependency: [if], data = [none] case 'b': buf.append(f.getLen()); break; case 'F': buf.append(f.isDir() ? "directory" : "regular file"); break; case 'n': buf.append(f.getPath().getName()); break; case 'o': buf.append(f.getBlockSize()); break; case 'r': buf.append(f.getReplication()); break; case 'y': buf.append(modifFmt.format(new Date(f.getModificationTime()))); break; case 'Y': buf.append(f.getModificationTime()); break; default: buf.append(fmt[i]); break; } } } System.out.println(buf.toString()); } } }
public class class_name { public static String underlineToCamel(String param) { if (isEmpty(param.trim())) { return ""; } StringBuilder sb = new StringBuilder(param); Matcher mc = Pattern.compile(UNDERLINE).matcher(param); int i = 0; while (mc.find()) { int position = mc.end() - (i++); sb.replace(position - 1, position + 1, sb.substring(position, position + 1).toUpperCase()); } return sb.toString(); } }
public class class_name { public static String underlineToCamel(String param) { if (isEmpty(param.trim())) { return ""; // depends on control dependency: [if], data = [none] } StringBuilder sb = new StringBuilder(param); Matcher mc = Pattern.compile(UNDERLINE).matcher(param); int i = 0; while (mc.find()) { int position = mc.end() - (i++); sb.replace(position - 1, position + 1, sb.substring(position, position + 1).toUpperCase()); // depends on control dependency: [while], data = [none] } return sb.toString(); } }
public class class_name { protected boolean isGetClassOnTypeLiteral() { JvmIdentifiableElement feature = getFeature(); if (isGetClass(feature)) { XExpression receiver = getSyntacticReceiver(); if (receiver instanceof XAbstractFeatureCall) { IFeatureLinkingCandidate linkingCandidate = getState().getResolvedTypes().getLinkingCandidate((XAbstractFeatureCall) receiver); if (linkingCandidate != null && linkingCandidate.isTypeLiteral()) { return true; } } } return false; } }
public class class_name { protected boolean isGetClassOnTypeLiteral() { JvmIdentifiableElement feature = getFeature(); if (isGetClass(feature)) { XExpression receiver = getSyntacticReceiver(); if (receiver instanceof XAbstractFeatureCall) { IFeatureLinkingCandidate linkingCandidate = getState().getResolvedTypes().getLinkingCandidate((XAbstractFeatureCall) receiver); if (linkingCandidate != null && linkingCandidate.isTypeLiteral()) { return true; // depends on control dependency: [if], data = [none] } } } return false; } }
public class class_name { public void marshall(LabelingJobResourceConfig labelingJobResourceConfig, ProtocolMarshaller protocolMarshaller) { if (labelingJobResourceConfig == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(labelingJobResourceConfig.getVolumeKmsKeyId(), VOLUMEKMSKEYID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(LabelingJobResourceConfig labelingJobResourceConfig, ProtocolMarshaller protocolMarshaller) { if (labelingJobResourceConfig == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(labelingJobResourceConfig.getVolumeKmsKeyId(), VOLUMEKMSKEYID_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 boolean isHideButtonAdvanced() { I_CmsDialogHandler handler = OpenCms.getWorkplaceManager().getDialogHandler(getDialogHandler()); CmsParameterConfiguration handlerParams = handler.getConfiguration(); if ((handlerParams != null) && handlerParams.containsKey(PARAM_HIDEADVANCED)) { // checks if "hideadvanced" is set to true boolean isHideAdvancedSet = false; List<String> hAdvanced = handlerParams.getList(PARAM_HIDEADVANCED); if (!hAdvanced.isEmpty()) { isHideAdvancedSet = Boolean.valueOf(hAdvanced.get(0)).booleanValue(); } if (isHideAdvancedSet) { // if user has the role root admin if (OpenCms.getRoleManager().hasRole(getCms(), CmsRole.ROOT_ADMIN)) { return false; } if (handlerParams.containsKey(PARAM_SHOWGROUP)) { // check if user is one of the configured groups CmsUser currentUser = getCms().getRequestContext().getCurrentUser(); List<String> confGroups = handlerParams.getList(PARAM_SHOWGROUP); for (String groupName : confGroups) { try { if (getCms().userInGroup(currentUser.getName(), groupName)) { return false; } } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } } } return true; } } return false; } }
public class class_name { protected boolean isHideButtonAdvanced() { I_CmsDialogHandler handler = OpenCms.getWorkplaceManager().getDialogHandler(getDialogHandler()); CmsParameterConfiguration handlerParams = handler.getConfiguration(); if ((handlerParams != null) && handlerParams.containsKey(PARAM_HIDEADVANCED)) { // checks if "hideadvanced" is set to true boolean isHideAdvancedSet = false; List<String> hAdvanced = handlerParams.getList(PARAM_HIDEADVANCED); if (!hAdvanced.isEmpty()) { isHideAdvancedSet = Boolean.valueOf(hAdvanced.get(0)).booleanValue(); // depends on control dependency: [if], data = [none] } if (isHideAdvancedSet) { // if user has the role root admin if (OpenCms.getRoleManager().hasRole(getCms(), CmsRole.ROOT_ADMIN)) { return false; // depends on control dependency: [if], data = [none] } if (handlerParams.containsKey(PARAM_SHOWGROUP)) { // check if user is one of the configured groups CmsUser currentUser = getCms().getRequestContext().getCurrentUser(); List<String> confGroups = handlerParams.getList(PARAM_SHOWGROUP); for (String groupName : confGroups) { try { if (getCms().userInGroup(currentUser.getName(), groupName)) { return false; // depends on control dependency: [if], data = [none] } } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } // depends on control dependency: [catch], data = [none] } } return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public ListDomainsResult withDomainNames(String... domainNames) { if (this.domainNames == null) { setDomainNames(new com.amazonaws.internal.SdkInternalList<String>(domainNames.length)); } for (String ele : domainNames) { this.domainNames.add(ele); } return this; } }
public class class_name { public ListDomainsResult withDomainNames(String... domainNames) { if (this.domainNames == null) { setDomainNames(new com.amazonaws.internal.SdkInternalList<String>(domainNames.length)); // depends on control dependency: [if], data = [none] } for (String ele : domainNames) { this.domainNames.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public String buildView() { final StringBuilder sb = new StringBuilder(); final ConnectionPool[] pools = ContainerUtil.searchComponentsAll(ConnectionPool.class); // plural if e.g. master/slave boolean firstDone = false; for (ConnectionPool pool : pools) { if (firstDone) { sb.append("\n"); } sb.append(pool.getClass().getName() + "@" + Integer.toHexString(pool.hashCode())); synchronized (pool) { // just in case final int free = pool.getFreePoolSize(); final int active = pool.getActivePoolSize(); final int txActive = pool.getTxActivePoolSize(); sb.append("\n").append("freePool=").append(free); sb.append(", activePool=").append(active).append(", txActivePool=").append(txActive); } final List<String> txViewList = findTransactionViewList(pool); if (!txViewList.isEmpty()) { for (String txView : txViewList) { sb.append("\n").append(txView); } } else { sb.append("\n(no transaction)"); } firstDone = true; } return sb.toString(); } }
public class class_name { public String buildView() { final StringBuilder sb = new StringBuilder(); final ConnectionPool[] pools = ContainerUtil.searchComponentsAll(ConnectionPool.class); // plural if e.g. master/slave boolean firstDone = false; for (ConnectionPool pool : pools) { if (firstDone) { sb.append("\n"); // depends on control dependency: [if], data = [none] } sb.append(pool.getClass().getName() + "@" + Integer.toHexString(pool.hashCode())); // depends on control dependency: [for], data = [pool] synchronized (pool) { // just in case // depends on control dependency: [for], data = [pool] final int free = pool.getFreePoolSize(); final int active = pool.getActivePoolSize(); final int txActive = pool.getTxActivePoolSize(); sb.append("\n").append("freePool=").append(free); sb.append(", activePool=").append(active).append(", txActivePool=").append(txActive); } final List<String> txViewList = findTransactionViewList(pool); if (!txViewList.isEmpty()) { for (String txView : txViewList) { sb.append("\n").append(txView); // depends on control dependency: [for], data = [txView] } } else { sb.append("\n(no transaction)"); // depends on control dependency: [if], data = [none] } firstDone = true; // depends on control dependency: [for], data = [none] } return sb.toString(); } }
public class class_name { @Override public void registerPropertyMatcher(PropertyMatcher<?> propertyMatcher) { if (propertyMatcher.getPathProvider() == null) { propertyMatcher.setPathProvider(this); } propertyMatcherList.add(propertyMatcher); } }
public class class_name { @Override public void registerPropertyMatcher(PropertyMatcher<?> propertyMatcher) { if (propertyMatcher.getPathProvider() == null) { propertyMatcher.setPathProvider(this); // depends on control dependency: [if], data = [none] } propertyMatcherList.add(propertyMatcher); } }