code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public static CmsModuleImportData readModuleData(CmsObject cms, String importFile, I_CmsReport report) throws CmsException { CmsModuleImportData result = new CmsModuleImportData(); CmsModule module = CmsModuleImportExportHandler.readModuleFromImport(importFile); cms = OpenCms.initCmsObject(cms); String importSite = module.getImportSite(); if (!CmsStringUtil.isEmptyOrWhitespaceOnly(importSite)) { cms.getRequestContext().setSiteRoot(importSite); } else { String siteToSet = cms.getRequestContext().getSiteRoot(); if ("".equals(siteToSet)) { siteToSet = "/"; } module.setSite(siteToSet); } result.setModule(module); result.setCms(cms); CmsImportResourceDataReader importer = new CmsImportResourceDataReader(result); CmsImportParameters params = new CmsImportParameters(importFile, "/", false); importer.importData(cms, report, params); // This only reads the module data into Java objects return result; } }
public class class_name { public static CmsModuleImportData readModuleData(CmsObject cms, String importFile, I_CmsReport report) throws CmsException { CmsModuleImportData result = new CmsModuleImportData(); CmsModule module = CmsModuleImportExportHandler.readModuleFromImport(importFile); cms = OpenCms.initCmsObject(cms); String importSite = module.getImportSite(); if (!CmsStringUtil.isEmptyOrWhitespaceOnly(importSite)) { cms.getRequestContext().setSiteRoot(importSite); } else { String siteToSet = cms.getRequestContext().getSiteRoot(); if ("".equals(siteToSet)) { siteToSet = "/"; // depends on control dependency: [if], data = [none] } module.setSite(siteToSet); } result.setModule(module); result.setCms(cms); CmsImportResourceDataReader importer = new CmsImportResourceDataReader(result); CmsImportParameters params = new CmsImportParameters(importFile, "/", false); importer.importData(cms, report, params); // This only reads the module data into Java objects return result; } }
public class class_name { public static synchronized boolean shutdown() { if (instance != null) { instance.markShuttingDown(); instance.interrupt(); connectionManagers.clear(); instance = null; return true; } return false; } }
public class class_name { public static synchronized boolean shutdown() { if (instance != null) { instance.markShuttingDown(); // depends on control dependency: [if], data = [none] instance.interrupt(); // depends on control dependency: [if], data = [none] connectionManagers.clear(); // depends on control dependency: [if], data = [none] instance = null; // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { protected CSRelatedNodeWrapper findExistingRelatedNode(final Relationship relationship, final List<CSRelatedNodeWrapper> topicRelatedNodes) { if (topicRelatedNodes != null) { // Loop over the current nodes and see if any match for (final CSRelatedNodeWrapper relatedNode : topicRelatedNodes) { if (relationship instanceof TargetRelationship) { if (doesRelationshipMatch((TargetRelationship) relationship, relatedNode)) { return relatedNode; } } else { if (doesRelationshipMatch((TopicRelationship) relationship, relatedNode)) { return relatedNode; } } } } return null; } }
public class class_name { protected CSRelatedNodeWrapper findExistingRelatedNode(final Relationship relationship, final List<CSRelatedNodeWrapper> topicRelatedNodes) { if (topicRelatedNodes != null) { // Loop over the current nodes and see if any match for (final CSRelatedNodeWrapper relatedNode : topicRelatedNodes) { if (relationship instanceof TargetRelationship) { if (doesRelationshipMatch((TargetRelationship) relationship, relatedNode)) { return relatedNode; // depends on control dependency: [if], data = [none] } } else { if (doesRelationshipMatch((TopicRelationship) relationship, relatedNode)) { return relatedNode; // depends on control dependency: [if], data = [none] } } } } return null; } }
public class class_name { private void setAndStartTask(ICBTask task){ task.setTaskListener(new CBTaskListener() { @Override public void onTaskStart() { lock.lock(); if (currentExecuteTaskNumber > maxTaskNumber) { try { condition.await(); } catch (InterruptedException e) { e.printStackTrace(); } } currentExecuteTaskNumber++; lock.unlock(); } @Override public void onTaskEnd() { lock.lock(); currentExecuteTaskNumber--; condition.signal(); lock.unlock(); } }); task.startTask(); } }
public class class_name { private void setAndStartTask(ICBTask task){ task.setTaskListener(new CBTaskListener() { @Override public void onTaskStart() { lock.lock(); if (currentExecuteTaskNumber > maxTaskNumber) { try { condition.await(); // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] } currentExecuteTaskNumber++; lock.unlock(); } @Override public void onTaskEnd() { lock.lock(); currentExecuteTaskNumber--; condition.signal(); lock.unlock(); } }); task.startTask(); } }
public class class_name { private JPanel createSorterPane() { JPanel insidePanel = new JPanel(); insidePanel.setLayout(new GridBagLayout()); preview = new JTableHeader(); Sortables[] sortables = MainFrame.getInstance().getAvailableSortables(); preview.setColumnModel(new SorterTableColumnModel(sortables)); for (Sortables s : sortables) { if (s != Sortables.DIVIDER) { checkBoxSortList.add(new SortableCheckBox(s)); } } setSorterCheckBoxes(); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.BOTH; gbc.gridx = 1; gbc.insets = new Insets(2,5,2,5); insidePanel.add(new JLabel("<html><h2>1. Choose bug properties"), gbc); insidePanel.add(new CheckBoxList<>(checkBoxSortList.toArray(new JCheckBox[checkBoxSortList.size()])), gbc); JTable t = new JTable(new DefaultTableModel(0, sortables.length)); t.setTableHeader(preview); preview.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR)); insidePanel.add(new JLabel("<html><h2>2. Drag and drop to change grouping priority"), gbc); insidePanel.add(createAppropriatelySizedScrollPane(t), gbc); sortApply = new JButton(edu.umd.cs.findbugs.L10N.getLocalString("dlg.apply_btn", "Apply")); sortApply.addActionListener(e -> { MainFrame.getInstance().getSorter().createFrom((SorterTableColumnModel) preview.getColumnModel()); ((BugTreeModel) MainFrame.getInstance().getTree().getModel()).checkSorter(); SorterDialog.this.dispose(); }); gbc.fill = GridBagConstraints.NONE; insidePanel.add(sortApply, gbc); JPanel sorter = new JPanel(); sorter.setLayout(new BorderLayout()); sorter.add(new JScrollPane(insidePanel), BorderLayout.CENTER); return sorter; } }
public class class_name { private JPanel createSorterPane() { JPanel insidePanel = new JPanel(); insidePanel.setLayout(new GridBagLayout()); preview = new JTableHeader(); Sortables[] sortables = MainFrame.getInstance().getAvailableSortables(); preview.setColumnModel(new SorterTableColumnModel(sortables)); for (Sortables s : sortables) { if (s != Sortables.DIVIDER) { checkBoxSortList.add(new SortableCheckBox(s)); // depends on control dependency: [if], data = [(s] } } setSorterCheckBoxes(); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.BOTH; gbc.gridx = 1; gbc.insets = new Insets(2,5,2,5); insidePanel.add(new JLabel("<html><h2>1. Choose bug properties"), gbc); insidePanel.add(new CheckBoxList<>(checkBoxSortList.toArray(new JCheckBox[checkBoxSortList.size()])), gbc); JTable t = new JTable(new DefaultTableModel(0, sortables.length)); t.setTableHeader(preview); preview.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR)); insidePanel.add(new JLabel("<html><h2>2. Drag and drop to change grouping priority"), gbc); insidePanel.add(createAppropriatelySizedScrollPane(t), gbc); sortApply = new JButton(edu.umd.cs.findbugs.L10N.getLocalString("dlg.apply_btn", "Apply")); sortApply.addActionListener(e -> { MainFrame.getInstance().getSorter().createFrom((SorterTableColumnModel) preview.getColumnModel()); ((BugTreeModel) MainFrame.getInstance().getTree().getModel()).checkSorter(); SorterDialog.this.dispose(); }); gbc.fill = GridBagConstraints.NONE; insidePanel.add(sortApply, gbc); JPanel sorter = new JPanel(); sorter.setLayout(new BorderLayout()); sorter.add(new JScrollPane(insidePanel), BorderLayout.CENTER); return sorter; } }
public class class_name { @Action(name = "Customize Windows Guest", outputs = { @Output(Outputs.RETURN_CODE), @Output(Outputs.RETURN_RESULT), @Output(Outputs.EXCEPTION) }, responses = { @Response(text = Outputs.SUCCESS, field = Outputs.RETURN_CODE, value = Outputs.RETURN_CODE_SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = Outputs.FAILURE, field = Outputs.RETURN_CODE, value = Outputs.RETURN_CODE_FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) public Map<String, String> customizeWindowsGuest(@Param(value = HOST, required = true) String host, @Param(value = PORT) String port, @Param(value = PROTOCOL) String protocol, @Param(value = USERNAME, required = true) String username, @Param(value = PASSWORD, encrypted = true) String password, @Param(value = TRUST_EVERYONE) String trustEveryone, @Param(value = CLOSE_SESSION) String closeSession, @Param(value = VM_NAME, required = true) String virtualMachineName, @Param(value = REBOOT_OPTION, required = true) String rebootOption, @Param(value = COMPUTER_NAME, required = true) String computerName, @Param(value = COMPUTER_PASSWORD, required = true) String computerPassword, @Param(value = OWNER_NAME, required = true) String ownerName, @Param(value = OWNER_ORGANIZATION, required = true) String ownerOrganization, @Param(value = PRODUCT_KEY) String productKey, @Param(value = DOMAIN_USERNAME) String domainUsername, @Param(value = DOMAIN_PASSWORD) String domainPassword, @Param(value = DOMAIN) String domain, @Param(value = WORKGROUP) String workgroup, @Param(value = LICENSE_DATA_MODE, required = true) String licenseDataMode, @Param(value = DNS_SERVER) String dnsServer, @Param(value = IP_ADDRESS) String ipAddress, @Param(value = SUBNET_MASK) String subnetMask, @Param(value = DEFAULT_GATEWAY) String defaultGateway, @Param(value = MAC_ADDRESS) String macAddress, @Param(value = AUTO_LOGON) String autoLogon, @Param(value = DELETE_ACCOUNTS) String deleteAccounts, @Param(value = CHANGE_SID, required = true) String changeSID, @Param(value = AUTO_LOGON_COUNT) String autoLogonCount, @Param(value = AUTO_USERS) String autoUsers, @Param(value = TIME_ZONE) String timeZone, @Param(value = VMWARE_GLOBAL_SESSION_OBJECT) GlobalSessionObject<Map<String, Connection>> globalSessionObject) { try { final HttpInputs httpInputs = new HttpInputs.HttpInputsBuilder() .withHost(host) .withPort(port) .withProtocol(protocol) .withUsername(username) .withPassword(password) .withTrustEveryone(defaultIfEmpty(trustEveryone, FALSE)) .withCloseSession(defaultIfEmpty(closeSession, TRUE)) .withGlobalSessionObject(globalSessionObject) .build(); final VmInputs vmInputs = new VmInputs.VmInputsBuilder() .withVirtualMachineName(virtualMachineName) .build(); final GuestInputs guestInputs = new GuestInputs.GuestInputsBuilder() .withRebootOption(rebootOption) .withComputerName(computerName) .withComputerPassword(computerPassword) .withOwnerName(ownerName) .withOwnerOrganization(ownerOrganization) .withProductKey(productKey) .withDomainUsername(domainUsername) .withDomainPassword(domainPassword) .withDomain(domain) .withWorkgroup(workgroup) .withLicenseDataMode(licenseDataMode) .withDnsServer(dnsServer) .withIpAddress(ipAddress) .withSubnetMask(subnetMask) .withDefaultGateway(defaultGateway) .withMacAddress(macAddress) .withAutoLogon(autoLogon) .withDeleteAccounts(deleteAccounts) .withChangeSID(changeSID) .withAutoLogonCount(autoLogonCount) .withAutoUsers(autoUsers) .withTimeZone(timeZone) .build(); return new GuestService().customizeVM(httpInputs, vmInputs, guestInputs, true); } catch (Exception ex) { return OutputUtilities.getFailureResultsMap(ex); } } }
public class class_name { @Action(name = "Customize Windows Guest", outputs = { @Output(Outputs.RETURN_CODE), @Output(Outputs.RETURN_RESULT), @Output(Outputs.EXCEPTION) }, responses = { @Response(text = Outputs.SUCCESS, field = Outputs.RETURN_CODE, value = Outputs.RETURN_CODE_SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = Outputs.FAILURE, field = Outputs.RETURN_CODE, value = Outputs.RETURN_CODE_FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) public Map<String, String> customizeWindowsGuest(@Param(value = HOST, required = true) String host, @Param(value = PORT) String port, @Param(value = PROTOCOL) String protocol, @Param(value = USERNAME, required = true) String username, @Param(value = PASSWORD, encrypted = true) String password, @Param(value = TRUST_EVERYONE) String trustEveryone, @Param(value = CLOSE_SESSION) String closeSession, @Param(value = VM_NAME, required = true) String virtualMachineName, @Param(value = REBOOT_OPTION, required = true) String rebootOption, @Param(value = COMPUTER_NAME, required = true) String computerName, @Param(value = COMPUTER_PASSWORD, required = true) String computerPassword, @Param(value = OWNER_NAME, required = true) String ownerName, @Param(value = OWNER_ORGANIZATION, required = true) String ownerOrganization, @Param(value = PRODUCT_KEY) String productKey, @Param(value = DOMAIN_USERNAME) String domainUsername, @Param(value = DOMAIN_PASSWORD) String domainPassword, @Param(value = DOMAIN) String domain, @Param(value = WORKGROUP) String workgroup, @Param(value = LICENSE_DATA_MODE, required = true) String licenseDataMode, @Param(value = DNS_SERVER) String dnsServer, @Param(value = IP_ADDRESS) String ipAddress, @Param(value = SUBNET_MASK) String subnetMask, @Param(value = DEFAULT_GATEWAY) String defaultGateway, @Param(value = MAC_ADDRESS) String macAddress, @Param(value = AUTO_LOGON) String autoLogon, @Param(value = DELETE_ACCOUNTS) String deleteAccounts, @Param(value = CHANGE_SID, required = true) String changeSID, @Param(value = AUTO_LOGON_COUNT) String autoLogonCount, @Param(value = AUTO_USERS) String autoUsers, @Param(value = TIME_ZONE) String timeZone, @Param(value = VMWARE_GLOBAL_SESSION_OBJECT) GlobalSessionObject<Map<String, Connection>> globalSessionObject) { try { final HttpInputs httpInputs = new HttpInputs.HttpInputsBuilder() .withHost(host) .withPort(port) .withProtocol(protocol) .withUsername(username) .withPassword(password) .withTrustEveryone(defaultIfEmpty(trustEveryone, FALSE)) .withCloseSession(defaultIfEmpty(closeSession, TRUE)) .withGlobalSessionObject(globalSessionObject) .build(); final VmInputs vmInputs = new VmInputs.VmInputsBuilder() .withVirtualMachineName(virtualMachineName) .build(); final GuestInputs guestInputs = new GuestInputs.GuestInputsBuilder() .withRebootOption(rebootOption) .withComputerName(computerName) .withComputerPassword(computerPassword) .withOwnerName(ownerName) .withOwnerOrganization(ownerOrganization) .withProductKey(productKey) .withDomainUsername(domainUsername) .withDomainPassword(domainPassword) .withDomain(domain) .withWorkgroup(workgroup) .withLicenseDataMode(licenseDataMode) .withDnsServer(dnsServer) .withIpAddress(ipAddress) .withSubnetMask(subnetMask) .withDefaultGateway(defaultGateway) .withMacAddress(macAddress) .withAutoLogon(autoLogon) .withDeleteAccounts(deleteAccounts) .withChangeSID(changeSID) .withAutoLogonCount(autoLogonCount) .withAutoUsers(autoUsers) .withTimeZone(timeZone) .build(); return new GuestService().customizeVM(httpInputs, vmInputs, guestInputs, true); // depends on control dependency: [try], data = [none] } catch (Exception ex) { return OutputUtilities.getFailureResultsMap(ex); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @RequestMapping public ModelAndView showSearchForm(RenderRequest request, RenderResponse response) { final Map<String, Object> model = new HashMap<>(); String viewName; // Determine if the new REST search should be used if (isRestSearch(request)) { viewName = "/jsp/Search/searchRest"; } else { // Determine if this portlet displays the search launch view or regular search view. final boolean isMobile = isMobile(request); viewName = isMobile ? "/jsp/Search/mobileSearch" : "/jsp/Search/search"; } // If this search portlet is configured to be the searchLauncher, calculate the URLs to the // indicated // search portlet. PortletPreferences prefs = request.getPreferences(); final String searchLaunchFname = prefs.getValue(SEARCH_LAUNCH_FNAME, null); if (searchLaunchFname != null) { model.put("searchLaunchUrl", calculateSearchLaunchUrl(request, response)); model.put("autocompleteUrl", calculateAutocompleteResourceUrl(request, response)); viewName = "/jsp/Search/searchLauncher"; } return new ModelAndView(viewName, model); } }
public class class_name { @RequestMapping public ModelAndView showSearchForm(RenderRequest request, RenderResponse response) { final Map<String, Object> model = new HashMap<>(); String viewName; // Determine if the new REST search should be used if (isRestSearch(request)) { viewName = "/jsp/Search/searchRest"; // depends on control dependency: [if], data = [none] } else { // Determine if this portlet displays the search launch view or regular search view. final boolean isMobile = isMobile(request); viewName = isMobile ? "/jsp/Search/mobileSearch" : "/jsp/Search/search"; // depends on control dependency: [if], data = [none] } // If this search portlet is configured to be the searchLauncher, calculate the URLs to the // indicated // search portlet. PortletPreferences prefs = request.getPreferences(); final String searchLaunchFname = prefs.getValue(SEARCH_LAUNCH_FNAME, null); if (searchLaunchFname != null) { model.put("searchLaunchUrl", calculateSearchLaunchUrl(request, response)); // depends on control dependency: [if], data = [none] model.put("autocompleteUrl", calculateAutocompleteResourceUrl(request, response)); // depends on control dependency: [if], data = [none] viewName = "/jsp/Search/searchLauncher"; // depends on control dependency: [if], data = [none] } return new ModelAndView(viewName, model); } }
public class class_name { public void stop() throws Throwable { if (validatorFactory != null) validatorFactory.close(); Context context = null; try { Properties properties = new Properties(); properties.setProperty(Context.PROVIDER_URL, jndiProtocol + "://" + jndiHost + ":" + jndiPort); context = new InitialContext(properties); context.unbind(VALIDATOR_FACTORY); } finally { try { if (context != null) context.close(); } catch (NamingException ne) { // Ignore } } } }
public class class_name { public void stop() throws Throwable { if (validatorFactory != null) validatorFactory.close(); Context context = null; try { Properties properties = new Properties(); properties.setProperty(Context.PROVIDER_URL, jndiProtocol + "://" + jndiHost + ":" + jndiPort); context = new InitialContext(properties); context.unbind(VALIDATOR_FACTORY); } finally { try { if (context != null) context.close(); } catch (NamingException ne) { // Ignore } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public boolean isStartedBy(T element) { if (element == null) { return false; } return comparator.compare(element, min) == 0; } }
public class class_name { public boolean isStartedBy(T element) { if (element == null) { return false; } // depends on control dependency: [if], data = [none] return comparator.compare(element, min) == 0; } }
public class class_name { public ByteBuf tlsunwrap(ByteBuffer srcBuffer, ByteBuf dstBuf, PooledByteBufAllocator allocator) { int writerIndex = dstBuf.writerIndex(); ByteBuffer byteBuffer = dstBuf.nioBuffer(writerIndex, dstBuf.writableBytes()); while (true) { SSLEngineResult result; try { result = m_sslEngine.unwrap(srcBuffer, byteBuffer); } catch (SSLException | ReadOnlyBufferException | IllegalArgumentException | IllegalStateException e) { dstBuf.release(); throw new TLSException("ssl engine unwrap fault", e); } catch (Throwable t) { dstBuf.release(); throw t; } switch (result.getStatus()) { case OK: if (result.bytesProduced() <= 0 || srcBuffer.hasRemaining()) { continue; } dstBuf.writerIndex(writerIndex + result.bytesProduced()); return dstBuf; case BUFFER_OVERFLOW: dstBuf.release(); if (m_sslEngine.getSession().getApplicationBufferSize() > dstBuf.writableBytes()) { int size = m_sslEngine.getSession().getApplicationBufferSize(); dstBuf = allocator.buffer(size); writerIndex = dstBuf.writerIndex(); byteBuffer = dstBuf.nioBuffer(writerIndex, dstBuf.writableBytes()); continue; } throw new TLSException("SSL engine unexpectedly overflowed when decrypting"); case BUFFER_UNDERFLOW: dstBuf.release(); throw new TLSException("SSL engine unexpectedly underflowed when decrypting"); case CLOSED: dstBuf.release(); throw new TLSException("SSL engine is closed on ssl unwrap of buffer."); } } } }
public class class_name { public ByteBuf tlsunwrap(ByteBuffer srcBuffer, ByteBuf dstBuf, PooledByteBufAllocator allocator) { int writerIndex = dstBuf.writerIndex(); ByteBuffer byteBuffer = dstBuf.nioBuffer(writerIndex, dstBuf.writableBytes()); while (true) { SSLEngineResult result; try { result = m_sslEngine.unwrap(srcBuffer, byteBuffer); // depends on control dependency: [try], data = [none] } catch (SSLException | ReadOnlyBufferException | IllegalArgumentException | IllegalStateException e) { dstBuf.release(); throw new TLSException("ssl engine unwrap fault", e); } catch (Throwable t) { // depends on control dependency: [catch], data = [none] dstBuf.release(); throw t; } // depends on control dependency: [catch], data = [none] switch (result.getStatus()) { case OK: if (result.bytesProduced() <= 0 || srcBuffer.hasRemaining()) { continue; } dstBuf.writerIndex(writerIndex + result.bytesProduced()); // depends on control dependency: [while], data = [none] return dstBuf; // depends on control dependency: [while], data = [none] case BUFFER_OVERFLOW: dstBuf.release(); if (m_sslEngine.getSession().getApplicationBufferSize() > dstBuf.writableBytes()) { int size = m_sslEngine.getSession().getApplicationBufferSize(); dstBuf = allocator.buffer(size); // depends on control dependency: [if], data = [none] writerIndex = dstBuf.writerIndex(); // depends on control dependency: [if], data = [none] byteBuffer = dstBuf.nioBuffer(writerIndex, dstBuf.writableBytes()); // depends on control dependency: [if], data = [dstBuf.writableBytes())] continue; } throw new TLSException("SSL engine unexpectedly overflowed when decrypting"); case BUFFER_UNDERFLOW: dstBuf.release(); throw new TLSException("SSL engine unexpectedly underflowed when decrypting"); case CLOSED: dstBuf.release(); throw new TLSException("SSL engine is closed on ssl unwrap of buffer."); } } } }
public class class_name { private static void addBoxes(final WPanel panel, final int amount) { for (int i = 1; i <= amount; i++) { panel.add(new BoxComponent(String.valueOf(i))); } } }
public class class_name { private static void addBoxes(final WPanel panel, final int amount) { for (int i = 1; i <= amount; i++) { panel.add(new BoxComponent(String.valueOf(i))); // depends on control dependency: [for], data = [i] } } }
public class class_name { public final Object getStatement(StatementCacheKey key) { Object stmt = statementCache.remove(key); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { if (stmt == null) { Tr.debug(this, tc, "No Matching Prepared Statement found in cache"); } else { Tr.debug(this, tc, "Matching Prepared Statement found in cache: " + stmt); } } return stmt; } }
public class class_name { public final Object getStatement(StatementCacheKey key) { Object stmt = statementCache.remove(key); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { if (stmt == null) { Tr.debug(this, tc, "No Matching Prepared Statement found in cache"); // depends on control dependency: [if], data = [none] } else { Tr.debug(this, tc, "Matching Prepared Statement found in cache: " + stmt); // depends on control dependency: [if], data = [none] } } return stmt; } }
public class class_name { public static <T extends V, V> Value<V> from(Optional<T> optional) { LettuceAssert.notNull(optional, "Optional must not be null"); if (optional.isPresent()) { return new Value<V>(optional.get()); } return (Value<V>) EMPTY; } }
public class class_name { public static <T extends V, V> Value<V> from(Optional<T> optional) { LettuceAssert.notNull(optional, "Optional must not be null"); if (optional.isPresent()) { return new Value<V>(optional.get()); // depends on control dependency: [if], data = [none] } return (Value<V>) EMPTY; } }
public class class_name { public SimpleMatrix getQ() { SimpleMatrix Q = SimpleMatrix.identity(QR.numRows()); int N = Math.min(QR.numCols(),QR.numRows()); // compute Q by first extracting the householder vectors from the columns of QR and then applying it to Q for( int j = N-1; j>= 0; j-- ) { SimpleMatrix u = new SimpleMatrix(QR.numRows(),1); u.insertIntoThis(j,0,QR.extractMatrix(j, END,j,j+1)); u.set(j,1.0); // A = (I - &gamma;*u*u<sup>T</sup>)*A<br> Q = Q.plus(-gammas[j],u.mult(u.transpose()).mult(Q)); } return Q; } }
public class class_name { public SimpleMatrix getQ() { SimpleMatrix Q = SimpleMatrix.identity(QR.numRows()); int N = Math.min(QR.numCols(),QR.numRows()); // compute Q by first extracting the householder vectors from the columns of QR and then applying it to Q for( int j = N-1; j>= 0; j-- ) { SimpleMatrix u = new SimpleMatrix(QR.numRows(),1); u.insertIntoThis(j,0,QR.extractMatrix(j, END,j,j+1)); // depends on control dependency: [for], data = [j] u.set(j,1.0); // depends on control dependency: [for], data = [j] // A = (I - &gamma;*u*u<sup>T</sup>)*A<br> Q = Q.plus(-gammas[j],u.mult(u.transpose()).mult(Q)); // depends on control dependency: [for], data = [j] } return Q; } }
public class class_name { @Override public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) { if ((defaultNamespace!=null) && (namespaceUri.equals(defaultNamespace))) { return ""; } if (namespaceUri.equals(PROV_NS)) { return "prov"; } if (namespaceUri.equals(PRINTER_NS)) { return "prn"; } // if (namespaceUri.equals(XSD_NS)) { // return "xsd"; // } if (namespaceUri.equals(DOMProcessing.XSD_NS_FOR_XML)) { // TODO: TO CHECK that's the one we need return "xsd"; } if (namespaceUri.equals(XML_NS)) { return "xml"; } if (namespaceUri.equals(XSI_NS)) { return "xsi"; } for (String k: nss.keySet()) { if (nss.get(k).equals(namespaceUri)) { return k; } } return suggestion; } }
public class class_name { @Override public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) { if ((defaultNamespace!=null) && (namespaceUri.equals(defaultNamespace))) { return ""; // depends on control dependency: [if], data = [none] } if (namespaceUri.equals(PROV_NS)) { return "prov"; // depends on control dependency: [if], data = [none] } if (namespaceUri.equals(PRINTER_NS)) { return "prn"; // depends on control dependency: [if], data = [none] } // if (namespaceUri.equals(XSD_NS)) { // return "xsd"; // } if (namespaceUri.equals(DOMProcessing.XSD_NS_FOR_XML)) { // TODO: TO CHECK that's the one we need return "xsd"; // depends on control dependency: [if], data = [none] } if (namespaceUri.equals(XML_NS)) { return "xml"; // depends on control dependency: [if], data = [none] } if (namespaceUri.equals(XSI_NS)) { return "xsi"; // depends on control dependency: [if], data = [none] } for (String k: nss.keySet()) { if (nss.get(k).equals(namespaceUri)) { return k; // depends on control dependency: [if], data = [none] } } return suggestion; } }
public class class_name { public void setProductViewDetails(java.util.Collection<ProductViewDetail> productViewDetails) { if (productViewDetails == null) { this.productViewDetails = null; return; } this.productViewDetails = new java.util.ArrayList<ProductViewDetail>(productViewDetails); } }
public class class_name { public void setProductViewDetails(java.util.Collection<ProductViewDetail> productViewDetails) { if (productViewDetails == null) { this.productViewDetails = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.productViewDetails = new java.util.ArrayList<ProductViewDetail>(productViewDetails); } }
public class class_name { public void setServerLaunchConfigurations(java.util.Collection<ServerLaunchConfiguration> serverLaunchConfigurations) { if (serverLaunchConfigurations == null) { this.serverLaunchConfigurations = null; return; } this.serverLaunchConfigurations = new java.util.ArrayList<ServerLaunchConfiguration>(serverLaunchConfigurations); } }
public class class_name { public void setServerLaunchConfigurations(java.util.Collection<ServerLaunchConfiguration> serverLaunchConfigurations) { if (serverLaunchConfigurations == null) { this.serverLaunchConfigurations = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.serverLaunchConfigurations = new java.util.ArrayList<ServerLaunchConfiguration>(serverLaunchConfigurations); } }
public class class_name { public void resume() { if (hasState(PAUSED)) { if (DBG) Log.v(TAG, "resume."); clearState(PAUSED); if (mContentView.isShown()) { schedule(MSG_SHOW, mNotiDisplayTime); return; } if (!mEntries.isEmpty()) { addState(TICKING); schedule(MSG_START, mNotiDisplayTime); } } } }
public class class_name { public void resume() { if (hasState(PAUSED)) { if (DBG) Log.v(TAG, "resume."); clearState(PAUSED); // depends on control dependency: [if], data = [none] if (mContentView.isShown()) { schedule(MSG_SHOW, mNotiDisplayTime); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } if (!mEntries.isEmpty()) { addState(TICKING); // depends on control dependency: [if], data = [none] schedule(MSG_START, mNotiDisplayTime); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void addLast(final T node) { if ( this.firstNode == null ) { this.firstNode = node; this.lastNode = node; } else { T currentLast = this.lastNode; currentLast.setNext( node ); node.setPrevious( currentLast ); this.lastNode = node; } this.size++; } }
public class class_name { public void addLast(final T node) { if ( this.firstNode == null ) { this.firstNode = node; // depends on control dependency: [if], data = [none] this.lastNode = node; // depends on control dependency: [if], data = [none] } else { T currentLast = this.lastNode; currentLast.setNext( node ); // depends on control dependency: [if], data = [none] node.setPrevious( currentLast ); // depends on control dependency: [if], data = [none] this.lastNode = node; // depends on control dependency: [if], data = [none] } this.size++; } }
public class class_name { public MachineTime<U> dividedBy( long divisor, RoundingMode roundingMode ) { if (divisor == 1) { return this; } BigDecimal value = this.toBigDecimal().setScale(9, RoundingMode.FLOOR).divide(new BigDecimal(divisor), roundingMode); MachineTime<?> mt; if (this.scale == POSIX) { mt = MachineTime.ofPosixSeconds(value); } else { mt = MachineTime.ofSISeconds(value); } return cast(mt); } }
public class class_name { public MachineTime<U> dividedBy( long divisor, RoundingMode roundingMode ) { if (divisor == 1) { return this; // depends on control dependency: [if], data = [none] } BigDecimal value = this.toBigDecimal().setScale(9, RoundingMode.FLOOR).divide(new BigDecimal(divisor), roundingMode); MachineTime<?> mt; if (this.scale == POSIX) { mt = MachineTime.ofPosixSeconds(value); // depends on control dependency: [if], data = [none] } else { mt = MachineTime.ofSISeconds(value); // depends on control dependency: [if], data = [none] } return cast(mt); } }
public class class_name { public void setMaxDateCreated(String maxCreationDate) { if ((CmsStringUtil.isNotEmptyOrWhitespaceOnly(maxCreationDate)) && (!maxCreationDate.equals("0"))) { m_searchParams.setMaxDateCreated(Long.parseLong(maxCreationDate)); } else { m_searchParams.setMaxDateCreated(Long.MAX_VALUE); } } }
public class class_name { public void setMaxDateCreated(String maxCreationDate) { if ((CmsStringUtil.isNotEmptyOrWhitespaceOnly(maxCreationDate)) && (!maxCreationDate.equals("0"))) { m_searchParams.setMaxDateCreated(Long.parseLong(maxCreationDate)); // depends on control dependency: [if], data = [none] } else { m_searchParams.setMaxDateCreated(Long.MAX_VALUE); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static List primitiveArrayToList(Object array) { int size = Array.getLength(array); List list = new ArrayList(size); for (int i = 0; i < size; i++) { Object item = Array.get(array, i); if (item != null && item.getClass().isArray() && item.getClass().getComponentType().isPrimitive()) { item = primitiveArrayToList(item); } list.add(item); } return list; } }
public class class_name { public static List primitiveArrayToList(Object array) { int size = Array.getLength(array); List list = new ArrayList(size); for (int i = 0; i < size; i++) { Object item = Array.get(array, i); if (item != null && item.getClass().isArray() && item.getClass().getComponentType().isPrimitive()) { item = primitiveArrayToList(item); // depends on control dependency: [if], data = [(item] } list.add(item); // depends on control dependency: [for], data = [none] } return list; } }
public class class_name { public void addParseBuffer(WsByteBuffer buffer) { // increment where we're about to put the new buffer in int index = ++this.parseIndex; if (null == this.parseBuffers) { // first parse buffer to track this.parseBuffers = new WsByteBuffer[BUFFERS_INITIAL_SIZE]; this.parseBuffersStartPos = new int[BUFFERS_INITIAL_SIZE]; for (int i = 0; i < BUFFERS_INITIAL_SIZE; i++) { this.parseBuffersStartPos[i] = HeaderStorage.NOTSET; } } else if (index == this.parseBuffers.length) { // grow the array int size = index + BUFFERS_MIN_GROWTH; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Increasing parse buffer array size to " + size); } WsByteBuffer[] tempNew = new WsByteBuffer[size]; System.arraycopy(this.parseBuffers, 0, tempNew, 0, index); this.parseBuffers = tempNew; int[] posNew = new int[size]; System.arraycopy(this.parseBuffersStartPos, 0, posNew, 0, index); for (int i = index; i < size; i++) { posNew[i] = HeaderStorage.NOTSET; } this.parseBuffersStartPos = posNew; } this.parseBuffers[index] = buffer; } }
public class class_name { public void addParseBuffer(WsByteBuffer buffer) { // increment where we're about to put the new buffer in int index = ++this.parseIndex; if (null == this.parseBuffers) { // first parse buffer to track this.parseBuffers = new WsByteBuffer[BUFFERS_INITIAL_SIZE]; // depends on control dependency: [if], data = [none] this.parseBuffersStartPos = new int[BUFFERS_INITIAL_SIZE]; // depends on control dependency: [if], data = [none] for (int i = 0; i < BUFFERS_INITIAL_SIZE; i++) { this.parseBuffersStartPos[i] = HeaderStorage.NOTSET; // depends on control dependency: [for], data = [i] } } else if (index == this.parseBuffers.length) { // grow the array int size = index + BUFFERS_MIN_GROWTH; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Increasing parse buffer array size to " + size); // depends on control dependency: [if], data = [none] } WsByteBuffer[] tempNew = new WsByteBuffer[size]; System.arraycopy(this.parseBuffers, 0, tempNew, 0, index); // depends on control dependency: [if], data = [none] this.parseBuffers = tempNew; // depends on control dependency: [if], data = [none] int[] posNew = new int[size]; System.arraycopy(this.parseBuffersStartPos, 0, posNew, 0, index); // depends on control dependency: [if], data = [none] for (int i = index; i < size; i++) { posNew[i] = HeaderStorage.NOTSET; // depends on control dependency: [for], data = [i] } this.parseBuffersStartPos = posNew; // depends on control dependency: [if], data = [none] } this.parseBuffers[index] = buffer; } }
public class class_name { public Expression withOr(Expression... or) { if (this.or == null) { setOr(new java.util.ArrayList<Expression>(or.length)); } for (Expression ele : or) { this.or.add(ele); } return this; } }
public class class_name { public Expression withOr(Expression... or) { if (this.or == null) { setOr(new java.util.ArrayList<Expression>(or.length)); // depends on control dependency: [if], data = [none] } for (Expression ele : or) { this.or.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public final EObject ruleXVariableDeclaration() throws RecognitionException { EObject current = null; Token lv_writeable_1_0=null; Token otherlv_2=null; Token otherlv_6=null; EObject lv_type_3_0 = null; AntlrDatatypeRuleToken lv_name_4_0 = null; AntlrDatatypeRuleToken lv_name_5_0 = null; EObject lv_right_7_0 = null; enterRule(); try { // InternalPureXbase.g:4510:2: ( ( () ( ( (lv_writeable_1_0= 'var' ) ) | otherlv_2= 'val' ) ( ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) | ( (lv_name_5_0= ruleValidID ) ) ) (otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) )? ) ) // InternalPureXbase.g:4511:2: ( () ( ( (lv_writeable_1_0= 'var' ) ) | otherlv_2= 'val' ) ( ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) | ( (lv_name_5_0= ruleValidID ) ) ) (otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) )? ) { // InternalPureXbase.g:4511:2: ( () ( ( (lv_writeable_1_0= 'var' ) ) | otherlv_2= 'val' ) ( ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) | ( (lv_name_5_0= ruleValidID ) ) ) (otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) )? ) // InternalPureXbase.g:4512:3: () ( ( (lv_writeable_1_0= 'var' ) ) | otherlv_2= 'val' ) ( ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) | ( (lv_name_5_0= ruleValidID ) ) ) (otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) )? { // InternalPureXbase.g:4512:3: () // InternalPureXbase.g:4513:4: { if ( state.backtracking==0 ) { current = forceCreateModelElement( grammarAccess.getXVariableDeclarationAccess().getXVariableDeclarationAction_0(), current); } } // InternalPureXbase.g:4519:3: ( ( (lv_writeable_1_0= 'var' ) ) | otherlv_2= 'val' ) int alt80=2; int LA80_0 = input.LA(1); if ( (LA80_0==18) ) { alt80=1; } else if ( (LA80_0==19) ) { alt80=2; } else { if (state.backtracking>0) {state.failed=true; return current;} NoViableAltException nvae = new NoViableAltException("", 80, 0, input); throw nvae; } switch (alt80) { case 1 : // InternalPureXbase.g:4520:4: ( (lv_writeable_1_0= 'var' ) ) { // InternalPureXbase.g:4520:4: ( (lv_writeable_1_0= 'var' ) ) // InternalPureXbase.g:4521:5: (lv_writeable_1_0= 'var' ) { // InternalPureXbase.g:4521:5: (lv_writeable_1_0= 'var' ) // InternalPureXbase.g:4522:6: lv_writeable_1_0= 'var' { lv_writeable_1_0=(Token)match(input,18,FOLLOW_11); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(lv_writeable_1_0, grammarAccess.getXVariableDeclarationAccess().getWriteableVarKeyword_1_0_0()); } if ( state.backtracking==0 ) { if (current==null) { current = createModelElement(grammarAccess.getXVariableDeclarationRule()); } setWithLastConsumed(current, "writeable", true, "var"); } } } } break; case 2 : // InternalPureXbase.g:4535:4: otherlv_2= 'val' { otherlv_2=(Token)match(input,19,FOLLOW_11); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(otherlv_2, grammarAccess.getXVariableDeclarationAccess().getValKeyword_1_1()); } } break; } // InternalPureXbase.g:4540:3: ( ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) | ( (lv_name_5_0= ruleValidID ) ) ) int alt81=2; int LA81_0 = input.LA(1); if ( (LA81_0==RULE_ID) ) { int LA81_1 = input.LA(2); if ( (synpred37_InternalPureXbase()) ) { alt81=1; } else if ( (true) ) { alt81=2; } else { if (state.backtracking>0) {state.failed=true; return current;} NoViableAltException nvae = new NoViableAltException("", 81, 1, input); throw nvae; } } else if ( (LA81_0==15) && (synpred37_InternalPureXbase())) { alt81=1; } else if ( (LA81_0==41) && (synpred37_InternalPureXbase())) { alt81=1; } else { if (state.backtracking>0) {state.failed=true; return current;} NoViableAltException nvae = new NoViableAltException("", 81, 0, input); throw nvae; } switch (alt81) { case 1 : // InternalPureXbase.g:4541:4: ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) { // InternalPureXbase.g:4541:4: ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) // InternalPureXbase.g:4542:5: ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) { // InternalPureXbase.g:4555:5: ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) // InternalPureXbase.g:4556:6: ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) { // InternalPureXbase.g:4556:6: ( (lv_type_3_0= ruleJvmTypeReference ) ) // InternalPureXbase.g:4557:7: (lv_type_3_0= ruleJvmTypeReference ) { // InternalPureXbase.g:4557:7: (lv_type_3_0= ruleJvmTypeReference ) // InternalPureXbase.g:4558:8: lv_type_3_0= ruleJvmTypeReference { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXVariableDeclarationAccess().getTypeJvmTypeReferenceParserRuleCall_2_0_0_0_0()); } pushFollow(FOLLOW_12); lv_type_3_0=ruleJvmTypeReference(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getXVariableDeclarationRule()); } set( current, "type", lv_type_3_0, "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); afterParserOrEnumRuleCall(); } } } // InternalPureXbase.g:4575:6: ( (lv_name_4_0= ruleValidID ) ) // InternalPureXbase.g:4576:7: (lv_name_4_0= ruleValidID ) { // InternalPureXbase.g:4576:7: (lv_name_4_0= ruleValidID ) // InternalPureXbase.g:4577:8: lv_name_4_0= ruleValidID { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXVariableDeclarationAccess().getNameValidIDParserRuleCall_2_0_0_1_0()); } pushFollow(FOLLOW_63); lv_name_4_0=ruleValidID(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getXVariableDeclarationRule()); } set( current, "name", lv_name_4_0, "org.eclipse.xtext.xbase.Xtype.ValidID"); afterParserOrEnumRuleCall(); } } } } } } break; case 2 : // InternalPureXbase.g:4597:4: ( (lv_name_5_0= ruleValidID ) ) { // InternalPureXbase.g:4597:4: ( (lv_name_5_0= ruleValidID ) ) // InternalPureXbase.g:4598:5: (lv_name_5_0= ruleValidID ) { // InternalPureXbase.g:4598:5: (lv_name_5_0= ruleValidID ) // InternalPureXbase.g:4599:6: lv_name_5_0= ruleValidID { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXVariableDeclarationAccess().getNameValidIDParserRuleCall_2_1_0()); } pushFollow(FOLLOW_63); lv_name_5_0=ruleValidID(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getXVariableDeclarationRule()); } set( current, "name", lv_name_5_0, "org.eclipse.xtext.xbase.Xtype.ValidID"); afterParserOrEnumRuleCall(); } } } } break; } // InternalPureXbase.g:4617:3: (otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) )? int alt82=2; int LA82_0 = input.LA(1); if ( (LA82_0==20) ) { alt82=1; } switch (alt82) { case 1 : // InternalPureXbase.g:4618:4: otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) { otherlv_6=(Token)match(input,20,FOLLOW_3); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(otherlv_6, grammarAccess.getXVariableDeclarationAccess().getEqualsSignKeyword_3_0()); } // InternalPureXbase.g:4622:4: ( (lv_right_7_0= ruleXExpression ) ) // InternalPureXbase.g:4623:5: (lv_right_7_0= ruleXExpression ) { // InternalPureXbase.g:4623:5: (lv_right_7_0= ruleXExpression ) // InternalPureXbase.g:4624:6: lv_right_7_0= ruleXExpression { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXVariableDeclarationAccess().getRightXExpressionParserRuleCall_3_1_0()); } pushFollow(FOLLOW_2); lv_right_7_0=ruleXExpression(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getXVariableDeclarationRule()); } set( current, "right", lv_right_7_0, "org.eclipse.xtext.xbase.Xbase.XExpression"); afterParserOrEnumRuleCall(); } } } } break; } } } if ( state.backtracking==0 ) { leaveRule(); } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; } }
public class class_name { public final EObject ruleXVariableDeclaration() throws RecognitionException { EObject current = null; Token lv_writeable_1_0=null; Token otherlv_2=null; Token otherlv_6=null; EObject lv_type_3_0 = null; AntlrDatatypeRuleToken lv_name_4_0 = null; AntlrDatatypeRuleToken lv_name_5_0 = null; EObject lv_right_7_0 = null; enterRule(); try { // InternalPureXbase.g:4510:2: ( ( () ( ( (lv_writeable_1_0= 'var' ) ) | otherlv_2= 'val' ) ( ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) | ( (lv_name_5_0= ruleValidID ) ) ) (otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) )? ) ) // InternalPureXbase.g:4511:2: ( () ( ( (lv_writeable_1_0= 'var' ) ) | otherlv_2= 'val' ) ( ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) | ( (lv_name_5_0= ruleValidID ) ) ) (otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) )? ) { // InternalPureXbase.g:4511:2: ( () ( ( (lv_writeable_1_0= 'var' ) ) | otherlv_2= 'val' ) ( ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) | ( (lv_name_5_0= ruleValidID ) ) ) (otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) )? ) // InternalPureXbase.g:4512:3: () ( ( (lv_writeable_1_0= 'var' ) ) | otherlv_2= 'val' ) ( ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) | ( (lv_name_5_0= ruleValidID ) ) ) (otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) )? { // InternalPureXbase.g:4512:3: () // InternalPureXbase.g:4513:4: { if ( state.backtracking==0 ) { current = forceCreateModelElement( grammarAccess.getXVariableDeclarationAccess().getXVariableDeclarationAction_0(), current); // depends on control dependency: [if], data = [none] } } // InternalPureXbase.g:4519:3: ( ( (lv_writeable_1_0= 'var' ) ) | otherlv_2= 'val' ) int alt80=2; int LA80_0 = input.LA(1); if ( (LA80_0==18) ) { alt80=1; // depends on control dependency: [if], data = [none] } else if ( (LA80_0==19) ) { alt80=2; // depends on control dependency: [if], data = [none] } else { if (state.backtracking>0) {state.failed=true; return current;} // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] NoViableAltException nvae = new NoViableAltException("", 80, 0, input); throw nvae; } switch (alt80) { case 1 : // InternalPureXbase.g:4520:4: ( (lv_writeable_1_0= 'var' ) ) { // InternalPureXbase.g:4520:4: ( (lv_writeable_1_0= 'var' ) ) // InternalPureXbase.g:4521:5: (lv_writeable_1_0= 'var' ) { // InternalPureXbase.g:4521:5: (lv_writeable_1_0= 'var' ) // InternalPureXbase.g:4522:6: lv_writeable_1_0= 'var' { lv_writeable_1_0=(Token)match(input,18,FOLLOW_11); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(lv_writeable_1_0, grammarAccess.getXVariableDeclarationAccess().getWriteableVarKeyword_1_0_0()); // depends on control dependency: [if], data = [none] } if ( state.backtracking==0 ) { if (current==null) { current = createModelElement(grammarAccess.getXVariableDeclarationRule()); // depends on control dependency: [if], data = [none] } setWithLastConsumed(current, "writeable", true, "var"); // depends on control dependency: [if], data = [none] } } } } break; case 2 : // InternalPureXbase.g:4535:4: otherlv_2= 'val' { otherlv_2=(Token)match(input,19,FOLLOW_11); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(otherlv_2, grammarAccess.getXVariableDeclarationAccess().getValKeyword_1_1()); // depends on control dependency: [if], data = [none] } } break; } // InternalPureXbase.g:4540:3: ( ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) | ( (lv_name_5_0= ruleValidID ) ) ) int alt81=2; int LA81_0 = input.LA(1); if ( (LA81_0==RULE_ID) ) { int LA81_1 = input.LA(2); if ( (synpred37_InternalPureXbase()) ) { alt81=1; // depends on control dependency: [if], data = [none] } else if ( (true) ) { alt81=2; // depends on control dependency: [if], data = [none] } else { if (state.backtracking>0) {state.failed=true; return current;} // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] NoViableAltException nvae = new NoViableAltException("", 81, 1, input); throw nvae; } } else if ( (LA81_0==15) && (synpred37_InternalPureXbase())) { alt81=1; // depends on control dependency: [if], data = [none] } else if ( (LA81_0==41) && (synpred37_InternalPureXbase())) { alt81=1; // depends on control dependency: [if], data = [none] } else { if (state.backtracking>0) {state.failed=true; return current;} // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] NoViableAltException nvae = new NoViableAltException("", 81, 0, input); throw nvae; } switch (alt81) { case 1 : // InternalPureXbase.g:4541:4: ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) { // InternalPureXbase.g:4541:4: ( ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) ) // InternalPureXbase.g:4542:5: ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )=> ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) { // InternalPureXbase.g:4555:5: ( ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) ) // InternalPureXbase.g:4556:6: ( (lv_type_3_0= ruleJvmTypeReference ) ) ( (lv_name_4_0= ruleValidID ) ) { // InternalPureXbase.g:4556:6: ( (lv_type_3_0= ruleJvmTypeReference ) ) // InternalPureXbase.g:4557:7: (lv_type_3_0= ruleJvmTypeReference ) { // InternalPureXbase.g:4557:7: (lv_type_3_0= ruleJvmTypeReference ) // InternalPureXbase.g:4558:8: lv_type_3_0= ruleJvmTypeReference { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXVariableDeclarationAccess().getTypeJvmTypeReferenceParserRuleCall_2_0_0_0_0()); // depends on control dependency: [if], data = [none] } pushFollow(FOLLOW_12); lv_type_3_0=ruleJvmTypeReference(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getXVariableDeclarationRule()); // depends on control dependency: [if], data = [none] } set( current, "type", lv_type_3_0, "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); // depends on control dependency: [if], data = [none] afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none] } } } // InternalPureXbase.g:4575:6: ( (lv_name_4_0= ruleValidID ) ) // InternalPureXbase.g:4576:7: (lv_name_4_0= ruleValidID ) { // InternalPureXbase.g:4576:7: (lv_name_4_0= ruleValidID ) // InternalPureXbase.g:4577:8: lv_name_4_0= ruleValidID { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXVariableDeclarationAccess().getNameValidIDParserRuleCall_2_0_0_1_0()); // depends on control dependency: [if], data = [none] } pushFollow(FOLLOW_63); lv_name_4_0=ruleValidID(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getXVariableDeclarationRule()); // depends on control dependency: [if], data = [none] } set( current, "name", lv_name_4_0, "org.eclipse.xtext.xbase.Xtype.ValidID"); // depends on control dependency: [if], data = [none] afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none] } } } } } } break; case 2 : // InternalPureXbase.g:4597:4: ( (lv_name_5_0= ruleValidID ) ) { // InternalPureXbase.g:4597:4: ( (lv_name_5_0= ruleValidID ) ) // InternalPureXbase.g:4598:5: (lv_name_5_0= ruleValidID ) { // InternalPureXbase.g:4598:5: (lv_name_5_0= ruleValidID ) // InternalPureXbase.g:4599:6: lv_name_5_0= ruleValidID { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXVariableDeclarationAccess().getNameValidIDParserRuleCall_2_1_0()); // depends on control dependency: [if], data = [none] } pushFollow(FOLLOW_63); lv_name_5_0=ruleValidID(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getXVariableDeclarationRule()); // depends on control dependency: [if], data = [none] } set( current, "name", lv_name_5_0, "org.eclipse.xtext.xbase.Xtype.ValidID"); // depends on control dependency: [if], data = [none] afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none] } } } } break; } // InternalPureXbase.g:4617:3: (otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) )? int alt82=2; int LA82_0 = input.LA(1); if ( (LA82_0==20) ) { alt82=1; // depends on control dependency: [if], data = [none] } switch (alt82) { case 1 : // InternalPureXbase.g:4618:4: otherlv_6= '=' ( (lv_right_7_0= ruleXExpression ) ) { otherlv_6=(Token)match(input,20,FOLLOW_3); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(otherlv_6, grammarAccess.getXVariableDeclarationAccess().getEqualsSignKeyword_3_0()); // depends on control dependency: [if], data = [none] } // InternalPureXbase.g:4622:4: ( (lv_right_7_0= ruleXExpression ) ) // InternalPureXbase.g:4623:5: (lv_right_7_0= ruleXExpression ) { // InternalPureXbase.g:4623:5: (lv_right_7_0= ruleXExpression ) // InternalPureXbase.g:4624:6: lv_right_7_0= ruleXExpression { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXVariableDeclarationAccess().getRightXExpressionParserRuleCall_3_1_0()); // depends on control dependency: [if], data = [none] } pushFollow(FOLLOW_2); lv_right_7_0=ruleXExpression(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getXVariableDeclarationRule()); // depends on control dependency: [if], data = [none] } set( current, "right", lv_right_7_0, "org.eclipse.xtext.xbase.Xbase.XExpression"); // depends on control dependency: [if], data = [none] afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none] } } } } break; } } } if ( state.backtracking==0 ) { leaveRule(); // depends on control dependency: [if], data = [none] } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; } }
public class class_name { public final void setTimeZone(final TimeZone timezone) { this.timezone = timezone; if (timezone != null) { getFormat().setTimeZone(timezone); } else { resetTimeZone(); } time = new Time(time, getFormat().getTimeZone(), false); } }
public class class_name { public final void setTimeZone(final TimeZone timezone) { this.timezone = timezone; if (timezone != null) { getFormat().setTimeZone(timezone); // depends on control dependency: [if], data = [(timezone] } else { resetTimeZone(); // depends on control dependency: [if], data = [none] } time = new Time(time, getFormat().getTimeZone(), false); } }
public class class_name { private static PersistenceUnitMetadata findWithinDeployment(DeploymentUnit unit, String persistenceUnitName) { if (traceEnabled) { ROOT_LOGGER.tracef("pu findWithinDeployment searching for %s", persistenceUnitName); } for (ResourceRoot root : DeploymentUtils.allResourceRoots(unit)) { PersistenceUnitMetadataHolder holder = root.getAttachment(PersistenceUnitMetadataHolder.PERSISTENCE_UNITS); if (holder == null || holder.getPersistenceUnits() == null) { if (traceEnabled) { ROOT_LOGGER.tracef("pu findWithinDeployment skipping empty pu holder for %s", persistenceUnitName); } continue; } ambiguousPUError(unit, persistenceUnitName, holder); persistenceUnitName = defaultPersistenceUnitName(persistenceUnitName, holder); for (PersistenceUnitMetadata persistenceUnit : holder.getPersistenceUnits()) { if (traceEnabled) { ROOT_LOGGER.tracef("findWithinDeployment check '%s' against pu '%s'", persistenceUnitName, persistenceUnit.getPersistenceUnitName()); } if (persistenceUnitName == null || persistenceUnitName.length() == 0 || persistenceUnit.getPersistenceUnitName().equals(persistenceUnitName)) { if (traceEnabled) { ROOT_LOGGER.tracef("findWithinDeployment matched '%s' against pu '%s'", persistenceUnitName, persistenceUnit.getPersistenceUnitName()); } return persistenceUnit; } } } return null; } }
public class class_name { private static PersistenceUnitMetadata findWithinDeployment(DeploymentUnit unit, String persistenceUnitName) { if (traceEnabled) { ROOT_LOGGER.tracef("pu findWithinDeployment searching for %s", persistenceUnitName); // depends on control dependency: [if], data = [none] } for (ResourceRoot root : DeploymentUtils.allResourceRoots(unit)) { PersistenceUnitMetadataHolder holder = root.getAttachment(PersistenceUnitMetadataHolder.PERSISTENCE_UNITS); if (holder == null || holder.getPersistenceUnits() == null) { if (traceEnabled) { ROOT_LOGGER.tracef("pu findWithinDeployment skipping empty pu holder for %s", persistenceUnitName); // depends on control dependency: [if], data = [none] } continue; } ambiguousPUError(unit, persistenceUnitName, holder); // depends on control dependency: [for], data = [none] persistenceUnitName = defaultPersistenceUnitName(persistenceUnitName, holder); // depends on control dependency: [for], data = [none] for (PersistenceUnitMetadata persistenceUnit : holder.getPersistenceUnits()) { if (traceEnabled) { ROOT_LOGGER.tracef("findWithinDeployment check '%s' against pu '%s'", persistenceUnitName, persistenceUnit.getPersistenceUnitName()); } if (persistenceUnitName == null || persistenceUnitName.length() == 0 || persistenceUnit.getPersistenceUnitName().equals(persistenceUnitName)) { if (traceEnabled) { ROOT_LOGGER.tracef("findWithinDeployment matched '%s' against pu '%s'", persistenceUnitName, persistenceUnit.getPersistenceUnitName()); // depends on control dependency: [if], data = [none] } return persistenceUnit; // depends on control dependency: [for], data = [persistenceUnit] } } } return null; } }
public class class_name { protected void threadStop() { if (thread == null) { return; } threadDone = true; thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { ; } thread = null; } }
public class class_name { protected void threadStop() { if (thread == null) { return; // depends on control dependency: [if], data = [none] } threadDone = true; thread.interrupt(); try { thread.join(); // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { ; } // depends on control dependency: [catch], data = [none] thread = null; } }
public class class_name { public void finished() { final ScheduledFuture<?> scheduled = nextCall.getAndSet(null); if (scheduled != null) { scheduled.cancel(true); } } }
public class class_name { public void finished() { final ScheduledFuture<?> scheduled = nextCall.getAndSet(null); if (scheduled != null) { scheduled.cancel(true); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected static String getCacheKey(URL url) { String protocol = url.getProtocol().toLowerCase(Locale.ROOT); String host = url.getHost().toLowerCase(Locale.ROOT); int port = url.getPort(); if (port == -1) { port = url.getDefaultPort(); } /* * Robot rules apply only to host, protocol, and port where robots.txt * is hosted (cf. NUTCH-1752). Consequently */ return protocol + ":" + host + ":" + port; } }
public class class_name { protected static String getCacheKey(URL url) { String protocol = url.getProtocol().toLowerCase(Locale.ROOT); String host = url.getHost().toLowerCase(Locale.ROOT); int port = url.getPort(); if (port == -1) { port = url.getDefaultPort(); // depends on control dependency: [if], data = [none] } /* * Robot rules apply only to host, protocol, and port where robots.txt * is hosted (cf. NUTCH-1752). Consequently */ return protocol + ":" + host + ":" + port; } }
public class class_name { @PublicAPI(usage = ACCESS) public static Set<Location> of(Iterable<URL> urls) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : urls) { result.add(Location.of(url)); } return result.build(); } }
public class class_name { @PublicAPI(usage = ACCESS) public static Set<Location> of(Iterable<URL> urls) { ImmutableSet.Builder<Location> result = ImmutableSet.builder(); for (URL url : urls) { result.add(Location.of(url)); // depends on control dependency: [for], data = [url] } return result.build(); } }
public class class_name { public void load(ClassLoader classLoader) { Map<String, GroovyRunner> map = runnerMap; // direct read if (map == null) { map = getMap(); // initialize and load (recursive call), result ignored if (classLoader == null) { // getMap() already loaded using a null classloader return; } } writeLock.lock(); try { if (classLoader == null) { classLoader = Thread.currentThread().getContextClassLoader(); } cachedValues = null; loadDefaultRunners(); loadWithLock(classLoader); } catch (SecurityException se) { LOG.log(Level.WARNING, "Failed to get the context ClassLoader", se); } catch (ServiceConfigurationError sce) { LOG.log(Level.WARNING, "Failed to load GroovyRunner services from ClassLoader " + classLoader, sce); } finally { writeLock.unlock(); } } }
public class class_name { public void load(ClassLoader classLoader) { Map<String, GroovyRunner> map = runnerMap; // direct read if (map == null) { map = getMap(); // initialize and load (recursive call), result ignored // depends on control dependency: [if], data = [none] if (classLoader == null) { // getMap() already loaded using a null classloader return; // depends on control dependency: [if], data = [none] } } writeLock.lock(); try { if (classLoader == null) { classLoader = Thread.currentThread().getContextClassLoader(); // depends on control dependency: [if], data = [none] } cachedValues = null; // depends on control dependency: [try], data = [none] loadDefaultRunners(); // depends on control dependency: [try], data = [none] loadWithLock(classLoader); // depends on control dependency: [try], data = [none] } catch (SecurityException se) { LOG.log(Level.WARNING, "Failed to get the context ClassLoader", se); } catch (ServiceConfigurationError sce) { // depends on control dependency: [catch], data = [none] LOG.log(Level.WARNING, "Failed to load GroovyRunner services from ClassLoader " + classLoader, sce); } finally { // depends on control dependency: [catch], data = [none] writeLock.unlock(); } } }
public class class_name { private void jenkins48775workaround(Proxy proxy, URL url) { if ("https".equals(url.getProtocol()) && !authCacheSeeded && proxy != Proxy.NO_PROXY) { HttpURLConnection preAuth = null; try { // We do not care if there is anything at this URL, all we care is that it is using the proxy preAuth = (HttpURLConnection) new URL("http", url.getHost(), -1, "/").openConnection(proxy); preAuth.setRequestMethod("HEAD"); preAuth.connect(); } catch (IOException e) { // ignore, this is just a probe we don't care at all } finally { if (preAuth != null) { preAuth.disconnect(); } } authCacheSeeded = true; } else if ("https".equals(url.getProtocol())){ // if we access any http url using a proxy then the auth cache will have been seeded authCacheSeeded = authCacheSeeded || proxy != Proxy.NO_PROXY; } } }
public class class_name { private void jenkins48775workaround(Proxy proxy, URL url) { if ("https".equals(url.getProtocol()) && !authCacheSeeded && proxy != Proxy.NO_PROXY) { HttpURLConnection preAuth = null; try { // We do not care if there is anything at this URL, all we care is that it is using the proxy preAuth = (HttpURLConnection) new URL("http", url.getHost(), -1, "/").openConnection(proxy); // depends on control dependency: [try], data = [none] preAuth.setRequestMethod("HEAD"); // depends on control dependency: [try], data = [none] preAuth.connect(); // depends on control dependency: [try], data = [none] } catch (IOException e) { // ignore, this is just a probe we don't care at all } finally { // depends on control dependency: [catch], data = [none] if (preAuth != null) { preAuth.disconnect(); // depends on control dependency: [if], data = [none] } } authCacheSeeded = true; // depends on control dependency: [if], data = [none] } else if ("https".equals(url.getProtocol())){ // if we access any http url using a proxy then the auth cache will have been seeded authCacheSeeded = authCacheSeeded || proxy != Proxy.NO_PROXY; // depends on control dependency: [if], data = [none] } } }
public class class_name { private void updateGUI(SimpleImageSequence<T> sequence) { BufferedImage orig = sequence.getGuiImage(); Graphics2D g2 = orig.createGraphics(); // draw tracks with semi-unique colors so you can track individual points with your eyes for( PointTrack p : tracker.getActiveTracks(null) ) { int red = (int)(2.5*(p.featureId%100)); int green = (int)((255.0/150.0)*(p.featureId%150)); int blue = (int)(p.featureId%255); VisualizeFeatures.drawPoint(g2, (int)p.x, (int)p.y, new Color(red,green,blue)); } // draw tracks which have just been spawned green for( PointTrack p : tracker.getNewTracks(null) ) { VisualizeFeatures.drawPoint(g2, (int)p.x, (int)p.y, Color.green); } // tell the GUI to update gui.setImage(orig); gui.repaint(); } }
public class class_name { private void updateGUI(SimpleImageSequence<T> sequence) { BufferedImage orig = sequence.getGuiImage(); Graphics2D g2 = orig.createGraphics(); // draw tracks with semi-unique colors so you can track individual points with your eyes for( PointTrack p : tracker.getActiveTracks(null) ) { int red = (int)(2.5*(p.featureId%100)); int green = (int)((255.0/150.0)*(p.featureId%150)); int blue = (int)(p.featureId%255); VisualizeFeatures.drawPoint(g2, (int)p.x, (int)p.y, new Color(red,green,blue)); // depends on control dependency: [for], data = [p] } // draw tracks which have just been spawned green for( PointTrack p : tracker.getNewTracks(null) ) { VisualizeFeatures.drawPoint(g2, (int)p.x, (int)p.y, Color.green); // depends on control dependency: [for], data = [p] } // tell the GUI to update gui.setImage(orig); gui.repaint(); } }
public class class_name { public void beforeBatch(PreparedStatement stmt) throws PlatformException { // Check for Oracle batching support final Method methodSetExecuteBatch; final Method methodSendBatch; methodSetExecuteBatch = ClassHelper.getMethod(stmt, "setExecuteBatch", PARAM_TYPE_INTEGER); methodSendBatch = ClassHelper.getMethod(stmt, "sendBatch", null); final boolean statementBatchingSupported = methodSetExecuteBatch != null && methodSendBatch != null; if (statementBatchingSupported) { try { // Set number of statements per batch methodSetExecuteBatch.invoke(stmt, PARAM_STATEMENT_BATCH_SIZE); m_batchStatementsInProgress.put(stmt, methodSendBatch); } catch (Exception e) { throw new PlatformException(e.getLocalizedMessage(), e); } } else { super.beforeBatch(stmt); } } }
public class class_name { public void beforeBatch(PreparedStatement stmt) throws PlatformException { // Check for Oracle batching support final Method methodSetExecuteBatch; final Method methodSendBatch; methodSetExecuteBatch = ClassHelper.getMethod(stmt, "setExecuteBatch", PARAM_TYPE_INTEGER); methodSendBatch = ClassHelper.getMethod(stmt, "sendBatch", null); final boolean statementBatchingSupported = methodSetExecuteBatch != null && methodSendBatch != null; if (statementBatchingSupported) { try { // Set number of statements per batch methodSetExecuteBatch.invoke(stmt, PARAM_STATEMENT_BATCH_SIZE); // depends on control dependency: [try], data = [none] m_batchStatementsInProgress.put(stmt, methodSendBatch); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new PlatformException(e.getLocalizedMessage(), e); } // depends on control dependency: [catch], data = [none] } else { super.beforeBatch(stmt); } } }
public class class_name { protected void initVisibilities(Element root, CmsXmlContentDefinition contentDefinition) { m_visibilityConfigurations = new HashMap<String, VisibilityConfiguration>(); String mainHandlerClassName = root.attributeValue(APPINFO_ATTR_CLASS); // using self as the default visibility handler implementation I_CmsXmlContentVisibilityHandler mainHandler = this; if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(mainHandlerClassName)) { try { // in case there is a main handler configured, try to instanciate it Class<?> handlerClass = Class.forName(mainHandlerClassName); mainHandler = (I_CmsXmlContentVisibilityHandler)handlerClass.newInstance(); } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); } } List<Element> elements = new ArrayList<Element>(CmsXmlGenericWrapper.elements(root, APPINFO_VISIBILITY)); for (Element element : elements) { try { String elementName = element.attributeValue(APPINFO_ATTR_ELEMENT); String handlerClassName = element.attributeValue(APPINFO_ATTR_CLASS); String params = element.attributeValue(APPINFO_ATTR_PARAMS); I_CmsXmlContentVisibilityHandler handler = null; if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(handlerClassName)) { Class<?> handlerClass = Class.forName(handlerClassName); handler = (I_CmsXmlContentVisibilityHandler)handlerClass.newInstance(); } else { handler = mainHandler; } m_visibilityConfigurations.put(elementName, new VisibilityConfiguration(handler, params)); } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); } } } }
public class class_name { protected void initVisibilities(Element root, CmsXmlContentDefinition contentDefinition) { m_visibilityConfigurations = new HashMap<String, VisibilityConfiguration>(); String mainHandlerClassName = root.attributeValue(APPINFO_ATTR_CLASS); // using self as the default visibility handler implementation I_CmsXmlContentVisibilityHandler mainHandler = this; if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(mainHandlerClassName)) { try { // in case there is a main handler configured, try to instanciate it Class<?> handlerClass = Class.forName(mainHandlerClassName); mainHandler = (I_CmsXmlContentVisibilityHandler)handlerClass.newInstance(); } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); } // depends on control dependency: [catch], data = [none] } List<Element> elements = new ArrayList<Element>(CmsXmlGenericWrapper.elements(root, APPINFO_VISIBILITY)); for (Element element : elements) { try { String elementName = element.attributeValue(APPINFO_ATTR_ELEMENT); String handlerClassName = element.attributeValue(APPINFO_ATTR_CLASS); String params = element.attributeValue(APPINFO_ATTR_PARAMS); I_CmsXmlContentVisibilityHandler handler = null; if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(handlerClassName)) { Class<?> handlerClass = Class.forName(handlerClassName); handler = (I_CmsXmlContentVisibilityHandler)handlerClass.newInstance(); } else { handler = mainHandler; // depends on control dependency: [if], data = [none] } m_visibilityConfigurations.put(elementName, new VisibilityConfiguration(handler, params)); // depends on control dependency: [try], data = [none] } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public void marshall(DescribeClusterRequest describeClusterRequest, ProtocolMarshaller protocolMarshaller) { if (describeClusterRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeClusterRequest.getName(), NAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DescribeClusterRequest describeClusterRequest, ProtocolMarshaller protocolMarshaller) { if (describeClusterRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeClusterRequest.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public void removeQueue(final String queueName, final boolean all) { for (final Worker worker : this.workers) { worker.removeQueue(queueName, all); } } }
public class class_name { @Override public void removeQueue(final String queueName, final boolean all) { for (final Worker worker : this.workers) { worker.removeQueue(queueName, all); // depends on control dependency: [for], data = [worker] } } }
public class class_name { public static IAtomContainer makeDeepCopy(IAtomContainer container) { IAtomContainer newAtomContainer = container.getBuilder().newInstance(IAtomContainer.class); // Deep copy of the Atoms IAtom[] atoms = copyAtoms(container, newAtomContainer); // Deep copy of the bonds copyBonds(atoms, container, newAtomContainer); // Deep copy of the LonePairs for (int index = 0; index < container.getLonePairCount(); index++) { if (container.getAtom(index).getSymbol().equalsIgnoreCase("R") || container.getAtom(index).getSymbol().equalsIgnoreCase("A")) { newAtomContainer.addLonePair(container.getBuilder().newInstance(ILonePair.class, container.getAtom(index))); } else { newAtomContainer.addLonePair(index); } } for (int index = 0; index < container.getSingleElectronCount(); index++) { newAtomContainer.addSingleElectron(index); } newAtomContainer.addProperties(container.getProperties()); newAtomContainer.setFlags(container.getFlags()); newAtomContainer.setID(container.getID()); newAtomContainer.notifyChanged(); return newAtomContainer; } }
public class class_name { public static IAtomContainer makeDeepCopy(IAtomContainer container) { IAtomContainer newAtomContainer = container.getBuilder().newInstance(IAtomContainer.class); // Deep copy of the Atoms IAtom[] atoms = copyAtoms(container, newAtomContainer); // Deep copy of the bonds copyBonds(atoms, container, newAtomContainer); // Deep copy of the LonePairs for (int index = 0; index < container.getLonePairCount(); index++) { if (container.getAtom(index).getSymbol().equalsIgnoreCase("R") || container.getAtom(index).getSymbol().equalsIgnoreCase("A")) { newAtomContainer.addLonePair(container.getBuilder().newInstance(ILonePair.class, container.getAtom(index))); // depends on control dependency: [if], data = [none] } else { newAtomContainer.addLonePair(index); // depends on control dependency: [if], data = [none] } } for (int index = 0; index < container.getSingleElectronCount(); index++) { newAtomContainer.addSingleElectron(index); // depends on control dependency: [for], data = [index] } newAtomContainer.addProperties(container.getProperties()); newAtomContainer.setFlags(container.getFlags()); newAtomContainer.setID(container.getID()); newAtomContainer.notifyChanged(); return newAtomContainer; } }
public class class_name { public int getCount(IESigType eSigType) { int result = 0; for (ESigItem item : items) { if (item.getESigType().equals(eSigType)) { result++; } } return result; } }
public class class_name { public int getCount(IESigType eSigType) { int result = 0; for (ESigItem item : items) { if (item.getESigType().equals(eSigType)) { result++; // depends on control dependency: [if], data = [none] } } return result; } }
public class class_name { public AObject find(String name) { for (int i = 0; i < nextid; i++) { if (objects[i].getName().equals(name)) { return objects[i]; } } return null; } }
public class class_name { public AObject find(String name) { for (int i = 0; i < nextid; i++) { if (objects[i].getName().equals(name)) { return objects[i]; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { InvocationContext getInvocationContextWithImplicitTransaction(int keyCount, boolean forceCreateTransaction) { InvocationContext invocationContext; boolean txInjected = false; if (transactional) { Transaction transaction = getOngoingTransaction(true); if (transaction == null && (forceCreateTransaction || config.transaction().autoCommit())) { transaction = tryBegin(); txInjected = true; } invocationContext = invocationContextFactory.createInvocationContext(transaction, txInjected); } else { invocationContext = invocationContextFactory.createInvocationContext(true, keyCount); } return invocationContext; } }
public class class_name { InvocationContext getInvocationContextWithImplicitTransaction(int keyCount, boolean forceCreateTransaction) { InvocationContext invocationContext; boolean txInjected = false; if (transactional) { Transaction transaction = getOngoingTransaction(true); if (transaction == null && (forceCreateTransaction || config.transaction().autoCommit())) { transaction = tryBegin(); // depends on control dependency: [if], data = [none] txInjected = true; // depends on control dependency: [if], data = [none] } invocationContext = invocationContextFactory.createInvocationContext(transaction, txInjected); // depends on control dependency: [if], data = [none] } else { invocationContext = invocationContextFactory.createInvocationContext(true, keyCount); // depends on control dependency: [if], data = [none] } return invocationContext; } }
public class class_name { public Structure getStructureForDomain(ScopDomain domain, ScopDatabase scopDatabase, boolean strictLigandHandling) throws IOException, StructureException { String pdbId = domain.getPdbId(); Structure fullStructure = getStructureForPdbId(pdbId); Structure structure = domain.reduce(fullStructure); // TODO It would be better to move all of this into the reduce method, // but that would require ligand handling properties in StructureIdentifiers // because ligands sometimes occur after TER records in PDB files, we may need to add some ligands back in // specifically, we add a ligand if and only if it occurs within the domain AtomPositionMap map = null; List<ResidueRangeAndLength> rrs = null; if (strictLigandHandling) { map = new AtomPositionMap(StructureTools.getAllAtomArray(fullStructure), AtomPositionMap.ANYTHING_MATCHER); rrs = ResidueRangeAndLength.parseMultiple(domain.getRanges(), map); } for (Chain chain : fullStructure.getNonPolyChains()) { if (!structure.hasPdbChain(chain.getName())) { continue; // we can't do anything with a chain our domain } Chain newChain; if (! structure.hasNonPolyChain(chain.getId())) { newChain = new ChainImpl(); newChain.setId(chain.getId()); newChain.setName(chain.getName()); newChain.setEntityInfo(chain.getEntityInfo()); structure.addChain(newChain); } else { newChain = structure.getNonPolyChain(chain.getId()); } List<Group> ligands = StructureTools.filterLigands(chain.getAtomGroups()); for (Group group : ligands) { boolean shouldContain = true; if (strictLigandHandling) { shouldContain = false; // whether the ligand occurs within the domain for (ResidueRange rr : rrs) { if (rr.contains(group.getResidueNumber(), map)) { shouldContain = true; } } } boolean alreadyContains = newChain.getAtomGroups().contains(group); // we don't want to add duplicate // ligands if (shouldContain && !alreadyContains) { newChain.addGroup(group); } } } // build a more meaningful description for the new structure StringBuilder header = new StringBuilder(); header.append(domain.getClassificationId()); if (scopDatabase != null) { int sf = domain.getSuperfamilyId(); ScopDescription description = scopDatabase.getScopDescriptionBySunid(sf); if (description != null) { header.append(" | "); header.append(description.getDescription()); } } structure.getPDBHeader().setDescription(header.toString()); return structure; } }
public class class_name { public Structure getStructureForDomain(ScopDomain domain, ScopDatabase scopDatabase, boolean strictLigandHandling) throws IOException, StructureException { String pdbId = domain.getPdbId(); Structure fullStructure = getStructureForPdbId(pdbId); Structure structure = domain.reduce(fullStructure); // TODO It would be better to move all of this into the reduce method, // but that would require ligand handling properties in StructureIdentifiers // because ligands sometimes occur after TER records in PDB files, we may need to add some ligands back in // specifically, we add a ligand if and only if it occurs within the domain AtomPositionMap map = null; List<ResidueRangeAndLength> rrs = null; if (strictLigandHandling) { map = new AtomPositionMap(StructureTools.getAllAtomArray(fullStructure), AtomPositionMap.ANYTHING_MATCHER); rrs = ResidueRangeAndLength.parseMultiple(domain.getRanges(), map); } for (Chain chain : fullStructure.getNonPolyChains()) { if (!structure.hasPdbChain(chain.getName())) { continue; // we can't do anything with a chain our domain } Chain newChain; if (! structure.hasNonPolyChain(chain.getId())) { newChain = new ChainImpl(); newChain.setId(chain.getId()); newChain.setName(chain.getName()); newChain.setEntityInfo(chain.getEntityInfo()); structure.addChain(newChain); } else { newChain = structure.getNonPolyChain(chain.getId()); } List<Group> ligands = StructureTools.filterLigands(chain.getAtomGroups()); for (Group group : ligands) { boolean shouldContain = true; if (strictLigandHandling) { shouldContain = false; // whether the ligand occurs within the domain // depends on control dependency: [if], data = [none] for (ResidueRange rr : rrs) { if (rr.contains(group.getResidueNumber(), map)) { shouldContain = true; // depends on control dependency: [if], data = [none] } } } boolean alreadyContains = newChain.getAtomGroups().contains(group); // we don't want to add duplicate // ligands if (shouldContain && !alreadyContains) { newChain.addGroup(group); // depends on control dependency: [if], data = [none] } } } // build a more meaningful description for the new structure StringBuilder header = new StringBuilder(); header.append(domain.getClassificationId()); if (scopDatabase != null) { int sf = domain.getSuperfamilyId(); ScopDescription description = scopDatabase.getScopDescriptionBySunid(sf); if (description != null) { header.append(" | "); header.append(description.getDescription()); } } structure.getPDBHeader().setDescription(header.toString()); return structure; } }
public class class_name { private void checkJodaSetYear() { int COUNT = COUNT_FAST; // Is it fair to use only MutableDateTime here? You decide. MutableDateTime dt = new MutableDateTime(GJChronology.getInstance()); for (int i = 0; i < AVERAGE; i++) { start("Joda", "setYear"); for (int j = 0; j < COUNT; j++) { dt.setYear(1972); if (dt == null) {System.out.println("Anti optimise");} } end(COUNT); } } }
public class class_name { private void checkJodaSetYear() { int COUNT = COUNT_FAST; // Is it fair to use only MutableDateTime here? You decide. MutableDateTime dt = new MutableDateTime(GJChronology.getInstance()); for (int i = 0; i < AVERAGE; i++) { start("Joda", "setYear"); // depends on control dependency: [for], data = [none] for (int j = 0; j < COUNT; j++) { dt.setYear(1972); // depends on control dependency: [for], data = [none] if (dt == null) {System.out.println("Anti optimise");} // depends on control dependency: [if], data = [none] } end(COUNT); // depends on control dependency: [for], data = [none] } } }
public class class_name { public void marshall(UpdateSchemaRequest updateSchemaRequest, ProtocolMarshaller protocolMarshaller) { if (updateSchemaRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateSchemaRequest.getSchemaArn(), SCHEMAARN_BINDING); protocolMarshaller.marshall(updateSchemaRequest.getName(), NAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(UpdateSchemaRequest updateSchemaRequest, ProtocolMarshaller protocolMarshaller) { if (updateSchemaRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateSchemaRequest.getSchemaArn(), SCHEMAARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateSchemaRequest.getName(), NAME_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 { T getTemporalOfOpenEnd() { T temporal = this.end.getTemporal(); if (temporal == null) { throw new UnsupportedOperationException( "An infinite interval has no finite duration."); } else if (this.end.isClosed()) { return this.getTimeLine().stepForward(temporal); } else { return temporal; } } }
public class class_name { T getTemporalOfOpenEnd() { T temporal = this.end.getTemporal(); if (temporal == null) { throw new UnsupportedOperationException( "An infinite interval has no finite duration."); } else if (this.end.isClosed()) { return this.getTimeLine().stepForward(temporal); // depends on control dependency: [if], data = [none] } else { return temporal; // depends on control dependency: [if], data = [none] } } }
public class class_name { public static void main(String[] args) throws Exception { Logger logger = Logger.getLogger("MASReader.main"); Properties beastConfigProperties = new Properties(); String beastConfigPropertiesFile = null; if (args.length > 0) { beastConfigPropertiesFile = args[0]; beastConfigProperties.load(new FileInputStream( beastConfigPropertiesFile)); logger.info("Properties file selected -> " + beastConfigPropertiesFile); } else { logger.severe("No properties file found. Set the path of properties file as argument."); throw new BeastException( "No properties file found. Set the path of properties file as argument."); } String loggerConfigPropertiesFile; if (args.length > 1) { Properties loggerConfigProperties = new Properties(); loggerConfigPropertiesFile = args[1]; try { FileInputStream loggerConfigFile = new FileInputStream( loggerConfigPropertiesFile); loggerConfigProperties.load(loggerConfigFile); LogManager.getLogManager().readConfiguration(loggerConfigFile); logger.info("Logging properties configured successfully. Logger config file: " + loggerConfigPropertiesFile); } catch (IOException ex) { logger.warning("WARNING: Could not open configuration file"); logger.warning("WARNING: Logging not configured (console output only)"); } } else { loggerConfigPropertiesFile = null; } MASReader.generateJavaFiles( beastConfigProperties.getProperty("requirementsFolder"), "\"" + beastConfigProperties.getProperty("MASPlatform") + "\"", beastConfigProperties.getProperty("srcTestRootFolder"), beastConfigProperties.getProperty("storiesPackage"), beastConfigProperties.getProperty("caseManagerPackage"), loggerConfigPropertiesFile, beastConfigProperties.getProperty("specificationPhase")); } }
public class class_name { public static void main(String[] args) throws Exception { Logger logger = Logger.getLogger("MASReader.main"); Properties beastConfigProperties = new Properties(); String beastConfigPropertiesFile = null; if (args.length > 0) { beastConfigPropertiesFile = args[0]; beastConfigProperties.load(new FileInputStream( beastConfigPropertiesFile)); logger.info("Properties file selected -> " + beastConfigPropertiesFile); } else { logger.severe("No properties file found. Set the path of properties file as argument."); throw new BeastException( "No properties file found. Set the path of properties file as argument."); } String loggerConfigPropertiesFile; if (args.length > 1) { Properties loggerConfigProperties = new Properties(); loggerConfigPropertiesFile = args[1]; try { FileInputStream loggerConfigFile = new FileInputStream( loggerConfigPropertiesFile); loggerConfigProperties.load(loggerConfigFile); // depends on control dependency: [try], data = [none] LogManager.getLogManager().readConfiguration(loggerConfigFile); // depends on control dependency: [try], data = [none] logger.info("Logging properties configured successfully. Logger config file: " + loggerConfigPropertiesFile); // depends on control dependency: [try], data = [none] } catch (IOException ex) { logger.warning("WARNING: Could not open configuration file"); logger.warning("WARNING: Logging not configured (console output only)"); } // depends on control dependency: [catch], data = [none] } else { loggerConfigPropertiesFile = null; } MASReader.generateJavaFiles( beastConfigProperties.getProperty("requirementsFolder"), "\"" + beastConfigProperties.getProperty("MASPlatform") + "\"", beastConfigProperties.getProperty("srcTestRootFolder"), beastConfigProperties.getProperty("storiesPackage"), beastConfigProperties.getProperty("caseManagerPackage"), loggerConfigPropertiesFile, beastConfigProperties.getProperty("specificationPhase")); } }
public class class_name { private int probe() { // Fast path for reliable well-distributed probe, available from JDK 7+. // As long as PROBE is final this branch will be inlined. if (PROBE != -1) { int probe; if ((probe = UNSAFE.getInt(Thread.currentThread(), PROBE)) == 0) { ThreadLocalRandom.current(); // force initialization probe = UNSAFE.getInt(Thread.currentThread(), PROBE); } return probe; } /* * Else use much worse (for values distribution) method: * Mix thread id with golden ratio and then xorshift it * to spread consecutive ids (see Knuth multiplicative method as reference). */ int probe = (int) ((Thread.currentThread().getId() * 0x9e3779b9) & Integer.MAX_VALUE); // xorshift probe ^= probe << 13; probe ^= probe >>> 17; probe ^= probe << 5; return probe; } }
public class class_name { private int probe() { // Fast path for reliable well-distributed probe, available from JDK 7+. // As long as PROBE is final this branch will be inlined. if (PROBE != -1) { int probe; if ((probe = UNSAFE.getInt(Thread.currentThread(), PROBE)) == 0) { ThreadLocalRandom.current(); // force initialization // depends on control dependency: [if], data = [none] probe = UNSAFE.getInt(Thread.currentThread(), PROBE); // depends on control dependency: [if], data = [none] } return probe; // depends on control dependency: [if], data = [none] } /* * Else use much worse (for values distribution) method: * Mix thread id with golden ratio and then xorshift it * to spread consecutive ids (see Knuth multiplicative method as reference). */ int probe = (int) ((Thread.currentThread().getId() * 0x9e3779b9) & Integer.MAX_VALUE); // xorshift probe ^= probe << 13; probe ^= probe >>> 17; probe ^= probe << 5; return probe; } }
public class class_name { @SuppressWarnings("unchecked") public boolean tryStart(final ProcessorGraphNode processorGraphNode) { this.processorLock.lock(); final boolean canStart; try { if (isRunning(processorGraphNode) || isFinished(processorGraphNode) || !allAreFinished(processorGraphNode.getRequirements())) { canStart = false; } else { started(processorGraphNode); canStart = true; } } finally { this.processorLock.unlock(); } return canStart; } }
public class class_name { @SuppressWarnings("unchecked") public boolean tryStart(final ProcessorGraphNode processorGraphNode) { this.processorLock.lock(); final boolean canStart; try { if (isRunning(processorGraphNode) || isFinished(processorGraphNode) || !allAreFinished(processorGraphNode.getRequirements())) { canStart = false; // depends on control dependency: [if], data = [none] } else { started(processorGraphNode); // depends on control dependency: [if], data = [none] canStart = true; // depends on control dependency: [if], data = [none] } } finally { this.processorLock.unlock(); } return canStart; } }
public class class_name { private static Object coerceNumber(Object value) { if ( value instanceof Number && !(value instanceof BigDecimal) ) { return getBigDecimalOrNull( value ); } else { return value; } } }
public class class_name { private static Object coerceNumber(Object value) { if ( value instanceof Number && !(value instanceof BigDecimal) ) { return getBigDecimalOrNull( value ); // depends on control dependency: [if], data = [none] } else { return value; // depends on control dependency: [if], data = [none] } } }
public class class_name { void notifyMessagePreConsume(SITransaction transaction) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "notifyMessagePreConsume", transaction); if (!(transaction instanceof SIXAResource)) { // We wish to increment this count even under auto_ack, since we use // it to determine whether the onMessage calls recover. uncommittedReceiveCount++; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() && (uncommittedReceiveCount % 100 == 0)) { SibTr.debug(this, tc, "session " + this + " uncommittedReceiveCount : " + uncommittedReceiveCount); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "notifyMessagePreConsume"); } }
public class class_name { void notifyMessagePreConsume(SITransaction transaction) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "notifyMessagePreConsume", transaction); if (!(transaction instanceof SIXAResource)) { // We wish to increment this count even under auto_ack, since we use // it to determine whether the onMessage calls recover. uncommittedReceiveCount++; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() && (uncommittedReceiveCount % 100 == 0)) { SibTr.debug(this, tc, "session " + this + " uncommittedReceiveCount : " + uncommittedReceiveCount); // depends on control dependency: [if], data = [none] } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "notifyMessagePreConsume"); } }
public class class_name { private ImmutableList<Writer> sortedWriters() { ImmutableList.Builder<Writer> sorted = ImmutableList.builder(); // invertedDependencies is intended to just be a 'view' on dependencies, so when dependencies is modified // we should always also modify invertedDependencies (and vice-versa). Multimap<Writer, Writer> dependencies = HashMultimap.create(this.dependencies); Multimap<Writer, Writer> invertedDependencies = HashMultimap.create(); Multimaps.invertFrom(dependencies, invertedDependencies); Queue<Writer> writerWithoutDependencies = new ArrayDeque<>(Sets.filter(writers, property -> dependencies.get(property).isEmpty())); Writer property; // Retrieve the next property without any dependencies while ((property = writerWithoutDependencies.poll()) != null) { sorted.add(property); // We copy this into a new list because the underlying collection gets modified during iteration Collection<Writer> dependents = Lists.newArrayList(invertedDependencies.get(property)); for (Writer dependent : dependents) { // Because the property has been removed, the dependent no longer needs to depend on it dependencies.remove(dependent, property); invertedDependencies.remove(property, dependent); boolean hasNoDependencies = dependencies.get(dependent).isEmpty(); if (hasNoDependencies) { writerWithoutDependencies.add(dependent); } } } if (!dependencies.isEmpty()) { // This means there must have been a loop. Pick an arbitrary remaining var to display Variable var = dependencies.keys().iterator().next().var(); throw GraqlQueryException.insertRecursive(printableRepresentation(var)); } return sorted.build(); } }
public class class_name { private ImmutableList<Writer> sortedWriters() { ImmutableList.Builder<Writer> sorted = ImmutableList.builder(); // invertedDependencies is intended to just be a 'view' on dependencies, so when dependencies is modified // we should always also modify invertedDependencies (and vice-versa). Multimap<Writer, Writer> dependencies = HashMultimap.create(this.dependencies); Multimap<Writer, Writer> invertedDependencies = HashMultimap.create(); Multimaps.invertFrom(dependencies, invertedDependencies); Queue<Writer> writerWithoutDependencies = new ArrayDeque<>(Sets.filter(writers, property -> dependencies.get(property).isEmpty())); Writer property; // Retrieve the next property without any dependencies while ((property = writerWithoutDependencies.poll()) != null) { sorted.add(property); // depends on control dependency: [while], data = [none] // We copy this into a new list because the underlying collection gets modified during iteration Collection<Writer> dependents = Lists.newArrayList(invertedDependencies.get(property)); for (Writer dependent : dependents) { // Because the property has been removed, the dependent no longer needs to depend on it dependencies.remove(dependent, property); // depends on control dependency: [for], data = [dependent] invertedDependencies.remove(property, dependent); // depends on control dependency: [for], data = [dependent] boolean hasNoDependencies = dependencies.get(dependent).isEmpty(); if (hasNoDependencies) { writerWithoutDependencies.add(dependent); // depends on control dependency: [if], data = [none] } } } if (!dependencies.isEmpty()) { // This means there must have been a loop. Pick an arbitrary remaining var to display Variable var = dependencies.keys().iterator().next().var(); throw GraqlQueryException.insertRecursive(printableRepresentation(var)); } return sorted.build(); } }
public class class_name { RLSSuspendToken registerSuspend(int timeout) { if (tc.isEntryEnabled()) Tr.entry(tc, "registerSuspend", new Integer(timeout)); // Generate the suspend token // RLSSuspendToken token = new RLSSuspendTokenImpl(); RLSSuspendToken token = Configuration.getRecoveryLogComponent() .createRLSSuspendToken(null); // Alarm reference Alarm alarm = null; // For a timeout value greater than zero, we create an alarm // A zero timeout value indicates that this suspend operation will // never timeout, hence no alarm is required if (timeout > 0) { // Create an alarm // alarm = AlarmManager.createNonDeferrable(((long)timeout) * 1000L, this, token); alarm = Configuration.getAlarmManager(). scheduleAlarm(timeout * 1000L, this, token); if (tc.isEventEnabled()) Tr.event(tc, "Alarm has been created for this suspend call", alarm); } synchronized(_tokenMap) { // Register the token and the alarm with the token map // bearing in mind that this alarm could be null _tokenMap.put(token, alarm); } if (tc.isEntryEnabled()) Tr.exit(tc, "registerSuspend", token); // Return the generated token return token; } }
public class class_name { RLSSuspendToken registerSuspend(int timeout) { if (tc.isEntryEnabled()) Tr.entry(tc, "registerSuspend", new Integer(timeout)); // Generate the suspend token // RLSSuspendToken token = new RLSSuspendTokenImpl(); RLSSuspendToken token = Configuration.getRecoveryLogComponent() .createRLSSuspendToken(null); // Alarm reference Alarm alarm = null; // For a timeout value greater than zero, we create an alarm // A zero timeout value indicates that this suspend operation will // never timeout, hence no alarm is required if (timeout > 0) { // Create an alarm // alarm = AlarmManager.createNonDeferrable(((long)timeout) * 1000L, this, token); alarm = Configuration.getAlarmManager(). scheduleAlarm(timeout * 1000L, this, token); // depends on control dependency: [if], data = [none] if (tc.isEventEnabled()) Tr.event(tc, "Alarm has been created for this suspend call", alarm); } synchronized(_tokenMap) { // Register the token and the alarm with the token map // bearing in mind that this alarm could be null _tokenMap.put(token, alarm); } if (tc.isEntryEnabled()) Tr.exit(tc, "registerSuspend", token); // Return the generated token return token; } }
public class class_name { private static String getAnchorAssociateChartId( final CTTwoCellAnchor ctanchor) { if (ctanchor.getGraphicFrame() == null) { return null; } Node parentNode = ctanchor.getGraphicFrame().getGraphic() .getGraphicData().getDomNode(); NodeList childNodes = parentNode.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { Node childNode = childNodes.item(i); if ((childNode != null) && ("c:chart".equalsIgnoreCase(childNode.getNodeName())) && (childNode.hasAttributes())) { String rId = getChartIdFromChildNodeAttributes( childNode.getAttributes()); if (rId != null) { return rId; } } } return null; } }
public class class_name { private static String getAnchorAssociateChartId( final CTTwoCellAnchor ctanchor) { if (ctanchor.getGraphicFrame() == null) { return null; // depends on control dependency: [if], data = [none] } Node parentNode = ctanchor.getGraphicFrame().getGraphic() .getGraphicData().getDomNode(); NodeList childNodes = parentNode.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { Node childNode = childNodes.item(i); if ((childNode != null) && ("c:chart".equalsIgnoreCase(childNode.getNodeName())) && (childNode.hasAttributes())) { String rId = getChartIdFromChildNodeAttributes( childNode.getAttributes()); if (rId != null) { return rId; // depends on control dependency: [if], data = [none] } } } return null; } }
public class class_name { public ServiceCall<TranslationResult> translate(TranslateOptions translateOptions) { Validator.notNull(translateOptions, "translateOptions cannot be null"); String[] pathSegments = { "v3/translate" }; RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("language_translator", "v3", "translate"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); final JsonObject contentJson = new JsonObject(); contentJson.add("text", GsonSingleton.getGson().toJsonTree(translateOptions.text())); if (translateOptions.modelId() != null) { contentJson.addProperty("model_id", translateOptions.modelId()); } if (translateOptions.source() != null) { contentJson.addProperty("source", translateOptions.source()); } if (translateOptions.target() != null) { contentJson.addProperty("target", translateOptions.target()); } builder.bodyJson(contentJson); return createServiceCall(builder.build(), ResponseConverterUtils.getObject(TranslationResult.class)); } }
public class class_name { public ServiceCall<TranslationResult> translate(TranslateOptions translateOptions) { Validator.notNull(translateOptions, "translateOptions cannot be null"); String[] pathSegments = { "v3/translate" }; RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("language_translator", "v3", "translate"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); // depends on control dependency: [for], data = [header] } builder.header("Accept", "application/json"); final JsonObject contentJson = new JsonObject(); contentJson.add("text", GsonSingleton.getGson().toJsonTree(translateOptions.text())); if (translateOptions.modelId() != null) { contentJson.addProperty("model_id", translateOptions.modelId()); // depends on control dependency: [if], data = [none] } if (translateOptions.source() != null) { contentJson.addProperty("source", translateOptions.source()); // depends on control dependency: [if], data = [none] } if (translateOptions.target() != null) { contentJson.addProperty("target", translateOptions.target()); // depends on control dependency: [if], data = [none] } builder.bodyJson(contentJson); return createServiceCall(builder.build(), ResponseConverterUtils.getObject(TranslationResult.class)); } }
public class class_name { private final void decode(ByteBuffer buffer, TextureFormat fmt) throws IOException { byte[] curLine = new byte[width * bytesPerPixel + 1]; byte[] prevLine = new byte[width * bytesPerPixel + 1]; final Inflater inflater = new Inflater(); try { for (int y = 0; y < height; y++) { readChunkUnzip(inflater, curLine, 0, curLine.length); unfilter(curLine, prevLine); switch (colorType) { case COLOR_TRUECOLOR: switch (fmt) { case ABGR: copyRGBtoABGR(buffer, curLine); break; case RGBA: copyRGBtoRGBA(buffer, curLine); break; case RGB: copy(buffer, curLine); break; default: throw new UnsupportedOperationException("Unsupported format for this image"); } break; case COLOR_TRUEALPHA: switch (fmt) { case ABGR: copyRGBAtoABGR(buffer, curLine); break; case RGBA: copy(buffer, curLine); break; case RGB: copyRGBAtoRGB(buffer, curLine); break; default: throw new UnsupportedOperationException("Unsupported format for this image"); } break; case COLOR_GREYSCALE: switch (fmt) { case LUMINANCE: case ALPHA: copy(buffer, curLine); break; default: throw new UnsupportedOperationException("Unsupported format for this image"); } break; case COLOR_INDEXED: switch (fmt) { case ABGR: copyPALtoABGR(buffer, curLine); break; case RGBA: copyPALtoRGBA(buffer, curLine); break; default: throw new UnsupportedOperationException("Unsupported format for this image"); } break; default: throw new UnsupportedOperationException("Not yet implemented"); } byte[] tmp = curLine; curLine = prevLine; prevLine = tmp; } } finally { inflater.end(); } } }
public class class_name { private final void decode(ByteBuffer buffer, TextureFormat fmt) throws IOException { byte[] curLine = new byte[width * bytesPerPixel + 1]; byte[] prevLine = new byte[width * bytesPerPixel + 1]; final Inflater inflater = new Inflater(); try { for (int y = 0; y < height; y++) { readChunkUnzip(inflater, curLine, 0, curLine.length); // depends on control dependency: [for], data = [none] unfilter(curLine, prevLine); // depends on control dependency: [for], data = [none] switch (colorType) { case COLOR_TRUECOLOR: switch (fmt) { case ABGR: copyRGBtoABGR(buffer, curLine); break; case RGBA: copyRGBtoRGBA(buffer, curLine); break; case RGB: copy(buffer, curLine); break; default: throw new UnsupportedOperationException("Unsupported format for this image"); } break; case COLOR_TRUEALPHA: switch (fmt) { case ABGR: copyRGBAtoABGR(buffer, curLine); break; case RGBA: copy(buffer, curLine); break; case RGB: copyRGBAtoRGB(buffer, curLine); break; default: throw new UnsupportedOperationException("Unsupported format for this image"); } break; case COLOR_GREYSCALE: switch (fmt) { case LUMINANCE: case ALPHA: copy(buffer, curLine); break; default: throw new UnsupportedOperationException("Unsupported format for this image"); } break; case COLOR_INDEXED: switch (fmt) { case ABGR: copyPALtoABGR(buffer, curLine); break; case RGBA: copyPALtoRGBA(buffer, curLine); break; default: throw new UnsupportedOperationException("Unsupported format for this image"); } break; default: throw new UnsupportedOperationException("Not yet implemented"); } byte[] tmp = curLine; curLine = prevLine; // depends on control dependency: [for], data = [none] prevLine = tmp; // depends on control dependency: [for], data = [none] } } finally { inflater.end(); } } }
public class class_name { public static void generateFieldParser(BindTypeContext context, PersistType persistType, BindProperty property, Modifier... modifiers) { Converter<String, String> format = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_CAMEL); MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("parse" + format.convert(property.getName())).addJavadoc("for attribute $L parsing\n", property.getName()).returns(typeName(property.getElement())); methodBuilder.addModifiers(modifiers); switch (persistType) { case STRING: methodBuilder.addParameter(ParameterSpec.builder(className(String.class), "input").build()); break; case BYTE: methodBuilder.addParameter(ParameterSpec.builder(TypeUtility.arrayTypeName(Byte.TYPE), "input").build()); break; } // if property type is byte[], return directly the value if (ArrayTypeName.of(Byte.TYPE).equals(property.getPropertyType().getTypeName()) && persistType == PersistType.BYTE) { methodBuilder.addStatement("return input"); } else { methodBuilder.beginControlFlow("if (input==null)"); methodBuilder.addStatement("return null"); methodBuilder.endControlFlow(); methodBuilder.addStatement("$T context=$T.jsonBind()", KriptonJsonContext.class, KriptonBinder.class); methodBuilder.beginControlFlow("try ($T wrapper=context.createParser(input))", JacksonWrapperParser.class); methodBuilder.addStatement("$T jacksonParser=wrapper.jacksonParser", JsonParser.class); methodBuilder.addCode("// START_OBJECT\n"); methodBuilder.addStatement("jacksonParser.nextToken()"); if (!property.isBindedObject()) { methodBuilder.addCode("// value of \"element\"\n"); methodBuilder.addStatement("jacksonParser.nextValue()"); } String parserName = "jacksonParser"; BindTransform bindTransform = BindTransformer.lookup(property); if (property.getParent()==null || ((ModelClass<?>)property.getParent()).isMutablePojo()) { methodBuilder.addStatement("$T result=null", property.getPropertyType().getTypeName()); } else { methodBuilder.addStatement("$T $L=null", property.getPropertyType().getTypeName(), ImmutableUtility.IMMUTABLE_PREFIX+property.getName()); } bindTransform.generateParseOnJackson(context, methodBuilder, parserName, null, "result", property); if (property.getParent()==null || ((ModelClass<?>)property.getParent()).isMutablePojo()) { methodBuilder.addStatement("return result"); } else { methodBuilder.addStatement("return $L", ImmutableUtility.IMMUTABLE_PREFIX+property.getName()); } methodBuilder.nextControlFlow("catch($T e)", Exception.class); methodBuilder.addStatement("throw(new $T(e.getMessage()))", KriptonRuntimeException.class); methodBuilder.endControlFlow(); } context.builder.addMethod(methodBuilder.build()); } }
public class class_name { public static void generateFieldParser(BindTypeContext context, PersistType persistType, BindProperty property, Modifier... modifiers) { Converter<String, String> format = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_CAMEL); MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("parse" + format.convert(property.getName())).addJavadoc("for attribute $L parsing\n", property.getName()).returns(typeName(property.getElement())); methodBuilder.addModifiers(modifiers); switch (persistType) { case STRING: methodBuilder.addParameter(ParameterSpec.builder(className(String.class), "input").build()); break; case BYTE: methodBuilder.addParameter(ParameterSpec.builder(TypeUtility.arrayTypeName(Byte.TYPE), "input").build()); break; } // if property type is byte[], return directly the value if (ArrayTypeName.of(Byte.TYPE).equals(property.getPropertyType().getTypeName()) && persistType == PersistType.BYTE) { methodBuilder.addStatement("return input"); // depends on control dependency: [if], data = [none] } else { methodBuilder.beginControlFlow("if (input==null)"); // depends on control dependency: [if], data = [none] methodBuilder.addStatement("return null"); // depends on control dependency: [if], data = [none] methodBuilder.endControlFlow(); // depends on control dependency: [if], data = [none] methodBuilder.addStatement("$T context=$T.jsonBind()", KriptonJsonContext.class, KriptonBinder.class); // depends on control dependency: [if], data = [none] methodBuilder.beginControlFlow("try ($T wrapper=context.createParser(input))", JacksonWrapperParser.class); // depends on control dependency: [if], data = [none] methodBuilder.addStatement("$T jacksonParser=wrapper.jacksonParser", JsonParser.class); // depends on control dependency: [if], data = [none] methodBuilder.addCode("// START_OBJECT\n"); methodBuilder.addStatement("jacksonParser.nextToken()"); // depends on control dependency: [if], data = [none] if (!property.isBindedObject()) { methodBuilder.addCode("// value of \"element\"\n"); methodBuilder.addStatement("jacksonParser.nextValue()"); // depends on control dependency: [if], data = [none] } String parserName = "jacksonParser"; BindTransform bindTransform = BindTransformer.lookup(property); if (property.getParent()==null || ((ModelClass<?>)property.getParent()).isMutablePojo()) { methodBuilder.addStatement("$T result=null", property.getPropertyType().getTypeName()); // depends on control dependency: [if], data = [none] } else { methodBuilder.addStatement("$T $L=null", property.getPropertyType().getTypeName(), ImmutableUtility.IMMUTABLE_PREFIX+property.getName()); // depends on control dependency: [if], data = [none] } bindTransform.generateParseOnJackson(context, methodBuilder, parserName, null, "result", property); // depends on control dependency: [if], data = [none] if (property.getParent()==null || ((ModelClass<?>)property.getParent()).isMutablePojo()) { methodBuilder.addStatement("return result"); // depends on control dependency: [if], data = [none] } else { methodBuilder.addStatement("return $L", ImmutableUtility.IMMUTABLE_PREFIX+property.getName()); // depends on control dependency: [if], data = [none] } methodBuilder.nextControlFlow("catch($T e)", Exception.class); // depends on control dependency: [if], data = [none] methodBuilder.addStatement("throw(new $T(e.getMessage()))", KriptonRuntimeException.class); // depends on control dependency: [if], data = [none] methodBuilder.endControlFlow(); // depends on control dependency: [if], data = [none] } context.builder.addMethod(methodBuilder.build()); } }
public class class_name { public String toAbsolute(String target) { if (isNotInitialized()) { return getMessage(NOT_INITIALIZED); } return CmsLinkManager.getAbsoluteUri(target, getController().getCurrentRequest().getElementUri()); } }
public class class_name { public String toAbsolute(String target) { if (isNotInitialized()) { return getMessage(NOT_INITIALIZED); // depends on control dependency: [if], data = [none] } return CmsLinkManager.getAbsoluteUri(target, getController().getCurrentRequest().getElementUri()); } }
public class class_name { public static ICalDataType find(String value) { if ("CID".equalsIgnoreCase(value)) { //"CID" is an alias for "CONTENT-ID" (vCal 1.0, p.17) return CONTENT_ID; } return enums.find(value); } }
public class class_name { public static ICalDataType find(String value) { if ("CID".equalsIgnoreCase(value)) { //"CID" is an alias for "CONTENT-ID" (vCal 1.0, p.17) return CONTENT_ID; // depends on control dependency: [if], data = [none] } return enums.find(value); } }
public class class_name { public boolean isReallocationRequired() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "isReallocationRequired"); SibTr.exit(tc, "isReallocationRequired", Boolean.valueOf(reallocateOnCommit)); } return reallocateOnCommit; } }
public class class_name { public boolean isReallocationRequired() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "isReallocationRequired"); // depends on control dependency: [if], data = [none] SibTr.exit(tc, "isReallocationRequired", Boolean.valueOf(reallocateOnCommit)); // depends on control dependency: [if], data = [none] } return reallocateOnCommit; } }
public class class_name { int writeValueSet(int type, Object id, ValueSet vs, boolean all) { final String methodName = "writeValueSet()"; int returnCode = NO_EXCEPTION; Exception diskException = null; HashtableOnDisk cache_instance = null; if (vs.size() == 0) { return returnCode; } HashtableOnDisk vshtod = null; try { rwLock.writeLock().lock(); if (type == DEP_ID_DATA) { cache_instance = dependency_cache; } else { cache_instance = template_cache; } //if (this.testException) { // throw new FileManagerException("*** Generate filemanager exception"); //} Long vsinstid = (Long) cache_instance.get(id); long vsinstance = 0; FileManager filemgr = cache_instance.getFileManager(); if (vsinstid == null) { // // no such instance as yet. Make one and put its pointer into the main valueset htod. // int valueSize = calculateTableSize(id, vs.size()); vsinstance = HashtableOnDisk.createInstance(filemgr, valueSize, hashtable_threshold); vshtod = HashtableOnDisk.getInstance(filemgr, valueset_rehash, vsinstance, !HashtableOnDisk.HAS_CACHE_VALUE, this); cache_instance.put(id, new Long(vsinstance)); } else { // // Existing instance. Get it and clear it. // Is this right? In the original code this method completely replaced the // existing valueset we I assume we want to do that here also. If we don't // clear it this method would perform a merge. If a merge is ok then we // can skip this step with potential for significant performance benefit. // // I don't think we should clear vsinstance = vsinstid.longValue(); if (vsinstance != -1) { vshtod = HashtableOnDisk.getInstance(filemgr, valueset_rehash, vsinstance, !HashtableOnDisk.HAS_CACHE_VALUE, this); } else { int valueSize = calculateTableSize(id, vs.size()); vsinstance = HashtableOnDisk.createInstance(filemgr, valueSize, hashtable_threshold); vshtod = HashtableOnDisk.getInstance(filemgr, valueset_rehash, vsinstance, !HashtableOnDisk.HAS_CACHE_VALUE, this); cache_instance.put(id, new Long(vsinstance)); } // pass the new table size to HashtableOndisk so that it can use it to rehash if (all == ALL) { if (vshtod.size() > 0) { vshtod.clear(); } vshtod.tempTableSize = calculateTableSize(id, vs.size()); } else { vshtod.tempTableSize = calculateTableSize(id, vshtod.size() + vs.size()); } //if (vshtod.size() < vs.size()) { // // pass the new table size to HashtableOndisk so that it can use it to rehash // vshtod.tempTableSize = calculateTableSize(id, vs.size()); //} //vshtod.clear(); } Object entry = null; do { entry = vs.getOne(); if (entry != null) { vshtod.put(entry, null); // value is null - better performance by skipping serialization and deserialization vs.remove(entry); } } while (entry != null); vshtod.close(); vshtod = null; } catch (FileManagerException ex) { this.diskCacheException = ex; diskException = ex; returnCode = DISK_EXCEPTION; } catch (HashtableOnDiskException ex) { this.diskCacheException = ex; diskException = ex; returnCode = DISK_EXCEPTION; } catch (IOException ex) { diskException = ex; if (ex.getMessage().equals(DISK_CACHE_IN_GB_OVER_LIMIT_MSG)) { returnCode = DISK_SIZE_OVER_LIMIT_EXCEPTION; } else { this.diskCacheException = ex; returnCode = DISK_EXCEPTION; } } catch (Exception ex) { returnCode = OTHER_EXCEPTION; diskException = ex; } finally { if (returnCode != NO_EXCEPTION) { if (tc.isDebugEnabled()) Tr.debug(tc, methodName, "cacheName=" + this.cacheName + "\n Exception: " + ExceptionUtility.getStackTrace(diskException)); } if (returnCode == DISK_EXCEPTION || returnCode == OTHER_EXCEPTION) { com.ibm.ws.ffdc.FFDCFilter.processException(diskException, "com.ibm.ws.cache.HTODDynacache.writeValueSet", "1738", this); } try { if (vshtod != null) { vshtod.close(); } } catch (Exception ex) { com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.HTODDynacache.writeValueSet", "1745", this); } rwLock.writeLock().unlock(); } return returnCode; } }
public class class_name { int writeValueSet(int type, Object id, ValueSet vs, boolean all) { final String methodName = "writeValueSet()"; int returnCode = NO_EXCEPTION; Exception diskException = null; HashtableOnDisk cache_instance = null; if (vs.size() == 0) { return returnCode; // depends on control dependency: [if], data = [none] } HashtableOnDisk vshtod = null; try { rwLock.writeLock().lock(); // depends on control dependency: [try], data = [none] if (type == DEP_ID_DATA) { cache_instance = dependency_cache; // depends on control dependency: [if], data = [none] } else { cache_instance = template_cache; // depends on control dependency: [if], data = [none] } //if (this.testException) { // throw new FileManagerException("*** Generate filemanager exception"); //} Long vsinstid = (Long) cache_instance.get(id); long vsinstance = 0; FileManager filemgr = cache_instance.getFileManager(); if (vsinstid == null) { // // no such instance as yet. Make one and put its pointer into the main valueset htod. // int valueSize = calculateTableSize(id, vs.size()); vsinstance = HashtableOnDisk.createInstance(filemgr, valueSize, hashtable_threshold); // depends on control dependency: [if], data = [none] vshtod = HashtableOnDisk.getInstance(filemgr, valueset_rehash, vsinstance, !HashtableOnDisk.HAS_CACHE_VALUE, this); // depends on control dependency: [if], data = [none] cache_instance.put(id, new Long(vsinstance)); // depends on control dependency: [if], data = [none] } else { // // Existing instance. Get it and clear it. // Is this right? In the original code this method completely replaced the // existing valueset we I assume we want to do that here also. If we don't // clear it this method would perform a merge. If a merge is ok then we // can skip this step with potential for significant performance benefit. // // I don't think we should clear vsinstance = vsinstid.longValue(); // depends on control dependency: [if], data = [none] if (vsinstance != -1) { vshtod = HashtableOnDisk.getInstance(filemgr, valueset_rehash, vsinstance, !HashtableOnDisk.HAS_CACHE_VALUE, this); // depends on control dependency: [if], data = [none] } else { int valueSize = calculateTableSize(id, vs.size()); vsinstance = HashtableOnDisk.createInstance(filemgr, valueSize, hashtable_threshold); // depends on control dependency: [if], data = [none] vshtod = HashtableOnDisk.getInstance(filemgr, valueset_rehash, vsinstance, !HashtableOnDisk.HAS_CACHE_VALUE, this); // depends on control dependency: [if], data = [none] cache_instance.put(id, new Long(vsinstance)); // depends on control dependency: [if], data = [(vsinstance] } // pass the new table size to HashtableOndisk so that it can use it to rehash if (all == ALL) { if (vshtod.size() > 0) { vshtod.clear(); // depends on control dependency: [if], data = [none] } vshtod.tempTableSize = calculateTableSize(id, vs.size()); // depends on control dependency: [if], data = [none] } else { vshtod.tempTableSize = calculateTableSize(id, vshtod.size() + vs.size()); // depends on control dependency: [if], data = [none] } //if (vshtod.size() < vs.size()) { // // pass the new table size to HashtableOndisk so that it can use it to rehash // vshtod.tempTableSize = calculateTableSize(id, vs.size()); //} //vshtod.clear(); } Object entry = null; do { entry = vs.getOne(); if (entry != null) { vshtod.put(entry, null); // value is null - better performance by skipping serialization and deserialization // depends on control dependency: [if], data = [(entry] vs.remove(entry); // depends on control dependency: [if], data = [(entry] } } while (entry != null); vshtod.close(); // depends on control dependency: [try], data = [none] vshtod = null; // depends on control dependency: [try], data = [none] } catch (FileManagerException ex) { this.diskCacheException = ex; diskException = ex; returnCode = DISK_EXCEPTION; } catch (HashtableOnDiskException ex) { // depends on control dependency: [catch], data = [none] this.diskCacheException = ex; diskException = ex; returnCode = DISK_EXCEPTION; } catch (IOException ex) { // depends on control dependency: [catch], data = [none] diskException = ex; if (ex.getMessage().equals(DISK_CACHE_IN_GB_OVER_LIMIT_MSG)) { returnCode = DISK_SIZE_OVER_LIMIT_EXCEPTION; // depends on control dependency: [if], data = [none] } else { this.diskCacheException = ex; // depends on control dependency: [if], data = [none] returnCode = DISK_EXCEPTION; // depends on control dependency: [if], data = [none] } } catch (Exception ex) { // depends on control dependency: [catch], data = [none] returnCode = OTHER_EXCEPTION; diskException = ex; } finally { // depends on control dependency: [catch], data = [none] if (returnCode != NO_EXCEPTION) { if (tc.isDebugEnabled()) Tr.debug(tc, methodName, "cacheName=" + this.cacheName + "\n Exception: " + ExceptionUtility.getStackTrace(diskException)); } if (returnCode == DISK_EXCEPTION || returnCode == OTHER_EXCEPTION) { com.ibm.ws.ffdc.FFDCFilter.processException(diskException, "com.ibm.ws.cache.HTODDynacache.writeValueSet", "1738", this); // depends on control dependency: [if], data = [none] } try { if (vshtod != null) { vshtod.close(); // depends on control dependency: [if], data = [none] } } catch (Exception ex) { com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.HTODDynacache.writeValueSet", "1745", this); } // depends on control dependency: [catch], data = [none] rwLock.writeLock().unlock(); } return returnCode; } }
public class class_name { public void update(BaseCell cell) { if (cell != null && mGroupBasicAdapter != null) { int position = mGroupBasicAdapter.getPositionByItem(cell); if (position >= 0) { cell.extras.put("_flag_invalidate_", true); mGroupBasicAdapter.notifyItemChanged(position); } } } }
public class class_name { public void update(BaseCell cell) { if (cell != null && mGroupBasicAdapter != null) { int position = mGroupBasicAdapter.getPositionByItem(cell); if (position >= 0) { cell.extras.put("_flag_invalidate_", true); // depends on control dependency: [if], data = [none] mGroupBasicAdapter.notifyItemChanged(position); // depends on control dependency: [if], data = [(position] } } } }
public class class_name { public static LinkedHashMap<String, String> getProjectMetadata( IHMConnection connection ) throws Exception { LinkedHashMap<String, String> metadataMap = new LinkedHashMap<>(); try (IHMStatement statement = connection.createStatement()) { statement.setQueryTimeout(30); // set timeout to 30 sec. String sql = "select " + MetadataTableFields.COLUMN_KEY.getFieldName() + ", " + // MetadataTableFields.COLUMN_VALUE.getFieldName() + " from " + TABLE_METADATA; IHMResultSet rs = statement.executeQuery(sql); while( rs.next() ) { String key = rs.getString(MetadataTableFields.COLUMN_KEY.getFieldName()); String value = rs.getString(MetadataTableFields.COLUMN_VALUE.getFieldName()); if (!key.endsWith("ts")) { metadataMap.put(key, value); } else { try { long ts = Long.parseLong(value); String dateTimeString = ETimeUtilities.INSTANCE.TIME_FORMATTER_LOCAL.format(new Date(ts)); metadataMap.put(key, dateTimeString); } catch (Exception e) { metadataMap.put(key, value); } } } } return metadataMap; } }
public class class_name { public static LinkedHashMap<String, String> getProjectMetadata( IHMConnection connection ) throws Exception { LinkedHashMap<String, String> metadataMap = new LinkedHashMap<>(); try (IHMStatement statement = connection.createStatement()) { statement.setQueryTimeout(30); // set timeout to 30 sec. String sql = "select " + MetadataTableFields.COLUMN_KEY.getFieldName() + ", " + // MetadataTableFields.COLUMN_VALUE.getFieldName() + " from " + TABLE_METADATA; IHMResultSet rs = statement.executeQuery(sql); while( rs.next() ) { String key = rs.getString(MetadataTableFields.COLUMN_KEY.getFieldName()); String value = rs.getString(MetadataTableFields.COLUMN_VALUE.getFieldName()); if (!key.endsWith("ts")) { metadataMap.put(key, value); } else { try { long ts = Long.parseLong(value); String dateTimeString = ETimeUtilities.INSTANCE.TIME_FORMATTER_LOCAL.format(new Date(ts)); metadataMap.put(key, dateTimeString); // depends on control dependency: [try], data = [none] } catch (Exception e) { metadataMap.put(key, value); } // depends on control dependency: [catch], data = [none] } } } return metadataMap; } }
public class class_name { static CharInput asCharInput(final CharSequence chars) { checkNotNull(chars); return new CharInput() { int index = 0; @Override public int read() { if (index < chars.length()) { return chars.charAt(index++); } else { return -1; } } @Override public void close() { index = chars.length(); } }; } }
public class class_name { static CharInput asCharInput(final CharSequence chars) { checkNotNull(chars); return new CharInput() { int index = 0; @Override public int read() { if (index < chars.length()) { return chars.charAt(index++); // depends on control dependency: [if], data = [(index] } else { return -1; // depends on control dependency: [if], data = [none] } } @Override public void close() { index = chars.length(); } }; } }
public class class_name { public String getString(Enum<?> key, String defaultValue) { if (key == null) { return defaultValue; } return getString(key.name(), defaultValue); } }
public class class_name { public String getString(Enum<?> key, String defaultValue) { if (key == null) { return defaultValue; // depends on control dependency: [if], data = [none] } return getString(key.name(), defaultValue); } }
public class class_name { public String attributes() { if (attributes==null && attributeMap==null) return noAttributes; StringBuffer buf = new StringBuffer(128); synchronized(buf) { if (attributeMap!=null) { Enumeration e = attributeMap.keys(); while (e.hasMoreElements()) { buf.append(' '); String a = (String)e.nextElement(); buf.append(a); buf.append('='); buf.append(attributeMap.get(a).toString()); } } if(attributes!=null && attributes.length()>0) { if (!attributes.startsWith(" ")) buf.append(' '); buf.append(attributes); } } return buf.toString(); } }
public class class_name { public String attributes() { if (attributes==null && attributeMap==null) return noAttributes; StringBuffer buf = new StringBuffer(128); synchronized(buf) { if (attributeMap!=null) { Enumeration e = attributeMap.keys(); while (e.hasMoreElements()) { buf.append(' '); // depends on control dependency: [while], data = [none] String a = (String)e.nextElement(); buf.append(a); // depends on control dependency: [while], data = [none] buf.append('='); // depends on control dependency: [while], data = [none] buf.append(attributeMap.get(a).toString()); // depends on control dependency: [while], data = [none] } } if(attributes!=null && attributes.length()>0) { if (!attributes.startsWith(" ")) buf.append(' '); buf.append(attributes); // depends on control dependency: [if], data = [(attributes] } } return buf.toString(); } }
public class class_name { @Override /*! #if ($TemplateOptions.KTypePrimitive) public KType [] toArray() { #else !*/ public Object[] toArray() { /*! #end !*/ final KType[] cloned = Intrinsics.<KType> newArray(size()); int j = 0; if (hasEmptyKey) { cloned[j++] = Intrinsics.empty(); } final KType[] keys = Intrinsics.<KType[]> cast(this.keys); for (int slot = 0, max = mask; slot <= max; slot++) { KType existing; if (!Intrinsics.isEmpty(existing = keys[slot])) { cloned[j++] = existing; } } return cloned; } }
public class class_name { @Override /*! #if ($TemplateOptions.KTypePrimitive) public KType [] toArray() { #else !*/ public Object[] toArray() { /*! #end !*/ final KType[] cloned = Intrinsics.<KType> newArray(size()); int j = 0; if (hasEmptyKey) { cloned[j++] = Intrinsics.empty(); // depends on control dependency: [if], data = [none] } final KType[] keys = Intrinsics.<KType[]> cast(this.keys); for (int slot = 0, max = mask; slot <= max; slot++) { KType existing; if (!Intrinsics.isEmpty(existing = keys[slot])) { cloned[j++] = existing; // depends on control dependency: [if], data = [none] } } return cloned; } }
public class class_name { @SuppressWarnings({ "unchecked", "rawtypes" }) protected void addStoreToSession(String store) { Exception initializationException = null; storeNames.add(store); for(Node node: nodesToStream) { SocketDestination destination = null; SocketAndStreams sands = null; try { destination = new SocketDestination(node.getHost(), node.getAdminPort(), RequestFormatType.ADMIN_PROTOCOL_BUFFERS); sands = streamingSocketPool.checkout(destination); DataOutputStream outputStream = sands.getOutputStream(); DataInputStream inputStream = sands.getInputStream(); nodeIdStoreToSocketRequest.put(new Pair(store, node.getId()), destination); nodeIdStoreToOutputStreamRequest.put(new Pair(store, node.getId()), outputStream); nodeIdStoreToInputStreamRequest.put(new Pair(store, node.getId()), inputStream); nodeIdStoreToSocketAndStreams.put(new Pair(store, node.getId()), sands); nodeIdStoreInitialized.put(new Pair(store, node.getId()), false); remoteStoreDefs = adminClient.metadataMgmtOps.getRemoteStoreDefList(node.getId()) .getValue(); } catch(Exception e) { logger.error(e); try { close(sands.getSocket()); streamingSocketPool.checkin(destination, sands); } catch(Exception ioE) { logger.error(ioE); } if(!faultyNodes.contains(node.getId())) faultyNodes.add(node.getId()); initializationException = e; } } if(initializationException != null) throw new VoldemortException(initializationException); if(store.equals("slop")) return; boolean foundStore = false; for(StoreDefinition remoteStoreDef: remoteStoreDefs) { if(remoteStoreDef.getName().equals(store)) { RoutingStrategyFactory factory = new RoutingStrategyFactory(); RoutingStrategy storeRoutingStrategy = factory.updateRoutingStrategy(remoteStoreDef, adminClient.getAdminClientCluster()); storeToRoutingStrategy.put(store, storeRoutingStrategy); validateSufficientNodesAvailable(blackListedNodes, remoteStoreDef); foundStore = true; break; } } if(!foundStore) { logger.error("Store Name not found on the cluster"); throw new VoldemortException("Store Name not found on the cluster"); } } }
public class class_name { @SuppressWarnings({ "unchecked", "rawtypes" }) protected void addStoreToSession(String store) { Exception initializationException = null; storeNames.add(store); for(Node node: nodesToStream) { SocketDestination destination = null; SocketAndStreams sands = null; try { destination = new SocketDestination(node.getHost(), node.getAdminPort(), RequestFormatType.ADMIN_PROTOCOL_BUFFERS); // depends on control dependency: [try], data = [none] sands = streamingSocketPool.checkout(destination); // depends on control dependency: [try], data = [none] DataOutputStream outputStream = sands.getOutputStream(); DataInputStream inputStream = sands.getInputStream(); nodeIdStoreToSocketRequest.put(new Pair(store, node.getId()), destination); // depends on control dependency: [try], data = [none] nodeIdStoreToOutputStreamRequest.put(new Pair(store, node.getId()), outputStream); // depends on control dependency: [try], data = [none] nodeIdStoreToInputStreamRequest.put(new Pair(store, node.getId()), inputStream); // depends on control dependency: [try], data = [none] nodeIdStoreToSocketAndStreams.put(new Pair(store, node.getId()), sands); // depends on control dependency: [try], data = [none] nodeIdStoreInitialized.put(new Pair(store, node.getId()), false); // depends on control dependency: [try], data = [none] remoteStoreDefs = adminClient.metadataMgmtOps.getRemoteStoreDefList(node.getId()) .getValue(); // depends on control dependency: [try], data = [none] } catch(Exception e) { logger.error(e); try { close(sands.getSocket()); // depends on control dependency: [try], data = [none] streamingSocketPool.checkin(destination, sands); // depends on control dependency: [try], data = [none] } catch(Exception ioE) { logger.error(ioE); } // depends on control dependency: [catch], data = [none] if(!faultyNodes.contains(node.getId())) faultyNodes.add(node.getId()); initializationException = e; } // depends on control dependency: [catch], data = [none] } if(initializationException != null) throw new VoldemortException(initializationException); if(store.equals("slop")) return; boolean foundStore = false; for(StoreDefinition remoteStoreDef: remoteStoreDefs) { if(remoteStoreDef.getName().equals(store)) { RoutingStrategyFactory factory = new RoutingStrategyFactory(); RoutingStrategy storeRoutingStrategy = factory.updateRoutingStrategy(remoteStoreDef, adminClient.getAdminClientCluster()); storeToRoutingStrategy.put(store, storeRoutingStrategy); // depends on control dependency: [if], data = [none] validateSufficientNodesAvailable(blackListedNodes, remoteStoreDef); // depends on control dependency: [if], data = [none] foundStore = true; // depends on control dependency: [if], data = [none] break; } } if(!foundStore) { logger.error("Store Name not found on the cluster"); // depends on control dependency: [if], data = [none] throw new VoldemortException("Store Name not found on the cluster"); } } }
public class class_name { public Coin getFee() { Coin fee = Coin.ZERO; if (inputs.isEmpty() || outputs.isEmpty()) // Incomplete transaction return null; for (TransactionInput input : inputs) { if (input.getValue() == null) return null; fee = fee.add(input.getValue()); } for (TransactionOutput output : outputs) { fee = fee.subtract(output.getValue()); } return fee; } }
public class class_name { public Coin getFee() { Coin fee = Coin.ZERO; if (inputs.isEmpty() || outputs.isEmpty()) // Incomplete transaction return null; for (TransactionInput input : inputs) { if (input.getValue() == null) return null; fee = fee.add(input.getValue()); // depends on control dependency: [for], data = [input] } for (TransactionOutput output : outputs) { fee = fee.subtract(output.getValue()); // depends on control dependency: [for], data = [output] } return fee; } }
public class class_name { @Nullable MultiTaskSlot getUnresolvedRootSlot(AbstractID groupId) { for (MultiTaskSlot multiTaskSlot : unresolvedRootSlots.values()) { if (!multiTaskSlot.contains(groupId)) { return multiTaskSlot; } } return null; } }
public class class_name { @Nullable MultiTaskSlot getUnresolvedRootSlot(AbstractID groupId) { for (MultiTaskSlot multiTaskSlot : unresolvedRootSlots.values()) { if (!multiTaskSlot.contains(groupId)) { return multiTaskSlot; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public static CreateRequest checkRequest(final FormItemList formItemList, final CreateResponse createResponse) { if (formItemList != null) { final CreateRequestType type = checkType(formItemList, createResponse); if (type != null) { return new CreateRequest(type); } } return null; } }
public class class_name { public static CreateRequest checkRequest(final FormItemList formItemList, final CreateResponse createResponse) { if (formItemList != null) { final CreateRequestType type = checkType(formItemList, createResponse); if (type != null) { return new CreateRequest(type); // depends on control dependency: [if], data = [(type] } } return null; } }
public class class_name { protected URL[] getUrls(File directory) throws MalformedURLException, IOException { List<URL> list = new LinkedList<URL>(); if (directory.exists() && directory.isDirectory()) { // Add directory list.add(directory.toURI().toURL()); // Add the contents of the directory too File[] jars = directory.listFiles(new JarFilter()); if (jars != null) { for (int j = 0; j < jars.length; j++) { list.add(jars[j].getCanonicalFile().toURI().toURL()); } } } return list.toArray(new URL[list.size()]); } }
public class class_name { protected URL[] getUrls(File directory) throws MalformedURLException, IOException { List<URL> list = new LinkedList<URL>(); if (directory.exists() && directory.isDirectory()) { // Add directory list.add(directory.toURI().toURL()); // Add the contents of the directory too File[] jars = directory.listFiles(new JarFilter()); if (jars != null) { for (int j = 0; j < jars.length; j++) { list.add(jars[j].getCanonicalFile().toURI().toURL()); // depends on control dependency: [for], data = [j] } } } return list.toArray(new URL[list.size()]); } }
public class class_name { public Object getColumnValue(String columnName) { for ( int i = 0; i < getColumnNames().length; i++ ) { String name = getColumnNames()[i]; if ( name.equals( columnName ) ) { return getColumnValues()[i]; } } throw new AssertionFailure( String.format( "Given column %s is not part of this key: %s", columnName, this.toString() ) ); } }
public class class_name { public Object getColumnValue(String columnName) { for ( int i = 0; i < getColumnNames().length; i++ ) { String name = getColumnNames()[i]; if ( name.equals( columnName ) ) { return getColumnValues()[i]; // depends on control dependency: [if], data = [none] } } throw new AssertionFailure( String.format( "Given column %s is not part of this key: %s", columnName, this.toString() ) ); } }
public class class_name { @Pure public static String getPreferredAttributeValueForRoadType(RoadType type) { final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkConstants.class); if (prefs != null) { final String v = prefs.get("ROAD_TYPE_VALUE_" + type.name(), null); //$NON-NLS-1$ if (v != null && !"".equals(v)) { //$NON-NLS-1$ return v; } } return getSystemDefault(type); } }
public class class_name { @Pure public static String getPreferredAttributeValueForRoadType(RoadType type) { final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkConstants.class); if (prefs != null) { final String v = prefs.get("ROAD_TYPE_VALUE_" + type.name(), null); //$NON-NLS-1$ if (v != null && !"".equals(v)) { //$NON-NLS-1$ return v; // depends on control dependency: [if], data = [none] } } return getSystemDefault(type); } }
public class class_name { public static long checkPreconditionL( final long value, final LongPredicate predicate, final LongFunction<String> describer) { final boolean ok; try { ok = predicate.test(value); } catch (final Throwable e) { final Violations violations = singleViolation(failedPredicate(e)); throw new PreconditionViolationException( failedMessage(Long.valueOf(value), violations), e, violations.count()); } return innerCheckL(value, ok, describer); } }
public class class_name { public static long checkPreconditionL( final long value, final LongPredicate predicate, final LongFunction<String> describer) { final boolean ok; try { ok = predicate.test(value); // depends on control dependency: [try], data = [none] } catch (final Throwable e) { final Violations violations = singleViolation(failedPredicate(e)); throw new PreconditionViolationException( failedMessage(Long.valueOf(value), violations), e, violations.count()); } // depends on control dependency: [catch], data = [none] return innerCheckL(value, ok, describer); } }
public class class_name { public void executeReport(final Locale locale) throws MavenReportException { locator.addSearchPath(FileResourceLoader.ID, project.getFile().getParentFile().getAbsolutePath()); locator.addSearchPath("url", ""); locator.setOutputDirectory(new File(project.getBuild().getDirectory())); // for when we start using maven-shared-io and maven-shared-monitor... // locator = new Locator( new MojoLogMonitorAdaptor( getLog() ) ); // locator = new Locator( getLog(), new File( project.getBuild().getDirectory() ) ); ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { CheckstyleExecutorRequest request = createRequest() .setLicenseArtifacts(collectArtifacts("license")) .setConfigurationArtifacts(collectArtifacts("configuration")); CheckstyleResults results = checkstyleExecutor.executeCheckstyle(request); ResourceBundle bundle = getBundle(locale); generateReportStatics(); generateMainReport(results, bundle); if (enableRSS) { CheckstyleRssGeneratorRequest checkstyleRssGeneratorRequest = new CheckstyleRssGeneratorRequest(this.project, this.getCopyright(), outputDirectory, getLog()); checkstyleRssGenerator.generateRSS(results, checkstyleRssGeneratorRequest); } } catch (CheckstyleException e) { throw new MavenReportException("Failed during checkstyle configuration", e); } catch (CheckstyleExecutorException e) { throw new MavenReportException("Failed during checkstyle execution", e); } finally { //be sure to restore original context classloader Thread.currentThread().setContextClassLoader(currentClassLoader); } } }
public class class_name { public void executeReport(final Locale locale) throws MavenReportException { locator.addSearchPath(FileResourceLoader.ID, project.getFile().getParentFile().getAbsolutePath()); locator.addSearchPath("url", ""); locator.setOutputDirectory(new File(project.getBuild().getDirectory())); // for when we start using maven-shared-io and maven-shared-monitor... // locator = new Locator( new MojoLogMonitorAdaptor( getLog() ) ); // locator = new Locator( getLog(), new File( project.getBuild().getDirectory() ) ); ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { CheckstyleExecutorRequest request = createRequest() .setLicenseArtifacts(collectArtifacts("license")) .setConfigurationArtifacts(collectArtifacts("configuration")); CheckstyleResults results = checkstyleExecutor.executeCheckstyle(request); ResourceBundle bundle = getBundle(locale); generateReportStatics(); generateMainReport(results, bundle); if (enableRSS) { CheckstyleRssGeneratorRequest checkstyleRssGeneratorRequest = new CheckstyleRssGeneratorRequest(this.project, this.getCopyright(), outputDirectory, getLog()); checkstyleRssGenerator.generateRSS(results, checkstyleRssGeneratorRequest); // depends on control dependency: [if], data = [none] } } catch (CheckstyleException e) { throw new MavenReportException("Failed during checkstyle configuration", e); } catch (CheckstyleExecutorException e) { throw new MavenReportException("Failed during checkstyle execution", e); } finally { //be sure to restore original context classloader Thread.currentThread().setContextClassLoader(currentClassLoader); } } }
public class class_name { protected Map<String, String> getElementAttributes() { // Preserve order of attributes Map<String, String> attrs = new HashMap<>(); if (this.getInputs() != null) { attrs.put("input", this.getInputsAsString()); } if (this.getAction() != null) { attrs.put("action", this.getAction().toString()); } if (this.getMethod() != null) { attrs.put("method", this.getMethod().toString()); } if (this.getTimeout() != null) { attrs.put("timeout", this.getTimeout().toString()); } if (this.getSpeechTimeout() != null) { attrs.put("speechTimeout", this.getSpeechTimeout()); } if (this.getMaxSpeechTime() != null) { attrs.put("maxSpeechTime", this.getMaxSpeechTime().toString()); } if (this.isProfanityFilter() != null) { attrs.put("profanityFilter", this.isProfanityFilter().toString()); } if (this.getFinishOnKey() != null) { attrs.put("finishOnKey", this.getFinishOnKey()); } if (this.getNumDigits() != null) { attrs.put("numDigits", this.getNumDigits().toString()); } if (this.getPartialResultCallback() != null) { attrs.put("partialResultCallback", this.getPartialResultCallback().toString()); } if (this.getPartialResultCallbackMethod() != null) { attrs.put("partialResultCallbackMethod", this.getPartialResultCallbackMethod().toString()); } if (this.getLanguage() != null) { attrs.put("language", this.getLanguage().toString()); } if (this.getHints() != null) { attrs.put("hints", this.getHints()); } if (this.isBargeIn() != null) { attrs.put("bargeIn", this.isBargeIn().toString()); } if (this.isDebug() != null) { attrs.put("debug", this.isDebug().toString()); } if (this.isActionOnEmptyResult() != null) { attrs.put("actionOnEmptyResult", this.isActionOnEmptyResult().toString()); } return attrs; } }
public class class_name { protected Map<String, String> getElementAttributes() { // Preserve order of attributes Map<String, String> attrs = new HashMap<>(); if (this.getInputs() != null) { attrs.put("input", this.getInputsAsString()); // depends on control dependency: [if], data = [none] } if (this.getAction() != null) { attrs.put("action", this.getAction().toString()); // depends on control dependency: [if], data = [none] } if (this.getMethod() != null) { attrs.put("method", this.getMethod().toString()); // depends on control dependency: [if], data = [none] } if (this.getTimeout() != null) { attrs.put("timeout", this.getTimeout().toString()); // depends on control dependency: [if], data = [none] } if (this.getSpeechTimeout() != null) { attrs.put("speechTimeout", this.getSpeechTimeout()); // depends on control dependency: [if], data = [none] } if (this.getMaxSpeechTime() != null) { attrs.put("maxSpeechTime", this.getMaxSpeechTime().toString()); // depends on control dependency: [if], data = [none] } if (this.isProfanityFilter() != null) { attrs.put("profanityFilter", this.isProfanityFilter().toString()); // depends on control dependency: [if], data = [none] } if (this.getFinishOnKey() != null) { attrs.put("finishOnKey", this.getFinishOnKey()); // depends on control dependency: [if], data = [none] } if (this.getNumDigits() != null) { attrs.put("numDigits", this.getNumDigits().toString()); // depends on control dependency: [if], data = [none] } if (this.getPartialResultCallback() != null) { attrs.put("partialResultCallback", this.getPartialResultCallback().toString()); // depends on control dependency: [if], data = [none] } if (this.getPartialResultCallbackMethod() != null) { attrs.put("partialResultCallbackMethod", this.getPartialResultCallbackMethod().toString()); // depends on control dependency: [if], data = [none] } if (this.getLanguage() != null) { attrs.put("language", this.getLanguage().toString()); // depends on control dependency: [if], data = [none] } if (this.getHints() != null) { attrs.put("hints", this.getHints()); // depends on control dependency: [if], data = [none] } if (this.isBargeIn() != null) { attrs.put("bargeIn", this.isBargeIn().toString()); // depends on control dependency: [if], data = [none] } if (this.isDebug() != null) { attrs.put("debug", this.isDebug().toString()); // depends on control dependency: [if], data = [none] } if (this.isActionOnEmptyResult() != null) { attrs.put("actionOnEmptyResult", this.isActionOnEmptyResult().toString()); // depends on control dependency: [if], data = [none] } return attrs; } }
public class class_name { public boolean addStylesFontFaceContainerStyle(final FontFaceContainerStyle ffcStyle) { final FontFace fontFace = ffcStyle.getFontFace(); if (fontFace != null) { this.fontFaces.add(fontFace); } return this.addStylesStyle(ffcStyle); } }
public class class_name { public boolean addStylesFontFaceContainerStyle(final FontFaceContainerStyle ffcStyle) { final FontFace fontFace = ffcStyle.getFontFace(); if (fontFace != null) { this.fontFaces.add(fontFace); // depends on control dependency: [if], data = [(fontFace] } return this.addStylesStyle(ffcStyle); } }
public class class_name { public static void printMatrix(int rows, int cols, Matrix m) { for(int col_num = 0; col_num < cols; col_num++) { for (int row_num = 0; row_num < rows; row_num++) { System.out.print(m.get(row_num,col_num) + " "); } System.out.print("\n"); } System.out.print("\n"); } }
public class class_name { public static void printMatrix(int rows, int cols, Matrix m) { for(int col_num = 0; col_num < cols; col_num++) { for (int row_num = 0; row_num < rows; row_num++) { System.out.print(m.get(row_num,col_num) + " "); // depends on control dependency: [for], data = [row_num] } System.out.print("\n"); // depends on control dependency: [for], data = [none] } System.out.print("\n"); } }
public class class_name { public static BufferedImage renderLabeled(GrayS32 labelImage, int numRegions, BufferedImage out) { int colors[] = new int[numRegions]; Random rand = new Random(123); for( int i = 0; i < colors.length; i++ ) { colors[i] = rand.nextInt(); } return renderLabeled(labelImage, colors, out); } }
public class class_name { public static BufferedImage renderLabeled(GrayS32 labelImage, int numRegions, BufferedImage out) { int colors[] = new int[numRegions]; Random rand = new Random(123); for( int i = 0; i < colors.length; i++ ) { colors[i] = rand.nextInt(); // depends on control dependency: [for], data = [i] } return renderLabeled(labelImage, colors, out); } }
public class class_name { public Object getBlockEventResult() { Object result = eventResultCache.get(); if (result != null) { return result; } if (eventResultHandler != null) { result = eventResultHandler.getBlockedValue(); if (result != null){ if (!eventResultCache.compareAndSet(null, result)){ result = eventResultCache.get(); } } } return result; } }
public class class_name { public Object getBlockEventResult() { Object result = eventResultCache.get(); if (result != null) { return result; // depends on control dependency: [if], data = [none] } if (eventResultHandler != null) { result = eventResultHandler.getBlockedValue(); // depends on control dependency: [if], data = [none] if (result != null){ if (!eventResultCache.compareAndSet(null, result)){ result = eventResultCache.get(); // depends on control dependency: [if], data = [none] } } } return result; } }
public class class_name { @Override protected void handleEvents(final String EVENT_TYPE) { super.handleEvents(EVENT_TYPE); if ("VISIBILITY".equals(EVENT_TYPE)) { boolean isDateVisible = clock.isDateVisible(); dateText.setVisible(isDateVisible); dateText.setManaged(isDateVisible); boolean isSecondsVisible = clock.isSecondsVisible(); secondBackgroundCircle.setVisible(isSecondsVisible); secondBackgroundCircle.setManaged(isSecondsVisible); secondArc.setVisible(isSecondsVisible); secondArc.setManaged(isSecondsVisible); } else if ("FINISHED".equals(EVENT_TYPE)) { } } }
public class class_name { @Override protected void handleEvents(final String EVENT_TYPE) { super.handleEvents(EVENT_TYPE); if ("VISIBILITY".equals(EVENT_TYPE)) { boolean isDateVisible = clock.isDateVisible(); dateText.setVisible(isDateVisible); // depends on control dependency: [if], data = [none] dateText.setManaged(isDateVisible); // depends on control dependency: [if], data = [none] boolean isSecondsVisible = clock.isSecondsVisible(); secondBackgroundCircle.setVisible(isSecondsVisible); // depends on control dependency: [if], data = [none] secondBackgroundCircle.setManaged(isSecondsVisible); // depends on control dependency: [if], data = [none] secondArc.setVisible(isSecondsVisible); // depends on control dependency: [if], data = [none] secondArc.setManaged(isSecondsVisible); // depends on control dependency: [if], data = [none] } else if ("FINISHED".equals(EVENT_TYPE)) { } } }
public class class_name { public void checkInternalState(String msg, boolean linkedOnly, Map<String,Source> srcs) { boolean baad = false; Map<String,Source> original = new HashMap<String,Source>(); Map<String,Source> calculated = new HashMap<String,Source>(); for (String s : sources.keySet()) { Source ss = sources.get(s); if (ss.isLinkedOnly() == linkedOnly) { calculated.put(s,ss); } } for (String s : srcs.keySet()) { Source ss = srcs.get(s); if (ss.isLinkedOnly() == linkedOnly) { original.put(s,ss); } } if (original.size() != calculated.size()) { Log.error("INTERNAL ERROR "+msg+" original and calculated are not the same size!"); baad = true; } if (!original.keySet().equals(calculated.keySet())) { Log.error("INTERNAL ERROR "+msg+" original and calculated do not have the same domain!"); baad = true; } if (!baad) { for (String s : original.keySet()) { Source s1 = original.get(s); Source s2 = calculated.get(s); if (s1 == null || s2 == null || !s1.equals(s2)) { Log.error("INTERNAL ERROR "+msg+" original and calculated have differing elements for "+s); } baad = true; } } if (baad) { for (String s : original.keySet()) { Source ss = original.get(s); Source sss = calculated.get(s); if (sss == null) { Log.error("The file "+s+" does not exist in calculated tree of sources."); } } for (String s : calculated.keySet()) { Source ss = calculated.get(s); Source sss = original.get(s); if (sss == null) { Log.error("The file "+s+" does not exist in original set of found sources."); } } } } }
public class class_name { public void checkInternalState(String msg, boolean linkedOnly, Map<String,Source> srcs) { boolean baad = false; Map<String,Source> original = new HashMap<String,Source>(); Map<String,Source> calculated = new HashMap<String,Source>(); for (String s : sources.keySet()) { Source ss = sources.get(s); if (ss.isLinkedOnly() == linkedOnly) { calculated.put(s,ss); // depends on control dependency: [if], data = [none] } } for (String s : srcs.keySet()) { Source ss = srcs.get(s); if (ss.isLinkedOnly() == linkedOnly) { original.put(s,ss); // depends on control dependency: [if], data = [none] } } if (original.size() != calculated.size()) { Log.error("INTERNAL ERROR "+msg+" original and calculated are not the same size!"); // depends on control dependency: [if], data = [none] baad = true; // depends on control dependency: [if], data = [none] } if (!original.keySet().equals(calculated.keySet())) { Log.error("INTERNAL ERROR "+msg+" original and calculated do not have the same domain!"); // depends on control dependency: [if], data = [none] baad = true; // depends on control dependency: [if], data = [none] } if (!baad) { for (String s : original.keySet()) { Source s1 = original.get(s); Source s2 = calculated.get(s); if (s1 == null || s2 == null || !s1.equals(s2)) { Log.error("INTERNAL ERROR "+msg+" original and calculated have differing elements for "+s); // depends on control dependency: [if], data = [none] } baad = true; // depends on control dependency: [for], data = [none] } } if (baad) { for (String s : original.keySet()) { Source ss = original.get(s); Source sss = calculated.get(s); if (sss == null) { Log.error("The file "+s+" does not exist in calculated tree of sources."); // depends on control dependency: [if], data = [none] } } for (String s : calculated.keySet()) { Source ss = calculated.get(s); Source sss = original.get(s); if (sss == null) { Log.error("The file "+s+" does not exist in original set of found sources."); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public static byte[] hex2byte(String str) { byte[] bytes = str.getBytes(); if ((bytes.length % 2) != 0) { throw new IllegalArgumentException(); } byte[] b2 = new byte[bytes.length / 2]; for (int n = 0; n < bytes.length; n += 2) { String item = new String(bytes, n, 2); b2[n / 2] = (byte) Integer.parseInt(item, 16); } return b2; } }
public class class_name { public static byte[] hex2byte(String str) { byte[] bytes = str.getBytes(); if ((bytes.length % 2) != 0) { throw new IllegalArgumentException(); } byte[] b2 = new byte[bytes.length / 2]; for (int n = 0; n < bytes.length; n += 2) { String item = new String(bytes, n, 2); b2[n / 2] = (byte) Integer.parseInt(item, 16); // depends on control dependency: [for], data = [n] } return b2; } }
public class class_name { @Override public void filter(Document document, Map<String, String> cleaningParameters) { List<Element> fontTags = filterDescendants(document.getDocumentElement(), new String[] { TAG_FONT }); for (Element fontTag : fontTags) { Element span = document.createElement(TAG_SPAN); moveChildren(fontTag, span); StringBuffer buffer = new StringBuffer(); if (fontTag.hasAttribute(ATTRIBUTE_FONTCOLOR)) { buffer.append(String.format("color:%s;", fontTag.getAttribute(ATTRIBUTE_FONTCOLOR))); } if (fontTag.hasAttribute(ATTRIBUTE_FONTFACE)) { buffer.append(String.format("font-family:%s;", fontTag.getAttribute(ATTRIBUTE_FONTFACE))); } if (fontTag.hasAttribute(ATTRIBUTE_FONTSIZE)) { String fontSize = fontTag.getAttribute(ATTRIBUTE_FONTSIZE); String fontSizeCss = FONT_SIZE_MAP.get(fontSize); fontSizeCss = (fontSizeCss != null) ? fontSizeCss : fontSize; buffer.append(String.format("font-size:%s;", fontSizeCss)); } if (fontTag.hasAttribute(ATTRIBUTE_STYLE) && fontTag.getAttribute(ATTRIBUTE_STYLE).trim().length() == 0) { buffer.append(fontTag.getAttribute(ATTRIBUTE_STYLE)); } if (buffer.length() > 0) { span.setAttribute(ATTRIBUTE_STYLE, buffer.toString()); } fontTag.getParentNode().insertBefore(span, fontTag); fontTag.getParentNode().removeChild(fontTag); } } }
public class class_name { @Override public void filter(Document document, Map<String, String> cleaningParameters) { List<Element> fontTags = filterDescendants(document.getDocumentElement(), new String[] { TAG_FONT }); for (Element fontTag : fontTags) { Element span = document.createElement(TAG_SPAN); moveChildren(fontTag, span); // depends on control dependency: [for], data = [fontTag] StringBuffer buffer = new StringBuffer(); if (fontTag.hasAttribute(ATTRIBUTE_FONTCOLOR)) { buffer.append(String.format("color:%s;", fontTag.getAttribute(ATTRIBUTE_FONTCOLOR))); // depends on control dependency: [if], data = [none] } if (fontTag.hasAttribute(ATTRIBUTE_FONTFACE)) { buffer.append(String.format("font-family:%s;", fontTag.getAttribute(ATTRIBUTE_FONTFACE))); // depends on control dependency: [if], data = [none] } if (fontTag.hasAttribute(ATTRIBUTE_FONTSIZE)) { String fontSize = fontTag.getAttribute(ATTRIBUTE_FONTSIZE); String fontSizeCss = FONT_SIZE_MAP.get(fontSize); fontSizeCss = (fontSizeCss != null) ? fontSizeCss : fontSize; // depends on control dependency: [if], data = [none] buffer.append(String.format("font-size:%s;", fontSizeCss)); // depends on control dependency: [if], data = [none] } if (fontTag.hasAttribute(ATTRIBUTE_STYLE) && fontTag.getAttribute(ATTRIBUTE_STYLE).trim().length() == 0) { buffer.append(fontTag.getAttribute(ATTRIBUTE_STYLE)); // depends on control dependency: [if], data = [none] } if (buffer.length() > 0) { span.setAttribute(ATTRIBUTE_STYLE, buffer.toString()); // depends on control dependency: [if], data = [none] } fontTag.getParentNode().insertBefore(span, fontTag); // depends on control dependency: [for], data = [fontTag] fontTag.getParentNode().removeChild(fontTag); // depends on control dependency: [for], data = [fontTag] } } }
public class class_name { private AdvancedModelWrapper updateEOByUpdatedModel(EDBModelObject reference, AdvancedModelWrapper model, Map<Object, AdvancedModelWrapper> updated) { ModelDescription source = model.getModelDescription(); ModelDescription description = reference.getModelDescription(); AdvancedModelWrapper wrapper = updated.get(reference.getOID()); Object ref = null; if (wrapper == null) { ref = reference.getCorrespondingModel(); } else { ref = wrapper.getUnderlyingModel(); } Object transformResult = transformationEngine.performTransformation(source, description, model.getUnderlyingModel(), ref); return AdvancedModelWrapper.wrap(transformResult); } }
public class class_name { private AdvancedModelWrapper updateEOByUpdatedModel(EDBModelObject reference, AdvancedModelWrapper model, Map<Object, AdvancedModelWrapper> updated) { ModelDescription source = model.getModelDescription(); ModelDescription description = reference.getModelDescription(); AdvancedModelWrapper wrapper = updated.get(reference.getOID()); Object ref = null; if (wrapper == null) { ref = reference.getCorrespondingModel(); // depends on control dependency: [if], data = [none] } else { ref = wrapper.getUnderlyingModel(); // depends on control dependency: [if], data = [none] } Object transformResult = transformationEngine.performTransformation(source, description, model.getUnderlyingModel(), ref); return AdvancedModelWrapper.wrap(transformResult); } }
public class class_name { public Content getSerializableFields(String heading, Content serializableFieldsTree) { HtmlTree li = new HtmlTree(HtmlTag.LI); li.addStyle(HtmlStyle.blockList); if (serializableFieldsTree.isValid()) { Content headingContent = new StringContent(heading); Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING, headingContent); li.addContent(serialHeading); li.addContent(serializableFieldsTree); } return li; } }
public class class_name { public Content getSerializableFields(String heading, Content serializableFieldsTree) { HtmlTree li = new HtmlTree(HtmlTag.LI); li.addStyle(HtmlStyle.blockList); if (serializableFieldsTree.isValid()) { Content headingContent = new StringContent(heading); Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING, headingContent); li.addContent(serialHeading); // depends on control dependency: [if], data = [none] li.addContent(serializableFieldsTree); // depends on control dependency: [if], data = [none] } return li; } }
public class class_name { @Override public final IFillerObjectFields<?> lazyGet(//NOPMD Rule:DoubleCheckedLocking final Map<String, Object> pAddParam, final Class<?> pBeanClass) throws Exception { // There is no way to get from Map partially initialized bean // in this double-checked locking implementation // cause putting to the Map fully initialized bean IFillerObjectFields<?> filler = this.fillersMap.get(pBeanClass); if (filler == null) { // locking: synchronized (this.fillersMap) { // make sure again whether it's null after locking: filler = this.fillersMap.get(pBeanClass); if (filler == null) { filler = createFillerObjectFieldsStd(pBeanClass); } } } return filler; } }
public class class_name { @Override public final IFillerObjectFields<?> lazyGet(//NOPMD Rule:DoubleCheckedLocking final Map<String, Object> pAddParam, final Class<?> pBeanClass) throws Exception { // There is no way to get from Map partially initialized bean // in this double-checked locking implementation // cause putting to the Map fully initialized bean IFillerObjectFields<?> filler = this.fillersMap.get(pBeanClass); if (filler == null) { // locking: synchronized (this.fillersMap) { // make sure again whether it's null after locking: filler = this.fillersMap.get(pBeanClass); if (filler == null) { filler = createFillerObjectFieldsStd(pBeanClass); // depends on control dependency: [if], data = [none] } } } return filler; } }
public class class_name { public SessionInfo getLockSessionInfo(Task objSession, String strUserName) { if (objSession == null) { Utility.getLogger().warning("null session"); return new SessionInfo(0, strUserName); // } SessionInfo intSession = (SessionInfo)m_hmLockSessions.get(objSession); if (intSession == null) m_hmLockSessions.put(objSession, intSession = new SessionInfo(m_iNextLockSession++, strUserName)); return intSession; } }
public class class_name { public SessionInfo getLockSessionInfo(Task objSession, String strUserName) { if (objSession == null) { Utility.getLogger().warning("null session"); // depends on control dependency: [if], data = [none] return new SessionInfo(0, strUserName); // // depends on control dependency: [if], data = [none] } SessionInfo intSession = (SessionInfo)m_hmLockSessions.get(objSession); if (intSession == null) m_hmLockSessions.put(objSession, intSession = new SessionInfo(m_iNextLockSession++, strUserName)); return intSession; } }
public class class_name { public synchronized void setOption(String key, String value) { if (key == null || value == null) { return; } config.put(key, value); } }
public class class_name { public synchronized void setOption(String key, String value) { if (key == null || value == null) { return; // depends on control dependency: [if], data = [none] } config.put(key, value); } }
public class class_name { public double highestEquivalentValue(final double value) { double nextNonEquivalentValue = nextNonEquivalentValue(value); // Theoretically, nextNonEquivalentValue - ulp(nextNonEquivalentValue) == nextNonEquivalentValue // is possible (if the ulp size switches right at nextNonEquivalentValue), so drop by 2 ulps and // increment back up to closest within-ulp value. double highestEquivalentValue = nextNonEquivalentValue - (2 * Math.ulp(nextNonEquivalentValue)); while (highestEquivalentValue + Math.ulp(highestEquivalentValue) < nextNonEquivalentValue) { highestEquivalentValue += Math.ulp(highestEquivalentValue); } return highestEquivalentValue; } }
public class class_name { public double highestEquivalentValue(final double value) { double nextNonEquivalentValue = nextNonEquivalentValue(value); // Theoretically, nextNonEquivalentValue - ulp(nextNonEquivalentValue) == nextNonEquivalentValue // is possible (if the ulp size switches right at nextNonEquivalentValue), so drop by 2 ulps and // increment back up to closest within-ulp value. double highestEquivalentValue = nextNonEquivalentValue - (2 * Math.ulp(nextNonEquivalentValue)); while (highestEquivalentValue + Math.ulp(highestEquivalentValue) < nextNonEquivalentValue) { highestEquivalentValue += Math.ulp(highestEquivalentValue); // depends on control dependency: [while], data = [none] } return highestEquivalentValue; } }
public class class_name { public void resetAutoLoadLastLoadTime(CacheKeyTO cacheKey) { if (null == autoLoadMap) { return; } AutoLoadTO autoLoadTO = autoLoadMap.get(cacheKey); if (null != autoLoadTO && !autoLoadTO.isLoading()) { autoLoadTO.setLastLoadTime(1L); } } }
public class class_name { public void resetAutoLoadLastLoadTime(CacheKeyTO cacheKey) { if (null == autoLoadMap) { return; // depends on control dependency: [if], data = [none] } AutoLoadTO autoLoadTO = autoLoadMap.get(cacheKey); if (null != autoLoadTO && !autoLoadTO.isLoading()) { autoLoadTO.setLastLoadTime(1L); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(ProviderUserIdentifierType providerUserIdentifierType, ProtocolMarshaller protocolMarshaller) { if (providerUserIdentifierType == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(providerUserIdentifierType.getProviderName(), PROVIDERNAME_BINDING); protocolMarshaller.marshall(providerUserIdentifierType.getProviderAttributeName(), PROVIDERATTRIBUTENAME_BINDING); protocolMarshaller.marshall(providerUserIdentifierType.getProviderAttributeValue(), PROVIDERATTRIBUTEVALUE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ProviderUserIdentifierType providerUserIdentifierType, ProtocolMarshaller protocolMarshaller) { if (providerUserIdentifierType == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(providerUserIdentifierType.getProviderName(), PROVIDERNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(providerUserIdentifierType.getProviderAttributeName(), PROVIDERATTRIBUTENAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(providerUserIdentifierType.getProviderAttributeValue(), PROVIDERATTRIBUTEVALUE_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 { @Nonnull public static String normalizeFile(@Nonnull String path, String extension) { path = path.replace("\\", "/"); if (path.startsWith("/")) { path = path.substring(1); } if (extension != null && !extension.startsWith(".")) { extension = "." + extension; if (path.endsWith(extension)) { int idx = path.indexOf(extension); path = path.substring(0, idx); } } return path; } }
public class class_name { @Nonnull public static String normalizeFile(@Nonnull String path, String extension) { path = path.replace("\\", "/"); if (path.startsWith("/")) { path = path.substring(1); // depends on control dependency: [if], data = [none] } if (extension != null && !extension.startsWith(".")) { extension = "." + extension; // depends on control dependency: [if], data = [none] if (path.endsWith(extension)) { int idx = path.indexOf(extension); path = path.substring(0, idx); // depends on control dependency: [if], data = [none] } } return path; } }
public class class_name { private static String getTypeInfo(List<Object> list) { StringBuilder s = new StringBuilder(); for (Object o : list) { if (s.length() > 0) s.append(", "); if (o == null) s.append("null"); else { s.append(o.getClass().getName()); s.append("="); s.append(o); } } return s.toString(); } }
public class class_name { private static String getTypeInfo(List<Object> list) { StringBuilder s = new StringBuilder(); for (Object o : list) { if (s.length() > 0) s.append(", "); if (o == null) s.append("null"); else { s.append(o.getClass().getName()); // depends on control dependency: [if], data = [(o] s.append("="); // depends on control dependency: [if], data = [none] s.append(o); // depends on control dependency: [if], data = [(o] } } return s.toString(); } }
public class class_name { public URI toURI() { String url = toString(); try { return new URI(url); } catch (URISyntaxException e) { throw new RuntimeException("Cannot convert to URI: " + url, e); } } }
public class class_name { public URI toURI() { String url = toString(); try { return new URI(url); // depends on control dependency: [try], data = [none] } catch (URISyntaxException e) { throw new RuntimeException("Cannot convert to URI: " + url, e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public boolean shutdown() { mServer.shutdown(); try { return mServer.awaitTermination(mServerShutdownTimeoutMs, TimeUnit.MILLISECONDS); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); return false; } finally { mServer.shutdownNow(); } } }
public class class_name { public boolean shutdown() { mServer.shutdown(); try { return mServer.awaitTermination(mServerShutdownTimeoutMs, TimeUnit.MILLISECONDS); // depends on control dependency: [try], data = [none] } catch (InterruptedException ie) { Thread.currentThread().interrupt(); return false; } finally { // depends on control dependency: [catch], data = [none] mServer.shutdownNow(); } } }
public class class_name { public double[][] latLonToProj(double[][] from, double[][] to, int latIndex, int lonIndex) { int cnt = from[0].length; double[] toX = to[INDEX_X]; double[] toY = to[INDEX_Y]; double[] fromLat = from[latIndex]; double[] fromLon = from[lonIndex]; double lat, lon; for (int i = 0; i < cnt; i++) { lat = fromLat[i]; lon = centerLon + Math.IEEEremainder(fromLon[i] - centerLon, 360.0); toX[i] = lon; toY[i] = lat; } return to; } }
public class class_name { public double[][] latLonToProj(double[][] from, double[][] to, int latIndex, int lonIndex) { int cnt = from[0].length; double[] toX = to[INDEX_X]; double[] toY = to[INDEX_Y]; double[] fromLat = from[latIndex]; double[] fromLon = from[lonIndex]; double lat, lon; for (int i = 0; i < cnt; i++) { lat = fromLat[i]; // depends on control dependency: [for], data = [i] lon = centerLon + Math.IEEEremainder(fromLon[i] - centerLon, 360.0); // depends on control dependency: [for], data = [i] toX[i] = lon; // depends on control dependency: [for], data = [i] toY[i] = lat; // depends on control dependency: [for], data = [i] } return to; } }
public class class_name { private static Set<TypeMirror> nonPrivateDeclaredTypes(Types typeUtils, TypeMirror type) { if (type == null) { return new TypeMirrorSet(); } else { Set<TypeMirror> declared = new TypeMirrorSet(); declared.add(type); List<TypeElement> nestedTypes = ElementFilter.typesIn(typeUtils.asElement(type).getEnclosedElements()); for (TypeElement nestedType : nestedTypes) { if (!nestedType.getModifiers().contains(PRIVATE)) { declared.add(nestedType.asType()); } } for (TypeMirror supertype : typeUtils.directSupertypes(type)) { declared.addAll(nonPrivateDeclaredTypes(typeUtils, supertype)); } return declared; } } }
public class class_name { private static Set<TypeMirror> nonPrivateDeclaredTypes(Types typeUtils, TypeMirror type) { if (type == null) { return new TypeMirrorSet(); // depends on control dependency: [if], data = [none] } else { Set<TypeMirror> declared = new TypeMirrorSet(); declared.add(type); // depends on control dependency: [if], data = [(type] List<TypeElement> nestedTypes = ElementFilter.typesIn(typeUtils.asElement(type).getEnclosedElements()); for (TypeElement nestedType : nestedTypes) { if (!nestedType.getModifiers().contains(PRIVATE)) { declared.add(nestedType.asType()); // depends on control dependency: [if], data = [none] } } for (TypeMirror supertype : typeUtils.directSupertypes(type)) { declared.addAll(nonPrivateDeclaredTypes(typeUtils, supertype)); // depends on control dependency: [for], data = [supertype] } return declared; // depends on control dependency: [if], data = [none] } } }
public class class_name { void resizeLog(int targetSize) throws InternalLogException, LogFullException { if (tc.isEntryEnabled()) Tr.entry(tc, "resizeLog", new Object[] { this, targetSize }); // Check that both files are actually open if (_activeFile == null || _inactiveFile == null) { if (tc.isEntryEnabled()) Tr.exit(tc, "resizeLog", "InternalLogException"); throw new InternalLogException(null); } try { _file1.fileExtend(targetSize); _file2.fileExtend(targetSize); } catch (LogAllocationException exc) { FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogHandle.resizeLog", "1612", this); // "Reset" the _activeFile reference. This is very important because when this keypoint operation // was started (keypointStarting) we switched the target file to the inactive file and prepared it // for a keypoint operation by updating its header block. Subsequently, the keypoint operation fails // which means that _activeFile currently points at an empty file into which we have been unable to // keypoint. // // We must leave this method with _activeFile pointing at the active file (as was the case prior // to the keypoint attempt). If we do not do this then any further keypoint operation will re-attempt // the same logic by switching from this empty file back to the active file. The active file will // be cleared in preparation for the keypoint operation (which will subsequently fail) and all // persistent information will be destroyed from disk. if (_activeFile == _file1) { _activeFile = _file2; } else { _activeFile = _file1; } if (tc.isEntryEnabled()) Tr.exit(tc, "resizeLog", "WriteOperationFailedException"); throw new WriteOperationFailedException(exc); } catch (Throwable exc) { FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogHandle.resizeLog", "1555", this); // Reset the target file reference (see description above for why this must be done) if (_activeFile == _file1) { _activeFile = _file2; } else { _activeFile = _file1; } if (tc.isEntryEnabled()) Tr.exit(tc, "resizeLog", "InternalLogException"); throw new InternalLogException(exc); } // Now determine how many bytes are currently available in the new target log file. _physicalFreeBytes = _activeFile.freeBytes(); if (tc.isDebugEnabled()) Tr.debug(tc, "Log file " + _activeFile.fileName() + " now has " + _physicalFreeBytes + " bytes of storage available"); if (tc.isEntryEnabled()) Tr.exit(tc, "resizeLog"); } }
public class class_name { void resizeLog(int targetSize) throws InternalLogException, LogFullException { if (tc.isEntryEnabled()) Tr.entry(tc, "resizeLog", new Object[] { this, targetSize }); // Check that both files are actually open if (_activeFile == null || _inactiveFile == null) { if (tc.isEntryEnabled()) Tr.exit(tc, "resizeLog", "InternalLogException"); throw new InternalLogException(null); } try { _file1.fileExtend(targetSize); // depends on control dependency: [try], data = [none] _file2.fileExtend(targetSize); // depends on control dependency: [try], data = [none] } catch (LogAllocationException exc) { FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogHandle.resizeLog", "1612", this); // "Reset" the _activeFile reference. This is very important because when this keypoint operation // was started (keypointStarting) we switched the target file to the inactive file and prepared it // for a keypoint operation by updating its header block. Subsequently, the keypoint operation fails // which means that _activeFile currently points at an empty file into which we have been unable to // keypoint. // // We must leave this method with _activeFile pointing at the active file (as was the case prior // to the keypoint attempt). If we do not do this then any further keypoint operation will re-attempt // the same logic by switching from this empty file back to the active file. The active file will // be cleared in preparation for the keypoint operation (which will subsequently fail) and all // persistent information will be destroyed from disk. if (_activeFile == _file1) { _activeFile = _file2; // depends on control dependency: [if], data = [none] } else { _activeFile = _file1; // depends on control dependency: [if], data = [none] } if (tc.isEntryEnabled()) Tr.exit(tc, "resizeLog", "WriteOperationFailedException"); throw new WriteOperationFailedException(exc); } catch (Throwable exc) // depends on control dependency: [catch], data = [none] { FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogHandle.resizeLog", "1555", this); // Reset the target file reference (see description above for why this must be done) if (_activeFile == _file1) { _activeFile = _file2; // depends on control dependency: [if], data = [none] } else { _activeFile = _file1; // depends on control dependency: [if], data = [none] } if (tc.isEntryEnabled()) Tr.exit(tc, "resizeLog", "InternalLogException"); throw new InternalLogException(exc); } // depends on control dependency: [catch], data = [none] // Now determine how many bytes are currently available in the new target log file. _physicalFreeBytes = _activeFile.freeBytes(); if (tc.isDebugEnabled()) Tr.debug(tc, "Log file " + _activeFile.fileName() + " now has " + _physicalFreeBytes + " bytes of storage available"); if (tc.isEntryEnabled()) Tr.exit(tc, "resizeLog"); } }