code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { @Cmd public File chooseFile(final String fileKey) { log.debug("Opening file chooser dialog"); JFileChooser fileChooser = new JFileChooser(System.getProperty(JFunkConstants.USER_DIR)); fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); fileChooser.setPreferredSize(new Dimension(600, 326)); int fileChooserResult = fileChooser.showOpenDialog(null); if (fileChooserResult == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); String filename = file.toString(); log.info("Assigning file path '{}' to property '{}'", filename, fileKey); config.put(fileKey, filename); return file; } log.error("No file or directory was chosen, execution will abort"); throw new IllegalArgumentException("No file or directory was chosen"); } }
public class class_name { @Cmd public File chooseFile(final String fileKey) { log.debug("Opening file chooser dialog"); JFileChooser fileChooser = new JFileChooser(System.getProperty(JFunkConstants.USER_DIR)); fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); fileChooser.setPreferredSize(new Dimension(600, 326)); int fileChooserResult = fileChooser.showOpenDialog(null); if (fileChooserResult == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); String filename = file.toString(); log.info("Assigning file path '{}' to property '{}'", filename, fileKey); // depends on control dependency: [if], data = [none] config.put(fileKey, filename); // depends on control dependency: [if], data = [none] return file; // depends on control dependency: [if], data = [none] } log.error("No file or directory was chosen, execution will abort"); throw new IllegalArgumentException("No file or directory was chosen"); } }
public class class_name { protected void addPackageResources(Package aPackage, Map<String, ClassResource> urlSet, ClassLoader[] classLoaders) { String packageName = aPackage.getName(); String relativePath = getPackageRelativePath(packageName); List<URL> resources = getResources(relativePath, classLoaders); for (URL resource : resources) { String key = getJavaResourceKey(resource); urlSet.put(key, new ClassResource(packageName, resource)); } } }
public class class_name { protected void addPackageResources(Package aPackage, Map<String, ClassResource> urlSet, ClassLoader[] classLoaders) { String packageName = aPackage.getName(); String relativePath = getPackageRelativePath(packageName); List<URL> resources = getResources(relativePath, classLoaders); for (URL resource : resources) { String key = getJavaResourceKey(resource); urlSet.put(key, new ClassResource(packageName, resource)); // depends on control dependency: [for], data = [resource] } } }
public class class_name { protected String getHasConditionsFromRequest(HttpServletRequest request) throws IOException { final String sourceMethod = "getHasConditionsFromRequest"; //$NON-NLS-1$ boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(sourceClass, sourceMethod, new Object[]{request}); } String ret = null; if (request.getParameter(FEATUREMAPHASH_REQPARAM) != null) { // The cookie called 'has' contains the has conditions if (isTraceLogging) { log.finer("has hash = " + request.getParameter(FEATUREMAPHASH_REQPARAM)); //$NON-NLS-1$ } Cookie[] cookies = request.getCookies(); if (cookies != null) { for (int i = 0; ret == null && i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookie.getName().equals(FEATUREMAP_REQPARAM) && cookie.getValue() != null) { if (isTraceLogging) { log.finer("has cookie = " + cookie.getValue()); //$NON-NLS-1$ } ret = URLDecoder.decode(cookie.getValue(), "US-ASCII"); //$NON-NLS-1$ break; } } } if (ret == null) { if (log.isLoggable(Level.WARNING)) { StringBuffer url = request.getRequestURL(); if (url != null) { // might be null if using mock request for unit testing url.append("?").append(request.getQueryString()).toString(); //$NON-NLS-1$ log.warning(MessageFormat.format( Messages.AbstractHttpTransport_0, new Object[]{url, request.getHeader("User-Agent")})); //$NON-NLS-1$ } } } } else { ret = request.getParameter(FEATUREMAP_REQPARAM); if (isTraceLogging) { log.finer("reading features from has query arg"); //$NON-NLS-1$ } } if (isTraceLogging) { log.exiting(sourceClass, sourceMethod, ret); } return ret; } }
public class class_name { protected String getHasConditionsFromRequest(HttpServletRequest request) throws IOException { final String sourceMethod = "getHasConditionsFromRequest"; //$NON-NLS-1$ boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(sourceClass, sourceMethod, new Object[]{request}); } String ret = null; if (request.getParameter(FEATUREMAPHASH_REQPARAM) != null) { // The cookie called 'has' contains the has conditions if (isTraceLogging) { log.finer("has hash = " + request.getParameter(FEATUREMAPHASH_REQPARAM)); //$NON-NLS-1$ // depends on control dependency: [if], data = [none] } Cookie[] cookies = request.getCookies(); if (cookies != null) { for (int i = 0; ret == null && i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookie.getName().equals(FEATUREMAP_REQPARAM) && cookie.getValue() != null) { if (isTraceLogging) { log.finer("has cookie = " + cookie.getValue()); //$NON-NLS-1$ // depends on control dependency: [if], data = [none] } ret = URLDecoder.decode(cookie.getValue(), "US-ASCII"); //$NON-NLS-1$ // depends on control dependency: [if], data = [none] break; } } } if (ret == null) { if (log.isLoggable(Level.WARNING)) { StringBuffer url = request.getRequestURL(); if (url != null) { // might be null if using mock request for unit testing url.append("?").append(request.getQueryString()).toString(); //$NON-NLS-1$ // depends on control dependency: [if], data = [none] log.warning(MessageFormat.format( Messages.AbstractHttpTransport_0, new Object[]{url, request.getHeader("User-Agent")})); //$NON-NLS-1$ // depends on control dependency: [if], data = [none] } } } } else { ret = request.getParameter(FEATUREMAP_REQPARAM); if (isTraceLogging) { log.finer("reading features from has query arg"); //$NON-NLS-1$ // depends on control dependency: [if], data = [none] } } if (isTraceLogging) { log.exiting(sourceClass, sourceMethod, ret); } return ret; } }
public class class_name { int estimateCodeComplexity(JCTree tree) { if (tree == null) return 0; class ComplexityScanner extends TreeScanner { int complexity = 0; public void scan(JCTree tree) { if (complexity > jsrlimit) return; super.scan(tree); } public void visitClassDef(JCClassDecl tree) {} public void visitDoLoop(JCDoWhileLoop tree) { super.visitDoLoop(tree); complexity++; } public void visitWhileLoop(JCWhileLoop tree) { super.visitWhileLoop(tree); complexity++; } public void visitForLoop(JCForLoop tree) { super.visitForLoop(tree); complexity++; } public void visitSwitch(JCSwitch tree) { super.visitSwitch(tree); complexity+=5; } public void visitCase(JCCase tree) { super.visitCase(tree); complexity++; } public void visitSynchronized(JCSynchronized tree) { super.visitSynchronized(tree); complexity+=6; } public void visitTry(JCTry tree) { super.visitTry(tree); if (tree.finalizer != null) complexity+=6; } public void visitCatch(JCCatch tree) { super.visitCatch(tree); complexity+=2; } public void visitConditional(JCConditional tree) { super.visitConditional(tree); complexity+=2; } public void visitIf(JCIf tree) { super.visitIf(tree); complexity+=2; } // note: for break, continue, and return we don't take unwind() into account. public void visitBreak(JCBreak tree) { super.visitBreak(tree); complexity+=1; } public void visitContinue(JCContinue tree) { super.visitContinue(tree); complexity+=1; } public void visitReturn(JCReturn tree) { super.visitReturn(tree); complexity+=1; } public void visitThrow(JCThrow tree) { super.visitThrow(tree); complexity+=1; } public void visitAssert(JCAssert tree) { super.visitAssert(tree); complexity+=5; } public void visitApply(JCMethodInvocation tree) { super.visitApply(tree); complexity+=2; } public void visitNewClass(JCNewClass tree) { scan(tree.encl); scan(tree.args); complexity+=2; } public void visitNewArray(JCNewArray tree) { super.visitNewArray(tree); complexity+=5; } public void visitAssign(JCAssign tree) { super.visitAssign(tree); complexity+=1; } public void visitAssignop(JCAssignOp tree) { super.visitAssignop(tree); complexity+=2; } public void visitUnary(JCUnary tree) { complexity+=1; if (tree.type.constValue() == null) super.visitUnary(tree); } public void visitBinary(JCBinary tree) { complexity+=1; if (tree.type.constValue() == null) super.visitBinary(tree); } public void visitTypeTest(JCInstanceOf tree) { super.visitTypeTest(tree); complexity+=1; } public void visitIndexed(JCArrayAccess tree) { super.visitIndexed(tree); complexity+=1; } public void visitSelect(JCFieldAccess tree) { super.visitSelect(tree); if (tree.sym.kind == VAR) complexity+=1; } public void visitIdent(JCIdent tree) { if (tree.sym.kind == VAR) { complexity+=1; if (tree.type.constValue() == null && tree.sym.owner.kind == TYP) complexity+=1; } } public void visitLiteral(JCLiteral tree) { complexity+=1; } public void visitTree(JCTree tree) {} public void visitWildcard(JCWildcard tree) { throw new AssertionError(this.getClass().getName()); } } ComplexityScanner scanner = new ComplexityScanner(); tree.accept(scanner); return scanner.complexity; } }
public class class_name { int estimateCodeComplexity(JCTree tree) { if (tree == null) return 0; class ComplexityScanner extends TreeScanner { int complexity = 0; public void scan(JCTree tree) { if (complexity > jsrlimit) return; super.scan(tree); } public void visitClassDef(JCClassDecl tree) {} public void visitDoLoop(JCDoWhileLoop tree) { super.visitDoLoop(tree); complexity++; } public void visitWhileLoop(JCWhileLoop tree) { super.visitWhileLoop(tree); complexity++; } public void visitForLoop(JCForLoop tree) { super.visitForLoop(tree); complexity++; } public void visitSwitch(JCSwitch tree) { super.visitSwitch(tree); complexity+=5; } public void visitCase(JCCase tree) { super.visitCase(tree); complexity++; } public void visitSynchronized(JCSynchronized tree) { super.visitSynchronized(tree); complexity+=6; } public void visitTry(JCTry tree) { super.visitTry(tree); if (tree.finalizer != null) complexity+=6; } public void visitCatch(JCCatch tree) { super.visitCatch(tree); complexity+=2; } public void visitConditional(JCConditional tree) { super.visitConditional(tree); complexity+=2; } public void visitIf(JCIf tree) { super.visitIf(tree); complexity+=2; } // note: for break, continue, and return we don't take unwind() into account. public void visitBreak(JCBreak tree) { super.visitBreak(tree); complexity+=1; } public void visitContinue(JCContinue tree) { super.visitContinue(tree); complexity+=1; } public void visitReturn(JCReturn tree) { super.visitReturn(tree); complexity+=1; } public void visitThrow(JCThrow tree) { super.visitThrow(tree); complexity+=1; } public void visitAssert(JCAssert tree) { super.visitAssert(tree); complexity+=5; } public void visitApply(JCMethodInvocation tree) { super.visitApply(tree); complexity+=2; } public void visitNewClass(JCNewClass tree) { scan(tree.encl); scan(tree.args); complexity+=2; } public void visitNewArray(JCNewArray tree) { super.visitNewArray(tree); complexity+=5; } public void visitAssign(JCAssign tree) { super.visitAssign(tree); complexity+=1; } public void visitAssignop(JCAssignOp tree) { super.visitAssignop(tree); complexity+=2; } public void visitUnary(JCUnary tree) { complexity+=1; if (tree.type.constValue() == null) super.visitUnary(tree); } public void visitBinary(JCBinary tree) { complexity+=1; if (tree.type.constValue() == null) super.visitBinary(tree); } public void visitTypeTest(JCInstanceOf tree) { super.visitTypeTest(tree); complexity+=1; } public void visitIndexed(JCArrayAccess tree) { super.visitIndexed(tree); complexity+=1; } public void visitSelect(JCFieldAccess tree) { super.visitSelect(tree); if (tree.sym.kind == VAR) complexity+=1; } public void visitIdent(JCIdent tree) { if (tree.sym.kind == VAR) { complexity+=1; // depends on control dependency: [if], data = [none] if (tree.type.constValue() == null && tree.sym.owner.kind == TYP) complexity+=1; } } public void visitLiteral(JCLiteral tree) { complexity+=1; } public void visitTree(JCTree tree) {} public void visitWildcard(JCWildcard tree) { throw new AssertionError(this.getClass().getName()); } } ComplexityScanner scanner = new ComplexityScanner(); tree.accept(scanner); return scanner.complexity; } }
public class class_name { public void parseBoundaryEvents(Element parentElement, ScopeImpl flowScope) { for (Element boundaryEventElement : parentElement.elements("boundaryEvent")) { // The boundary event is attached to an activity, reference by the // 'attachedToRef' attribute String attachedToRef = boundaryEventElement.attribute("attachedToRef"); if (attachedToRef == null || attachedToRef.equals("")) { addError("AttachedToRef is required when using a timerEventDefinition", boundaryEventElement); } // Representation structure-wise is a nested activity in the activity to // which its attached String id = boundaryEventElement.attribute("id"); LOG.parsingElement("boundary event", id); // Depending on the sub-element definition, the correct activityBehavior // parsing is selected Element timerEventDefinition = boundaryEventElement.element(TIMER_EVENT_DEFINITION); Element errorEventDefinition = boundaryEventElement.element(ERROR_EVENT_DEFINITION); Element signalEventDefinition = boundaryEventElement.element(SIGNAL_EVENT_DEFINITION); Element cancelEventDefinition = boundaryEventElement.element(CANCEL_EVENT_DEFINITION); Element compensateEventDefinition = boundaryEventElement.element(COMPENSATE_EVENT_DEFINITION); Element messageEventDefinition = boundaryEventElement.element(MESSAGE_EVENT_DEFINITION); Element escalationEventDefinition = boundaryEventElement.element(ESCALATION_EVENT_DEFINITION); Element conditionalEventDefinition = boundaryEventElement.element(CONDITIONAL_EVENT_DEFINITION); // create the boundary event activity ActivityImpl boundaryEventActivity = createActivityOnScope(boundaryEventElement, flowScope); parseAsynchronousContinuation(boundaryEventElement, boundaryEventActivity); ActivityImpl attachedActivity = flowScope.findActivityAtLevelOfSubprocess(attachedToRef); if (attachedActivity == null) { addError("Invalid reference in boundary event. Make sure that the referenced activity is defined in the same scope as the boundary event", boundaryEventElement); } // determine the correct event scope (the scope in which the boundary event catches events) if (compensateEventDefinition == null) { ActivityImpl multiInstanceScope = getMultiInstanceScope(attachedActivity); if (multiInstanceScope != null) { // if the boundary event is attached to a multi instance activity, // then the scope of the boundary event is the multi instance body. boundaryEventActivity.setEventScope(multiInstanceScope); } else { attachedActivity.setScope(true); boundaryEventActivity.setEventScope(attachedActivity); } } else { boundaryEventActivity.setEventScope(attachedActivity); } // except escalation, by default is assumed to abort the activity String cancelActivityAttr = boundaryEventElement.attribute("cancelActivity", TRUE); boolean isCancelActivity = Boolean.valueOf(cancelActivityAttr); // determine start behavior if (isCancelActivity) { boundaryEventActivity.setActivityStartBehavior(ActivityStartBehavior.CANCEL_EVENT_SCOPE); } else { boundaryEventActivity.setActivityStartBehavior(ActivityStartBehavior.CONCURRENT_IN_FLOW_SCOPE); } // Catch event behavior is the same for most types ActivityBehavior behavior = new BoundaryEventActivityBehavior(); if (timerEventDefinition != null) { parseBoundaryTimerEventDefinition(timerEventDefinition, isCancelActivity, boundaryEventActivity); } else if (errorEventDefinition != null) { parseBoundaryErrorEventDefinition(errorEventDefinition, boundaryEventActivity); } else if (signalEventDefinition != null) { parseBoundarySignalEventDefinition(signalEventDefinition, isCancelActivity, boundaryEventActivity); } else if (cancelEventDefinition != null) { behavior = parseBoundaryCancelEventDefinition(cancelEventDefinition, boundaryEventActivity); } else if (compensateEventDefinition != null) { parseBoundaryCompensateEventDefinition(compensateEventDefinition, boundaryEventActivity); } else if (messageEventDefinition != null) { parseBoundaryMessageEventDefinition(messageEventDefinition, isCancelActivity, boundaryEventActivity); } else if (escalationEventDefinition != null) { if (attachedActivity.isSubProcessScope() || attachedActivity.getActivityBehavior() instanceof CallActivityBehavior) { parseBoundaryEscalationEventDefinition(escalationEventDefinition, isCancelActivity, boundaryEventActivity); } else { addError("An escalation boundary event should only be attached to a subprocess or a call activity", boundaryEventElement); } } else if (conditionalEventDefinition != null) { behavior = parseBoundaryConditionalEventDefinition(conditionalEventDefinition, isCancelActivity, boundaryEventActivity); } else { addError("Unsupported boundary event type", boundaryEventElement); } ensureNoIoMappingDefined(boundaryEventElement); boundaryEventActivity.setActivityBehavior(behavior); parseExecutionListenersOnScope(boundaryEventElement, boundaryEventActivity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseBoundaryEvent(boundaryEventElement, flowScope, boundaryEventActivity); } } } }
public class class_name { public void parseBoundaryEvents(Element parentElement, ScopeImpl flowScope) { for (Element boundaryEventElement : parentElement.elements("boundaryEvent")) { // The boundary event is attached to an activity, reference by the // 'attachedToRef' attribute String attachedToRef = boundaryEventElement.attribute("attachedToRef"); if (attachedToRef == null || attachedToRef.equals("")) { addError("AttachedToRef is required when using a timerEventDefinition", boundaryEventElement); // depends on control dependency: [if], data = [none] } // Representation structure-wise is a nested activity in the activity to // which its attached String id = boundaryEventElement.attribute("id"); LOG.parsingElement("boundary event", id); // depends on control dependency: [for], data = [none] // Depending on the sub-element definition, the correct activityBehavior // parsing is selected Element timerEventDefinition = boundaryEventElement.element(TIMER_EVENT_DEFINITION); Element errorEventDefinition = boundaryEventElement.element(ERROR_EVENT_DEFINITION); Element signalEventDefinition = boundaryEventElement.element(SIGNAL_EVENT_DEFINITION); Element cancelEventDefinition = boundaryEventElement.element(CANCEL_EVENT_DEFINITION); Element compensateEventDefinition = boundaryEventElement.element(COMPENSATE_EVENT_DEFINITION); Element messageEventDefinition = boundaryEventElement.element(MESSAGE_EVENT_DEFINITION); Element escalationEventDefinition = boundaryEventElement.element(ESCALATION_EVENT_DEFINITION); Element conditionalEventDefinition = boundaryEventElement.element(CONDITIONAL_EVENT_DEFINITION); // create the boundary event activity ActivityImpl boundaryEventActivity = createActivityOnScope(boundaryEventElement, flowScope); parseAsynchronousContinuation(boundaryEventElement, boundaryEventActivity); // depends on control dependency: [for], data = [boundaryEventElement] ActivityImpl attachedActivity = flowScope.findActivityAtLevelOfSubprocess(attachedToRef); if (attachedActivity == null) { addError("Invalid reference in boundary event. Make sure that the referenced activity is defined in the same scope as the boundary event", boundaryEventElement); // depends on control dependency: [if], data = [none] } // determine the correct event scope (the scope in which the boundary event catches events) if (compensateEventDefinition == null) { ActivityImpl multiInstanceScope = getMultiInstanceScope(attachedActivity); if (multiInstanceScope != null) { // if the boundary event is attached to a multi instance activity, // then the scope of the boundary event is the multi instance body. boundaryEventActivity.setEventScope(multiInstanceScope); // depends on control dependency: [if], data = [(multiInstanceScope] } else { attachedActivity.setScope(true); // depends on control dependency: [if], data = [none] boundaryEventActivity.setEventScope(attachedActivity); // depends on control dependency: [if], data = [none] } } else { boundaryEventActivity.setEventScope(attachedActivity); // depends on control dependency: [if], data = [none] } // except escalation, by default is assumed to abort the activity String cancelActivityAttr = boundaryEventElement.attribute("cancelActivity", TRUE); boolean isCancelActivity = Boolean.valueOf(cancelActivityAttr); // determine start behavior if (isCancelActivity) { boundaryEventActivity.setActivityStartBehavior(ActivityStartBehavior.CANCEL_EVENT_SCOPE); // depends on control dependency: [if], data = [none] } else { boundaryEventActivity.setActivityStartBehavior(ActivityStartBehavior.CONCURRENT_IN_FLOW_SCOPE); // depends on control dependency: [if], data = [none] } // Catch event behavior is the same for most types ActivityBehavior behavior = new BoundaryEventActivityBehavior(); if (timerEventDefinition != null) { parseBoundaryTimerEventDefinition(timerEventDefinition, isCancelActivity, boundaryEventActivity); // depends on control dependency: [if], data = [(timerEventDefinition] } else if (errorEventDefinition != null) { parseBoundaryErrorEventDefinition(errorEventDefinition, boundaryEventActivity); // depends on control dependency: [if], data = [(errorEventDefinition] } else if (signalEventDefinition != null) { parseBoundarySignalEventDefinition(signalEventDefinition, isCancelActivity, boundaryEventActivity); // depends on control dependency: [if], data = [(signalEventDefinition] } else if (cancelEventDefinition != null) { behavior = parseBoundaryCancelEventDefinition(cancelEventDefinition, boundaryEventActivity); // depends on control dependency: [if], data = [(cancelEventDefinition] } else if (compensateEventDefinition != null) { parseBoundaryCompensateEventDefinition(compensateEventDefinition, boundaryEventActivity); // depends on control dependency: [if], data = [(compensateEventDefinition] } else if (messageEventDefinition != null) { parseBoundaryMessageEventDefinition(messageEventDefinition, isCancelActivity, boundaryEventActivity); // depends on control dependency: [if], data = [(messageEventDefinition] } else if (escalationEventDefinition != null) { if (attachedActivity.isSubProcessScope() || attachedActivity.getActivityBehavior() instanceof CallActivityBehavior) { parseBoundaryEscalationEventDefinition(escalationEventDefinition, isCancelActivity, boundaryEventActivity); // depends on control dependency: [if], data = [none] } else { addError("An escalation boundary event should only be attached to a subprocess or a call activity", boundaryEventElement); // depends on control dependency: [if], data = [none] } } else if (conditionalEventDefinition != null) { behavior = parseBoundaryConditionalEventDefinition(conditionalEventDefinition, isCancelActivity, boundaryEventActivity); // depends on control dependency: [if], data = [(conditionalEventDefinition] } else { addError("Unsupported boundary event type", boundaryEventElement); // depends on control dependency: [if], data = [none] } ensureNoIoMappingDefined(boundaryEventElement); // depends on control dependency: [for], data = [boundaryEventElement] boundaryEventActivity.setActivityBehavior(behavior); // depends on control dependency: [for], data = [none] parseExecutionListenersOnScope(boundaryEventElement, boundaryEventActivity); // depends on control dependency: [for], data = [boundaryEventElement] for (BpmnParseListener parseListener : parseListeners) { parseListener.parseBoundaryEvent(boundaryEventElement, flowScope, boundaryEventActivity); // depends on control dependency: [for], data = [parseListener] } } } }
public class class_name { public CommandLine setSeparator(String separator) { getCommandSpec().parser().separator(Assert.notNull(separator, "separator")); for (CommandLine command : getCommandSpec().subcommands().values()) { command.setSeparator(separator); } return this; } }
public class class_name { public CommandLine setSeparator(String separator) { getCommandSpec().parser().separator(Assert.notNull(separator, "separator")); for (CommandLine command : getCommandSpec().subcommands().values()) { command.setSeparator(separator); // depends on control dependency: [for], data = [command] } return this; } }
public class class_name { private IUserLayoutChannelDescription getTransientNode(String nodeId) throws PortalException { // get fname from subscribe id final String fname = getFname(nodeId); if (null == fname || fname.equals("")) { return null; } try { // check cache first IPortletDefinition chanDef = mChanMap.get(nodeId); if (null == chanDef) { chanDef = PortletDefinitionRegistryLocator.getPortletDefinitionRegistry() .getPortletDefinitionByFname(fname); mChanMap.put(nodeId, chanDef); } return createUserLayoutChannelDescription(nodeId, chanDef); } catch (Exception e) { throw new PortalException("Failed to obtain channel definition using fname: " + fname); } } }
public class class_name { private IUserLayoutChannelDescription getTransientNode(String nodeId) throws PortalException { // get fname from subscribe id final String fname = getFname(nodeId); if (null == fname || fname.equals("")) { return null; } try { // check cache first IPortletDefinition chanDef = mChanMap.get(nodeId); if (null == chanDef) { chanDef = PortletDefinitionRegistryLocator.getPortletDefinitionRegistry() .getPortletDefinitionByFname(fname); // depends on control dependency: [if], data = [none] mChanMap.put(nodeId, chanDef); // depends on control dependency: [if], data = [chanDef)] } return createUserLayoutChannelDescription(nodeId, chanDef); } catch (Exception e) { throw new PortalException("Failed to obtain channel definition using fname: " + fname); } } }
public class class_name { private void processCheckExpandedCustomNodes(final TreeItemIdNode node, final Set<String> expandedRows) { // Node has no children if (!node.hasChildren()) { return; } // Check node is expanded boolean expanded = getExpandMode() == WTree.ExpandMode.CLIENT || expandedRows.contains(node.getItemId()); if (!expanded) { return; } if (node.getChildren().isEmpty()) { // Add children from the model loadCustomNodeChildren(node); } else { // Check the expanded child nodes for (TreeItemIdNode child : node.getChildren()) { processCheckExpandedCustomNodes(child, expandedRows); } } } }
public class class_name { private void processCheckExpandedCustomNodes(final TreeItemIdNode node, final Set<String> expandedRows) { // Node has no children if (!node.hasChildren()) { return; // depends on control dependency: [if], data = [none] } // Check node is expanded boolean expanded = getExpandMode() == WTree.ExpandMode.CLIENT || expandedRows.contains(node.getItemId()); if (!expanded) { return; // depends on control dependency: [if], data = [none] } if (node.getChildren().isEmpty()) { // Add children from the model loadCustomNodeChildren(node); // depends on control dependency: [if], data = [none] } else { // Check the expanded child nodes for (TreeItemIdNode child : node.getChildren()) { processCheckExpandedCustomNodes(child, expandedRows); // depends on control dependency: [for], data = [child] } } } }
public class class_name { public Node findChildNodeWithName(final String name) { if (childNodes == null) { return null; } for (final Node childNode : childNodes) { if (childNode.getNodeName().equals(name)) { return childNode; } } return null; } }
public class class_name { public Node findChildNodeWithName(final String name) { if (childNodes == null) { return null; // depends on control dependency: [if], data = [none] } for (final Node childNode : childNodes) { if (childNode.getNodeName().equals(name)) { return childNode; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public void registerCommand(final OServerCommand iServerCommandInstance) { for (String name : iServerCommandInstance.getNames()) if (OStringSerializerHelper.contains(name, '{')) { restCommands.put(name, iServerCommandInstance); } else if (OStringSerializerHelper.contains(name, '*')) wildcardCommands.put(name, iServerCommandInstance); else exactCommands.put(name, iServerCommandInstance); iServerCommandInstance.configure(server); } }
public class class_name { public void registerCommand(final OServerCommand iServerCommandInstance) { for (String name : iServerCommandInstance.getNames()) if (OStringSerializerHelper.contains(name, '{')) { restCommands.put(name, iServerCommandInstance); // depends on control dependency: [if], data = [none] } else if (OStringSerializerHelper.contains(name, '*')) wildcardCommands.put(name, iServerCommandInstance); else exactCommands.put(name, iServerCommandInstance); iServerCommandInstance.configure(server); } }
public class class_name { private static Object getObject(final String className) { try { // we get the class coresponding to the life cycle name final Class<?> clazz = Class.forName(className); // we get the default constructor (with no parameter) final Constructor<?> contructor = clazz.getConstructor(new Class[]{}); // we create an instance of the class using the constructor return contructor.newInstance(new Object[]{}); } catch (final Exception e) { e.printStackTrace(); } return null; } }
public class class_name { private static Object getObject(final String className) { try { // we get the class coresponding to the life cycle name final Class<?> clazz = Class.forName(className); // we get the default constructor (with no parameter) final Constructor<?> contructor = clazz.getConstructor(new Class[]{}); // we create an instance of the class using the constructor return contructor.newInstance(new Object[]{}); // depends on control dependency: [try], data = [none] } catch (final Exception e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] return null; } }
public class class_name { public static JavaRDD<LabeledPoint> fromDataSet(JavaRDD<DataSet> data, boolean preCache) { if (preCache && !data.getStorageLevel().useMemory()) { data.cache(); } return data.map(new Function<DataSet, LabeledPoint>() { @Override public LabeledPoint call(DataSet dataSet) { return toLabeledPoint(dataSet); } }); } }
public class class_name { public static JavaRDD<LabeledPoint> fromDataSet(JavaRDD<DataSet> data, boolean preCache) { if (preCache && !data.getStorageLevel().useMemory()) { data.cache(); // depends on control dependency: [if], data = [none] } return data.map(new Function<DataSet, LabeledPoint>() { @Override public LabeledPoint call(DataSet dataSet) { return toLabeledPoint(dataSet); } }); } }
public class class_name { public void free() { int iOldEditMode = 0; if (m_record != null) // First, release the record for this table { iOldEditMode = this.getRecord().getEditMode(); this.getRecord().setEditMode(iOldEditMode | DBConstants.EDIT_CLOSE_IN_FREE); // This is a cludge... signals tables that this is the last close()! } this.close(); if (m_record != null) // First, release the record for this table this.getRecord().setEditMode(iOldEditMode); // This is a cludge... signals tables that this is the last close()! super.free(); // Set the record's table reference to null. if (m_database != null) m_database.removeTable(this); m_database = null; m_dataSource = null; m_objectID = null; } }
public class class_name { public void free() { int iOldEditMode = 0; if (m_record != null) // First, release the record for this table { iOldEditMode = this.getRecord().getEditMode(); // depends on control dependency: [if], data = [none] this.getRecord().setEditMode(iOldEditMode | DBConstants.EDIT_CLOSE_IN_FREE); // This is a cludge... signals tables that this is the last close()! // depends on control dependency: [if], data = [none] } this.close(); if (m_record != null) // First, release the record for this table this.getRecord().setEditMode(iOldEditMode); // This is a cludge... signals tables that this is the last close()! super.free(); // Set the record's table reference to null. if (m_database != null) m_database.removeTable(this); m_database = null; m_dataSource = null; m_objectID = null; } }
public class class_name { public TransactionConfidence seen(Sha256Hash hash, PeerAddress byPeer) { TransactionConfidence confidence; boolean fresh = false; lock.lock(); try { cleanTable(); confidence = getOrCreate(hash); fresh = confidence.markBroadcastBy(byPeer); } finally { lock.unlock(); } if (fresh) confidence.queueListeners(TransactionConfidence.Listener.ChangeReason.SEEN_PEERS); return confidence; } }
public class class_name { public TransactionConfidence seen(Sha256Hash hash, PeerAddress byPeer) { TransactionConfidence confidence; boolean fresh = false; lock.lock(); try { cleanTable(); // depends on control dependency: [try], data = [none] confidence = getOrCreate(hash); // depends on control dependency: [try], data = [none] fresh = confidence.markBroadcastBy(byPeer); // depends on control dependency: [try], data = [none] } finally { lock.unlock(); } if (fresh) confidence.queueListeners(TransactionConfidence.Listener.ChangeReason.SEEN_PEERS); return confidence; } }
public class class_name { boolean putIfMissing(Key key, V value){ if(containsKey(key)){ return false; } put(key, value); return true; } }
public class class_name { boolean putIfMissing(Key key, V value){ if(containsKey(key)){ return false; // depends on control dependency: [if], data = [none] } put(key, value); return true; } }
public class class_name { @Override public <T> void fire(T event, NonManagedObserver<T> nonManagedObserver) { Validate.notNull(event, "Event must be specified"); runtimeLogger.debug(event, true); // we start fresh pr new event handledThrowables.get().clear(); List<ObserverMethod> observers = resolveObservers(event.getClass()); List<ObserverMethod> interceptorObservers = resolveInterceptorObservers(event.getClass()); ApplicationContext context = (ApplicationContext) getScopedContext(ApplicationScoped.class); // We need to know if we were to the one to Activate it to avoid: // * nested ApplicationContexts // * ending the scope to soon (to low in the stack) boolean activatedApplicationContext = false; try { if (!context.isActive()) { context.activate(); activatedApplicationContext = true; } new EventContextImpl<T>(this, interceptorObservers, observers, nonManagedObserver, event, runtimeLogger).proceed(); } catch (Exception e) { Throwable fireException = e; if (fireException instanceof InvocationException) { fireException = fireException.getCause(); } if (handledThrowables.get().contains(fireException.getClass())) { UncheckedThrow.throwUnchecked(fireException); } else { fireException(fireException); } } finally { runtimeLogger.debug(event, false); if (activatedApplicationContext && context.isActive()) { context.deactivate(); } } } }
public class class_name { @Override public <T> void fire(T event, NonManagedObserver<T> nonManagedObserver) { Validate.notNull(event, "Event must be specified"); runtimeLogger.debug(event, true); // we start fresh pr new event handledThrowables.get().clear(); List<ObserverMethod> observers = resolveObservers(event.getClass()); List<ObserverMethod> interceptorObservers = resolveInterceptorObservers(event.getClass()); ApplicationContext context = (ApplicationContext) getScopedContext(ApplicationScoped.class); // We need to know if we were to the one to Activate it to avoid: // * nested ApplicationContexts // * ending the scope to soon (to low in the stack) boolean activatedApplicationContext = false; try { if (!context.isActive()) { context.activate(); // depends on control dependency: [if], data = [none] activatedApplicationContext = true; // depends on control dependency: [if], data = [none] } new EventContextImpl<T>(this, interceptorObservers, observers, nonManagedObserver, event, runtimeLogger).proceed(); // depends on control dependency: [try], data = [none] } catch (Exception e) { Throwable fireException = e; if (fireException instanceof InvocationException) { fireException = fireException.getCause(); // depends on control dependency: [if], data = [none] } if (handledThrowables.get().contains(fireException.getClass())) { UncheckedThrow.throwUnchecked(fireException); // depends on control dependency: [if], data = [none] } else { fireException(fireException); // depends on control dependency: [if], data = [none] } } finally { // depends on control dependency: [catch], data = [none] runtimeLogger.debug(event, false); if (activatedApplicationContext && context.isActive()) { context.deactivate(); // depends on control dependency: [if], data = [none] } } } }
public class class_name { private static int getLoggedinState(Context context, String uid) { Cursor cursor = context.getContentResolver().query( LOGGED_IN_URI.buildUpon().appendPath(uid).build(), null, // projection null, // selection clause null, // selection args null); // sort order if (cursor == null) { // DropboxApp not installed return NO_USER; } cursor.moveToFirst(); return cursor.getInt(cursor.getColumnIndex("logged_in")); } }
public class class_name { private static int getLoggedinState(Context context, String uid) { Cursor cursor = context.getContentResolver().query( LOGGED_IN_URI.buildUpon().appendPath(uid).build(), null, // projection null, // selection clause null, // selection args null); // sort order if (cursor == null) { // DropboxApp not installed return NO_USER; // depends on control dependency: [if], data = [none] } cursor.moveToFirst(); return cursor.getInt(cursor.getColumnIndex("logged_in")); } }
public class class_name { private void waitForCoordinator() { LOG.info("Waiting to be released by the coordinator"); try { lock.await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
public class class_name { private void waitForCoordinator() { LOG.info("Waiting to be released by the coordinator"); try { lock.await(); // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { Thread.currentThread().interrupt(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @NonNull @Override public Iterator<Node> iterator() { int i = nextIndex.get(); if (i >= nodes.length) { return Collections.<Node>emptyList().iterator(); } else { return Iterators.forArray(Arrays.copyOfRange(nodes, i, nodes.length, Node[].class)); } } }
public class class_name { @NonNull @Override public Iterator<Node> iterator() { int i = nextIndex.get(); if (i >= nodes.length) { return Collections.<Node>emptyList().iterator(); // depends on control dependency: [if], data = [none] } else { return Iterators.forArray(Arrays.copyOfRange(nodes, i, nodes.length, Node[].class)); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected long claimUpTo( int number ) { assert number > 0; long nextPosition = this.nextPosition; long maxPosition = nextPosition + number; long wrapPoint = maxPosition - bufferSize; long cachedSlowestConsumerPosition = this.slowestConsumerPosition; if (wrapPoint > cachedSlowestConsumerPosition || cachedSlowestConsumerPosition > nextPosition) { long minPosition; while (wrapPoint > (minPosition = positionOfSlowestPointer(nextPosition))) { // This takes on the order of tens of nanoseconds, so it's a useful activity to pause a bit. LockSupport.parkNanos(1L); waitStrategy.signalAllWhenBlocking(); } this.slowestConsumerPosition = minPosition; } this.nextPosition = maxPosition; return maxPosition; } }
public class class_name { protected long claimUpTo( int number ) { assert number > 0; long nextPosition = this.nextPosition; long maxPosition = nextPosition + number; long wrapPoint = maxPosition - bufferSize; long cachedSlowestConsumerPosition = this.slowestConsumerPosition; if (wrapPoint > cachedSlowestConsumerPosition || cachedSlowestConsumerPosition > nextPosition) { long minPosition; while (wrapPoint > (minPosition = positionOfSlowestPointer(nextPosition))) { // This takes on the order of tens of nanoseconds, so it's a useful activity to pause a bit. LockSupport.parkNanos(1L); // depends on control dependency: [while], data = [none] waitStrategy.signalAllWhenBlocking(); // depends on control dependency: [while], data = [none] } this.slowestConsumerPosition = minPosition; // depends on control dependency: [if], data = [none] } this.nextPosition = maxPosition; return maxPosition; } }
public class class_name { public void reload() { List<CmsResource> settingConfigResources = new ArrayList<>(); try { I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(TYPE_SETTINGS_CONFIG); CmsResourceFilter filter = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(type); settingConfigResources.addAll(m_cms.readResources("/", filter)); } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); } Map<CmsUUID, List<CmsXmlContentProperty>> settingConfigs = new HashMap<>(); for (CmsResource resource : settingConfigResources) { parseSettingsConfig(resource, settingConfigs); } m_settingConfigs = settingConfigs; List<CmsResource> formatterResources = new ArrayList<CmsResource>(); try { I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(TYPE_FORMATTER_CONFIG); CmsResourceFilter filter = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(type); formatterResources.addAll(m_cms.readResources("/", filter)); } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); } try { I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(TYPE_MACRO_FORMATTER); CmsResourceFilter filter = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(type); formatterResources.addAll(m_cms.readResources("/", filter)); I_CmsResourceType typeFlex = OpenCms.getResourceManager().getResourceType(TYPE_FLEX_FORMATTER); CmsResourceFilter filterFlex = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(typeFlex); formatterResources.addAll(m_cms.readResources("/", filterFlex)); I_CmsResourceType typeFunction = OpenCms.getResourceManager().getResourceType( CmsResourceTypeFunctionConfig.TYPE_NAME); CmsResourceFilter filterFunction = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(typeFunction); formatterResources.addAll(m_cms.readResources("/", filterFunction)); } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); } Map<CmsUUID, I_CmsFormatterBean> newFormatters = Maps.newHashMap(); for (CmsResource formatterResource : formatterResources) { I_CmsFormatterBean formatterBean = readFormatter(formatterResource.getStructureId()); if (formatterBean != null) { newFormatters.put(formatterResource.getStructureId(), formatterBean); } } m_state = new CmsFormatterConfigurationCacheState(newFormatters); } }
public class class_name { public void reload() { List<CmsResource> settingConfigResources = new ArrayList<>(); try { I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(TYPE_SETTINGS_CONFIG); CmsResourceFilter filter = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(type); settingConfigResources.addAll(m_cms.readResources("/", filter)); // depends on control dependency: [try], data = [none] } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); } // depends on control dependency: [catch], data = [none] Map<CmsUUID, List<CmsXmlContentProperty>> settingConfigs = new HashMap<>(); for (CmsResource resource : settingConfigResources) { parseSettingsConfig(resource, settingConfigs); // depends on control dependency: [for], data = [resource] } m_settingConfigs = settingConfigs; List<CmsResource> formatterResources = new ArrayList<CmsResource>(); try { I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(TYPE_FORMATTER_CONFIG); CmsResourceFilter filter = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(type); formatterResources.addAll(m_cms.readResources("/", filter)); // depends on control dependency: [try], data = [none] } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); } // depends on control dependency: [catch], data = [none] try { I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(TYPE_MACRO_FORMATTER); CmsResourceFilter filter = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(type); formatterResources.addAll(m_cms.readResources("/", filter)); // depends on control dependency: [try], data = [none] I_CmsResourceType typeFlex = OpenCms.getResourceManager().getResourceType(TYPE_FLEX_FORMATTER); CmsResourceFilter filterFlex = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(typeFlex); formatterResources.addAll(m_cms.readResources("/", filterFlex)); // depends on control dependency: [try], data = [none] I_CmsResourceType typeFunction = OpenCms.getResourceManager().getResourceType( CmsResourceTypeFunctionConfig.TYPE_NAME); CmsResourceFilter filterFunction = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(typeFunction); formatterResources.addAll(m_cms.readResources("/", filterFunction)); // depends on control dependency: [try], data = [none] } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); } // depends on control dependency: [catch], data = [none] Map<CmsUUID, I_CmsFormatterBean> newFormatters = Maps.newHashMap(); for (CmsResource formatterResource : formatterResources) { I_CmsFormatterBean formatterBean = readFormatter(formatterResource.getStructureId()); if (formatterBean != null) { newFormatters.put(formatterResource.getStructureId(), formatterBean); // depends on control dependency: [if], data = [none] } } m_state = new CmsFormatterConfigurationCacheState(newFormatters); } }
public class class_name { public Http2ClientChannel borrowChannel(Http2SourceHandler http2SrcHandler, HttpRoute httpRoute) { EventLoopPool eventLoopPool; String key = generateKey(httpRoute); EventLoopPool.PerRouteConnectionPool perRouteConnectionPool; if (http2SrcHandler != null) { eventLoopPool = getOrCreateEventLoopPool(http2SrcHandler.getChannelHandlerContext().channel().eventLoop()); perRouteConnectionPool = getOrCreatePerRoutePool(eventLoopPool, key); } else { if (eventLoops.isEmpty()) { return null; } eventLoopPool = getOrCreateEventLoopPool(eventLoops.peek()); perRouteConnectionPool = getOrCreatePerRoutePool(eventLoopPool, key); } Http2ClientChannel http2ClientChannel = null; if (perRouteConnectionPool != null) { http2ClientChannel = perRouteConnectionPool.fetchTargetChannel(); } return http2ClientChannel; } }
public class class_name { public Http2ClientChannel borrowChannel(Http2SourceHandler http2SrcHandler, HttpRoute httpRoute) { EventLoopPool eventLoopPool; String key = generateKey(httpRoute); EventLoopPool.PerRouteConnectionPool perRouteConnectionPool; if (http2SrcHandler != null) { eventLoopPool = getOrCreateEventLoopPool(http2SrcHandler.getChannelHandlerContext().channel().eventLoop()); // depends on control dependency: [if], data = [(http2SrcHandler] perRouteConnectionPool = getOrCreatePerRoutePool(eventLoopPool, key); // depends on control dependency: [if], data = [none] } else { if (eventLoops.isEmpty()) { return null; // depends on control dependency: [if], data = [none] } eventLoopPool = getOrCreateEventLoopPool(eventLoops.peek()); // depends on control dependency: [if], data = [none] perRouteConnectionPool = getOrCreatePerRoutePool(eventLoopPool, key); // depends on control dependency: [if], data = [none] } Http2ClientChannel http2ClientChannel = null; if (perRouteConnectionPool != null) { http2ClientChannel = perRouteConnectionPool.fetchTargetChannel(); // depends on control dependency: [if], data = [none] } return http2ClientChannel; } }
public class class_name { public void add(long readyTs, T value) { Object[] values = delayed.get(readyTs); // if one or more objects is already scheduled for given time if (values != null) { // make a list Object[] values2 = new Object[values.length + 1]; values2[0] = value; for (int i = 0; i < values.length; i++) { values2[i + 1] = values[i]; } values = values2; } else { values = new Object[] { value }; } delayed.put(readyTs, values); m_size++; } }
public class class_name { public void add(long readyTs, T value) { Object[] values = delayed.get(readyTs); // if one or more objects is already scheduled for given time if (values != null) { // make a list Object[] values2 = new Object[values.length + 1]; values2[0] = value; // depends on control dependency: [if], data = [none] for (int i = 0; i < values.length; i++) { values2[i + 1] = values[i]; // depends on control dependency: [for], data = [i] } values = values2; // depends on control dependency: [if], data = [none] } else { values = new Object[] { value }; // depends on control dependency: [if], data = [none] } delayed.put(readyTs, values); m_size++; } }
public class class_name { public double getSouth() { Double s = get(SOUTH); if (s != null) { return s; } return HMConstants.doubleNovalue; } }
public class class_name { public double getSouth() { Double s = get(SOUTH); if (s != null) { return s; // depends on control dependency: [if], data = [none] } return HMConstants.doubleNovalue; } }
public class class_name { private QueryBuilderKraken parseInsert() { Token token; if ((token = scanToken()) != Token.INTO) { throw error("expected INTO at '{0}'", token); } TableKraken table = parseTable(); Objects.requireNonNull(table); TableKelp tableKelp = table.getTableKelp(); ArrayList<Column> columns = new ArrayList<>(); boolean isKeyHash = false; if ((token = scanToken()) == Token.LPAREN) { do { String columnName = parseIdentifier(); Column column = tableKelp.getColumn(columnName); if (column == null) { throw error("'{0}' is not a valid column in {1}", columnName, table.getName()); } columns.add(column); } while ((token = scanToken()) == Token.COMMA); if (token != Token.RPAREN) { throw error("expected ')' at '{0}'", token); } token = scanToken(); } else { for (Column column : tableKelp.getColumns()) { if (column.name().startsWith(":")) { continue; } columns.add(column); } } if (token != Token.VALUES) throw error("expected VALUES at '{0}'", token); if ((token = scanToken()) != Token.LPAREN) { throw error("expected '(' at '{0}'", token); } ArrayList<ExprKraken> values = new ArrayList<>(); InsertQueryBuilder query; query = new InsertQueryBuilder(this, _sql, table, columns); _query = query; do { ExprKraken expr = parseExpr(); //expr = expr.bind(new TempQueryBuilder(table)); values.add(expr); } while ((token = scanToken()) == Token.COMMA); if (token != Token.RPAREN) { throw error("expected ')' at '{0}'", token); } if (columns.size() != values.size()) { throw error("number of columns does not match number of values"); } ParamExpr []params = _params.toArray(new ParamExpr[_params.size()]); query.setParams(params); query.setValues(values); // query.init(); return query; } }
public class class_name { private QueryBuilderKraken parseInsert() { Token token; if ((token = scanToken()) != Token.INTO) { throw error("expected INTO at '{0}'", token); } TableKraken table = parseTable(); Objects.requireNonNull(table); TableKelp tableKelp = table.getTableKelp(); ArrayList<Column> columns = new ArrayList<>(); boolean isKeyHash = false; if ((token = scanToken()) == Token.LPAREN) { do { String columnName = parseIdentifier(); Column column = tableKelp.getColumn(columnName); if (column == null) { throw error("'{0}' is not a valid column in {1}", columnName, table.getName()); } columns.add(column); } while ((token = scanToken()) == Token.COMMA); if (token != Token.RPAREN) { throw error("expected ')' at '{0}'", token); } token = scanToken(); // depends on control dependency: [if], data = [none] } else { for (Column column : tableKelp.getColumns()) { if (column.name().startsWith(":")) { continue; } columns.add(column); // depends on control dependency: [for], data = [column] } } if (token != Token.VALUES) throw error("expected VALUES at '{0}'", token); if ((token = scanToken()) != Token.LPAREN) { throw error("expected '(' at '{0}'", token); } ArrayList<ExprKraken> values = new ArrayList<>(); InsertQueryBuilder query; query = new InsertQueryBuilder(this, _sql, table, columns); _query = query; do { ExprKraken expr = parseExpr(); //expr = expr.bind(new TempQueryBuilder(table)); values.add(expr); } while ((token = scanToken()) == Token.COMMA); if (token != Token.RPAREN) { throw error("expected ')' at '{0}'", token); } if (columns.size() != values.size()) { throw error("number of columns does not match number of values"); } ParamExpr []params = _params.toArray(new ParamExpr[_params.size()]); query.setParams(params); query.setValues(values); // query.init(); return query; } }
public class class_name { private boolean checkSupportedAudio() { AudioHeader header = audioFile.getAudioHeader(); bitrate = header.getBitRateAsNumber(); sampleRate = header.getSampleRateAsNumber(); channels = header.getChannels(); if (header.getChannels().toLowerCase().contains("stereo")) { channels = "2"; } if (header instanceof MP3AudioHeader) { duration = ((MP3AudioHeader) header).getPreciseTrackLength(); } else if (header instanceof Mp4AudioHeader) { duration = (double) ((Mp4AudioHeader) header).getPreciseLength(); } else { duration = (double) header.getTrackLength(); } // generic frames Tag tag = audioFile.getTag(); artist = tag.getFirst(FieldKey.ARTIST); album = tag.getFirst(FieldKey.ALBUM); title = tag.getFirst(FieldKey.TITLE); comment = tag.getFirst(FieldKey.COMMENT); year = tag.getFirst(FieldKey.YEAR); track = tag.getFirst(FieldKey.TRACK); genre = tag.getFirst(FieldKey.GENRE); artwork = new ArrayList<>(); for (Artwork a : tag.getArtworkList()) { AudioMetadataArtwork ama = new AudioMetadataArtwork(); ama.setMimeType(a.getMimeType()); if (a.getPictureType() >= 0) { ama.setType(a.getPictureType()); } ama.setData(a.getBinaryData()); artwork.add(ama); } return true; } }
public class class_name { private boolean checkSupportedAudio() { AudioHeader header = audioFile.getAudioHeader(); bitrate = header.getBitRateAsNumber(); sampleRate = header.getSampleRateAsNumber(); channels = header.getChannels(); if (header.getChannels().toLowerCase().contains("stereo")) { channels = "2"; // depends on control dependency: [if], data = [none] } if (header instanceof MP3AudioHeader) { duration = ((MP3AudioHeader) header).getPreciseTrackLength(); // depends on control dependency: [if], data = [none] } else if (header instanceof Mp4AudioHeader) { duration = (double) ((Mp4AudioHeader) header).getPreciseLength(); // depends on control dependency: [if], data = [none] } else { duration = (double) header.getTrackLength(); // depends on control dependency: [if], data = [none] } // generic frames Tag tag = audioFile.getTag(); artist = tag.getFirst(FieldKey.ARTIST); album = tag.getFirst(FieldKey.ALBUM); title = tag.getFirst(FieldKey.TITLE); comment = tag.getFirst(FieldKey.COMMENT); year = tag.getFirst(FieldKey.YEAR); track = tag.getFirst(FieldKey.TRACK); genre = tag.getFirst(FieldKey.GENRE); artwork = new ArrayList<>(); for (Artwork a : tag.getArtworkList()) { AudioMetadataArtwork ama = new AudioMetadataArtwork(); ama.setMimeType(a.getMimeType()); // depends on control dependency: [for], data = [a] if (a.getPictureType() >= 0) { ama.setType(a.getPictureType()); // depends on control dependency: [if], data = [(a.getPictureType()] } ama.setData(a.getBinaryData()); // depends on control dependency: [for], data = [a] artwork.add(ama); // depends on control dependency: [for], data = [a] } return true; } }
public class class_name { @Override protected DoubleMatrix1D getUb() { if (this.limitedUb == null) { if (super.getUb() == null) { this.limitedUb = F1.make(getC().size(), maxUBValue); } else { this.limitedUb = F1.make(super.getUb().size()); for (int i = 0; i < super.getUb().size(); i++) { double ubi = super.getUb().getQuick(i); if (maxUBValue < ubi) { log.warn("the " + i +"-th upper bound was limited form "+ubi+" to the value of maxUBValue: " + maxUBValue); limitedUb.setQuick(i, maxUBValue); } else { limitedUb.setQuick(i, ubi); } } } } return limitedUb; } }
public class class_name { @Override protected DoubleMatrix1D getUb() { if (this.limitedUb == null) { if (super.getUb() == null) { this.limitedUb = F1.make(getC().size(), maxUBValue); // depends on control dependency: [if], data = [none] } else { this.limitedUb = F1.make(super.getUb().size()); // depends on control dependency: [if], data = [(super.getUb()] for (int i = 0; i < super.getUb().size(); i++) { double ubi = super.getUb().getQuick(i); if (maxUBValue < ubi) { log.warn("the " + i +"-th upper bound was limited form "+ubi+" to the value of maxUBValue: " + maxUBValue); // depends on control dependency: [if], data = [none] limitedUb.setQuick(i, maxUBValue); // depends on control dependency: [if], data = [none] } else { limitedUb.setQuick(i, ubi); // depends on control dependency: [if], data = [ubi)] } } } } return limitedUb; } }
public class class_name { public void close() { if (_isClosed) { return; } _isClosed = true; KelpManager backing = _kelpBacking; // _localBacking = null; if (backing != null) { backing.close(); } } }
public class class_name { public void close() { if (_isClosed) { return; // depends on control dependency: [if], data = [none] } _isClosed = true; KelpManager backing = _kelpBacking; // _localBacking = null; if (backing != null) { backing.close(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public Optional<MasterSlaveRule> findMasterSlaveRule(final String dataSourceName) { for (MasterSlaveRule each : masterSlaveRules) { if (each.containDataSourceName(dataSourceName)) { return Optional.of(each); } } return Optional.absent(); } }
public class class_name { public Optional<MasterSlaveRule> findMasterSlaveRule(final String dataSourceName) { for (MasterSlaveRule each : masterSlaveRules) { if (each.containDataSourceName(dataSourceName)) { return Optional.of(each); // depends on control dependency: [if], data = [none] } } return Optional.absent(); } }
public class class_name { public final Future<InetAddress> resolve(String inetHost, Iterable<DnsRecord> additionals, Promise<InetAddress> promise) { checkNotNull(promise, "promise"); DnsRecord[] additionalsArray = toArray(additionals, true); try { doResolve(inetHost, additionalsArray, promise, resolveCache); return promise; } catch (Exception e) { return promise.setFailure(e); } } }
public class class_name { public final Future<InetAddress> resolve(String inetHost, Iterable<DnsRecord> additionals, Promise<InetAddress> promise) { checkNotNull(promise, "promise"); DnsRecord[] additionalsArray = toArray(additionals, true); try { doResolve(inetHost, additionalsArray, promise, resolveCache); // depends on control dependency: [try], data = [none] return promise; // depends on control dependency: [try], data = [none] } catch (Exception e) { return promise.setFailure(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void updateRecordMetrics() { for (Optional<Fork> fork : this.forks.keySet()) { if (fork.isPresent()) { fork.get().updateRecordMetrics(); } } } }
public class class_name { public void updateRecordMetrics() { for (Optional<Fork> fork : this.forks.keySet()) { if (fork.isPresent()) { fork.get().updateRecordMetrics(); // depends on control dependency: [if], data = [none] } } } }
public class class_name { protected List asMultiStringWrapperList(StringWrapperIterator i) { List buffer = new ArrayList(); while (i.hasNext()) { StringWrapper w = i.nextStringWrapper(); MultiStringWrapper mw = asMultiStringWrapper(w); buffer.add(mw); } return buffer; } }
public class class_name { protected List asMultiStringWrapperList(StringWrapperIterator i) { List buffer = new ArrayList(); while (i.hasNext()) { StringWrapper w = i.nextStringWrapper(); MultiStringWrapper mw = asMultiStringWrapper(w); buffer.add(mw); // depends on control dependency: [while], data = [none] } return buffer; } }
public class class_name { final boolean isAnyChildIgnored() { if (isAnyChildIgnored == null) { isAnyChildIgnored = false; for (RecursableDiffEntity entity : childEntities()) { if ((entity.isIgnored() && !entity.isContentEmpty()) || entity.isAnyChildIgnored()) { isAnyChildIgnored = true; break; } } } return isAnyChildIgnored; } }
public class class_name { final boolean isAnyChildIgnored() { if (isAnyChildIgnored == null) { isAnyChildIgnored = false; // depends on control dependency: [if], data = [none] for (RecursableDiffEntity entity : childEntities()) { if ((entity.isIgnored() && !entity.isContentEmpty()) || entity.isAnyChildIgnored()) { isAnyChildIgnored = true; // depends on control dependency: [if], data = [none] break; } } } return isAnyChildIgnored; } }
public class class_name { public void parse2DJSON(String str) { for (String latlon : str.split("\\[")) { if (latlon.trim().length() == 0) continue; String ll[] = latlon.split(","); String lat = ll[1].replace("]", "").trim(); add(Double.parseDouble(lat), Double.parseDouble(ll[0].trim()), Double.NaN); } } }
public class class_name { public void parse2DJSON(String str) { for (String latlon : str.split("\\[")) { if (latlon.trim().length() == 0) continue; String ll[] = latlon.split(","); String lat = ll[1].replace("]", "").trim(); add(Double.parseDouble(lat), Double.parseDouble(ll[0].trim()), Double.NaN); // depends on control dependency: [for], data = [none] } } }
public class class_name { @Override public Query query(Schema schema) { BooleanQuery luceneQuery = new BooleanQuery(); luceneQuery.setBoost(boost); for (Condition query : must) { luceneQuery.add(query.query(schema), Occur.MUST); } for (Condition query : should) { luceneQuery.add(query.query(schema), Occur.SHOULD); } for (Condition query : not) { luceneQuery.add(query.query(schema), Occur.MUST_NOT); } return luceneQuery; } }
public class class_name { @Override public Query query(Schema schema) { BooleanQuery luceneQuery = new BooleanQuery(); luceneQuery.setBoost(boost); for (Condition query : must) { luceneQuery.add(query.query(schema), Occur.MUST); // depends on control dependency: [for], data = [query] } for (Condition query : should) { luceneQuery.add(query.query(schema), Occur.SHOULD); // depends on control dependency: [for], data = [query] } for (Condition query : not) { luceneQuery.add(query.query(schema), Occur.MUST_NOT); // depends on control dependency: [for], data = [query] } return luceneQuery; } }
public class class_name { @SuppressWarnings("null") public byte[] toByteArray(final ArrayOfItemsSerDe<T> serDe) { final int preLongs; final int outBytes; final boolean empty = isEmpty(); final int activeItems = getNumActiveItems(); byte[] bytes = null; if (empty) { preLongs = 1; outBytes = 8; } else { preLongs = Family.FREQUENCY.getMaxPreLongs(); bytes = serDe.serializeToByteArray(hashMap.getActiveKeys()); outBytes = ((preLongs + activeItems) << 3) + bytes.length; } final byte[] outArr = new byte[outBytes]; final WritableMemory mem = WritableMemory.wrap(outArr); // build first preLong empty or not long pre0 = 0L; pre0 = insertPreLongs(preLongs, pre0); //Byte 0 pre0 = insertSerVer(SER_VER, pre0); //Byte 1 pre0 = insertFamilyID(Family.FREQUENCY.getID(), pre0); //Byte 2 pre0 = insertLgMaxMapSize(lgMaxMapSize, pre0); //Byte 3 pre0 = insertLgCurMapSize(hashMap.getLgLength(), pre0); //Byte 4 pre0 = empty ? insertFlags(EMPTY_FLAG_MASK, pre0) : insertFlags(0, pre0); //Byte 5 if (empty) { mem.putLong(0, pre0); } else { final long pre = 0; final long[] preArr = new long[preLongs]; preArr[0] = pre0; preArr[1] = insertActiveItems(activeItems, pre); preArr[2] = this.streamWeight; preArr[3] = this.offset; mem.putLongArray(0, preArr, 0, preLongs); final int preBytes = preLongs << 3; mem.putLongArray(preBytes, hashMap.getActiveValues(), 0, activeItems); mem.putByteArray(preBytes + (this.getNumActiveItems() << 3), bytes, 0, bytes.length); } return outArr; } }
public class class_name { @SuppressWarnings("null") public byte[] toByteArray(final ArrayOfItemsSerDe<T> serDe) { final int preLongs; final int outBytes; final boolean empty = isEmpty(); final int activeItems = getNumActiveItems(); byte[] bytes = null; if (empty) { preLongs = 1; // depends on control dependency: [if], data = [none] outBytes = 8; // depends on control dependency: [if], data = [none] } else { preLongs = Family.FREQUENCY.getMaxPreLongs(); // depends on control dependency: [if], data = [none] bytes = serDe.serializeToByteArray(hashMap.getActiveKeys()); // depends on control dependency: [if], data = [none] outBytes = ((preLongs + activeItems) << 3) + bytes.length; // depends on control dependency: [if], data = [none] } final byte[] outArr = new byte[outBytes]; final WritableMemory mem = WritableMemory.wrap(outArr); // build first preLong empty or not long pre0 = 0L; pre0 = insertPreLongs(preLongs, pre0); //Byte 0 pre0 = insertSerVer(SER_VER, pre0); //Byte 1 pre0 = insertFamilyID(Family.FREQUENCY.getID(), pre0); //Byte 2 pre0 = insertLgMaxMapSize(lgMaxMapSize, pre0); //Byte 3 pre0 = insertLgCurMapSize(hashMap.getLgLength(), pre0); //Byte 4 pre0 = empty ? insertFlags(EMPTY_FLAG_MASK, pre0) : insertFlags(0, pre0); //Byte 5 if (empty) { mem.putLong(0, pre0); // depends on control dependency: [if], data = [none] } else { final long pre = 0; final long[] preArr = new long[preLongs]; preArr[0] = pre0; // depends on control dependency: [if], data = [none] preArr[1] = insertActiveItems(activeItems, pre); // depends on control dependency: [if], data = [none] preArr[2] = this.streamWeight; // depends on control dependency: [if], data = [none] preArr[3] = this.offset; // depends on control dependency: [if], data = [none] mem.putLongArray(0, preArr, 0, preLongs); // depends on control dependency: [if], data = [none] final int preBytes = preLongs << 3; mem.putLongArray(preBytes, hashMap.getActiveValues(), 0, activeItems); // depends on control dependency: [if], data = [none] mem.putByteArray(preBytes + (this.getNumActiveItems() << 3), bytes, 0, bytes.length); // depends on control dependency: [if], data = [none] } return outArr; } }
public class class_name { public static Bitmap load(String path) { try { File fi = new File(path); if (fi.isDirectory() || !fi.exists()) { return null; } return load(new FileInputStream(path), -1, -1); } catch (Exception e) { Log.e(TAG, "", e); return null; } } }
public class class_name { public static Bitmap load(String path) { try { File fi = new File(path); if (fi.isDirectory() || !fi.exists()) { return null; // depends on control dependency: [if], data = [none] } return load(new FileInputStream(path), -1, -1); // depends on control dependency: [try], data = [none] } catch (Exception e) { Log.e(TAG, "", e); return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static LinkedHashMap<String, String> extractTags(String s) { LinkedHashMap<String, String> map = Maps.newLinkedHashMap(); int c = s.lastIndexOf(CHECKSUM_DELIMITER); if (c == -1) { return map; } s = s.substring(0, c); String[] items = s.split(PARAMETER_DELIMITER); for (String item : items) { int i = item.indexOf(CODE_DELIMITER); if (i == -1) throw new NmeaMessageParseException( "TAG BLOCK parameter is not is format 'a:b' :" + s); map.put(item.substring(0, i), item.substring(i + 1)); } return map; } }
public class class_name { public static LinkedHashMap<String, String> extractTags(String s) { LinkedHashMap<String, String> map = Maps.newLinkedHashMap(); int c = s.lastIndexOf(CHECKSUM_DELIMITER); if (c == -1) { return map; // depends on control dependency: [if], data = [none] } s = s.substring(0, c); String[] items = s.split(PARAMETER_DELIMITER); for (String item : items) { int i = item.indexOf(CODE_DELIMITER); if (i == -1) throw new NmeaMessageParseException( "TAG BLOCK parameter is not is format 'a:b' :" + s); map.put(item.substring(0, i), item.substring(i + 1)); // depends on control dependency: [for], data = [item] } return map; } }
public class class_name { @Override public V put(K key, V value) { BinarySet<Entry<K,V>> es = (BinarySet<Entry<K,V>>) entrySet; Entry<K,V> oldEntry = es.addEntry(entry(key, value)); if (oldEntry != null) { return oldEntry.getValue(); } return null; } }
public class class_name { @Override public V put(K key, V value) { BinarySet<Entry<K,V>> es = (BinarySet<Entry<K,V>>) entrySet; Entry<K,V> oldEntry = es.addEntry(entry(key, value)); if (oldEntry != null) { return oldEntry.getValue(); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public Future emit(String event, T... args) { ConcurrentLinkedQueue<Listener> callbacks = this.callbacks.get(event); if (callbacks != null) { callbacks = new ConcurrentLinkedQueue<Listener>(callbacks); for (Listener fn : callbacks) { fn.call(args); } } return null; } }
public class class_name { public Future emit(String event, T... args) { ConcurrentLinkedQueue<Listener> callbacks = this.callbacks.get(event); if (callbacks != null) { callbacks = new ConcurrentLinkedQueue<Listener>(callbacks); // depends on control dependency: [if], data = [(callbacks] for (Listener fn : callbacks) { fn.call(args); // depends on control dependency: [for], data = [fn] } } return null; } }
public class class_name { public void marshall(ElasticsearchClusterConfig elasticsearchClusterConfig, ProtocolMarshaller protocolMarshaller) { if (elasticsearchClusterConfig == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(elasticsearchClusterConfig.getInstanceType(), INSTANCETYPE_BINDING); protocolMarshaller.marshall(elasticsearchClusterConfig.getInstanceCount(), INSTANCECOUNT_BINDING); protocolMarshaller.marshall(elasticsearchClusterConfig.getDedicatedMasterEnabled(), DEDICATEDMASTERENABLED_BINDING); protocolMarshaller.marshall(elasticsearchClusterConfig.getZoneAwarenessEnabled(), ZONEAWARENESSENABLED_BINDING); protocolMarshaller.marshall(elasticsearchClusterConfig.getZoneAwarenessConfig(), ZONEAWARENESSCONFIG_BINDING); protocolMarshaller.marshall(elasticsearchClusterConfig.getDedicatedMasterType(), DEDICATEDMASTERTYPE_BINDING); protocolMarshaller.marshall(elasticsearchClusterConfig.getDedicatedMasterCount(), DEDICATEDMASTERCOUNT_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ElasticsearchClusterConfig elasticsearchClusterConfig, ProtocolMarshaller protocolMarshaller) { if (elasticsearchClusterConfig == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(elasticsearchClusterConfig.getInstanceType(), INSTANCETYPE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(elasticsearchClusterConfig.getInstanceCount(), INSTANCECOUNT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(elasticsearchClusterConfig.getDedicatedMasterEnabled(), DEDICATEDMASTERENABLED_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(elasticsearchClusterConfig.getZoneAwarenessEnabled(), ZONEAWARENESSENABLED_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(elasticsearchClusterConfig.getZoneAwarenessConfig(), ZONEAWARENESSCONFIG_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(elasticsearchClusterConfig.getDedicatedMasterType(), DEDICATEDMASTERTYPE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(elasticsearchClusterConfig.getDedicatedMasterCount(), DEDICATEDMASTERCOUNT_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 Short getAsShort(String key) { Object value = mValues.get(key); try { return value != null ? ((Number) value).shortValue() : null; } catch (ClassCastException e) { if (value instanceof CharSequence) { try { return Short.valueOf(value.toString()); } catch (NumberFormatException e2) { DLog.e(TAG, "Cannot parse Short value for " + value + " at key " + key); return null; } } else { DLog.e(TAG, "Cannot cast value for " + key + " to a Short: " + value, e); return null; } } } }
public class class_name { public Short getAsShort(String key) { Object value = mValues.get(key); try { return value != null ? ((Number) value).shortValue() : null; // depends on control dependency: [try], data = [none] } catch (ClassCastException e) { if (value instanceof CharSequence) { try { return Short.valueOf(value.toString()); // depends on control dependency: [try], data = [none] } catch (NumberFormatException e2) { DLog.e(TAG, "Cannot parse Short value for " + value + " at key " + key); return null; } // depends on control dependency: [catch], data = [none] } else { DLog.e(TAG, "Cannot cast value for " + key + " to a Short: " + value, e); // depends on control dependency: [if], data = [none] return null; // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] } }
public class class_name { protected String fixedInput ( String type, String name, Object value, String extra) { StringBuilder buf = new StringBuilder(); buf.append("<input type=\"").append(type).append("\""); buf.append(" name=\"").append(name).append("\""); buf.append(" value=\"").append(value).append("\""); if (!StringUtil.isBlank(extra)) { buf.append(" ").append(extra); } buf.append(getCloseBrace()); return buf.toString(); } }
public class class_name { protected String fixedInput ( String type, String name, Object value, String extra) { StringBuilder buf = new StringBuilder(); buf.append("<input type=\"").append(type).append("\""); buf.append(" name=\"").append(name).append("\""); buf.append(" value=\"").append(value).append("\""); if (!StringUtil.isBlank(extra)) { buf.append(" ").append(extra); // depends on control dependency: [if], data = [none] } buf.append(getCloseBrace()); return buf.toString(); } }
public class class_name { public ICalComponentScribe<? extends ICalComponent> getComponentScribe(ICalComponent component) { if (component instanceof RawComponent) { RawComponent raw = (RawComponent) component; return new RawComponentScribe(raw.getName()); } return getComponentScribe(component.getClass()); } }
public class class_name { public ICalComponentScribe<? extends ICalComponent> getComponentScribe(ICalComponent component) { if (component instanceof RawComponent) { RawComponent raw = (RawComponent) component; return new RawComponentScribe(raw.getName()); // depends on control dependency: [if], data = [none] } return getComponentScribe(component.getClass()); } }
public class class_name { private boolean datatypeMatches(Datatype d1, Datatype d2) { assert (d1.getFeature() == d2.getFeature()); AbstractLiteral lhsLit = d1.getLiteral(); AbstractLiteral rhsLit = d2.getLiteral(); Operator lhsOp = d1.getOperator(); Operator rhsOp = d2.getOperator(); if (rhsOp == Operator.EQUALS) { // If the rhs operator is =, then the expression will only match // if the lhs operator is also = and the literal values are the // same. if(lhsOp != Operator.EQUALS) { return false; } else { return d1.getLiteral().equals(d2.getLiteral()); } } else if (rhsOp == Operator.GREATER_THAN) { if (lhsOp == Operator.LESS_THAN || lhsOp == Operator.LESS_THAN_EQUALS) { return false; } else if (lhsOp == Operator.EQUALS) { if (compareLiterals(lhsLit, rhsLit) > 0) { return true; } else { return false; } } else if (lhsOp == Operator.GREATER_THAN) { if (compareLiterals(lhsLit, rhsLit) >= 0) { return true; } else { return false; } } else if (lhsOp == Operator.GREATER_THAN_EQUALS) { if (compareLiterals(lhsLit, rhsLit) > 0) { return true; } else { return false; } } } else if (rhsOp == Operator.GREATER_THAN_EQUALS) { if (lhsOp == Operator.LESS_THAN || lhsOp == Operator.LESS_THAN_EQUALS) { return false; } else if (lhsOp == Operator.EQUALS) { if (compareLiterals(lhsLit, rhsLit) >= 0) { return true; } else { return false; } } else if (lhsOp == Operator.GREATER_THAN) { if (compareLiterals(lhsLit, rhsLit) >= -1) { return true; } else { return false; } } else if (lhsOp == Operator.GREATER_THAN_EQUALS) { if (compareLiterals(lhsLit, rhsLit) >= 0) { return true; } else { return false; } } } else if (rhsOp == Operator.LESS_THAN) { if (lhsOp == Operator.GREATER_THAN || lhsOp == Operator.GREATER_THAN_EQUALS) { return false; } else if (lhsOp == Operator.EQUALS) { if (compareLiterals(lhsLit, rhsLit) < 0) { return true; } else { return false; } } else if (lhsOp == Operator.LESS_THAN) { if (compareLiterals(lhsLit, rhsLit) <= 0) { return true; } else { return false; } } else if (lhsOp == Operator.LESS_THAN_EQUALS) { if (compareLiterals(lhsLit, rhsLit) < 0) { return true; } else { return false; } } } else if (rhsOp == Operator.LESS_THAN_EQUALS) { if (lhsOp == Operator.GREATER_THAN || lhsOp == Operator.GREATER_THAN_EQUALS) { return false; } else if (lhsOp == Operator.EQUALS) { if (compareLiterals(lhsLit, rhsLit) <= 0) { return true; } else { return false; } } else if (lhsOp == Operator.LESS_THAN) { if (compareLiterals(lhsLit, rhsLit) <= 1) { return true; } else { return false; } } else if (lhsOp == Operator.LESS_THAN_EQUALS) { if (compareLiterals(lhsLit, rhsLit) <= 0) { return true; } else { return false; } } } return d1.getLiteral().equals(d2.getLiteral()); } }
public class class_name { private boolean datatypeMatches(Datatype d1, Datatype d2) { assert (d1.getFeature() == d2.getFeature()); AbstractLiteral lhsLit = d1.getLiteral(); AbstractLiteral rhsLit = d2.getLiteral(); Operator lhsOp = d1.getOperator(); Operator rhsOp = d2.getOperator(); if (rhsOp == Operator.EQUALS) { // If the rhs operator is =, then the expression will only match // if the lhs operator is also = and the literal values are the // same. if(lhsOp != Operator.EQUALS) { return false; // depends on control dependency: [if], data = [none] } else { return d1.getLiteral().equals(d2.getLiteral()); // depends on control dependency: [if], data = [none] } } else if (rhsOp == Operator.GREATER_THAN) { if (lhsOp == Operator.LESS_THAN || lhsOp == Operator.LESS_THAN_EQUALS) { return false; // depends on control dependency: [if], data = [none] } else if (lhsOp == Operator.EQUALS) { if (compareLiterals(lhsLit, rhsLit) > 0) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } else if (lhsOp == Operator.GREATER_THAN) { if (compareLiterals(lhsLit, rhsLit) >= 0) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } else if (lhsOp == Operator.GREATER_THAN_EQUALS) { if (compareLiterals(lhsLit, rhsLit) > 0) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } } else if (rhsOp == Operator.GREATER_THAN_EQUALS) { if (lhsOp == Operator.LESS_THAN || lhsOp == Operator.LESS_THAN_EQUALS) { return false; // depends on control dependency: [if], data = [none] } else if (lhsOp == Operator.EQUALS) { if (compareLiterals(lhsLit, rhsLit) >= 0) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } else if (lhsOp == Operator.GREATER_THAN) { if (compareLiterals(lhsLit, rhsLit) >= -1) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } else if (lhsOp == Operator.GREATER_THAN_EQUALS) { if (compareLiterals(lhsLit, rhsLit) >= 0) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } } else if (rhsOp == Operator.LESS_THAN) { if (lhsOp == Operator.GREATER_THAN || lhsOp == Operator.GREATER_THAN_EQUALS) { return false; // depends on control dependency: [if], data = [none] } else if (lhsOp == Operator.EQUALS) { if (compareLiterals(lhsLit, rhsLit) < 0) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } else if (lhsOp == Operator.LESS_THAN) { if (compareLiterals(lhsLit, rhsLit) <= 0) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } else if (lhsOp == Operator.LESS_THAN_EQUALS) { if (compareLiterals(lhsLit, rhsLit) < 0) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } } else if (rhsOp == Operator.LESS_THAN_EQUALS) { if (lhsOp == Operator.GREATER_THAN || lhsOp == Operator.GREATER_THAN_EQUALS) { return false; // depends on control dependency: [if], data = [none] } else if (lhsOp == Operator.EQUALS) { if (compareLiterals(lhsLit, rhsLit) <= 0) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } else if (lhsOp == Operator.LESS_THAN) { if (compareLiterals(lhsLit, rhsLit) <= 1) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } else if (lhsOp == Operator.LESS_THAN_EQUALS) { if (compareLiterals(lhsLit, rhsLit) <= 0) { return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } } return d1.getLiteral().equals(d2.getLiteral()); } }
public class class_name { public static IAsyncProvider getInstance() { if (instance != null) { return instance; } try { return createInstance(); } catch (AsyncException x) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Error getting async provider instance, exception: " + x.getMessage()); } FFDCFilter.processException(x, "com.ibm.io.async.AsyncLibrary", "331"); return null; } } }
public class class_name { public static IAsyncProvider getInstance() { if (instance != null) { return instance; // depends on control dependency: [if], data = [none] } try { return createInstance(); // depends on control dependency: [try], data = [none] } catch (AsyncException x) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Error getting async provider instance, exception: " + x.getMessage()); // depends on control dependency: [if], data = [none] } FFDCFilter.processException(x, "com.ibm.io.async.AsyncLibrary", "331"); return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public void encodeBegin(FacesContext context, UIComponent component) throws IOException { if (!component.isRendered()) { return; } Label label = (Label) component; ResponseWriter rw = context.getResponseWriter(); String clientId = label.getClientId(); boolean idHasBeenRendered = false; String sev = label.getSeverity(); String txt = label.getValue(); if (txt == null) { txt = label.getText(); } // add responsive style String clazz = Responsive.getResponsiveStyleClass(label, false).trim(); boolean isResponsive = clazz.length() > 0; if (isResponsive) { rw.startElement("div", label); rw.writeAttribute("class", clazz, null); rw.writeAttribute("id", clientId, "id"); idHasBeenRendered = true; } rw.startElement("span", label); if (!idHasBeenRendered) { rw.writeAttribute("id", clientId, "id"); } Tooltip.generateTooltip(context, label, rw); String sclass = "label" + " " + "label"; if (sev != null) { sclass += "-" + sev; } else { sclass += "-default"; } String styleClass = label.getStyleClass(); sclass += styleClass != null ? " " + styleClass : ""; rw.writeAttribute("class", sclass, "class"); String style = label.getStyle(); if (isResponsive) { if (null == style) { style = "display:block"; } else { style += ";display:block"; } } if (style != null) rw.writeAttribute("style", style, "style"); rw.writeText(txt, null); rw.endElement("span"); if (isResponsive) { rw.endElement("div"); } Tooltip.activateTooltips(context, label); } }
public class class_name { @Override public void encodeBegin(FacesContext context, UIComponent component) throws IOException { if (!component.isRendered()) { return; } Label label = (Label) component; ResponseWriter rw = context.getResponseWriter(); String clientId = label.getClientId(); boolean idHasBeenRendered = false; String sev = label.getSeverity(); String txt = label.getValue(); if (txt == null) { txt = label.getText(); } // add responsive style String clazz = Responsive.getResponsiveStyleClass(label, false).trim(); boolean isResponsive = clazz.length() > 0; if (isResponsive) { rw.startElement("div", label); rw.writeAttribute("class", clazz, null); rw.writeAttribute("id", clientId, "id"); idHasBeenRendered = true; } rw.startElement("span", label); if (!idHasBeenRendered) { rw.writeAttribute("id", clientId, "id"); } Tooltip.generateTooltip(context, label, rw); String sclass = "label" + " " + "label"; if (sev != null) { sclass += "-" + sev; } else { sclass += "-default"; } String styleClass = label.getStyleClass(); sclass += styleClass != null ? " " + styleClass : ""; rw.writeAttribute("class", sclass, "class"); String style = label.getStyle(); if (isResponsive) { if (null == style) { style = "display:block"; // depends on control dependency: [if], data = [none] } else { style += ";display:block"; // depends on control dependency: [if], data = [none] } } if (style != null) rw.writeAttribute("style", style, "style"); rw.writeText(txt, null); rw.endElement("span"); if (isResponsive) { rw.endElement("div"); } Tooltip.activateTooltips(context, label); } }
public class class_name { @Override public boolean exists() { URL url; if (this.clazz != null) { url = this.clazz.getResource(this.path); } else { url = this.classLoader.getResource(this.path); } return (url != null); } }
public class class_name { @Override public boolean exists() { URL url; if (this.clazz != null) { url = this.clazz.getResource(this.path); // depends on control dependency: [if], data = [none] } else { url = this.classLoader.getResource(this.path); // depends on control dependency: [if], data = [none] } return (url != null); } }
public class class_name { public void set(final Exception e) { if (this.value.compareAndSet(null, e)) { this.listeners.clear(); this.cdl.countDown(); } } }
public class class_name { public void set(final Exception e) { if (this.value.compareAndSet(null, e)) { this.listeners.clear(); // depends on control dependency: [if], data = [none] this.cdl.countDown(); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public void solve(DMatrixRMaj B, DMatrixRMaj X) { if( B.numRows != numRows ) throw new IllegalArgumentException("Unexpected dimensions for X: X rows = "+X.numRows+" expected = "+numCols); X.reshape(numCols,B.numCols); int BnumCols = B.numCols; // solve each column one by one for( int colB = 0; colB < BnumCols; colB++ ) { // make a copy of this column in the vector for( int i = 0; i < numRows; i++ ) { a[i] = B.data[i*BnumCols + colB]; } // Solve Qa=b // a = Q'b // a = Q_{n-1}...Q_2*Q_1*b // // Q_n*b = (I-gamma*u*u^T)*b = b - u*(gamma*U^T*b) for( int n = 0; n < numCols; n++ ) { u[n] = 1; double ub = a[n]; // U^T*b for( int i = n+1; i < numRows; i++ ) { ub += (u[i] = QR.unsafe_get(i,n))*a[i]; } // gamma*U^T*b ub *= gammas[n]; for( int i = n; i < numRows; i++ ) { a[i] -= u[i]*ub; } } // solve for Rx = b using the standard upper triangular solver TriangularSolver_DDRM.solveU(QR.data,a,numCols); // save the results for( int i = 0; i < numCols; i++ ) { X.data[i*X.numCols+colB] = a[i]; } } } }
public class class_name { @Override public void solve(DMatrixRMaj B, DMatrixRMaj X) { if( B.numRows != numRows ) throw new IllegalArgumentException("Unexpected dimensions for X: X rows = "+X.numRows+" expected = "+numCols); X.reshape(numCols,B.numCols); int BnumCols = B.numCols; // solve each column one by one for( int colB = 0; colB < BnumCols; colB++ ) { // make a copy of this column in the vector for( int i = 0; i < numRows; i++ ) { a[i] = B.data[i*BnumCols + colB]; // depends on control dependency: [for], data = [i] } // Solve Qa=b // a = Q'b // a = Q_{n-1}...Q_2*Q_1*b // // Q_n*b = (I-gamma*u*u^T)*b = b - u*(gamma*U^T*b) for( int n = 0; n < numCols; n++ ) { u[n] = 1; // depends on control dependency: [for], data = [n] double ub = a[n]; // U^T*b for( int i = n+1; i < numRows; i++ ) { ub += (u[i] = QR.unsafe_get(i,n))*a[i]; // depends on control dependency: [for], data = [i] } // gamma*U^T*b ub *= gammas[n]; // depends on control dependency: [for], data = [n] for( int i = n; i < numRows; i++ ) { a[i] -= u[i]*ub; // depends on control dependency: [for], data = [i] } } // solve for Rx = b using the standard upper triangular solver TriangularSolver_DDRM.solveU(QR.data,a,numCols); // depends on control dependency: [for], data = [none] // save the results for( int i = 0; i < numCols; i++ ) { X.data[i*X.numCols+colB] = a[i]; // depends on control dependency: [for], data = [i] } } } }
public class class_name { public static Builder fromPropertyFileOrSystemProperties(String filename, CharsetDecoder decoder) { Properties properties = new Properties(); if (filename != null && filename.length() > 0) { try { properties.load(new InputStreamReader(new FileInputStream(filename), decoder)); } catch (Exception e) { log.debug("Trying system properties - unable to read properties file: " + filename); } } return fromProperties(properties, "", true); } }
public class class_name { public static Builder fromPropertyFileOrSystemProperties(String filename, CharsetDecoder decoder) { Properties properties = new Properties(); if (filename != null && filename.length() > 0) { try { properties.load(new InputStreamReader(new FileInputStream(filename), decoder)); // depends on control dependency: [try], data = [none] } catch (Exception e) { log.debug("Trying system properties - unable to read properties file: " + filename); } // depends on control dependency: [catch], data = [none] } return fromProperties(properties, "", true); } }
public class class_name { public static String getClientId(Connection connection) { String clientId = null; try { clientId = connection == null ? null : connection.getClientID(); } catch (JMSException e) {} return clientId; } }
public class class_name { public static String getClientId(Connection connection) { String clientId = null; try { clientId = connection == null ? null : connection.getClientID(); // depends on control dependency: [try], data = [none] } catch (JMSException e) {} // depends on control dependency: [catch], data = [none] return clientId; } }
public class class_name { void close() { if (logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER, logger.getName(), "close", "Close called for " + RESTClientMessagesUtil.getObjID(this) + " within connection: " + connector.getConnectionId()); } closePollingThread(); if (notificationRegistry != null) { notificationRegistry.close(); } if (connector.logFailovers()) { String disconnectMsg = RESTClientMessagesUtil.getMessage(RESTClientMessagesUtil.MEMBER_DISCONNECT, connector.getCurrentEndpoint()); logger.logp(Level.INFO, logger.getName(), "close", disconnectMsg); } disconnect(); } }
public class class_name { void close() { if (logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER, logger.getName(), "close", "Close called for " + RESTClientMessagesUtil.getObjID(this) + " within connection: " + connector.getConnectionId()); // depends on control dependency: [if], data = [none] } closePollingThread(); if (notificationRegistry != null) { notificationRegistry.close(); // depends on control dependency: [if], data = [none] } if (connector.logFailovers()) { String disconnectMsg = RESTClientMessagesUtil.getMessage(RESTClientMessagesUtil.MEMBER_DISCONNECT, connector.getCurrentEndpoint()); logger.logp(Level.INFO, logger.getName(), "close", disconnectMsg); // depends on control dependency: [if], data = [none] } disconnect(); } }
public class class_name { public static boolean isPublicField(Object obj, String name) { Class<?> clazz = obj.getClass(); try { Field f = clazz.getDeclaredField(name); return Modifier.isPublic(f.getModifiers()); } catch (NoSuchFieldException e) { return false; } } }
public class class_name { public static boolean isPublicField(Object obj, String name) { Class<?> clazz = obj.getClass(); try { Field f = clazz.getDeclaredField(name); return Modifier.isPublic(f.getModifiers()); // depends on control dependency: [try], data = [none] } catch (NoSuchFieldException e) { return false; } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override protected IIOMetadataNode getStandardChromaNode() { IIOMetadataNode chroma = new IIOMetadataNode("Chroma"); IIOMetadataNode colorSpaceType = new IIOMetadataNode("ColorSpaceType"); String cs; switch (header.mode) { case PSD.COLOR_MODE_BITMAP: case PSD.COLOR_MODE_GRAYSCALE: case PSD.COLOR_MODE_DUOTONE: // Rationale: Spec says treat as gray... cs = "GRAY"; break; case PSD.COLOR_MODE_RGB: case PSD.COLOR_MODE_INDEXED: cs = "RGB"; break; case PSD.COLOR_MODE_CMYK: cs = "CMYK"; break; case PSD.COLOR_MODE_MULTICHANNEL: cs = getMultiChannelCS(header.channels); break; case PSD.COLOR_MODE_LAB: cs = "Lab"; break; default: throw new AssertionError("Unreachable"); } colorSpaceType.setAttribute("name", cs); chroma.appendChild(colorSpaceType); // TODO: Channels might be 5 for RGB + A + Mask... Probably not correct IIOMetadataNode numChannels = new IIOMetadataNode("NumChannels"); numChannels.setAttribute("value", Integer.toString(header.channels)); chroma.appendChild(numChannels); IIOMetadataNode blackIsZero = new IIOMetadataNode("BlackIsZero"); blackIsZero.setAttribute("value", "true"); chroma.appendChild(blackIsZero); if (header.mode == PSD.COLOR_MODE_INDEXED) { IIOMetadataNode paletteNode = createPaletteNode(); chroma.appendChild(paletteNode); } // TODO: Use // if (bKGD_present) { // if (bKGD_colorType == PNGImageReader.PNG_COLOR_PALETTE) { // node = new IIOMetadataNode("BackgroundIndex"); // node.setAttribute("value", Integer.toString(bKGD_index)); // } else { // node = new IIOMetadataNode("BackgroundColor"); // int r, g, b; // // if (bKGD_colorType == PNGImageReader.PNG_COLOR_GRAY) { // r = g = b = bKGD_gray; // } else { // r = bKGD_red; // g = bKGD_green; // b = bKGD_blue; // } // node.setAttribute("red", Integer.toString(r)); // node.setAttribute("green", Integer.toString(g)); // node.setAttribute("blue", Integer.toString(b)); // } // chroma_node.appendChild(node); // } return chroma; } }
public class class_name { @Override protected IIOMetadataNode getStandardChromaNode() { IIOMetadataNode chroma = new IIOMetadataNode("Chroma"); IIOMetadataNode colorSpaceType = new IIOMetadataNode("ColorSpaceType"); String cs; switch (header.mode) { case PSD.COLOR_MODE_BITMAP: case PSD.COLOR_MODE_GRAYSCALE: case PSD.COLOR_MODE_DUOTONE: // Rationale: Spec says treat as gray... cs = "GRAY"; break; case PSD.COLOR_MODE_RGB: case PSD.COLOR_MODE_INDEXED: cs = "RGB"; break; case PSD.COLOR_MODE_CMYK: cs = "CMYK"; break; case PSD.COLOR_MODE_MULTICHANNEL: cs = getMultiChannelCS(header.channels); break; case PSD.COLOR_MODE_LAB: cs = "Lab"; break; default: throw new AssertionError("Unreachable"); } colorSpaceType.setAttribute("name", cs); chroma.appendChild(colorSpaceType); // TODO: Channels might be 5 for RGB + A + Mask... Probably not correct IIOMetadataNode numChannels = new IIOMetadataNode("NumChannels"); numChannels.setAttribute("value", Integer.toString(header.channels)); chroma.appendChild(numChannels); IIOMetadataNode blackIsZero = new IIOMetadataNode("BlackIsZero"); blackIsZero.setAttribute("value", "true"); chroma.appendChild(blackIsZero); if (header.mode == PSD.COLOR_MODE_INDEXED) { IIOMetadataNode paletteNode = createPaletteNode(); chroma.appendChild(paletteNode); // depends on control dependency: [if], data = [none] } // TODO: Use // if (bKGD_present) { // if (bKGD_colorType == PNGImageReader.PNG_COLOR_PALETTE) { // node = new IIOMetadataNode("BackgroundIndex"); // node.setAttribute("value", Integer.toString(bKGD_index)); // } else { // node = new IIOMetadataNode("BackgroundColor"); // int r, g, b; // // if (bKGD_colorType == PNGImageReader.PNG_COLOR_GRAY) { // r = g = b = bKGD_gray; // } else { // r = bKGD_red; // g = bKGD_green; // b = bKGD_blue; // } // node.setAttribute("red", Integer.toString(r)); // node.setAttribute("green", Integer.toString(g)); // node.setAttribute("blue", Integer.toString(b)); // } // chroma_node.appendChild(node); // } return chroma; } }
public class class_name { private BeanDeploymentArchive createNewBdaAndMakeWiring(Class<?> beanClass) { try { OnDemandArchive onDemandArchive = new OnDemandArchive(cdiRuntime, application, beanClass); WebSphereBeanDeploymentArchive newBda = BDAFactory.createBDA(this, onDemandArchive, cdiRuntime); ClassLoader beanClassCL = onDemandArchive.getClassLoader(); // need to make this bda to be accessible to other bdas according to classloader hierarchy for (WebSphereBeanDeploymentArchive wbda : getWebSphereBeanDeploymentArchives()) { ClassLoader thisBDACL = wbda.getClassLoader(); //If the current archive is an extension bda, let's add this newly created bda accessible to it if (wbda.getType() == ArchiveType.RUNTIME_EXTENSION) { newBda.addBeanDeploymentArchive(wbda); } else { //let's check to see whether the wbda needs to be accessible to this new bda //The current bda should be accessible to the newly created bda if the newly created bda's classloader // is the same or the child classloader of the current bda makeWiring(newBda, wbda, thisBDACL, beanClassCL); } if ((wbda.getType() == ArchiveType.RUNTIME_EXTENSION) && wbda.extensionCanSeeApplicationBDAs()) { wbda.addBeanDeploymentArchive(newBda); } else { //Let's check whether the wbda's classloader is the descendant classloader of the new bda makeWiring(wbda, newBda, beanClassCL, thisBDACL); } } //Add this new bda to the deployment graph addBeanDeploymentArchive(newBda); return newBda; } catch (CDIException e) { throw new IllegalStateException(e); } } }
public class class_name { private BeanDeploymentArchive createNewBdaAndMakeWiring(Class<?> beanClass) { try { OnDemandArchive onDemandArchive = new OnDemandArchive(cdiRuntime, application, beanClass); WebSphereBeanDeploymentArchive newBda = BDAFactory.createBDA(this, onDemandArchive, cdiRuntime); ClassLoader beanClassCL = onDemandArchive.getClassLoader(); // need to make this bda to be accessible to other bdas according to classloader hierarchy for (WebSphereBeanDeploymentArchive wbda : getWebSphereBeanDeploymentArchives()) { ClassLoader thisBDACL = wbda.getClassLoader(); //If the current archive is an extension bda, let's add this newly created bda accessible to it if (wbda.getType() == ArchiveType.RUNTIME_EXTENSION) { newBda.addBeanDeploymentArchive(wbda); // depends on control dependency: [if], data = [none] } else { //let's check to see whether the wbda needs to be accessible to this new bda //The current bda should be accessible to the newly created bda if the newly created bda's classloader // is the same or the child classloader of the current bda makeWiring(newBda, wbda, thisBDACL, beanClassCL); // depends on control dependency: [if], data = [none] } if ((wbda.getType() == ArchiveType.RUNTIME_EXTENSION) && wbda.extensionCanSeeApplicationBDAs()) { wbda.addBeanDeploymentArchive(newBda); // depends on control dependency: [if], data = [none] } else { //Let's check whether the wbda's classloader is the descendant classloader of the new bda makeWiring(wbda, newBda, beanClassCL, thisBDACL); // depends on control dependency: [if], data = [none] } } //Add this new bda to the deployment graph addBeanDeploymentArchive(newBda); // depends on control dependency: [try], data = [none] return newBda; // depends on control dependency: [try], data = [none] } catch (CDIException e) { throw new IllegalStateException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public long[] sampleNumbers(Track track) { if ("vide".equals(track.getHandler())) { if (track.getSyncSamples() != null && track.getSyncSamples().length > 0) { List<long[]> times = getSyncSamplesTimestamps(movie, track); return getCommonIndices(track.getSyncSamples(), getTimes(track, movie), track.getTrackMetaData().getTimescale(), times.toArray(new long[times.size()][])); } else { throw new RuntimeException("Video Tracks need sync samples. Only tracks other than video may have no sync samples."); } } else if ("soun".equals(track.getHandler())) { if (referenceTrack == null) { for (Track candidate : movie.getTracks()) { if (candidate.getSyncSamples() != null && "vide".equals(candidate.getHandler()) && candidate.getSyncSamples().length > 0) { referenceTrack = candidate; } } } if (referenceTrack != null) { // Gets the reference track's fra long[] refSyncSamples = sampleNumbers(referenceTrack); int refSampleCount = referenceTrack.getSamples().size(); long[] syncSamples = new long[refSyncSamples.length]; long minSampleRate = 192000; for (Track testTrack : movie.getTracks()) { if (getFormat(track).equals(getFormat(testTrack))) { AudioSampleEntry ase = null; for (SampleEntry sampleEntry : testTrack.getSampleEntries()) { if (ase == null) { ase = (AudioSampleEntry) sampleEntry; } else if (ase.getSampleRate() != ((AudioSampleEntry) sampleEntry).getSampleRate()) { throw new RuntimeException("Multiple SampleEntries and different sample rates is not supported"); } } assert ase != null; if (ase.getSampleRate() < minSampleRate) { minSampleRate = ase.getSampleRate(); long sc = testTrack.getSamples().size(); double stretch = (double) sc / refSampleCount; long samplesPerFrame = testTrack.getSampleDurations()[0]; // Assuming all audio tracks have the same number of samples per frame, which they do for all known types for (int i = 0; i < syncSamples.length; i++) { long start = (long) Math.ceil(stretch * (refSyncSamples[i] - 1) * samplesPerFrame); syncSamples[i] = start; // The Stretch makes sure that there are as much audio and video chunks! } break; } } } AudioSampleEntry ase = null; for (SampleEntry sampleEntry : track.getSampleEntries()) { if (ase == null) { ase = (AudioSampleEntry) sampleEntry; } else if (ase.getSampleRate() != ((AudioSampleEntry) sampleEntry).getSampleRate()) { throw new RuntimeException("Multiple SampleEntries and different sample rates is not supported"); } } assert ase != null; long samplesPerFrame = track.getSampleDurations()[0]; // Assuming all audio tracks have the same number of samples per frame, which they do for all known types double factor = (double) ase.getSampleRate() / (double) minSampleRate; if (factor != Math.rint(factor)) { // Not an integer throw new RuntimeException("Sample rates must be a multiple of the lowest sample rate to create a correct file!"); } for (int i = 0; i < syncSamples.length; i++) { syncSamples[i] = (long) (1 + syncSamples[i] * factor / (double) samplesPerFrame); } return syncSamples; } throw new RuntimeException("There was absolutely no Track with sync samples. I can't work with that!"); } else { // Ok, my track has no sync samples - let's find one with sync samples. for (Track candidate : movie.getTracks()) { if (candidate.getSyncSamples() != null && candidate.getSyncSamples().length > 0) { long[] refSyncSamples = sampleNumbers(candidate); int refSampleCount = candidate.getSamples().size(); long[] syncSamples = new long[refSyncSamples.length]; long sc = track.getSamples().size(); double stretch = (double) sc / refSampleCount; for (int i = 0; i < syncSamples.length; i++) { long start = (long) Math.ceil(stretch * (refSyncSamples[i] - 1)) + 1; syncSamples[i] = start; // The Stretch makes sure that there are as much audio and video chunks! } return syncSamples; } } throw new RuntimeException("There was absolutely no Track with sync samples. I can't work with that!"); } } }
public class class_name { public long[] sampleNumbers(Track track) { if ("vide".equals(track.getHandler())) { if (track.getSyncSamples() != null && track.getSyncSamples().length > 0) { List<long[]> times = getSyncSamplesTimestamps(movie, track); return getCommonIndices(track.getSyncSamples(), getTimes(track, movie), track.getTrackMetaData().getTimescale(), times.toArray(new long[times.size()][])); // depends on control dependency: [if], data = [(track.getSyncSamples()] } else { throw new RuntimeException("Video Tracks need sync samples. Only tracks other than video may have no sync samples."); } } else if ("soun".equals(track.getHandler())) { if (referenceTrack == null) { for (Track candidate : movie.getTracks()) { if (candidate.getSyncSamples() != null && "vide".equals(candidate.getHandler()) && candidate.getSyncSamples().length > 0) { referenceTrack = candidate; // depends on control dependency: [if], data = [none] } } } if (referenceTrack != null) { // Gets the reference track's fra long[] refSyncSamples = sampleNumbers(referenceTrack); int refSampleCount = referenceTrack.getSamples().size(); long[] syncSamples = new long[refSyncSamples.length]; long minSampleRate = 192000; for (Track testTrack : movie.getTracks()) { if (getFormat(track).equals(getFormat(testTrack))) { AudioSampleEntry ase = null; for (SampleEntry sampleEntry : testTrack.getSampleEntries()) { if (ase == null) { ase = (AudioSampleEntry) sampleEntry; // depends on control dependency: [if], data = [none] } else if (ase.getSampleRate() != ((AudioSampleEntry) sampleEntry).getSampleRate()) { throw new RuntimeException("Multiple SampleEntries and different sample rates is not supported"); } } assert ase != null; if (ase.getSampleRate() < minSampleRate) { minSampleRate = ase.getSampleRate(); // depends on control dependency: [if], data = [none] long sc = testTrack.getSamples().size(); double stretch = (double) sc / refSampleCount; long samplesPerFrame = testTrack.getSampleDurations()[0]; // Assuming all audio tracks have the same number of samples per frame, which they do for all known types for (int i = 0; i < syncSamples.length; i++) { long start = (long) Math.ceil(stretch * (refSyncSamples[i] - 1) * samplesPerFrame); syncSamples[i] = start; // depends on control dependency: [for], data = [i] // The Stretch makes sure that there are as much audio and video chunks! } break; } } } AudioSampleEntry ase = null; for (SampleEntry sampleEntry : track.getSampleEntries()) { if (ase == null) { ase = (AudioSampleEntry) sampleEntry; // depends on control dependency: [if], data = [none] } else if (ase.getSampleRate() != ((AudioSampleEntry) sampleEntry).getSampleRate()) { throw new RuntimeException("Multiple SampleEntries and different sample rates is not supported"); } } assert ase != null; long samplesPerFrame = track.getSampleDurations()[0]; // Assuming all audio tracks have the same number of samples per frame, which they do for all known types double factor = (double) ase.getSampleRate() / (double) minSampleRate; if (factor != Math.rint(factor)) { // Not an integer throw new RuntimeException("Sample rates must be a multiple of the lowest sample rate to create a correct file!"); } for (int i = 0; i < syncSamples.length; i++) { syncSamples[i] = (long) (1 + syncSamples[i] * factor / (double) samplesPerFrame); // depends on control dependency: [for], data = [i] } return syncSamples; // depends on control dependency: [if], data = [none] } throw new RuntimeException("There was absolutely no Track with sync samples. I can't work with that!"); } else { // Ok, my track has no sync samples - let's find one with sync samples. for (Track candidate : movie.getTracks()) { if (candidate.getSyncSamples() != null && candidate.getSyncSamples().length > 0) { long[] refSyncSamples = sampleNumbers(candidate); int refSampleCount = candidate.getSamples().size(); long[] syncSamples = new long[refSyncSamples.length]; long sc = track.getSamples().size(); double stretch = (double) sc / refSampleCount; for (int i = 0; i < syncSamples.length; i++) { long start = (long) Math.ceil(stretch * (refSyncSamples[i] - 1)) + 1; syncSamples[i] = start; // depends on control dependency: [for], data = [i] // The Stretch makes sure that there are as much audio and video chunks! } return syncSamples; // depends on control dependency: [if], data = [none] } } throw new RuntimeException("There was absolutely no Track with sync samples. I can't work with that!"); } } }
public class class_name { public void addUploadFile(HttpServletRequest request, UploadFile uploadFile) { if (uploadFile == null) return; try{ HttpSession session = request.getSession(true); Collection uploadList = (Collection)session.getAttribute(PIC_NAME_PACKAGE); if (uploadList == null) { uploadList = new ArrayList(); session.setAttribute(PIC_NAME_PACKAGE, uploadList); } uploadList.add(uploadFile); uploadFile.setTempId(Integer.toString(uploadList.size() - 1)); //临时给予id }catch(Exception ex){ Debug.logError("[JdonFramework]addUploadFile error:" + ex, module); } } }
public class class_name { public void addUploadFile(HttpServletRequest request, UploadFile uploadFile) { if (uploadFile == null) return; try{ HttpSession session = request.getSession(true); Collection uploadList = (Collection)session.getAttribute(PIC_NAME_PACKAGE); if (uploadList == null) { uploadList = new ArrayList(); // depends on control dependency: [if], data = [none] session.setAttribute(PIC_NAME_PACKAGE, uploadList); // depends on control dependency: [if], data = [none] } uploadList.add(uploadFile); // depends on control dependency: [try], data = [none] uploadFile.setTempId(Integer.toString(uploadList.size() - 1)); //临时给予id // depends on control dependency: [try], data = [none] }catch(Exception ex){ Debug.logError("[JdonFramework]addUploadFile error:" + ex, module); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void marshall(RejectSharedDirectoryRequest rejectSharedDirectoryRequest, ProtocolMarshaller protocolMarshaller) { if (rejectSharedDirectoryRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(rejectSharedDirectoryRequest.getSharedDirectoryId(), SHAREDDIRECTORYID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(RejectSharedDirectoryRequest rejectSharedDirectoryRequest, ProtocolMarshaller protocolMarshaller) { if (rejectSharedDirectoryRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(rejectSharedDirectoryRequest.getSharedDirectoryId(), SHAREDDIRECTORYID_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 ServiceInstance choose(String serviceId, Object hint) { Server server = getServer(getLoadBalancer(serviceId), hint); if (server == null) { return null; } return new RibbonServer(serviceId, server, isSecure(server, serviceId), serverIntrospector(serviceId).getMetadata(server)); } }
public class class_name { public ServiceInstance choose(String serviceId, Object hint) { Server server = getServer(getLoadBalancer(serviceId), hint); if (server == null) { return null; // depends on control dependency: [if], data = [none] } return new RibbonServer(serviceId, server, isSecure(server, serviceId), serverIntrospector(serviceId).getMetadata(server)); } }
public class class_name { public List<JAXBElement<Object>> get_GenericApplicationPropertyOfParameterizedTexture() { if (_GenericApplicationPropertyOfParameterizedTexture == null) { _GenericApplicationPropertyOfParameterizedTexture = new ArrayList<JAXBElement<Object>>(); } return this._GenericApplicationPropertyOfParameterizedTexture; } }
public class class_name { public List<JAXBElement<Object>> get_GenericApplicationPropertyOfParameterizedTexture() { if (_GenericApplicationPropertyOfParameterizedTexture == null) { _GenericApplicationPropertyOfParameterizedTexture = new ArrayList<JAXBElement<Object>>(); // depends on control dependency: [if], data = [none] } return this._GenericApplicationPropertyOfParameterizedTexture; } }
public class class_name { public boolean supports(final String committeeReport,final String rm) { for (final ViewRiksdagenCommitteeBallotDecisionPartySummary summary : ballotDecisions) { if (summary.getRm().equalsIgnoreCase(rm) && summary.getCommitteeReport().equalsIgnoreCase(committeeReport)) { return summary.isPartyApproved(); } } return false; } }
public class class_name { public boolean supports(final String committeeReport,final String rm) { for (final ViewRiksdagenCommitteeBallotDecisionPartySummary summary : ballotDecisions) { if (summary.getRm().equalsIgnoreCase(rm) && summary.getCommitteeReport().equalsIgnoreCase(committeeReport)) { return summary.isPartyApproved(); // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { private CmsPublishGroupPanel addGroupPanel(CmsPublishGroup group, int currentIndex) { String header = group.getName(); CmsPublishGroupPanel groupPanel = new CmsPublishGroupPanel( group, header, currentIndex, this, m_model, m_selectionControllers, getContextMenuHandler(), getEditorHandler(), m_showProblemsOnly); if (m_model.hasSingleGroup()) { groupPanel.hideGroupSelectCheckBox(); } m_groupPanels.add(groupPanel); m_groupPanelContainer.add(groupPanel); return groupPanel; } }
public class class_name { private CmsPublishGroupPanel addGroupPanel(CmsPublishGroup group, int currentIndex) { String header = group.getName(); CmsPublishGroupPanel groupPanel = new CmsPublishGroupPanel( group, header, currentIndex, this, m_model, m_selectionControllers, getContextMenuHandler(), getEditorHandler(), m_showProblemsOnly); if (m_model.hasSingleGroup()) { groupPanel.hideGroupSelectCheckBox(); // depends on control dependency: [if], data = [none] } m_groupPanels.add(groupPanel); m_groupPanelContainer.add(groupPanel); return groupPanel; } }
public class class_name { public void unregisterAllTaskManagers() { for(Instance instance: registeredHostsById.values()) { deadHosts.add(instance.getTaskManagerID()); instance.markDead(); totalNumberOfAliveTaskSlots -= instance.getTotalNumberOfSlots(); notifyDeadInstance(instance); } registeredHostsById.clear(); registeredHostsByResource.clear(); } }
public class class_name { public void unregisterAllTaskManagers() { for(Instance instance: registeredHostsById.values()) { deadHosts.add(instance.getTaskManagerID()); // depends on control dependency: [for], data = [instance] instance.markDead(); // depends on control dependency: [for], data = [instance] totalNumberOfAliveTaskSlots -= instance.getTotalNumberOfSlots(); // depends on control dependency: [for], data = [instance] notifyDeadInstance(instance); // depends on control dependency: [for], data = [instance] } registeredHostsById.clear(); registeredHostsByResource.clear(); } }
public class class_name { public Period normalizedStandard(PeriodType type) { type = DateTimeUtils.getPeriodType(type); long millis = getMillis(); // no overflow can happen, even with Integer.MAX_VALUEs millis += (((long) getSeconds()) * ((long) DateTimeConstants.MILLIS_PER_SECOND)); millis += (((long) getMinutes()) * ((long) DateTimeConstants.MILLIS_PER_MINUTE)); millis += (((long) getHours()) * ((long) DateTimeConstants.MILLIS_PER_HOUR)); millis += (((long) getDays()) * ((long) DateTimeConstants.MILLIS_PER_DAY)); millis += (((long) getWeeks()) * ((long) DateTimeConstants.MILLIS_PER_WEEK)); Period result = new Period(millis, type, ISOChronology.getInstanceUTC()); int years = getYears(); int months = getMonths(); if (years != 0 || months != 0) { long totalMonths = years * 12L + months; if (type.isSupported(DurationFieldType.YEARS_TYPE)) { int normalizedYears = FieldUtils.safeToInt(totalMonths / 12); result = result.withYears(normalizedYears); totalMonths = totalMonths - (normalizedYears * 12); } if (type.isSupported(DurationFieldType.MONTHS_TYPE)) { int normalizedMonths = FieldUtils.safeToInt(totalMonths); result = result.withMonths(normalizedMonths); totalMonths = totalMonths - normalizedMonths; } if (totalMonths != 0) { throw new UnsupportedOperationException("Unable to normalize as PeriodType is missing either years or months but period has a month/year amount: " + toString()); } } return result; } }
public class class_name { public Period normalizedStandard(PeriodType type) { type = DateTimeUtils.getPeriodType(type); long millis = getMillis(); // no overflow can happen, even with Integer.MAX_VALUEs millis += (((long) getSeconds()) * ((long) DateTimeConstants.MILLIS_PER_SECOND)); millis += (((long) getMinutes()) * ((long) DateTimeConstants.MILLIS_PER_MINUTE)); millis += (((long) getHours()) * ((long) DateTimeConstants.MILLIS_PER_HOUR)); millis += (((long) getDays()) * ((long) DateTimeConstants.MILLIS_PER_DAY)); millis += (((long) getWeeks()) * ((long) DateTimeConstants.MILLIS_PER_WEEK)); Period result = new Period(millis, type, ISOChronology.getInstanceUTC()); int years = getYears(); int months = getMonths(); if (years != 0 || months != 0) { long totalMonths = years * 12L + months; if (type.isSupported(DurationFieldType.YEARS_TYPE)) { int normalizedYears = FieldUtils.safeToInt(totalMonths / 12); result = result.withYears(normalizedYears); // depends on control dependency: [if], data = [none] totalMonths = totalMonths - (normalizedYears * 12); // depends on control dependency: [if], data = [none] } if (type.isSupported(DurationFieldType.MONTHS_TYPE)) { int normalizedMonths = FieldUtils.safeToInt(totalMonths); result = result.withMonths(normalizedMonths); // depends on control dependency: [if], data = [none] totalMonths = totalMonths - normalizedMonths; // depends on control dependency: [if], data = [none] } if (totalMonths != 0) { throw new UnsupportedOperationException("Unable to normalize as PeriodType is missing either years or months but period has a month/year amount: " + toString()); } } return result; } }
public class class_name { protected void invalidateConnection(boolean notifyPeer, Throwable throwable, String debugReason) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "invalidateConnection", new Object[]{new Boolean(notifyPeer), throwable, debugReason}); if (con != null) { ConnectionInterface connection = con.getConnectionReference(); if (connection != null) { connection.invalidate(notifyPeer, throwable, debugReason); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "invalidateConnection"); } }
public class class_name { protected void invalidateConnection(boolean notifyPeer, Throwable throwable, String debugReason) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "invalidateConnection", new Object[]{new Boolean(notifyPeer), throwable, debugReason}); if (con != null) { ConnectionInterface connection = con.getConnectionReference(); if (connection != null) { connection.invalidate(notifyPeer, throwable, debugReason); // depends on control dependency: [if], data = [none] } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "invalidateConnection"); } }
public class class_name { @Deprecated public static RequestQueue getRequestQueue(Context context) { if (InstanceRequestQueue == null) { InstanceRequestQueue = newRequestQueue(context); } return InstanceRequestQueue; } }
public class class_name { @Deprecated public static RequestQueue getRequestQueue(Context context) { if (InstanceRequestQueue == null) { InstanceRequestQueue = newRequestQueue(context); // depends on control dependency: [if], data = [none] } return InstanceRequestQueue; } }
public class class_name { @SuppressWarnings("unchecked") static <E, M extends BinderMapper<E>> M getMapper(Class<E> cls) { M mapper = (M) OBJECT_MAPPERS.get(cls); if (mapper == null) { // The only way the mapper wouldn't already be loaded into // OBJECT_MAPPERS is if it was compiled separately, but let's handle // it anyway String beanClassName = cls.getName(); String mapperClassName = cls.getName() + KriptonBinder.MAPPER_CLASS_SUFFIX; try { Class<E> mapperClass = (Class<E>) Class.forName(mapperClassName); mapper = (M) mapperClass.newInstance(); // mapper. OBJECT_MAPPERS.put(cls, mapper); } catch (ClassNotFoundException e) { e.printStackTrace(); throw new KriptonRuntimeException(String.format("Class '%s' does not exist. Does '%s' have @BindType annotation?", mapperClassName, beanClassName)); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } return mapper; } }
public class class_name { @SuppressWarnings("unchecked") static <E, M extends BinderMapper<E>> M getMapper(Class<E> cls) { M mapper = (M) OBJECT_MAPPERS.get(cls); if (mapper == null) { // The only way the mapper wouldn't already be loaded into // OBJECT_MAPPERS is if it was compiled separately, but let's handle // it anyway String beanClassName = cls.getName(); String mapperClassName = cls.getName() + KriptonBinder.MAPPER_CLASS_SUFFIX; try { Class<E> mapperClass = (Class<E>) Class.forName(mapperClassName); // depends on control dependency: [try], data = [none] mapper = (M) mapperClass.newInstance(); // depends on control dependency: [try], data = [none] // mapper. OBJECT_MAPPERS.put(cls, mapper); // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException e) { e.printStackTrace(); throw new KriptonRuntimeException(String.format("Class '%s' does not exist. Does '%s' have @BindType annotation?", mapperClassName, beanClassName)); } catch (InstantiationException e) { // depends on control dependency: [catch], data = [none] e.printStackTrace(); } catch (IllegalAccessException e) { // depends on control dependency: [catch], data = [none] e.printStackTrace(); } // depends on control dependency: [catch], data = [none] } return mapper; } }
public class class_name { public synchronized void release() { if (_in!=null) { try{_in.close();}catch(IOException e){LogSupport.ignore(log,e);} _in=null; } if (_connection!=null) _connection=null; } }
public class class_name { public synchronized void release() { if (_in!=null) { try{_in.close();}catch(IOException e){LogSupport.ignore(log,e);} // depends on control dependency: [try], data = [none] // depends on control dependency: [catch], data = [none] _in=null; // depends on control dependency: [if], data = [none] } if (_connection!=null) _connection=null; } }
public class class_name { private ExpressionNode readLogicalOR() { final List<ExpressionNode> ops = new ArrayList<ExpressionNode>(); ops.add(readLogicalAND()); while (true) { int savepoint = filter.position(); if (filter.hasSignificantSubSequence(LogicalOperator.OR.getOperatorString())) { ops.add(readLogicalAND()); } else { filter.setPosition(savepoint); break; } } return 1 == ops.size() ? ops.get(0) : LogicalExpressionNode.createLogicalOr(ops); } }
public class class_name { private ExpressionNode readLogicalOR() { final List<ExpressionNode> ops = new ArrayList<ExpressionNode>(); ops.add(readLogicalAND()); while (true) { int savepoint = filter.position(); if (filter.hasSignificantSubSequence(LogicalOperator.OR.getOperatorString())) { ops.add(readLogicalAND()); // depends on control dependency: [if], data = [none] } else { filter.setPosition(savepoint); // depends on control dependency: [if], data = [none] break; } } return 1 == ops.size() ? ops.get(0) : LogicalExpressionNode.createLogicalOr(ops); } }
public class class_name { protected void createBulge( int x1 , double p , double scale , boolean byAngle ) { double b11 = diag[x1]; double b12 = off[x1]; double b22 = diag[x1+1]; if( byAngle ) { c = Math.cos(p); s = Math.sin(p); } else { // normalize to improve resistance to overflow/underflow double u1 = (b11/scale)*(b11/scale)-p; double u2 = (b12/scale)*(b11/scale); double gamma = Math.sqrt(u1*u1 + u2*u2); c = u1/gamma; s = u2/gamma; } // multiply the rotator on the top left. diag[x1] = b11*c + b12*s; off[x1] = b12*c - b11*s; diag[x1+1] = b22*c; bulge = b22*s; // SimpleMatrix Q = createQ(x1, c, s, false); // B=B.mult(Q); // // B.print(); // printMatrix(); // System.out.println(" bulge = "+bulge); if( Vt != null ) { updateRotator(Vt,x1,x1+1,c,s); // SimpleMatrix.wrap(Ut).mult(B).mult(SimpleMatrix.wrap(Vt).transpose()).print(); // printMatrix(); // System.out.println("bulge = "+bulge); // System.out.println(); } } }
public class class_name { protected void createBulge( int x1 , double p , double scale , boolean byAngle ) { double b11 = diag[x1]; double b12 = off[x1]; double b22 = diag[x1+1]; if( byAngle ) { c = Math.cos(p); // depends on control dependency: [if], data = [none] s = Math.sin(p); // depends on control dependency: [if], data = [none] } else { // normalize to improve resistance to overflow/underflow double u1 = (b11/scale)*(b11/scale)-p; double u2 = (b12/scale)*(b11/scale); double gamma = Math.sqrt(u1*u1 + u2*u2); c = u1/gamma; // depends on control dependency: [if], data = [none] s = u2/gamma; // depends on control dependency: [if], data = [none] } // multiply the rotator on the top left. diag[x1] = b11*c + b12*s; off[x1] = b12*c - b11*s; diag[x1+1] = b22*c; bulge = b22*s; // SimpleMatrix Q = createQ(x1, c, s, false); // B=B.mult(Q); // // B.print(); // printMatrix(); // System.out.println(" bulge = "+bulge); if( Vt != null ) { updateRotator(Vt,x1,x1+1,c,s); // depends on control dependency: [if], data = [none] // SimpleMatrix.wrap(Ut).mult(B).mult(SimpleMatrix.wrap(Vt).transpose()).print(); // printMatrix(); // System.out.println("bulge = "+bulge); // System.out.println(); } } }
public class class_name { @RunAsSystem public void executeScheduledJob(String scheduledJobId) { ScheduledJob scheduledJob = dataService.findOneById(SCHEDULED_JOB, scheduledJobId, ScheduledJob.class); if (scheduledJob == null) { throw new UnknownEntityException(SCHEDULED_JOB, scheduledJobId); } JobExecution jobExecution = createJobExecution(scheduledJob); Job molgenisJob = saveExecutionAndCreateJob(jobExecution); Progress progress = jobExecutionRegistry.registerJobExecution(jobExecution); try { runJob(jobExecution, molgenisJob, progress); } catch (Exception ex) { handleJobException(jobExecution, ex); } finally { jobExecutionRegistry.unregisterJobExecution(jobExecution); } } }
public class class_name { @RunAsSystem public void executeScheduledJob(String scheduledJobId) { ScheduledJob scheduledJob = dataService.findOneById(SCHEDULED_JOB, scheduledJobId, ScheduledJob.class); if (scheduledJob == null) { throw new UnknownEntityException(SCHEDULED_JOB, scheduledJobId); } JobExecution jobExecution = createJobExecution(scheduledJob); Job molgenisJob = saveExecutionAndCreateJob(jobExecution); Progress progress = jobExecutionRegistry.registerJobExecution(jobExecution); try { runJob(jobExecution, molgenisJob, progress); // depends on control dependency: [try], data = [none] } catch (Exception ex) { handleJobException(jobExecution, ex); } finally { // depends on control dependency: [catch], data = [none] jobExecutionRegistry.unregisterJobExecution(jobExecution); } } }
public class class_name { public static String generateNumricPassword(final int numberOfChar) { final Random randomGenerator = new Random(); String password = ""; for (int i = 1; i <= numberOfChar; ++i) { password += randomGenerator.nextInt(10); } return password; } }
public class class_name { public static String generateNumricPassword(final int numberOfChar) { final Random randomGenerator = new Random(); String password = ""; for (int i = 1; i <= numberOfChar; ++i) { password += randomGenerator.nextInt(10); // depends on control dependency: [for], data = [none] } return password; } }
public class class_name { static public String fqnXMLEscape(String fqn) { // Split the fqn into pieces StringBuilder xml = new StringBuilder(); String segment = null; List<String> segments = Escape.backslashsplit(fqn, '/'); for(int i = 1; i < segments.size() - 1; i++) { // skip leading / segment = segments.get(i); segment = Escape.backslashUnescape(segment); // get to raw name segment = Escape.entityEscape(segment, "\"");// '"' -> &quot; segment = Escape.backslashEscape(segment, "/."); // re-escape xml.append("/"); xml.append(segment); } // Last segment might be structure path, so similar processing, // but worry about '.' segment = segments.get(segments.size() - 1); segments = Escape.backslashsplit(segment, '.'); xml.append("/"); for(int i = 0; i < segments.size(); i++) { segment = segments.get(i); segment = Escape.backslashUnescape(segment); // get to raw name segment = Escape.entityEscape(segment, "\"");// '"' -> &quot; segment = Escape.backslashEscape(segment, "/."); // re-escape if(i > 0) xml.append("."); xml.append(segment); } return xml.toString(); } }
public class class_name { static public String fqnXMLEscape(String fqn) { // Split the fqn into pieces StringBuilder xml = new StringBuilder(); String segment = null; List<String> segments = Escape.backslashsplit(fqn, '/'); for(int i = 1; i < segments.size() - 1; i++) { // skip leading / segment = segments.get(i); // depends on control dependency: [for], data = [i] segment = Escape.backslashUnescape(segment); // get to raw name // depends on control dependency: [for], data = [none] segment = Escape.entityEscape(segment, "\"");// '"' -> &quot; // depends on control dependency: [for], data = [none] segment = Escape.backslashEscape(segment, "/."); // re-escape // depends on control dependency: [for], data = [none] xml.append("/"); // depends on control dependency: [for], data = [none] xml.append(segment); // depends on control dependency: [for], data = [none] } // Last segment might be structure path, so similar processing, // but worry about '.' segment = segments.get(segments.size() - 1); segments = Escape.backslashsplit(segment, '.'); xml.append("/"); for(int i = 0; i < segments.size(); i++) { segment = segments.get(i); // depends on control dependency: [for], data = [i] segment = Escape.backslashUnescape(segment); // get to raw name // depends on control dependency: [for], data = [none] segment = Escape.entityEscape(segment, "\"");// '"' -> &quot; // depends on control dependency: [for], data = [none] segment = Escape.backslashEscape(segment, "/."); // re-escape // depends on control dependency: [for], data = [none] if(i > 0) xml.append("."); xml.append(segment); // depends on control dependency: [for], data = [none] } return xml.toString(); } }
public class class_name { private PersistableDownload captureDownloadState( final GetObjectRequest getObjectRequest, final File file) { if (getObjectRequest.getSSECustomerKey() == null) { return new PersistableDownload( getObjectRequest.getBucketName(), getObjectRequest.getKey(), getObjectRequest.getVersionId(), getObjectRequest.getRange(), getObjectRequest.getResponseHeaders(), getObjectRequest.isRequesterPays(), file.getAbsolutePath(), getLastFullyDownloadedPartNumber(), getObjectMetadata().getLastModified().getTime(), getLastFullyDownloadedFilePosition()); } return null; } }
public class class_name { private PersistableDownload captureDownloadState( final GetObjectRequest getObjectRequest, final File file) { if (getObjectRequest.getSSECustomerKey() == null) { return new PersistableDownload( getObjectRequest.getBucketName(), getObjectRequest.getKey(), getObjectRequest.getVersionId(), getObjectRequest.getRange(), getObjectRequest.getResponseHeaders(), getObjectRequest.isRequesterPays(), file.getAbsolutePath(), getLastFullyDownloadedPartNumber(), getObjectMetadata().getLastModified().getTime(), getLastFullyDownloadedFilePosition()); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { private void readInput() { if (buf.limit() == buf.capacity()) makeSpace(); // Prepare to receive data int p = buf.position(); buf.position(buf.limit()); buf.limit(buf.capacity()); int n = 0; try { n = source.read(buf); } catch (IOException ioe) { lastException = ioe; n = -1; } if (n == -1) { sourceClosed = true; needInput = false; } if (n > 0) needInput = false; // Restore current position and limit for reading buf.limit(buf.position()); buf.position(p); // Android-changed: The matcher implementation eagerly calls toString() so we'll have // to update its input whenever the buffer limit, position etc. changes. matcher.reset(buf); } }
public class class_name { private void readInput() { if (buf.limit() == buf.capacity()) makeSpace(); // Prepare to receive data int p = buf.position(); buf.position(buf.limit()); buf.limit(buf.capacity()); int n = 0; try { n = source.read(buf); // depends on control dependency: [try], data = [none] } catch (IOException ioe) { lastException = ioe; n = -1; } // depends on control dependency: [catch], data = [none] if (n == -1) { sourceClosed = true; // depends on control dependency: [if], data = [none] needInput = false; // depends on control dependency: [if], data = [none] } if (n > 0) needInput = false; // Restore current position and limit for reading buf.limit(buf.position()); buf.position(p); // Android-changed: The matcher implementation eagerly calls toString() so we'll have // to update its input whenever the buffer limit, position etc. changes. matcher.reset(buf); } }
public class class_name { @Override @SuppressFBWarnings("NIR_NEEDLESS_INSTANCE_RETRIEVAL") public void afterPropertiesSet() { val appContext = applicationContextProvider().getConfigurableApplicationContext(); val conversionService = new DefaultFormattingConversionService(true); conversionService.setEmbeddedValueResolver(new CasEmbeddedValueResolver(appContext)); appContext.getEnvironment().setConversionService(conversionService); if (appContext.getParent() != null) { var env = (ConfigurableEnvironment) appContext.getParent().getEnvironment(); env.setConversionService(conversionService); } val registry = (ConverterRegistry) DefaultConversionService.getSharedInstance(); registry.addConverter(zonedDateTimeToStringConverter()); } }
public class class_name { @Override @SuppressFBWarnings("NIR_NEEDLESS_INSTANCE_RETRIEVAL") public void afterPropertiesSet() { val appContext = applicationContextProvider().getConfigurableApplicationContext(); val conversionService = new DefaultFormattingConversionService(true); conversionService.setEmbeddedValueResolver(new CasEmbeddedValueResolver(appContext)); appContext.getEnvironment().setConversionService(conversionService); if (appContext.getParent() != null) { var env = (ConfigurableEnvironment) appContext.getParent().getEnvironment(); env.setConversionService(conversionService); // depends on control dependency: [if], data = [none] } val registry = (ConverterRegistry) DefaultConversionService.getSharedInstance(); registry.addConverter(zonedDateTimeToStringConverter()); } }
public class class_name { private void ensureCapacity() { if (size < selectionKeys.length) { return; } SelectionKey[] newArray = new SelectionKey[selectionKeys.length * 2]; System.arraycopy(selectionKeys, 0, newArray, 0, size); selectionKeys = newArray; } }
public class class_name { private void ensureCapacity() { if (size < selectionKeys.length) { return; // depends on control dependency: [if], data = [none] } SelectionKey[] newArray = new SelectionKey[selectionKeys.length * 2]; System.arraycopy(selectionKeys, 0, newArray, 0, size); selectionKeys = newArray; } }
public class class_name { public float getAxisValue(int axis) { switch (axis) { case AXIS_X: return x; case AXIS_Y: return y; case AXIS_PRESSURE: return pressure; case AXIS_SIZE: return size; case AXIS_TOUCH_MAJOR: return touchMajor; case AXIS_TOUCH_MINOR: return touchMinor; case AXIS_TOOL_MAJOR: return toolMajor; case AXIS_TOOL_MINOR: return toolMinor; case AXIS_ORIENTATION: return orientation; default: { if (axis < 0 || axis > 63) { throw new IllegalArgumentException("Axis out of range."); } final long bits = mPackedAxisBits; final long axisBit = 1L << axis; if ((bits & axisBit) == 0) { return 0; } final int index = Long.bitCount(bits & (axisBit - 1L)); return mPackedAxisValues[index]; } } } }
public class class_name { public float getAxisValue(int axis) { switch (axis) { case AXIS_X: return x; case AXIS_Y: return y; case AXIS_PRESSURE: return pressure; case AXIS_SIZE: return size; case AXIS_TOUCH_MAJOR: return touchMajor; case AXIS_TOUCH_MINOR: return touchMinor; case AXIS_TOOL_MAJOR: return toolMajor; case AXIS_TOOL_MINOR: return toolMinor; case AXIS_ORIENTATION: return orientation; default: { if (axis < 0 || axis > 63) { throw new IllegalArgumentException("Axis out of range."); } final long bits = mPackedAxisBits; final long axisBit = 1L << axis; if ((bits & axisBit) == 0) { return 0; // depends on control dependency: [if], data = [none] } final int index = Long.bitCount(bits & (axisBit - 1L)); return mPackedAxisValues[index]; } } } }
public class class_name { @Pure public double distance(Point2D<?, ?> point, double width) { double mind = Double.POSITIVE_INFINITY; double dist; double w = width; w = Math.abs(w) / 2.; Point2d previousPoint; Point2d currentPoint; Iterator<Point2d> points; boolean treatFirstPoint; for (final PointGroup grp : groups()) { previousPoint = null; treatFirstPoint = false; points = grp.iterator(); while (points.hasNext()) { currentPoint = points.next(); if (previousPoint != null) { treatFirstPoint = true; dist = Segment2afp.calculatesDistanceSegmentPoint( previousPoint.getX(), previousPoint.getY(), currentPoint.getX(), currentPoint.getY(), point.getX(), point.getY()) - w; if (dist < mind) { mind = dist; } } previousPoint = currentPoint; } if (previousPoint != null && !treatFirstPoint) { dist = previousPoint.getDistance(point); if (dist < mind) { mind = dist; } } } return mind; } }
public class class_name { @Pure public double distance(Point2D<?, ?> point, double width) { double mind = Double.POSITIVE_INFINITY; double dist; double w = width; w = Math.abs(w) / 2.; Point2d previousPoint; Point2d currentPoint; Iterator<Point2d> points; boolean treatFirstPoint; for (final PointGroup grp : groups()) { previousPoint = null; // depends on control dependency: [for], data = [none] treatFirstPoint = false; // depends on control dependency: [for], data = [none] points = grp.iterator(); // depends on control dependency: [for], data = [grp] while (points.hasNext()) { currentPoint = points.next(); // depends on control dependency: [while], data = [none] if (previousPoint != null) { treatFirstPoint = true; // depends on control dependency: [if], data = [none] dist = Segment2afp.calculatesDistanceSegmentPoint( previousPoint.getX(), previousPoint.getY(), currentPoint.getX(), currentPoint.getY(), point.getX(), point.getY()) - w; // depends on control dependency: [if], data = [none] if (dist < mind) { mind = dist; // depends on control dependency: [if], data = [none] } } previousPoint = currentPoint; // depends on control dependency: [while], data = [none] } if (previousPoint != null && !treatFirstPoint) { dist = previousPoint.getDistance(point); // depends on control dependency: [if], data = [none] if (dist < mind) { mind = dist; // depends on control dependency: [if], data = [none] } } } return mind; } }
public class class_name { public static String pathJoin(String... strings) { StringBuilder buffer = new StringBuilder(); for (String string : strings) { if (string == null) { continue; } if (buffer.length() > 0) { boolean bufferEndsWithSeparator = buffer.toString().endsWith("/"); boolean stringStartsWithSeparator = string.startsWith("/"); if (bufferEndsWithSeparator) { if (stringStartsWithSeparator) { string = string.substring(1); } } else { if (!stringStartsWithSeparator) { buffer.append("/"); } } } buffer.append(string); } return buffer.toString(); } }
public class class_name { public static String pathJoin(String... strings) { StringBuilder buffer = new StringBuilder(); for (String string : strings) { if (string == null) { continue; } if (buffer.length() > 0) { boolean bufferEndsWithSeparator = buffer.toString().endsWith("/"); boolean stringStartsWithSeparator = string.startsWith("/"); if (bufferEndsWithSeparator) { if (stringStartsWithSeparator) { string = string.substring(1); // depends on control dependency: [if], data = [none] } } else { if (!stringStartsWithSeparator) { buffer.append("/"); // depends on control dependency: [if], data = [none] } } } buffer.append(string); // depends on control dependency: [for], data = [string] } return buffer.toString(); } }
public class class_name { private SingularAttribute<? super X, ?> getSingularAttribute(String paramString, boolean checkValidity) { SingularAttribute<? super X, ?> attribute = getDeclaredSingularAttribute(paramString, false); try { if (attribute == null && superClazzType != null) { attribute = superClazzType.getSingularAttribute(paramString); } } catch (IllegalArgumentException iaex) { attribute = null; onValidity(paramString, checkValidity, attribute); } onValidity(paramString, checkValidity, attribute); return attribute; } }
public class class_name { private SingularAttribute<? super X, ?> getSingularAttribute(String paramString, boolean checkValidity) { SingularAttribute<? super X, ?> attribute = getDeclaredSingularAttribute(paramString, false); try { if (attribute == null && superClazzType != null) { attribute = superClazzType.getSingularAttribute(paramString); // depends on control dependency: [if], data = [none] } } catch (IllegalArgumentException iaex) { attribute = null; onValidity(paramString, checkValidity, attribute); } // depends on control dependency: [catch], data = [none] onValidity(paramString, checkValidity, attribute); return attribute; } }
public class class_name { public Host lookup(final String hostName) { final Map<String, Host> cache = this.refresh(); Host h = cache.get(hostName); if(h == null) { h = new Host(); } if(h.patternsApplied) { return h; } for(final Map.Entry<String, Host> e : cache.entrySet()) { if(!isHostPattern(e.getKey())) { continue; } if(!isHostMatch(e.getKey(), hostName)) { continue; } //log.debug("Found host match in SSH config:" + e.getValue()); h.copyFrom(e.getValue()); } if(h.port == 0) { h.port = -1; } h.patternsApplied = true; return h; } }
public class class_name { public Host lookup(final String hostName) { final Map<String, Host> cache = this.refresh(); Host h = cache.get(hostName); if(h == null) { h = new Host(); // depends on control dependency: [if], data = [none] } if(h.patternsApplied) { return h; // depends on control dependency: [if], data = [none] } for(final Map.Entry<String, Host> e : cache.entrySet()) { if(!isHostPattern(e.getKey())) { continue; } if(!isHostMatch(e.getKey(), hostName)) { continue; } //log.debug("Found host match in SSH config:" + e.getValue()); h.copyFrom(e.getValue()); // depends on control dependency: [for], data = [e] } if(h.port == 0) { h.port = -1; // depends on control dependency: [if], data = [none] } h.patternsApplied = true; return h; } }
public class class_name { public void setKeywords(final List<String> keywords) { StringBuilder builder = new StringBuilder(); for (String keyword: keywords) { if (builder.length() > 0) { builder.append(','); } builder.append(keyword.trim()); } this.keywords = Optional.of(builder.toString()); } }
public class class_name { public void setKeywords(final List<String> keywords) { StringBuilder builder = new StringBuilder(); for (String keyword: keywords) { if (builder.length() > 0) { builder.append(','); // depends on control dependency: [if], data = [none] } builder.append(keyword.trim()); // depends on control dependency: [for], data = [keyword] } this.keywords = Optional.of(builder.toString()); } }
public class class_name { private DistributionPattern connectJobVertices(Channel channel, int inputNumber, final JobVertex sourceVertex, final TaskConfig sourceConfig, final JobVertex targetVertex, final TaskConfig targetConfig, boolean isBroadcast) throws CompilerException { // ------------ connect the vertices to the job graph -------------- final DistributionPattern distributionPattern; switch (channel.getShipStrategy()) { case FORWARD: distributionPattern = DistributionPattern.POINTWISE; break; case PARTITION_RANDOM: case BROADCAST: case PARTITION_HASH: case PARTITION_CUSTOM: case PARTITION_RANGE: case PARTITION_FORCED_REBALANCE: distributionPattern = DistributionPattern.ALL_TO_ALL; break; default: throw new RuntimeException("Unknown runtime ship strategy: " + channel.getShipStrategy()); } final ResultPartitionType resultType; switch (channel.getDataExchangeMode()) { case PIPELINED: resultType = ResultPartitionType.PIPELINED; break; case BATCH: // BLOCKING results are currently not supported in closed loop iterations // // See https://issues.apache.org/jira/browse/FLINK-1713 for details resultType = channel.getSource().isOnDynamicPath() ? ResultPartitionType.PIPELINED : ResultPartitionType.BLOCKING; break; case PIPELINE_WITH_BATCH_FALLBACK: throw new UnsupportedOperationException("Data exchange mode " + channel.getDataExchangeMode() + " currently not supported."); default: throw new UnsupportedOperationException("Unknown data exchange mode."); } JobEdge edge = targetVertex.connectNewDataSetAsInput(sourceVertex, distributionPattern, resultType); // -------------- configure the source task's ship strategy strategies in task config -------------- final int outputIndex = sourceConfig.getNumOutputs(); sourceConfig.addOutputShipStrategy(channel.getShipStrategy()); if (outputIndex == 0) { sourceConfig.setOutputSerializer(channel.getSerializer()); } if (channel.getShipStrategyComparator() != null) { sourceConfig.setOutputComparator(channel.getShipStrategyComparator(), outputIndex); } if (channel.getShipStrategy() == ShipStrategyType.PARTITION_RANGE) { final DataDistribution dataDistribution = channel.getDataDistribution(); if (dataDistribution != null) { sourceConfig.setOutputDataDistribution(dataDistribution, outputIndex); } else { throw new RuntimeException("Range partitioning requires data distribution."); } } if (channel.getShipStrategy() == ShipStrategyType.PARTITION_CUSTOM) { if (channel.getPartitioner() != null) { sourceConfig.setOutputPartitioner(channel.getPartitioner(), outputIndex); } else { throw new CompilerException("The ship strategy was set to custom partitioning, but no partitioner was set."); } } // ---------------- configure the receiver ------------------- if (isBroadcast) { targetConfig.addBroadcastInputToGroup(inputNumber); } else { targetConfig.addInputToGroup(inputNumber); } // ---------------- attach the additional infos to the job edge ------------------- String shipStrategy = JsonMapper.getShipStrategyString(channel.getShipStrategy()); if (channel.getShipStrategyKeys() != null && channel.getShipStrategyKeys().size() > 0) { shipStrategy += " on " + (channel.getShipStrategySortOrder() == null ? channel.getShipStrategyKeys().toString() : Utils.createOrdering(channel.getShipStrategyKeys(), channel.getShipStrategySortOrder()).toString()); } String localStrategy; if (channel.getLocalStrategy() == null || channel.getLocalStrategy() == LocalStrategy.NONE) { localStrategy = null; } else { localStrategy = JsonMapper.getLocalStrategyString(channel.getLocalStrategy()); if (localStrategy != null && channel.getLocalStrategyKeys() != null && channel.getLocalStrategyKeys().size() > 0) { localStrategy += " on " + (channel.getLocalStrategySortOrder() == null ? channel.getLocalStrategyKeys().toString() : Utils.createOrdering(channel.getLocalStrategyKeys(), channel.getLocalStrategySortOrder()).toString()); } } String caching = channel.getTempMode() == TempMode.NONE ? null : channel.getTempMode().toString(); edge.setShipStrategyName(shipStrategy); edge.setPreProcessingOperationName(localStrategy); edge.setOperatorLevelCachingDescription(caching); return distributionPattern; } }
public class class_name { private DistributionPattern connectJobVertices(Channel channel, int inputNumber, final JobVertex sourceVertex, final TaskConfig sourceConfig, final JobVertex targetVertex, final TaskConfig targetConfig, boolean isBroadcast) throws CompilerException { // ------------ connect the vertices to the job graph -------------- final DistributionPattern distributionPattern; switch (channel.getShipStrategy()) { case FORWARD: distributionPattern = DistributionPattern.POINTWISE; break; case PARTITION_RANDOM: case BROADCAST: case PARTITION_HASH: case PARTITION_CUSTOM: case PARTITION_RANGE: case PARTITION_FORCED_REBALANCE: distributionPattern = DistributionPattern.ALL_TO_ALL; break; default: throw new RuntimeException("Unknown runtime ship strategy: " + channel.getShipStrategy()); } final ResultPartitionType resultType; switch (channel.getDataExchangeMode()) { case PIPELINED: resultType = ResultPartitionType.PIPELINED; break; case BATCH: // BLOCKING results are currently not supported in closed loop iterations // // See https://issues.apache.org/jira/browse/FLINK-1713 for details resultType = channel.getSource().isOnDynamicPath() ? ResultPartitionType.PIPELINED : ResultPartitionType.BLOCKING; break; case PIPELINE_WITH_BATCH_FALLBACK: throw new UnsupportedOperationException("Data exchange mode " + channel.getDataExchangeMode() + " currently not supported."); default: throw new UnsupportedOperationException("Unknown data exchange mode."); } JobEdge edge = targetVertex.connectNewDataSetAsInput(sourceVertex, distributionPattern, resultType); // -------------- configure the source task's ship strategy strategies in task config -------------- final int outputIndex = sourceConfig.getNumOutputs(); sourceConfig.addOutputShipStrategy(channel.getShipStrategy()); if (outputIndex == 0) { sourceConfig.setOutputSerializer(channel.getSerializer()); } if (channel.getShipStrategyComparator() != null) { sourceConfig.setOutputComparator(channel.getShipStrategyComparator(), outputIndex); } if (channel.getShipStrategy() == ShipStrategyType.PARTITION_RANGE) { final DataDistribution dataDistribution = channel.getDataDistribution(); if (dataDistribution != null) { sourceConfig.setOutputDataDistribution(dataDistribution, outputIndex); // depends on control dependency: [if], data = [(dataDistribution] } else { throw new RuntimeException("Range partitioning requires data distribution."); } } if (channel.getShipStrategy() == ShipStrategyType.PARTITION_CUSTOM) { if (channel.getPartitioner() != null) { sourceConfig.setOutputPartitioner(channel.getPartitioner(), outputIndex); // depends on control dependency: [if], data = [(channel.getPartitioner()] } else { throw new CompilerException("The ship strategy was set to custom partitioning, but no partitioner was set."); } } // ---------------- configure the receiver ------------------- if (isBroadcast) { targetConfig.addBroadcastInputToGroup(inputNumber); } else { targetConfig.addInputToGroup(inputNumber); } // ---------------- attach the additional infos to the job edge ------------------- String shipStrategy = JsonMapper.getShipStrategyString(channel.getShipStrategy()); if (channel.getShipStrategyKeys() != null && channel.getShipStrategyKeys().size() > 0) { shipStrategy += " on " + (channel.getShipStrategySortOrder() == null ? channel.getShipStrategyKeys().toString() : Utils.createOrdering(channel.getShipStrategyKeys(), channel.getShipStrategySortOrder()).toString()); } String localStrategy; if (channel.getLocalStrategy() == null || channel.getLocalStrategy() == LocalStrategy.NONE) { localStrategy = null; } else { localStrategy = JsonMapper.getLocalStrategyString(channel.getLocalStrategy()); if (localStrategy != null && channel.getLocalStrategyKeys() != null && channel.getLocalStrategyKeys().size() > 0) { localStrategy += " on " + (channel.getLocalStrategySortOrder() == null ? channel.getLocalStrategyKeys().toString() : Utils.createOrdering(channel.getLocalStrategyKeys(), channel.getLocalStrategySortOrder()).toString()); // depends on control dependency: [if], data = [none] } } String caching = channel.getTempMode() == TempMode.NONE ? null : channel.getTempMode().toString(); edge.setShipStrategyName(shipStrategy); edge.setPreProcessingOperationName(localStrategy); edge.setOperatorLevelCachingDescription(caching); return distributionPattern; } }
public class class_name { public Seconds plus(int seconds) { if (seconds == 0) { return this; } return Seconds.seconds(FieldUtils.safeAdd(getValue(), seconds)); } }
public class class_name { public Seconds plus(int seconds) { if (seconds == 0) { return this; // depends on control dependency: [if], data = [none] } return Seconds.seconds(FieldUtils.safeAdd(getValue(), seconds)); } }
public class class_name { @Override public EClass getIfcSectionedSpine() { if (ifcSectionedSpineEClass == null) { ifcSectionedSpineEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(590); } return ifcSectionedSpineEClass; } }
public class class_name { @Override public EClass getIfcSectionedSpine() { if (ifcSectionedSpineEClass == null) { ifcSectionedSpineEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(590); // depends on control dependency: [if], data = [none] } return ifcSectionedSpineEClass; } }
public class class_name { public void resizeEip(ResizeEipRequest request) { checkNotNull(request.getNewBandwidthInMbps(), "newBandwidthInMbps should not be null"); checkStringNotEmpty(request.getEip(), "eip should not be empty"); if (Strings.isNullOrEmpty(request.getClientToken())) { request.setClientToken(generateDefaultClientToken()); } InternalRequest internalRequest = this.createRequest(request, HttpMethodName.PUT, request.getEip()); internalRequest.addParameter("resize", null); internalRequest.addParameter(CLIENT_TOKEN_IDENTIFY, request.getClientToken()); fillPayload(internalRequest, request); invokeHttpClient(internalRequest, AbstractBceResponse.class); } }
public class class_name { public void resizeEip(ResizeEipRequest request) { checkNotNull(request.getNewBandwidthInMbps(), "newBandwidthInMbps should not be null"); checkStringNotEmpty(request.getEip(), "eip should not be empty"); if (Strings.isNullOrEmpty(request.getClientToken())) { request.setClientToken(generateDefaultClientToken()); // depends on control dependency: [if], data = [none] } InternalRequest internalRequest = this.createRequest(request, HttpMethodName.PUT, request.getEip()); internalRequest.addParameter("resize", null); internalRequest.addParameter(CLIENT_TOKEN_IDENTIFY, request.getClientToken()); fillPayload(internalRequest, request); invokeHttpClient(internalRequest, AbstractBceResponse.class); } }
public class class_name { @Override protected String getServiceName(final String methodName) { if (methodName != null) { int ndx = methodName.indexOf(this.separator); if (ndx > 0) { return methodName.substring(0, ndx); } } return methodName; } }
public class class_name { @Override protected String getServiceName(final String methodName) { if (methodName != null) { int ndx = methodName.indexOf(this.separator); if (ndx > 0) { return methodName.substring(0, ndx); // depends on control dependency: [if], data = [none] } } return methodName; } }
public class class_name { public BoundingBox getBoundingBox(long zoomLevel) { BoundingBox boundingBox = null; TileMatrix tileMatrix = getTileMatrix(zoomLevel); if (tileMatrix != null) { TileGrid tileGrid = queryForTileGrid(zoomLevel); if (tileGrid != null) { BoundingBox matrixSetBoundingBox = getBoundingBox(); boundingBox = TileBoundingBoxUtils.getBoundingBox( matrixSetBoundingBox, tileMatrix, tileGrid); } } return boundingBox; } }
public class class_name { public BoundingBox getBoundingBox(long zoomLevel) { BoundingBox boundingBox = null; TileMatrix tileMatrix = getTileMatrix(zoomLevel); if (tileMatrix != null) { TileGrid tileGrid = queryForTileGrid(zoomLevel); if (tileGrid != null) { BoundingBox matrixSetBoundingBox = getBoundingBox(); boundingBox = TileBoundingBoxUtils.getBoundingBox( matrixSetBoundingBox, tileMatrix, tileGrid); // depends on control dependency: [if], data = [none] } } return boundingBox; } }
public class class_name { public List<T> execute() { if (CollectionUtils.isEmpty(from)) { logger.info("Querying from an empty collection, returning empty list."); return Collections.emptyList(); } List copied = new ArrayList(this.from); logger.info("Start apply predicate [{}] to collection with [{}] items.", predicate, copied.size()); CollectionUtils.filter(copied, this.predicate); logger.info("Done filtering collection, filtered result size is [{}]", copied.size()); if (null != this.comparator && copied.size()>1) { Comparator actualComparator = this.descSorting ? comparator.desc() : comparator.asc(); logger.info("Start to sort the filtered collection with comparator [{}]", actualComparator); Collections.sort(copied, actualComparator); logger.info("Done sorting the filtered collection."); } logger.info("Start to slect from filtered collection with selector [{}].", selector); List<T> select = this.selector.select(copied); logger.info("Done select from filtered collection."); return select; } }
public class class_name { public List<T> execute() { if (CollectionUtils.isEmpty(from)) { logger.info("Querying from an empty collection, returning empty list."); // depends on control dependency: [if], data = [none] return Collections.emptyList(); // depends on control dependency: [if], data = [none] } List copied = new ArrayList(this.from); logger.info("Start apply predicate [{}] to collection with [{}] items.", predicate, copied.size()); CollectionUtils.filter(copied, this.predicate); logger.info("Done filtering collection, filtered result size is [{}]", copied.size()); if (null != this.comparator && copied.size()>1) { Comparator actualComparator = this.descSorting ? comparator.desc() : comparator.asc(); logger.info("Start to sort the filtered collection with comparator [{}]", actualComparator); Collections.sort(copied, actualComparator); logger.info("Done sorting the filtered collection."); } logger.info("Start to slect from filtered collection with selector [{}].", selector); List<T> select = this.selector.select(copied); logger.info("Done select from filtered collection."); return select; // depends on control dependency: [if], data = [none] } }
public class class_name { public static void addLazyDefinitions(SourceBuilder code) { Set<Declaration> defined = new HashSet<>(); // Definitions may lazily declare new names; ensure we add them all List<Declaration> declarations = code.scope().keysOfType(Declaration.class).stream().sorted().collect(toList()); while (!defined.containsAll(declarations)) { for (Declaration declaration : declarations) { if (defined.add(declaration)) { code.add(code.scope().get(declaration).definition); } } declarations = code.scope().keysOfType(Declaration.class).stream().sorted().collect(toList()); } } }
public class class_name { public static void addLazyDefinitions(SourceBuilder code) { Set<Declaration> defined = new HashSet<>(); // Definitions may lazily declare new names; ensure we add them all List<Declaration> declarations = code.scope().keysOfType(Declaration.class).stream().sorted().collect(toList()); while (!defined.containsAll(declarations)) { for (Declaration declaration : declarations) { if (defined.add(declaration)) { code.add(code.scope().get(declaration).definition); // depends on control dependency: [if], data = [none] } } declarations = code.scope().keysOfType(Declaration.class).stream().sorted().collect(toList()); // depends on control dependency: [while], data = [none] } } }
public class class_name { @Override public int encode ( byte[] dst, int dstIndex ) { int start = dstIndex; System.arraycopy(this.sourceKey, 0, dst, dstIndex, 24); dstIndex += 24; SMBUtil.writeInt4(this.chunks.length, dst, dstIndex); dstIndex += 4; dstIndex += 4; // Reserved for ( SrvCopychunk chk : this.chunks ) { dstIndex += chk.encode(dst, dstIndex); } return dstIndex - start; } }
public class class_name { @Override public int encode ( byte[] dst, int dstIndex ) { int start = dstIndex; System.arraycopy(this.sourceKey, 0, dst, dstIndex, 24); dstIndex += 24; SMBUtil.writeInt4(this.chunks.length, dst, dstIndex); dstIndex += 4; dstIndex += 4; // Reserved for ( SrvCopychunk chk : this.chunks ) { dstIndex += chk.encode(dst, dstIndex); // depends on control dependency: [for], data = [chk] } return dstIndex - start; } }
public class class_name { public EEnum getIfcHumidifierTypeEnum() { if (ifcHumidifierTypeEnumEEnum == null) { ifcHumidifierTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(847); } return ifcHumidifierTypeEnumEEnum; } }
public class class_name { public EEnum getIfcHumidifierTypeEnum() { if (ifcHumidifierTypeEnumEEnum == null) { ifcHumidifierTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(847); // depends on control dependency: [if], data = [none] } return ifcHumidifierTypeEnumEEnum; } }
public class class_name { public EClass getIfcLightDistributionDataSourceSelect() { if (ifcLightDistributionDataSourceSelectEClass == null) { ifcLightDistributionDataSourceSelectEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(960); } return ifcLightDistributionDataSourceSelectEClass; } }
public class class_name { public EClass getIfcLightDistributionDataSourceSelect() { if (ifcLightDistributionDataSourceSelectEClass == null) { ifcLightDistributionDataSourceSelectEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(960); // depends on control dependency: [if], data = [none] } return ifcLightDistributionDataSourceSelectEClass; } }
public class class_name { protected void addUUIDColumnToTable(CmsSetupDb dbCon, String tablename, String column) throws SQLException { System.out.println(new Exception().getStackTrace()[0].toString()); if (!dbCon.hasTableOrColumn(tablename, column)) { String query = readQuery(QUERY_ADD_TEMP_UUID_COLUMN); // Get the query // if the table is not one of the ONLINE or OFFLINE resources add the new column in the first position if (!RESOURCES_TABLES_LIST.contains(tablename)) { query += " FIRST"; } Map<String, String> replacer = new HashMap<String, String>(); // Build the replacements replacer.put(REPLACEMENT_TABLENAME, tablename); replacer.put(REPLACEMENT_COLUMN, column); dbCon.updateSqlStatement(query, replacer, null); // execute the query } else { System.out.println("column " + column + " in table " + tablename + " already exists"); } } }
public class class_name { protected void addUUIDColumnToTable(CmsSetupDb dbCon, String tablename, String column) throws SQLException { System.out.println(new Exception().getStackTrace()[0].toString()); if (!dbCon.hasTableOrColumn(tablename, column)) { String query = readQuery(QUERY_ADD_TEMP_UUID_COLUMN); // Get the query // if the table is not one of the ONLINE or OFFLINE resources add the new column in the first position if (!RESOURCES_TABLES_LIST.contains(tablename)) { query += " FIRST"; // depends on control dependency: [if], data = [none] } Map<String, String> replacer = new HashMap<String, String>(); // Build the replacements replacer.put(REPLACEMENT_TABLENAME, tablename); replacer.put(REPLACEMENT_COLUMN, column); dbCon.updateSqlStatement(query, replacer, null); // execute the query } else { System.out.println("column " + column + " in table " + tablename + " already exists"); } } }
public class class_name { public void marshall(CompleteLayerUploadRequest completeLayerUploadRequest, ProtocolMarshaller protocolMarshaller) { if (completeLayerUploadRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(completeLayerUploadRequest.getRegistryId(), REGISTRYID_BINDING); protocolMarshaller.marshall(completeLayerUploadRequest.getRepositoryName(), REPOSITORYNAME_BINDING); protocolMarshaller.marshall(completeLayerUploadRequest.getUploadId(), UPLOADID_BINDING); protocolMarshaller.marshall(completeLayerUploadRequest.getLayerDigests(), LAYERDIGESTS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(CompleteLayerUploadRequest completeLayerUploadRequest, ProtocolMarshaller protocolMarshaller) { if (completeLayerUploadRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(completeLayerUploadRequest.getRegistryId(), REGISTRYID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(completeLayerUploadRequest.getRepositoryName(), REPOSITORYNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(completeLayerUploadRequest.getUploadId(), UPLOADID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(completeLayerUploadRequest.getLayerDigests(), LAYERDIGESTS_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 { @SafeVarargs public final <X> DataSource<X> fromElements(X... data) { if (data == null) { throw new IllegalArgumentException("The data must not be null."); } if (data.length == 0) { throw new IllegalArgumentException("The number of elements must not be zero."); } TypeInformation<X> typeInfo; try { typeInfo = TypeExtractor.getForObject(data[0]); } catch (Exception e) { throw new RuntimeException("Could not create TypeInformation for type " + data[0].getClass().getName() + "; please specify the TypeInformation manually via " + "ExecutionEnvironment#fromElements(Collection, TypeInformation)", e); } return fromCollection(Arrays.asList(data), typeInfo, Utils.getCallLocationName()); } }
public class class_name { @SafeVarargs public final <X> DataSource<X> fromElements(X... data) { if (data == null) { throw new IllegalArgumentException("The data must not be null."); } if (data.length == 0) { throw new IllegalArgumentException("The number of elements must not be zero."); } TypeInformation<X> typeInfo; try { typeInfo = TypeExtractor.getForObject(data[0]); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new RuntimeException("Could not create TypeInformation for type " + data[0].getClass().getName() + "; please specify the TypeInformation manually via " + "ExecutionEnvironment#fromElements(Collection, TypeInformation)", e); } // depends on control dependency: [catch], data = [none] return fromCollection(Arrays.asList(data), typeInfo, Utils.getCallLocationName()); } }
public class class_name { private JSONArray makeJsonOutputArray(String stringResult) { JSONParser parser = new JSONParser(); try { return (JSONArray) parser.parse(stringResult); } catch (ParseException | ClassCastException e) { LOGGER.error( "There was a problem parsing the JSONArray response value from the source system:\n" + e.getMessage() + " | " + e.getCause()); return new JSONArray(); } } }
public class class_name { private JSONArray makeJsonOutputArray(String stringResult) { JSONParser parser = new JSONParser(); try { return (JSONArray) parser.parse(stringResult); // depends on control dependency: [try], data = [none] } catch (ParseException | ClassCastException e) { LOGGER.error( "There was a problem parsing the JSONArray response value from the source system:\n" + e.getMessage() + " | " + e.getCause()); return new JSONArray(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void marshall(UpdateFleetCapacityRequest updateFleetCapacityRequest, ProtocolMarshaller protocolMarshaller) { if (updateFleetCapacityRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateFleetCapacityRequest.getFleetId(), FLEETID_BINDING); protocolMarshaller.marshall(updateFleetCapacityRequest.getDesiredInstances(), DESIREDINSTANCES_BINDING); protocolMarshaller.marshall(updateFleetCapacityRequest.getMinSize(), MINSIZE_BINDING); protocolMarshaller.marshall(updateFleetCapacityRequest.getMaxSize(), MAXSIZE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(UpdateFleetCapacityRequest updateFleetCapacityRequest, ProtocolMarshaller protocolMarshaller) { if (updateFleetCapacityRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateFleetCapacityRequest.getFleetId(), FLEETID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateFleetCapacityRequest.getDesiredInstances(), DESIREDINSTANCES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateFleetCapacityRequest.getMinSize(), MINSIZE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateFleetCapacityRequest.getMaxSize(), MAXSIZE_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] } }