code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public Iterator<Locale> getAcceptLanguages() { LinkedList<Locale> ll = new LinkedList<Locale>(); Iterator<Header> it = (Iterator<Header>) this.message .getHeaders(AcceptLanguageHeader.NAME); while (it.hasNext()) { AcceptLanguageHeader alh = (AcceptLanguageHeader) it.next(); ll.add(alh.getAcceptLanguage()); } return ll.iterator(); } }
public class class_name { public Iterator<Locale> getAcceptLanguages() { LinkedList<Locale> ll = new LinkedList<Locale>(); Iterator<Header> it = (Iterator<Header>) this.message .getHeaders(AcceptLanguageHeader.NAME); while (it.hasNext()) { AcceptLanguageHeader alh = (AcceptLanguageHeader) it.next(); ll.add(alh.getAcceptLanguage()); // depends on control dependency: [while], data = [none] } return ll.iterator(); } }
public class class_name { public void marshall(TrainingJobStatusCounters trainingJobStatusCounters, ProtocolMarshaller protocolMarshaller) { if (trainingJobStatusCounters == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(trainingJobStatusCounters.getCompleted(), COMPLETED_BINDING); protocolMarshaller.marshall(trainingJobStatusCounters.getInProgress(), INPROGRESS_BINDING); protocolMarshaller.marshall(trainingJobStatusCounters.getRetryableError(), RETRYABLEERROR_BINDING); protocolMarshaller.marshall(trainingJobStatusCounters.getNonRetryableError(), NONRETRYABLEERROR_BINDING); protocolMarshaller.marshall(trainingJobStatusCounters.getStopped(), STOPPED_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(TrainingJobStatusCounters trainingJobStatusCounters, ProtocolMarshaller protocolMarshaller) { if (trainingJobStatusCounters == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(trainingJobStatusCounters.getCompleted(), COMPLETED_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(trainingJobStatusCounters.getInProgress(), INPROGRESS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(trainingJobStatusCounters.getRetryableError(), RETRYABLEERROR_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(trainingJobStatusCounters.getNonRetryableError(), NONRETRYABLEERROR_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(trainingJobStatusCounters.getStopped(), STOPPED_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public boolean orderByColumnsDetermineAllDisplayColumnsForUnion( List<ParsedColInfo> orderColumns) { Set<AbstractExpression> orderExprs = new HashSet<>(); for (ParsedColInfo col : orderColumns) { orderExprs.add(col.m_expression); } for (ParsedColInfo col : m_displayColumns) { if (! orderExprs.contains(col.m_expression)) { return false; } } return true; } }
public class class_name { public boolean orderByColumnsDetermineAllDisplayColumnsForUnion( List<ParsedColInfo> orderColumns) { Set<AbstractExpression> orderExprs = new HashSet<>(); for (ParsedColInfo col : orderColumns) { orderExprs.add(col.m_expression); // depends on control dependency: [for], data = [col] } for (ParsedColInfo col : m_displayColumns) { if (! orderExprs.contains(col.m_expression)) { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { public boolean exportUserHasReadPermission() { String vfsName = getParamResource(); CmsObject cms = getCms(); try { // static export must always be checked with the export users permissions, // not the current users permissions CmsObject exportCms = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserExport()); exportCms.getRequestContext().setSiteRoot(getCms().getRequestContext().getSiteRoot()); // let's look up if the export user has the permission to read return exportCms.hasPermissions( cms.readResource(vfsName, CmsResourceFilter.IGNORE_EXPIRATION), CmsPermissionSet.ACCESS_READ); } catch (CmsException e) { // ignore this exception } return false; } }
public class class_name { public boolean exportUserHasReadPermission() { String vfsName = getParamResource(); CmsObject cms = getCms(); try { // static export must always be checked with the export users permissions, // not the current users permissions CmsObject exportCms = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserExport()); exportCms.getRequestContext().setSiteRoot(getCms().getRequestContext().getSiteRoot()); // depends on control dependency: [try], data = [none] // let's look up if the export user has the permission to read return exportCms.hasPermissions( cms.readResource(vfsName, CmsResourceFilter.IGNORE_EXPIRATION), CmsPermissionSet.ACCESS_READ); // depends on control dependency: [try], data = [none] } catch (CmsException e) { // ignore this exception } // depends on control dependency: [catch], data = [none] return false; } }
public class class_name { private static Date getDate(final AnnotationData pAnnotation, final BitUtils pBit) { Date date = null; if (pAnnotation.getDateStandard() == BCD_DATE) { date = pBit.getNextDate(pAnnotation.getSize(), pAnnotation.getFormat(), true); } else if (pAnnotation.getDateStandard() == CPCL_DATE) { date = calculateCplcDate(pBit.getNextByte(pAnnotation.getSize())); } else { date = pBit.getNextDate(pAnnotation.getSize(), pAnnotation.getFormat()); } return date; } }
public class class_name { private static Date getDate(final AnnotationData pAnnotation, final BitUtils pBit) { Date date = null; if (pAnnotation.getDateStandard() == BCD_DATE) { date = pBit.getNextDate(pAnnotation.getSize(), pAnnotation.getFormat(), true); // depends on control dependency: [if], data = [none] } else if (pAnnotation.getDateStandard() == CPCL_DATE) { date = calculateCplcDate(pBit.getNextByte(pAnnotation.getSize())); // depends on control dependency: [if], data = [none] } else { date = pBit.getNextDate(pAnnotation.getSize(), pAnnotation.getFormat()); // depends on control dependency: [if], data = [none] } return date; } }
public class class_name { public void marshall(CreateCaseRequest createCaseRequest, ProtocolMarshaller protocolMarshaller) { if (createCaseRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createCaseRequest.getSubject(), SUBJECT_BINDING); protocolMarshaller.marshall(createCaseRequest.getServiceCode(), SERVICECODE_BINDING); protocolMarshaller.marshall(createCaseRequest.getSeverityCode(), SEVERITYCODE_BINDING); protocolMarshaller.marshall(createCaseRequest.getCategoryCode(), CATEGORYCODE_BINDING); protocolMarshaller.marshall(createCaseRequest.getCommunicationBody(), COMMUNICATIONBODY_BINDING); protocolMarshaller.marshall(createCaseRequest.getCcEmailAddresses(), CCEMAILADDRESSES_BINDING); protocolMarshaller.marshall(createCaseRequest.getLanguage(), LANGUAGE_BINDING); protocolMarshaller.marshall(createCaseRequest.getIssueType(), ISSUETYPE_BINDING); protocolMarshaller.marshall(createCaseRequest.getAttachmentSetId(), ATTACHMENTSETID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(CreateCaseRequest createCaseRequest, ProtocolMarshaller protocolMarshaller) { if (createCaseRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createCaseRequest.getSubject(), SUBJECT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createCaseRequest.getServiceCode(), SERVICECODE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createCaseRequest.getSeverityCode(), SEVERITYCODE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createCaseRequest.getCategoryCode(), CATEGORYCODE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createCaseRequest.getCommunicationBody(), COMMUNICATIONBODY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createCaseRequest.getCcEmailAddresses(), CCEMAILADDRESSES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createCaseRequest.getLanguage(), LANGUAGE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createCaseRequest.getIssueType(), ISSUETYPE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createCaseRequest.getAttachmentSetId(), ATTACHMENTSETID_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static IAtomContainer createNewMolecule(IChemModel chemModel) { // Add a new molecule either the set of molecules IAtomContainer molecule = chemModel.getBuilder().newInstance(IAtomContainer.class); if (chemModel.getMoleculeSet() != null) { IAtomContainerSet moleculeSet = chemModel.getMoleculeSet(); for (int i = 0; i < moleculeSet.getAtomContainerCount(); i++) { if (moleculeSet.getAtomContainer(i).getAtomCount() == 0) { moleculeSet.removeAtomContainer(i); i--; } } moleculeSet.addAtomContainer(molecule); } else { IAtomContainerSet moleculeSet = chemModel.getBuilder().newInstance(IAtomContainerSet.class); moleculeSet.addAtomContainer(molecule); chemModel.setMoleculeSet(moleculeSet); } return molecule; } }
public class class_name { public static IAtomContainer createNewMolecule(IChemModel chemModel) { // Add a new molecule either the set of molecules IAtomContainer molecule = chemModel.getBuilder().newInstance(IAtomContainer.class); if (chemModel.getMoleculeSet() != null) { IAtomContainerSet moleculeSet = chemModel.getMoleculeSet(); for (int i = 0; i < moleculeSet.getAtomContainerCount(); i++) { if (moleculeSet.getAtomContainer(i).getAtomCount() == 0) { moleculeSet.removeAtomContainer(i); // depends on control dependency: [if], data = [none] i--; // depends on control dependency: [if], data = [none] } } moleculeSet.addAtomContainer(molecule); // depends on control dependency: [if], data = [none] } else { IAtomContainerSet moleculeSet = chemModel.getBuilder().newInstance(IAtomContainerSet.class); moleculeSet.addAtomContainer(molecule); // depends on control dependency: [if], data = [none] chemModel.setMoleculeSet(moleculeSet); // depends on control dependency: [if], data = [none] } return molecule; } }
public class class_name { public static void addStory(File caseManager, String storyName, String testPath, String user, String feature, String benefit) throws BeastException { FileWriter caseManagerWriter; String storyClass = SystemReader.createClassName(storyName); try { BufferedReader reader = new BufferedReader(new FileReader( caseManager)); String targetLine1 = " public void " + MASReader.createFirstLowCaseName(storyName) + "() {"; String targetLine2 = " Result result = JUnitCore.runClasses(" + testPath + "." + storyClass + ".class);"; String in; while ((in = reader.readLine()) != null) { if (in.equals(targetLine1)) { while ((in = reader.readLine()) != null) { if (in.equals(targetLine2)) { reader.close(); // This test is already written in the case manager. return; } } reader.close(); throw new BeastException("Two different stories with the same name (same method name) are being created in the same CaseManager file. That is not possible. Please, change the name of the story: " + testPath + "." + storyClass + ".java"); } } reader.close(); caseManagerWriter = new FileWriter(caseManager, true); caseManagerWriter.write(" /**\n"); caseManagerWriter.write(" * This is the story: " + storyName + "\n"); caseManagerWriter.write(" * requested by: " + user + "\n"); caseManagerWriter.write(" * providing the feature: " + feature + "\n"); caseManagerWriter.write(" * so the user gets the benefit: " + benefit + "\n"); caseManagerWriter.write(" */\n"); caseManagerWriter.write(" @Test\n"); caseManagerWriter.write(" public void " + MASReader.createFirstLowCaseName(storyName) + "() {\n"); caseManagerWriter.write(" Result result = JUnitCore.runClasses(" + testPath + "." + storyClass + ".class);\n"); caseManagerWriter.write(" Assert.assertTrue(result.wasSuccessful());\n"); caseManagerWriter.write(" }\n"); caseManagerWriter.write("\n"); caseManagerWriter.flush(); caseManagerWriter.close(); } catch (IOException e) { Logger logger = Logger.getLogger("CreateMASCaseManager.createTest"); logger.info("ERROR writing the file"); } } }
public class class_name { public static void addStory(File caseManager, String storyName, String testPath, String user, String feature, String benefit) throws BeastException { FileWriter caseManagerWriter; String storyClass = SystemReader.createClassName(storyName); try { BufferedReader reader = new BufferedReader(new FileReader( caseManager)); String targetLine1 = " public void " + MASReader.createFirstLowCaseName(storyName) + "() {"; String targetLine2 = " Result result = JUnitCore.runClasses(" + testPath + "." + storyClass + ".class);"; String in; while ((in = reader.readLine()) != null) { if (in.equals(targetLine1)) { while ((in = reader.readLine()) != null) { if (in.equals(targetLine2)) { reader.close(); // depends on control dependency: [if], data = [none] // This test is already written in the case manager. return; // depends on control dependency: [if], data = [none] } } reader.close(); // depends on control dependency: [if], data = [none] throw new BeastException("Two different stories with the same name (same method name) are being created in the same CaseManager file. That is not possible. Please, change the name of the story: " + testPath + "." + storyClass + ".java"); } } reader.close(); caseManagerWriter = new FileWriter(caseManager, true); caseManagerWriter.write(" /**\n"); caseManagerWriter.write(" * This is the story: " + storyName + "\n"); caseManagerWriter.write(" * requested by: " + user + "\n"); caseManagerWriter.write(" * providing the feature: " + feature + "\n"); caseManagerWriter.write(" * so the user gets the benefit: " + benefit + "\n"); caseManagerWriter.write(" */\n"); caseManagerWriter.write(" @Test\n"); caseManagerWriter.write(" public void " + MASReader.createFirstLowCaseName(storyName) + "() {\n"); caseManagerWriter.write(" Result result = JUnitCore.runClasses(" + testPath + "." + storyClass + ".class);\n"); caseManagerWriter.write(" Assert.assertTrue(result.wasSuccessful());\n"); caseManagerWriter.write(" }\n"); caseManagerWriter.write("\n"); caseManagerWriter.flush(); caseManagerWriter.close(); } catch (IOException e) { Logger logger = Logger.getLogger("CreateMASCaseManager.createTest"); logger.info("ERROR writing the file"); } } }
public class class_name { @RobotKeyword("Disconnect from MQTT Broker") public void disconnectFromMQTTBroker() { if (client != null) { try { client.disconnect(); } catch (MqttException e) { throw new RuntimeException(e.getLocalizedMessage()); } } } }
public class class_name { @RobotKeyword("Disconnect from MQTT Broker") public void disconnectFromMQTTBroker() { if (client != null) { try { client.disconnect(); // depends on control dependency: [try], data = [none] } catch (MqttException e) { throw new RuntimeException(e.getLocalizedMessage()); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { @Override public void removeByUuid_C(String uuid, long companyId) { for (CPDefinitionLink cpDefinitionLink : findByUuid_C(uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(cpDefinitionLink); } } }
public class class_name { @Override public void removeByUuid_C(String uuid, long companyId) { for (CPDefinitionLink cpDefinitionLink : findByUuid_C(uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(cpDefinitionLink); // depends on control dependency: [for], data = [cpDefinitionLink] } } }
public class class_name { public static Object getTypeValue(final String iValue) { if (iValue == null) return null; if (iValue.length() == 0) return ""; if (iValue.length() > 1) if (iValue.charAt(0) == '"' && iValue.charAt(iValue.length() - 1) == '"') // STRING return OStringSerializerHelper.decode(iValue.substring(1, iValue.length() - 1)); else if (iValue.charAt(0) == OStringSerializerHelper.BINARY_BEGINEND && iValue.charAt(iValue.length() - 1) == OStringSerializerHelper.BINARY_BEGINEND) // STRING return OStringSerializerHelper.getBinaryContent(iValue); else if (iValue.charAt(0) == OStringSerializerHelper.COLLECTION_BEGIN && iValue.charAt(iValue.length() - 1) == OStringSerializerHelper.COLLECTION_END) { // COLLECTION final ArrayList<String> coll = new ArrayList<String>(); OStringSerializerHelper.getCollection(iValue, 0, coll); return coll; } else if (iValue.charAt(0) == OStringSerializerHelper.MAP_BEGIN && iValue.charAt(iValue.length() - 1) == OStringSerializerHelper.MAP_END) { // MAP return OStringSerializerHelper.getMap(iValue); } if (iValue.charAt(0) == ORID.PREFIX) // RID return new ORecordId(iValue); boolean integer = true; char c; for (int index = 0; index < iValue.length(); ++index) { c = iValue.charAt(index); if (c < '0' || c > '9') if ((index == 0 && (c == '+' || c == '-'))) continue; else if (c == DECIMAL_SEPARATOR) integer = false; else { if (index > 0) { if (!integer && c == 'E') { // CHECK FOR SCIENTIFIC NOTATION if (index < iValue.length()) index++; if (iValue.charAt(index) == '-') continue; } final String v = iValue.substring(0, index); if (c == 'f') return new Float(v); else if (c == 'c') return new BigDecimal(v); else if (c == 'l') return new Long(v); else if (c == 'd') return new Double(v); else if (c == 'b') return new Byte(v); else if (c == 'a' || c == 't') return new Date(Long.parseLong(v)); else if (c == 's') return new Short(v); } return iValue; } } if (integer) { try { return new Integer(iValue); } catch (NumberFormatException e) { return new Long(iValue); } } else return new BigDecimal(iValue); } }
public class class_name { public static Object getTypeValue(final String iValue) { if (iValue == null) return null; if (iValue.length() == 0) return ""; if (iValue.length() > 1) if (iValue.charAt(0) == '"' && iValue.charAt(iValue.length() - 1) == '"') // STRING return OStringSerializerHelper.decode(iValue.substring(1, iValue.length() - 1)); else if (iValue.charAt(0) == OStringSerializerHelper.BINARY_BEGINEND && iValue.charAt(iValue.length() - 1) == OStringSerializerHelper.BINARY_BEGINEND) // STRING return OStringSerializerHelper.getBinaryContent(iValue); else if (iValue.charAt(0) == OStringSerializerHelper.COLLECTION_BEGIN && iValue.charAt(iValue.length() - 1) == OStringSerializerHelper.COLLECTION_END) { // COLLECTION final ArrayList<String> coll = new ArrayList<String>(); OStringSerializerHelper.getCollection(iValue, 0, coll); // depends on control dependency: [if], data = [none] return coll; // depends on control dependency: [if], data = [none] } else if (iValue.charAt(0) == OStringSerializerHelper.MAP_BEGIN && iValue.charAt(iValue.length() - 1) == OStringSerializerHelper.MAP_END) { // MAP return OStringSerializerHelper.getMap(iValue); // depends on control dependency: [if], data = [none] } if (iValue.charAt(0) == ORID.PREFIX) // RID return new ORecordId(iValue); boolean integer = true; char c; for (int index = 0; index < iValue.length(); ++index) { c = iValue.charAt(index); // depends on control dependency: [for], data = [index] if (c < '0' || c > '9') if ((index == 0 && (c == '+' || c == '-'))) continue; else if (c == DECIMAL_SEPARATOR) integer = false; else { if (index > 0) { if (!integer && c == 'E') { // CHECK FOR SCIENTIFIC NOTATION if (index < iValue.length()) index++; if (iValue.charAt(index) == '-') continue; } final String v = iValue.substring(0, index); if (c == 'f') return new Float(v); else if (c == 'c') return new BigDecimal(v); else if (c == 'l') return new Long(v); else if (c == 'd') return new Double(v); else if (c == 'b') return new Byte(v); else if (c == 'a' || c == 't') return new Date(Long.parseLong(v)); else if (c == 's') return new Short(v); } return iValue; // depends on control dependency: [if], data = [none] } } if (integer) { try { return new Integer(iValue); // depends on control dependency: [try], data = [none] } catch (NumberFormatException e) { return new Long(iValue); } // depends on control dependency: [catch], data = [none] } else return new BigDecimal(iValue); } }
public class class_name { static String generateGraphVizDotFileFromInterClassDependencies(final ClassInfoList classInfoList, final float sizeX, final float sizeY, final boolean includeExternalClasses) { final StringBuilder buf = new StringBuilder(1024 * 1024); buf.append("digraph {\n"); buf.append("size=\"").append(sizeX).append(',').append(sizeY).append("\";\n"); buf.append("layout=dot;\n"); buf.append("rankdir=\"BT\";\n"); buf.append("overlap=false;\n"); buf.append("splines=true;\n"); buf.append("pack=true;\n"); buf.append("graph [fontname = \"Courier, Regular\"]\n"); buf.append("node [fontname = \"Courier, Regular\"]\n"); buf.append("edge [fontname = \"Courier, Regular\"]\n"); final Set<ClassInfo> allVisibleNodes = new HashSet<>(classInfoList); if (includeExternalClasses) { for (final ClassInfo ci : classInfoList) { allVisibleNodes.addAll(ci.getClassDependencies()); } } for (final ClassInfo ci : allVisibleNodes) { buf.append('"').append(ci.getName()).append('"'); buf.append("[shape=").append(ci.isAnnotation() ? "oval" : ci.isInterface() ? "diamond" : "box") .append(",style=filled,fillcolor=\"#").append(ci.isAnnotation() ? ANNOTATION_COLOR : ci.isInterface() ? INTERFACE_COLOR : STANDARD_CLASS_COLOR) .append("\",label="); buf.append('<'); buf.append("<table border='0' cellborder='0' cellspacing='1'>"); // Class modifiers buf.append("<tr><td><font point-size='12'>").append(ci.getModifiersStr()).append(' ') .append(ci.isEnum() ? "enum" : ci.isAnnotation() ? "@interface" : ci.isInterface() ? "interface" : "class") .append("</font></td></tr>"); if (ci.getName().contains(".")) { buf.append("<tr><td><font point-size='14'><b>"); htmlEncode(ci.getPackageName(), buf); buf.append("</b></font></td></tr>"); } // Class name buf.append("<tr><td><font point-size='20'><b>"); htmlEncode(ci.getSimpleName(), buf); buf.append("</b></font></td></tr>"); buf.append("</table>"); buf.append(">];\n"); } buf.append('\n'); for (final ClassInfo ci : classInfoList) { for (final ClassInfo dep : ci.getClassDependencies()) { if (includeExternalClasses || allVisibleNodes.contains(dep)) { // class --> dep buf.append(" \"").append(ci.getName()).append("\" -> \"").append(dep.getName()) .append("\" [arrowsize=2.5]\n"); } } } buf.append('}'); return buf.toString(); } }
public class class_name { static String generateGraphVizDotFileFromInterClassDependencies(final ClassInfoList classInfoList, final float sizeX, final float sizeY, final boolean includeExternalClasses) { final StringBuilder buf = new StringBuilder(1024 * 1024); buf.append("digraph {\n"); buf.append("size=\"").append(sizeX).append(',').append(sizeY).append("\";\n"); buf.append("layout=dot;\n"); buf.append("rankdir=\"BT\";\n"); buf.append("overlap=false;\n"); buf.append("splines=true;\n"); buf.append("pack=true;\n"); buf.append("graph [fontname = \"Courier, Regular\"]\n"); buf.append("node [fontname = \"Courier, Regular\"]\n"); buf.append("edge [fontname = \"Courier, Regular\"]\n"); final Set<ClassInfo> allVisibleNodes = new HashSet<>(classInfoList); if (includeExternalClasses) { for (final ClassInfo ci : classInfoList) { allVisibleNodes.addAll(ci.getClassDependencies()); // depends on control dependency: [for], data = [ci] } } for (final ClassInfo ci : allVisibleNodes) { buf.append('"').append(ci.getName()).append('"'); // depends on control dependency: [for], data = [ci] buf.append("[shape=").append(ci.isAnnotation() ? "oval" : ci.isInterface() ? "diamond" : "box") .append(",style=filled,fillcolor=\"#").append(ci.isAnnotation() ? ANNOTATION_COLOR : ci.isInterface() ? INTERFACE_COLOR : STANDARD_CLASS_COLOR) .append("\",label="); // depends on control dependency: [for], data = [none] buf.append('<'); // depends on control dependency: [for], data = [none] buf.append("<table border='0' cellborder='0' cellspacing='1'>"); // depends on control dependency: [for], data = [ci] // Class modifiers buf.append("<tr><td><font point-size='12'>").append(ci.getModifiersStr()).append(' ') .append(ci.isEnum() ? "enum" : ci.isAnnotation() ? "@interface" : ci.isInterface() ? "interface" : "class") .append("</font></td></tr>"); // depends on control dependency: [for], data = [none] if (ci.getName().contains(".")) { buf.append("<tr><td><font point-size='14'><b>"); // depends on control dependency: [if], data = [none] htmlEncode(ci.getPackageName(), buf); // depends on control dependency: [if], data = [none] buf.append("</b></font></td></tr>"); // depends on control dependency: [if], data = [none] } // Class name buf.append("<tr><td><font point-size='20'><b>"); // depends on control dependency: [for], data = [none] htmlEncode(ci.getSimpleName(), buf); // depends on control dependency: [for], data = [ci] buf.append("</b></font></td></tr>"); // depends on control dependency: [for], data = [none] buf.append("</table>"); // depends on control dependency: [for], data = [none] buf.append(">];\n"); // depends on control dependency: [for], data = [none] } buf.append('\n'); for (final ClassInfo ci : classInfoList) { for (final ClassInfo dep : ci.getClassDependencies()) { if (includeExternalClasses || allVisibleNodes.contains(dep)) { // class --> dep buf.append(" \"").append(ci.getName()).append("\" -> \"").append(dep.getName()) .append("\" [arrowsize=2.5]\n"); // depends on control dependency: [if], data = [none] } } } buf.append('}'); return buf.toString(); } }
public class class_name { private void startImageLoaderTask(final ImageConsumer consumer, final ImageRequest request) { final String key = request.getKey(); if (debug) { Log.d(TAG, "Key " + key); } ImageLoader loader = currentLoads.get(key); if (loader != null) { final boolean added = loader.addTarget(consumer); if (!added) { loader = null; } } if (loader == null) { if (debug) { Log.d(TAG, "Start a new task"); } loader = new ImageLoader(request, this); if (!loader.addTarget(consumer)) { throw new IllegalStateException("Cannot add target to the new loader"); } currentLoads.put(key, loader); if (debug) { Log.d(TAG, "Current loaders count: " + currentLoads.size()); } final Executor executor = getImageTaskExecutor(); executor.execute(loader.future); } else if (debug) { Log.d(TAG, "Joined to the existing task " + key); } } }
public class class_name { private void startImageLoaderTask(final ImageConsumer consumer, final ImageRequest request) { final String key = request.getKey(); if (debug) { Log.d(TAG, "Key " + key); } // depends on control dependency: [if], data = [none] ImageLoader loader = currentLoads.get(key); if (loader != null) { final boolean added = loader.addTarget(consumer); if (!added) { loader = null; } // depends on control dependency: [if], data = [none] } if (loader == null) { if (debug) { Log.d(TAG, "Start a new task"); } // depends on control dependency: [if], data = [none] loader = new ImageLoader(request, this); // depends on control dependency: [if], data = [none] if (!loader.addTarget(consumer)) { throw new IllegalStateException("Cannot add target to the new loader"); } currentLoads.put(key, loader); // depends on control dependency: [if], data = [none] if (debug) { Log.d(TAG, "Current loaders count: " + currentLoads.size()); } // depends on control dependency: [if], data = [none] final Executor executor = getImageTaskExecutor(); executor.execute(loader.future); // depends on control dependency: [if], data = [(loader] } else if (debug) { Log.d(TAG, "Joined to the existing task " + key); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setEvalCmd(String evalCmd) { this.cmdStr = evalCmd; if (cmdStr != null) { cmdStr = cmdStr.trim(); if (cmdStr.length() == 0) { cmdStr = null; } } cmd = getCmd(cmdStr); } }
public class class_name { public void setEvalCmd(String evalCmd) { this.cmdStr = evalCmd; if (cmdStr != null) { cmdStr = cmdStr.trim(); // depends on control dependency: [if], data = [none] if (cmdStr.length() == 0) { cmdStr = null; } // depends on control dependency: [if], data = [none] } cmd = getCmd(cmdStr); } }
public class class_name { private void extractRawText(TextContainer parent, StringBuilder str) { Iterator<SvgObject> iter = parent.children.iterator(); boolean isFirstChild = true; while (iter.hasNext()) { SvgObject child = iter.next(); if (child instanceof TextContainer) { extractRawText((TextContainer) child, str); } else if (child instanceof TextSequence) { str.append(textXMLSpaceTransform(((TextSequence) child).text, isFirstChild, !iter.hasNext() /*isLastChild*/)); } isFirstChild = false; } } }
public class class_name { private void extractRawText(TextContainer parent, StringBuilder str) { Iterator<SvgObject> iter = parent.children.iterator(); boolean isFirstChild = true; while (iter.hasNext()) { SvgObject child = iter.next(); if (child instanceof TextContainer) { extractRawText((TextContainer) child, str); // depends on control dependency: [if], data = [none] } else if (child instanceof TextSequence) { str.append(textXMLSpaceTransform(((TextSequence) child).text, isFirstChild, !iter.hasNext() /*isLastChild*/)); // depends on control dependency: [if], data = [none] } isFirstChild = false; // depends on control dependency: [while], data = [none] } } }
public class class_name { private static CheerleaderPlayer getInstance(Context context, String clientId) { if (clientId == null) { throw new IllegalArgumentException("Sound cloud client id can't be null."); } if (sInstance == null || sInstance.mIsClosed) { sInstance = new CheerleaderPlayer(context.getApplicationContext(), clientId); } else { sInstance.mClientKey = clientId; } // reset destroy request each time an instance is requested. sInstance.mDestroyDelayed = false; return sInstance; } }
public class class_name { private static CheerleaderPlayer getInstance(Context context, String clientId) { if (clientId == null) { throw new IllegalArgumentException("Sound cloud client id can't be null."); } if (sInstance == null || sInstance.mIsClosed) { sInstance = new CheerleaderPlayer(context.getApplicationContext(), clientId); // depends on control dependency: [if], data = [none] } else { sInstance.mClientKey = clientId; // depends on control dependency: [if], data = [none] } // reset destroy request each time an instance is requested. sInstance.mDestroyDelayed = false; return sInstance; } }
public class class_name { final public void LiteralExpression() throws ParseException { /*@bgen(jjtree) LiteralExpression */ AstLiteralExpression jjtn000 = new AstLiteralExpression(JJTLITERALEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);Token t = null; try { t = jj_consume_token(LITERAL_EXPRESSION); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtn000.setImage(t.image); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); } } } }
public class class_name { final public void LiteralExpression() throws ParseException { /*@bgen(jjtree) LiteralExpression */ AstLiteralExpression jjtn000 = new AstLiteralExpression(JJTLITERALEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);Token t = null; try { t = jj_consume_token(LITERAL_EXPRESSION); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtn000.setImage(t.image); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); // depends on control dependency: [if], data = [none] } } } }
public class class_name { @SuppressWarnings("unchecked") private void reduce(AnalyzerJob analyzerJob, Collection<AnalyzerResult> slaveResults, Map<ComponentJob, AnalyzerResult> resultMap, List<AnalysisResultReductionException> reductionErrors) { if (slaveResults.size() == 1) { // special case where these was only 1 slave job final AnalyzerResult firstResult = slaveResults.iterator().next(); resultMap.put(analyzerJob, firstResult); _analysisListener.analyzerSuccess(_masterJob, analyzerJob, firstResult); return; } final Class<? extends AnalyzerResultReducer<?>> reducerClass = analyzerJob.getDescriptor() .getResultReducerClass(); final ComponentDescriptor<? extends AnalyzerResultReducer<?>> reducerDescriptor = Descriptors .ofComponent(reducerClass); AnalyzerResultReducer<AnalyzerResult> reducer = null; boolean success = false; try { reducer = (AnalyzerResultReducer<AnalyzerResult>) reducerDescriptor.newInstance(); _lifeCycleHelper.assignProvidedProperties(reducerDescriptor, reducer); _lifeCycleHelper.initialize(reducerDescriptor, reducer); final AnalyzerResult reducedResult = reducer.reduce(slaveResults); resultMap.put(analyzerJob, reducedResult); success = true; _analysisListener.analyzerSuccess(_masterJob, analyzerJob, reducedResult); } catch (Exception e) { AnalysisResultReductionException reductionError = new AnalysisResultReductionException(analyzerJob, slaveResults, e); reductionErrors.add(reductionError); _analysisListener.errorInComponent(_masterJob, analyzerJob, null, e); } finally { if (reducer != null) { _lifeCycleHelper.close(reducerDescriptor, reducer, success); } } } }
public class class_name { @SuppressWarnings("unchecked") private void reduce(AnalyzerJob analyzerJob, Collection<AnalyzerResult> slaveResults, Map<ComponentJob, AnalyzerResult> resultMap, List<AnalysisResultReductionException> reductionErrors) { if (slaveResults.size() == 1) { // special case where these was only 1 slave job final AnalyzerResult firstResult = slaveResults.iterator().next(); resultMap.put(analyzerJob, firstResult); // depends on control dependency: [if], data = [none] _analysisListener.analyzerSuccess(_masterJob, analyzerJob, firstResult); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } final Class<? extends AnalyzerResultReducer<?>> reducerClass = analyzerJob.getDescriptor() .getResultReducerClass(); final ComponentDescriptor<? extends AnalyzerResultReducer<?>> reducerDescriptor = Descriptors .ofComponent(reducerClass); AnalyzerResultReducer<AnalyzerResult> reducer = null; boolean success = false; try { reducer = (AnalyzerResultReducer<AnalyzerResult>) reducerDescriptor.newInstance(); // depends on control dependency: [try], data = [none] _lifeCycleHelper.assignProvidedProperties(reducerDescriptor, reducer); // depends on control dependency: [try], data = [none] _lifeCycleHelper.initialize(reducerDescriptor, reducer); // depends on control dependency: [try], data = [none] final AnalyzerResult reducedResult = reducer.reduce(slaveResults); resultMap.put(analyzerJob, reducedResult); // depends on control dependency: [try], data = [none] success = true; // depends on control dependency: [try], data = [none] _analysisListener.analyzerSuccess(_masterJob, analyzerJob, reducedResult); // depends on control dependency: [try], data = [none] } catch (Exception e) { AnalysisResultReductionException reductionError = new AnalysisResultReductionException(analyzerJob, slaveResults, e); reductionErrors.add(reductionError); _analysisListener.errorInComponent(_masterJob, analyzerJob, null, e); } finally { // depends on control dependency: [catch], data = [none] if (reducer != null) { _lifeCycleHelper.close(reducerDescriptor, reducer, success); // depends on control dependency: [if], data = [(reducer] } } } }
public class class_name { private int[] findText(String str, String key, PluralFormat pluralFormatKey, int startingAt) { RbnfLenientScanner scanner = formatter.getLenientScanner(); if (pluralFormatKey != null) { FieldPosition position = new FieldPosition(NumberFormat.INTEGER_FIELD); position.setBeginIndex(startingAt); pluralFormatKey.parseType(str, scanner, position); int start = position.getBeginIndex(); if (start >= 0) { int pluralRuleStart = ruleText.indexOf("$("); int pluralRuleSuffix = ruleText.indexOf(")$", pluralRuleStart) + 2; int matchLen = position.getEndIndex() - start; String prefix = ruleText.substring(0, pluralRuleStart); String suffix = ruleText.substring(pluralRuleSuffix); if (str.regionMatches(start - prefix.length(), prefix, 0, prefix.length()) && str.regionMatches(start + matchLen, suffix, 0, suffix.length())) { return new int[]{start - prefix.length(), matchLen + prefix.length() + suffix.length()}; } } return new int[]{-1, 0}; } if (scanner != null) { // if lenient parsing is turned ON, we've got some work // ahead of us return scanner.findText(str, key, startingAt); } // if lenient parsing is turned off, this is easy. Just call // String.indexOf() and we're done return new int[]{str.indexOf(key, startingAt), key.length()}; } }
public class class_name { private int[] findText(String str, String key, PluralFormat pluralFormatKey, int startingAt) { RbnfLenientScanner scanner = formatter.getLenientScanner(); if (pluralFormatKey != null) { FieldPosition position = new FieldPosition(NumberFormat.INTEGER_FIELD); position.setBeginIndex(startingAt); // depends on control dependency: [if], data = [none] pluralFormatKey.parseType(str, scanner, position); // depends on control dependency: [if], data = [none] int start = position.getBeginIndex(); if (start >= 0) { int pluralRuleStart = ruleText.indexOf("$("); int pluralRuleSuffix = ruleText.indexOf(")$", pluralRuleStart) + 2; int matchLen = position.getEndIndex() - start; String prefix = ruleText.substring(0, pluralRuleStart); String suffix = ruleText.substring(pluralRuleSuffix); if (str.regionMatches(start - prefix.length(), prefix, 0, prefix.length()) && str.regionMatches(start + matchLen, suffix, 0, suffix.length())) { return new int[]{start - prefix.length(), matchLen + prefix.length() + suffix.length()}; // depends on control dependency: [if], data = [none] } } return new int[]{-1, 0}; // depends on control dependency: [if], data = [none] } if (scanner != null) { // if lenient parsing is turned ON, we've got some work // ahead of us return scanner.findText(str, key, startingAt); // depends on control dependency: [if], data = [none] } // if lenient parsing is turned off, this is easy. Just call // String.indexOf() and we're done return new int[]{str.indexOf(key, startingAt), key.length()}; } }
public class class_name { private Object parseItem() { Object obj = Parse.nullobj; for (Parse parse : parses) { obj = parse.fetchItem(exp); if (obj != Parse.nullobj) { skipSpace(); return parseItem(obj); } } throw new ElException("无法解析!"); } }
public class class_name { private Object parseItem() { Object obj = Parse.nullobj; for (Parse parse : parses) { obj = parse.fetchItem(exp); // depends on control dependency: [for], data = [parse] if (obj != Parse.nullobj) { skipSpace(); // depends on control dependency: [if], data = [none] return parseItem(obj); // depends on control dependency: [if], data = [(obj] } } throw new ElException("无法解析!"); } }
public class class_name { public AwsSecurityFindingFilters withCompanyName(StringFilter... companyName) { if (this.companyName == null) { setCompanyName(new java.util.ArrayList<StringFilter>(companyName.length)); } for (StringFilter ele : companyName) { this.companyName.add(ele); } return this; } }
public class class_name { public AwsSecurityFindingFilters withCompanyName(StringFilter... companyName) { if (this.companyName == null) { setCompanyName(new java.util.ArrayList<StringFilter>(companyName.length)); // depends on control dependency: [if], data = [none] } for (StringFilter ele : companyName) { this.companyName.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public static CPMeasurementUnit toModel(CPMeasurementUnitSoap soapModel) { if (soapModel == null) { return null; } CPMeasurementUnit model = new CPMeasurementUnitImpl(); model.setUuid(soapModel.getUuid()); model.setCPMeasurementUnitId(soapModel.getCPMeasurementUnitId()); model.setGroupId(soapModel.getGroupId()); model.setCompanyId(soapModel.getCompanyId()); model.setUserId(soapModel.getUserId()); model.setUserName(soapModel.getUserName()); model.setCreateDate(soapModel.getCreateDate()); model.setModifiedDate(soapModel.getModifiedDate()); model.setName(soapModel.getName()); model.setKey(soapModel.getKey()); model.setRate(soapModel.getRate()); model.setPrimary(soapModel.isPrimary()); model.setPriority(soapModel.getPriority()); model.setType(soapModel.getType()); model.setLastPublishDate(soapModel.getLastPublishDate()); return model; } }
public class class_name { public static CPMeasurementUnit toModel(CPMeasurementUnitSoap soapModel) { if (soapModel == null) { return null; // depends on control dependency: [if], data = [none] } CPMeasurementUnit model = new CPMeasurementUnitImpl(); model.setUuid(soapModel.getUuid()); model.setCPMeasurementUnitId(soapModel.getCPMeasurementUnitId()); model.setGroupId(soapModel.getGroupId()); model.setCompanyId(soapModel.getCompanyId()); model.setUserId(soapModel.getUserId()); model.setUserName(soapModel.getUserName()); model.setCreateDate(soapModel.getCreateDate()); model.setModifiedDate(soapModel.getModifiedDate()); model.setName(soapModel.getName()); model.setKey(soapModel.getKey()); model.setRate(soapModel.getRate()); model.setPrimary(soapModel.isPrimary()); model.setPriority(soapModel.getPriority()); model.setType(soapModel.getType()); model.setLastPublishDate(soapModel.getLastPublishDate()); return model; } }
public class class_name { public MavenProject getMavenProject(Artifact artifact) { try { final MavenSession session = getMavenSession(); final MavenProject current = session.getCurrentProject(); final MavenProject prj = getMavenProjectBuilder().buildFromRepository( artifact, current.getRemoteArtifactRepositories(), session.getLocalRepository()); return prj; } catch (ProjectBuildingException e) { getLog().warn(e); } return null; } }
public class class_name { public MavenProject getMavenProject(Artifact artifact) { try { final MavenSession session = getMavenSession(); final MavenProject current = session.getCurrentProject(); final MavenProject prj = getMavenProjectBuilder().buildFromRepository( artifact, current.getRemoteArtifactRepositories(), session.getLocalRepository()); return prj; // depends on control dependency: [try], data = [none] } catch (ProjectBuildingException e) { getLog().warn(e); } // depends on control dependency: [catch], data = [none] return null; } }
public class class_name { public void setCdataSectionElements(Vector URI_and_localNames) { // convert to the new way. if (URI_and_localNames != null) { final int len = URI_and_localNames.size() - 1; if (len > 0) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < len; i += 2) { // whitspace separated "{uri1}local1 {uri2}local2 ..." if (i != 0) sb.append(' '); final String uri = (String) URI_and_localNames.elementAt(i); final String localName = (String) URI_and_localNames.elementAt(i + 1); if (uri != null) { // If there is no URI don't put this in, just the localName then. sb.append('{'); sb.append(uri); sb.append('}'); } sb.append(localName); } m_StringOfCDATASections = sb.toString(); } } initCdataElems(m_StringOfCDATASections); } }
public class class_name { public void setCdataSectionElements(Vector URI_and_localNames) { // convert to the new way. if (URI_and_localNames != null) { final int len = URI_and_localNames.size() - 1; if (len > 0) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < len; i += 2) { // whitspace separated "{uri1}local1 {uri2}local2 ..." if (i != 0) sb.append(' '); final String uri = (String) URI_and_localNames.elementAt(i); final String localName = (String) URI_and_localNames.elementAt(i + 1); if (uri != null) { // If there is no URI don't put this in, just the localName then. sb.append('{'); // depends on control dependency: [if], data = [none] sb.append(uri); // depends on control dependency: [if], data = [(uri] sb.append('}'); // depends on control dependency: [if], data = [none] } sb.append(localName); // depends on control dependency: [for], data = [none] } m_StringOfCDATASections = sb.toString(); // depends on control dependency: [if], data = [none] } } initCdataElems(m_StringOfCDATASections); } }
public class class_name { @Override public String apply(@SuppressWarnings("rawtypes") final ProfileRequestContext input) { String msg = null; if (input != null) { ProxiedStatusContext context = input.getSubcontext(ProxiedStatusContext.class, false); if (context != null && context.getStatus() != null && context.getStatus().getStatusMessage() != null) { msg = context.getStatus().getStatusMessage().getMessage(); } } return msg != null ? msg : super.apply(input); } }
public class class_name { @Override public String apply(@SuppressWarnings("rawtypes") final ProfileRequestContext input) { String msg = null; if (input != null) { ProxiedStatusContext context = input.getSubcontext(ProxiedStatusContext.class, false); if (context != null && context.getStatus() != null && context.getStatus().getStatusMessage() != null) { msg = context.getStatus().getStatusMessage().getMessage(); // depends on control dependency: [if], data = [none] } } return msg != null ? msg : super.apply(input); } }
public class class_name { public static String generateLabelValue( final String fieldName ) { final StringBuilder buffer = new StringBuilder( fieldName.length() * 2 ); class GenerationCommand { boolean capNextChar = false; boolean lastCharWasUpperCase = false; boolean lastCharWasNumber = false; boolean lastCharWasSpecial = false; boolean shouldContinue = true; char[] chars = fieldName.toCharArray(); void processFieldName() { for ( int index = 0; index < chars.length; index++ ) { char cchar = chars[ index ]; shouldContinue = true; processCharWasNumber( buffer, index, cchar ); if ( !shouldContinue ) { continue; } processCharWasUpperCase( buffer, index, cchar ); if ( !shouldContinue ) { continue; } processSpecialChars( buffer, cchar ); if ( !shouldContinue ) { continue; } cchar = processCapitalizeCommand( cchar ); cchar = processFirstCharacterCheck( buffer, index, cchar ); if ( !shouldContinue ) { continue; } buffer.append( cchar ); } } private void processCharWasNumber( StringBuilder buffer, int index, char cchar ) { if ( lastCharWasSpecial ) { return; } if ( Character.isDigit( cchar ) ) { if ( index != 0 && !lastCharWasNumber ) { buffer.append( ' ' ); } lastCharWasNumber = true; buffer.append( cchar ); this.shouldContinue = false; } else { lastCharWasNumber = false; } } private char processFirstCharacterCheck( final StringBuilder buffer, int index, char cchar ) { /* Always capitalize the first character. */ if ( index == 0 ) { cchar = Character.toUpperCase( cchar ); buffer.append( cchar ); this.shouldContinue = false; } return cchar; } private char processCapitalizeCommand( char cchar ) { /* Capitalize the character. */ if ( capNextChar ) { capNextChar = false; cchar = Character.toUpperCase( cchar ); } return cchar; } private void processSpecialChars( final StringBuilder buffer, char cchar ) { lastCharWasSpecial = false; /* If the character is '.' or '_' then append a space and mark * the next iteration to capitalize. */ if ( cchar == '.' || cchar == '_' ) { buffer.append( ' ' ); capNextChar = true; lastCharWasSpecial = false; this.shouldContinue = false; } } private void processCharWasUpperCase( final StringBuilder buffer, int index, char cchar ) { /* If the character is uppercase, append a space and keep track * that the last character was uppercase for the next iteration. */ if ( Character.isUpperCase( cchar ) ) { if ( index != 0 && !lastCharWasUpperCase ) { buffer.append( ' ' ); } lastCharWasUpperCase = true; buffer.append( cchar ); this.shouldContinue = false; } else { lastCharWasUpperCase = false; } } } GenerationCommand gc = new GenerationCommand(); gc.processFieldName(); /* This is a hack to get address.line_1 to work. */ return buffer.toString().replace( " ", " " ); } }
public class class_name { public static String generateLabelValue( final String fieldName ) { final StringBuilder buffer = new StringBuilder( fieldName.length() * 2 ); class GenerationCommand { boolean capNextChar = false; boolean lastCharWasUpperCase = false; boolean lastCharWasNumber = false; boolean lastCharWasSpecial = false; boolean shouldContinue = true; char[] chars = fieldName.toCharArray(); void processFieldName() { for ( int index = 0; index < chars.length; index++ ) { char cchar = chars[ index ]; shouldContinue = true; // depends on control dependency: [for], data = [none] processCharWasNumber( buffer, index, cchar ); // depends on control dependency: [for], data = [index] if ( !shouldContinue ) { continue; } processCharWasUpperCase( buffer, index, cchar ); // depends on control dependency: [for], data = [index] if ( !shouldContinue ) { continue; } processSpecialChars( buffer, cchar ); // depends on control dependency: [for], data = [none] if ( !shouldContinue ) { continue; } cchar = processCapitalizeCommand( cchar ); // depends on control dependency: [for], data = [none] cchar = processFirstCharacterCheck( buffer, index, cchar ); // depends on control dependency: [for], data = [index] if ( !shouldContinue ) { continue; } buffer.append( cchar ); // depends on control dependency: [for], data = [none] } } private void processCharWasNumber( StringBuilder buffer, int index, char cchar ) { if ( lastCharWasSpecial ) { return; // depends on control dependency: [if], data = [none] } if ( Character.isDigit( cchar ) ) { if ( index != 0 && !lastCharWasNumber ) { buffer.append( ' ' ); // depends on control dependency: [if], data = [none] } lastCharWasNumber = true; // depends on control dependency: [if], data = [none] buffer.append( cchar ); // depends on control dependency: [if], data = [none] this.shouldContinue = false; // depends on control dependency: [if], data = [none] } else { lastCharWasNumber = false; // depends on control dependency: [if], data = [none] } } private char processFirstCharacterCheck( final StringBuilder buffer, int index, char cchar ) { /* Always capitalize the first character. */ if ( index == 0 ) { cchar = Character.toUpperCase( cchar ); // depends on control dependency: [if], data = [none] buffer.append( cchar ); // depends on control dependency: [if], data = [none] this.shouldContinue = false; // depends on control dependency: [if], data = [none] } return cchar; } private char processCapitalizeCommand( char cchar ) { /* Capitalize the character. */ if ( capNextChar ) { capNextChar = false; // depends on control dependency: [if], data = [none] cchar = Character.toUpperCase( cchar ); // depends on control dependency: [if], data = [none] } return cchar; } private void processSpecialChars( final StringBuilder buffer, char cchar ) { lastCharWasSpecial = false; /* If the character is '.' or '_' then append a space and mark * the next iteration to capitalize. */ if ( cchar == '.' || cchar == '_' ) { buffer.append( ' ' ); // depends on control dependency: [if], data = [none] capNextChar = true; // depends on control dependency: [if], data = [none] lastCharWasSpecial = false; // depends on control dependency: [if], data = [none] this.shouldContinue = false; // depends on control dependency: [if], data = [none] } } private void processCharWasUpperCase( final StringBuilder buffer, int index, char cchar ) { /* If the character is uppercase, append a space and keep track * that the last character was uppercase for the next iteration. */ if ( Character.isUpperCase( cchar ) ) { if ( index != 0 && !lastCharWasUpperCase ) { buffer.append( ' ' ); // depends on control dependency: [if], data = [none] } lastCharWasUpperCase = true; // depends on control dependency: [if], data = [none] buffer.append( cchar ); // depends on control dependency: [if], data = [none] this.shouldContinue = false; // depends on control dependency: [if], data = [none] } else { lastCharWasUpperCase = false; // depends on control dependency: [if], data = [none] } } } GenerationCommand gc = new GenerationCommand(); gc.processFieldName(); /* This is a hack to get address.line_1 to work. */ return buffer.toString().replace( " ", " " ); } }
public class class_name { protected final String getForRetrieveForReverse(final Class<?> pClass) { if (PurchaseReturnLine.class == pClass) { return PrcPurchaseReturnLineGfr.class.getSimpleName(); } else if (SalesReturnLine.class == pClass) { return PrcSalesReturnLineGfr.class.getSimpleName(); } else if (UsedMaterialLine.class == pClass) { return PrcUsedMaterialLineGfr.class.getSimpleName(); } else if (GoodsLossLine.class == pClass) { return PrcGoodsLossLineGfr.class.getSimpleName(); } else if (SalesInvoiceLine.class == pClass) { return PrcSalesInvoiceLineGfr.class.getSimpleName(); } else if (BeginningInventoryLine.class == pClass) { return PrcBeginningInventoryLineGfr.class.getSimpleName(); } else if (PurchaseInvoiceLine.class == pClass) { return PrcPurchaseInvoiceLineGfr.class.getSimpleName(); } else if (PrepaymentFrom.class == pClass) { return PrcPrepaymentFromGfr.class.getSimpleName(); } else if (Manufacture.class == pClass) { return PrcManufactureGfr.class.getSimpleName(); } else if (ManufacturingProcess.class == pClass) { return PrcManufacturingProcessGfr.class.getSimpleName(); } else if (PrepaymentTo.class == pClass) { return PrcPrepaymentToGfr.class.getSimpleName(); } else if (PaymentFrom.class == pClass) { return PrcPaymentFromGfr.class.getSimpleName(); } else if (Wage.class == pClass) { return PrcWageGfr.class.getSimpleName(); } else if (PaymentTo.class == pClass) { return PrcPaymentToGfr.class.getSimpleName(); } else if (GoodsLoss.class == pClass || BeginningInventory.class == pClass) { return PrcAccDocGetForReverse.class.getSimpleName(); } else if (PurchaseInvoice.class == pClass || SalesInvoice.class == pClass || SalesReturn.class == pClass || PurchaseReturn.class == pClass) { return PrcAccDocWithTaxesGetForReverse.class.getSimpleName(); } throw new RuntimeException( "there_is_no_retriever_for_reverse_name_for_class::" + pClass.getCanonicalName()); } }
public class class_name { protected final String getForRetrieveForReverse(final Class<?> pClass) { if (PurchaseReturnLine.class == pClass) { return PrcPurchaseReturnLineGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (SalesReturnLine.class == pClass) { return PrcSalesReturnLineGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (UsedMaterialLine.class == pClass) { return PrcUsedMaterialLineGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (GoodsLossLine.class == pClass) { return PrcGoodsLossLineGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (SalesInvoiceLine.class == pClass) { return PrcSalesInvoiceLineGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (BeginningInventoryLine.class == pClass) { return PrcBeginningInventoryLineGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (PurchaseInvoiceLine.class == pClass) { return PrcPurchaseInvoiceLineGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (PrepaymentFrom.class == pClass) { return PrcPrepaymentFromGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (Manufacture.class == pClass) { return PrcManufactureGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (ManufacturingProcess.class == pClass) { return PrcManufacturingProcessGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (PrepaymentTo.class == pClass) { return PrcPrepaymentToGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (PaymentFrom.class == pClass) { return PrcPaymentFromGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (Wage.class == pClass) { return PrcWageGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (PaymentTo.class == pClass) { return PrcPaymentToGfr.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (GoodsLoss.class == pClass || BeginningInventory.class == pClass) { return PrcAccDocGetForReverse.class.getSimpleName(); // depends on control dependency: [if], data = [none] } else if (PurchaseInvoice.class == pClass || SalesInvoice.class == pClass || SalesReturn.class == pClass || PurchaseReturn.class == pClass) { return PrcAccDocWithTaxesGetForReverse.class.getSimpleName(); // depends on control dependency: [if], data = [none] } throw new RuntimeException( "there_is_no_retriever_for_reverse_name_for_class::" + pClass.getCanonicalName()); } }
public class class_name { public void handle(ServletRequest request, ServletResponse response) throws ServletException, UnavailableException, IOException { if (_class==null) throw new UnavailableException("Servlet Not Initialized"); Servlet servlet=(!_initOnStartup||_servlets!=null)?getServlet():_servlet; if (servlet==null) throw new UnavailableException("Could not instantiate "+_class); // Service the request boolean servlet_error=true; Principal user=null; HttpRequest http_request=null; try { // Handle aliased path if (_forcedPath!=null) // TODO complain about poor naming to the Jasper folks request.setAttribute("org.apache.catalina.jsp_file",_forcedPath); // Handle run as if (_runAs!=null && _realm!=null) { http_request=getHttpContext().getHttpConnection().getRequest(); user=_realm.pushRole(http_request.getUserPrincipal(),_runAs); http_request.setUserPrincipal(user); } servlet.service(request,response); servlet_error=false; } catch(UnavailableException e) { if (_servlets!=null && servlet!=null) stop(); makeUnavailable(e); } finally { // pop run-as role if (_runAs!=null && _realm!=null && user!=null) { user=_realm.popRole(user); http_request.setUserPrincipal(user); } // Handle error params. if (servlet_error) request.setAttribute("javax.servlet.error.servlet_name",getName()); // Return to singleThreaded pool synchronized(this) { if (_servlets!=null && servlet!=null) _servlets.push(servlet); } } } }
public class class_name { public void handle(ServletRequest request, ServletResponse response) throws ServletException, UnavailableException, IOException { if (_class==null) throw new UnavailableException("Servlet Not Initialized"); Servlet servlet=(!_initOnStartup||_servlets!=null)?getServlet():_servlet; if (servlet==null) throw new UnavailableException("Could not instantiate "+_class); // Service the request boolean servlet_error=true; Principal user=null; HttpRequest http_request=null; try { // Handle aliased path if (_forcedPath!=null) // TODO complain about poor naming to the Jasper folks request.setAttribute("org.apache.catalina.jsp_file",_forcedPath); // Handle run as if (_runAs!=null && _realm!=null) { http_request=getHttpContext().getHttpConnection().getRequest(); // depends on control dependency: [if], data = [none] user=_realm.pushRole(http_request.getUserPrincipal(),_runAs); // depends on control dependency: [if], data = [none] http_request.setUserPrincipal(user); // depends on control dependency: [if], data = [none] } servlet.service(request,response); servlet_error=false; } catch(UnavailableException e) { if (_servlets!=null && servlet!=null) stop(); makeUnavailable(e); } finally { // pop run-as role if (_runAs!=null && _realm!=null && user!=null) { user=_realm.popRole(user); // depends on control dependency: [if], data = [none] http_request.setUserPrincipal(user); // depends on control dependency: [if], data = [none] } // Handle error params. if (servlet_error) request.setAttribute("javax.servlet.error.servlet_name",getName()); // Return to singleThreaded pool synchronized(this) { if (_servlets!=null && servlet!=null) _servlets.push(servlet); } } } }
public class class_name { private void processHibernateSessionFactoryBean(GraphRewrite event, String dsBeanName, String hibernateDialect, String springDatabaseName) { LOG.info("DS Name: " + dsBeanName + ", " + hibernateDialect + ", " + springDatabaseName); SpringBeanService springBeanService = new SpringBeanService(event.getGraphContext()); DataSourceService dataSourceService = new DataSourceService(event.getGraphContext()); for (SpringBeanModel model : springBeanService.findAllBySpringBeanName(dsBeanName)) { if (model instanceof JNDIReferenceModel && ((JNDIReferenceModel) model).getJndiReference() != null) { // then this is likely a datasource; set JNDI to Datasource JNDIReferenceModel ref = (JNDIReferenceModel) model; DataSourceModel dataSource = dataSourceService.addTypeToModel(ref.getJndiReference()); if (StringUtils.isNotBlank(hibernateDialect)) { LOG.info(" - Resolved Hibernate dialect: " + hibernateDialect); String resolvedType = HibernateDialectDataSourceTypeResolver.resolveDataSourceTypeFromDialect(hibernateDialect); if (StringUtils.isNotBlank(resolvedType)) { dataSource.setDatabaseTypeName(resolvedType); } } else if (StringUtils.isNotBlank(springDatabaseName)) { LOG.info(" - Resolved Spring database type: " + springDatabaseName); String resolvedType = SpringDataSourceTypeResolver.resolveDataSourceTypeFromDialect(springDatabaseName); if (StringUtils.isNotBlank(resolvedType)) { dataSource.setDatabaseTypeName(resolvedType); } } } else { LOG.warning("Not JNDI Reference."); } } } }
public class class_name { private void processHibernateSessionFactoryBean(GraphRewrite event, String dsBeanName, String hibernateDialect, String springDatabaseName) { LOG.info("DS Name: " + dsBeanName + ", " + hibernateDialect + ", " + springDatabaseName); SpringBeanService springBeanService = new SpringBeanService(event.getGraphContext()); DataSourceService dataSourceService = new DataSourceService(event.getGraphContext()); for (SpringBeanModel model : springBeanService.findAllBySpringBeanName(dsBeanName)) { if (model instanceof JNDIReferenceModel && ((JNDIReferenceModel) model).getJndiReference() != null) { // then this is likely a datasource; set JNDI to Datasource JNDIReferenceModel ref = (JNDIReferenceModel) model; DataSourceModel dataSource = dataSourceService.addTypeToModel(ref.getJndiReference()); if (StringUtils.isNotBlank(hibernateDialect)) { LOG.info(" - Resolved Hibernate dialect: " + hibernateDialect); // depends on control dependency: [if], data = [none] String resolvedType = HibernateDialectDataSourceTypeResolver.resolveDataSourceTypeFromDialect(hibernateDialect); if (StringUtils.isNotBlank(resolvedType)) { dataSource.setDatabaseTypeName(resolvedType); // depends on control dependency: [if], data = [none] } } else if (StringUtils.isNotBlank(springDatabaseName)) { LOG.info(" - Resolved Spring database type: " + springDatabaseName); // depends on control dependency: [if], data = [none] String resolvedType = SpringDataSourceTypeResolver.resolveDataSourceTypeFromDialect(springDatabaseName); if (StringUtils.isNotBlank(resolvedType)) { dataSource.setDatabaseTypeName(resolvedType); // depends on control dependency: [if], data = [none] } } } else { LOG.warning("Not JNDI Reference."); // depends on control dependency: [if], data = [none] } } } }
public class class_name { @Override public void eventReceived(EventSubscriptionEntity eventSubscriptionEntity, Object payload, boolean processASync) { if (processASync) { scheduleEventAsync(eventSubscriptionEntity, payload); } else { processEventSync(eventSubscriptionEntity, payload); } } }
public class class_name { @Override public void eventReceived(EventSubscriptionEntity eventSubscriptionEntity, Object payload, boolean processASync) { if (processASync) { scheduleEventAsync(eventSubscriptionEntity, payload); // depends on control dependency: [if], data = [none] } else { processEventSync(eventSubscriptionEntity, payload); // depends on control dependency: [if], data = [none] } } }
public class class_name { public GetDiskSnapshotsResult withDiskSnapshots(DiskSnapshot... diskSnapshots) { if (this.diskSnapshots == null) { setDiskSnapshots(new java.util.ArrayList<DiskSnapshot>(diskSnapshots.length)); } for (DiskSnapshot ele : diskSnapshots) { this.diskSnapshots.add(ele); } return this; } }
public class class_name { public GetDiskSnapshotsResult withDiskSnapshots(DiskSnapshot... diskSnapshots) { if (this.diskSnapshots == null) { setDiskSnapshots(new java.util.ArrayList<DiskSnapshot>(diskSnapshots.length)); // depends on control dependency: [if], data = [none] } for (DiskSnapshot ele : diskSnapshots) { this.diskSnapshots.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public boolean exists(K k) { Key<K> key = keys.get(k); if(key != null) { return objects.get(key) != null; } return false; } }
public class class_name { public boolean exists(K k) { Key<K> key = keys.get(k); if(key != null) { return objects.get(key) != null; // depends on control dependency: [if], data = [(key] } return false; } }
public class class_name { private boolean parseSource(HttpMessage message, Source source, int depth, String baseURL) { log.debug("Parsing an HTML message..."); boolean resourcesfound = false; // Process A elements List<Element> elements = source.getAllElements(HTMLElementName.A); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "href"); } // Process AREA elements elements = source.getAllElements(HTMLElementName.AREA); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "href"); } // Process Frame Elements elements = source.getAllElements(HTMLElementName.FRAME); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "src"); } // Process IFrame Elements elements = source.getAllElements(HTMLElementName.IFRAME); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "src"); } // Process Link elements elements = source.getAllElements(HTMLElementName.LINK); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "href"); } // Process Script elements with src elements = source.getAllElements(HTMLElementName.SCRIPT); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "src"); } // Process Img elements elements = source.getAllElements(HTMLElementName.IMG); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "src"); } // Process META elements elements = source.getAllElements(HTMLElementName.META); for (Element el : elements) { // If we have http-equiv attribute, then urls can be found. String equiv = el.getAttributeValue("http-equiv"); String content = el.getAttributeValue("content"); if (equiv != null && content != null) { // For the following cases: // http-equiv="refresh" content="0;URL=http://foo.bar/..." // http-equiv="location" content="url=http://foo.bar/..." if (equiv.equalsIgnoreCase("refresh") || equiv.equalsIgnoreCase("location")) { Matcher matcher = urlPattern.matcher(content); if (matcher.find()) { String url = matcher.group(1); processURL(message, depth, url, baseURL); resourcesfound = true; } } } } return resourcesfound; } }
public class class_name { private boolean parseSource(HttpMessage message, Source source, int depth, String baseURL) { log.debug("Parsing an HTML message..."); boolean resourcesfound = false; // Process A elements List<Element> elements = source.getAllElements(HTMLElementName.A); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "href"); // depends on control dependency: [for], data = [el] } // Process AREA elements elements = source.getAllElements(HTMLElementName.AREA); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "href"); // depends on control dependency: [for], data = [el] } // Process Frame Elements elements = source.getAllElements(HTMLElementName.FRAME); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "src"); // depends on control dependency: [for], data = [el] } // Process IFrame Elements elements = source.getAllElements(HTMLElementName.IFRAME); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "src"); // depends on control dependency: [for], data = [el] } // Process Link elements elements = source.getAllElements(HTMLElementName.LINK); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "href"); // depends on control dependency: [for], data = [el] } // Process Script elements with src elements = source.getAllElements(HTMLElementName.SCRIPT); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "src"); // depends on control dependency: [for], data = [el] } // Process Img elements elements = source.getAllElements(HTMLElementName.IMG); for (Element el : elements) { resourcesfound |= processAttributeElement(message, depth, baseURL, el, "src"); // depends on control dependency: [for], data = [el] } // Process META elements elements = source.getAllElements(HTMLElementName.META); for (Element el : elements) { // If we have http-equiv attribute, then urls can be found. String equiv = el.getAttributeValue("http-equiv"); String content = el.getAttributeValue("content"); if (equiv != null && content != null) { // For the following cases: // http-equiv="refresh" content="0;URL=http://foo.bar/..." // http-equiv="location" content="url=http://foo.bar/..." if (equiv.equalsIgnoreCase("refresh") || equiv.equalsIgnoreCase("location")) { Matcher matcher = urlPattern.matcher(content); if (matcher.find()) { String url = matcher.group(1); processURL(message, depth, url, baseURL); // depends on control dependency: [if], data = [none] resourcesfound = true; // depends on control dependency: [if], data = [none] } } } } return resourcesfound; } }
public class class_name { @SuppressWarnings("unchecked") public Map<String, String> getSystemJavaxPersistenceOverrides() { if(propertyOverridesExist()) { // we make use of a type cast hack to convert Properties to a Map return mergeFilteredMaps(System.getenv(), (Map) System.getProperties()); } return null; } }
public class class_name { @SuppressWarnings("unchecked") public Map<String, String> getSystemJavaxPersistenceOverrides() { if(propertyOverridesExist()) { // we make use of a type cast hack to convert Properties to a Map return mergeFilteredMaps(System.getenv(), (Map) System.getProperties()); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public void deltaRollback(long time) { rollbackCount.incrementAndGet(); if (time > 0) { rollbackTotalTime.addAndGet(time); if (time > rollbackMaxTime.get()) rollbackMaxTime.set(time); } } }
public class class_name { public void deltaRollback(long time) { rollbackCount.incrementAndGet(); if (time > 0) { rollbackTotalTime.addAndGet(time); // depends on control dependency: [if], data = [(time] if (time > rollbackMaxTime.get()) rollbackMaxTime.set(time); } } }
public class class_name { public void run () { log.info("DOMGR running."); // make a note of the thread that's processing events synchronized (this) { _dobjThread = Thread.currentThread(); } while (isRunning()) { // pop the next unit off the queue and process it processUnit(_evqueue.get()); } log.info("DOMGR exited."); } }
public class class_name { public void run () { log.info("DOMGR running."); // make a note of the thread that's processing events synchronized (this) { _dobjThread = Thread.currentThread(); } while (isRunning()) { // pop the next unit off the queue and process it processUnit(_evqueue.get()); // depends on control dependency: [while], data = [none] } log.info("DOMGR exited."); } }
public class class_name { public boolean set(String key, V value) { int index = exactMatchSearch(key); if (index >= 0) { v[index] = value; return true; } return false; } }
public class class_name { public boolean set(String key, V value) { int index = exactMatchSearch(key); if (index >= 0) { v[index] = value; // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { public Class<?> findOrInsert(ClassLoader classLoader, T key, Callable<Class<?>> lazy) { Class<?> type = find(classLoader, key); if (type != null) { return type; } else { try { return insert(classLoader, key, lazy.call()); } catch (Throwable throwable) { throw new IllegalArgumentException("Could not create type", throwable); } } } }
public class class_name { public Class<?> findOrInsert(ClassLoader classLoader, T key, Callable<Class<?>> lazy) { Class<?> type = find(classLoader, key); if (type != null) { return type; } else { try { return insert(classLoader, key, lazy.call()); // depends on control dependency: [try], data = [none] } catch (Throwable throwable) { throw new IllegalArgumentException("Could not create type", throwable); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public void marshall(SupportedEndpointType supportedEndpointType, ProtocolMarshaller protocolMarshaller) { if (supportedEndpointType == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(supportedEndpointType.getEngineName(), ENGINENAME_BINDING); protocolMarshaller.marshall(supportedEndpointType.getSupportsCDC(), SUPPORTSCDC_BINDING); protocolMarshaller.marshall(supportedEndpointType.getEndpointType(), ENDPOINTTYPE_BINDING); protocolMarshaller.marshall(supportedEndpointType.getEngineDisplayName(), ENGINEDISPLAYNAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(SupportedEndpointType supportedEndpointType, ProtocolMarshaller protocolMarshaller) { if (supportedEndpointType == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(supportedEndpointType.getEngineName(), ENGINENAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(supportedEndpointType.getSupportsCDC(), SUPPORTSCDC_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(supportedEndpointType.getEndpointType(), ENDPOINTTYPE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(supportedEndpointType.getEngineDisplayName(), ENGINEDISPLAYNAME_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { protected void cancel() { if (trace) log.tracef("Cancel work: %s", this); ExecutionContext ctx = getWorkContext(TransactionContext.class); if (ctx == null) { ctx = getExecutionContext(); } if (ctx != null) { Xid xid = ctx.getXid(); if (xid != null) { workManager.getXATerminator().cancelWork(work, xid); } } if (trace) log.tracef("Canceled work: %s", this); } }
public class class_name { protected void cancel() { if (trace) log.tracef("Cancel work: %s", this); ExecutionContext ctx = getWorkContext(TransactionContext.class); if (ctx == null) { ctx = getExecutionContext(); // depends on control dependency: [if], data = [none] } if (ctx != null) { Xid xid = ctx.getXid(); if (xid != null) { workManager.getXATerminator().cancelWork(work, xid); // depends on control dependency: [if], data = [none] } } if (trace) log.tracef("Canceled work: %s", this); } }
public class class_name { public BatchUpdateUserRequest withUpdateUserRequestItems(UpdateUserRequestItem... updateUserRequestItems) { if (this.updateUserRequestItems == null) { setUpdateUserRequestItems(new java.util.ArrayList<UpdateUserRequestItem>(updateUserRequestItems.length)); } for (UpdateUserRequestItem ele : updateUserRequestItems) { this.updateUserRequestItems.add(ele); } return this; } }
public class class_name { public BatchUpdateUserRequest withUpdateUserRequestItems(UpdateUserRequestItem... updateUserRequestItems) { if (this.updateUserRequestItems == null) { setUpdateUserRequestItems(new java.util.ArrayList<UpdateUserRequestItem>(updateUserRequestItems.length)); // depends on control dependency: [if], data = [none] } for (UpdateUserRequestItem ele : updateUserRequestItems) { this.updateUserRequestItems.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public static int[][] startAndEndIndexesOf(final String inputString, final String startingWith, final String endingWith) { if (!inputString.contains(startingWith) || !inputString.contains(endingWith)) { return new int[0][0]; } final int inputStringLength = inputString.length(); final int endingWithLength = endingWith.length(); final int maxArrayLength = inputStringLength / (startingWith.length() + endingWithLength); if (maxArrayLength == 0) { return new int[0][0]; } final int[][] maxIndexes = new int[maxArrayLength][0]; int startSearchFromIndex = 0; int count = 0; do { final int startIndex = inputString.indexOf(startingWith, startSearchFromIndex); if (!((startIndex + 1) < inputStringLength)) { return new int[0][0]; } final int indexOfEndingWith = inputString.indexOf(endingWith, startIndex + 1); if (startIndex < 0 || indexOfEndingWith < 0) { break; } final int endIndex = indexOfEndingWith + endingWithLength - 1; startSearchFromIndex = endIndex; if ((startIndex > endIndex)) { startSearchFromIndex = inputStringLength; } else { final int[] is = { startIndex, endIndex }; maxIndexes[count] = is; count++; } } while (startSearchFromIndex < inputStringLength); final int[][] indexes = new int[count][0]; // TODO check later if System.arraycopy is better than small sized // arrays. System.arraycopy(maxIndexes, 0, indexes, 0, count); return indexes; } }
public class class_name { public static int[][] startAndEndIndexesOf(final String inputString, final String startingWith, final String endingWith) { if (!inputString.contains(startingWith) || !inputString.contains(endingWith)) { return new int[0][0]; // depends on control dependency: [if], data = [none] } final int inputStringLength = inputString.length(); final int endingWithLength = endingWith.length(); final int maxArrayLength = inputStringLength / (startingWith.length() + endingWithLength); if (maxArrayLength == 0) { return new int[0][0]; // depends on control dependency: [if], data = [none] } final int[][] maxIndexes = new int[maxArrayLength][0]; int startSearchFromIndex = 0; int count = 0; do { final int startIndex = inputString.indexOf(startingWith, startSearchFromIndex); if (!((startIndex + 1) < inputStringLength)) { return new int[0][0]; // depends on control dependency: [if], data = [none] } final int indexOfEndingWith = inputString.indexOf(endingWith, startIndex + 1); if (startIndex < 0 || indexOfEndingWith < 0) { break; } final int endIndex = indexOfEndingWith + endingWithLength - 1; startSearchFromIndex = endIndex; if ((startIndex > endIndex)) { startSearchFromIndex = inputStringLength; // depends on control dependency: [if], data = [none] } else { final int[] is = { startIndex, endIndex }; maxIndexes[count] = is; // depends on control dependency: [if], data = [none] count++; // depends on control dependency: [if], data = [none] } } while (startSearchFromIndex < inputStringLength); final int[][] indexes = new int[count][0]; // TODO check later if System.arraycopy is better than small sized // arrays. System.arraycopy(maxIndexes, 0, indexes, 0, count); return indexes; } }
public class class_name { public static boolean isPortletEnvSupported() { if (enabled == null) { synchronized (PortletSupport.class) { if (enabled == null) { try { PortletSupport.class.getClassLoader().loadClass("javax.portlet.PortletContext"); enabled = true; } catch (Throwable ignored) { enabled = false; } } } } return enabled; } }
public class class_name { public static boolean isPortletEnvSupported() { if (enabled == null) { synchronized (PortletSupport.class) { // depends on control dependency: [if], data = [none] if (enabled == null) { try { PortletSupport.class.getClassLoader().loadClass("javax.portlet.PortletContext"); // depends on control dependency: [try], data = [none] enabled = true; // depends on control dependency: [try], data = [none] } catch (Throwable ignored) { enabled = false; } // depends on control dependency: [catch], data = [none] } } } return enabled; } }
public class class_name { public void showBackground(SwipeDirection direction, boolean dimBackground){ if(SwipeDirection.DIRECTION_NEUTRAL != direction && mBackgroundMap.get(direction) == null) return; if(SwipeDirection.DIRECTION_NEUTRAL != visibleView) mBackgroundMap.get(visibleView).setVisibility(View.INVISIBLE); if(SwipeDirection.DIRECTION_NEUTRAL != direction) { mBackgroundMap.get(direction).setVisibility(View.VISIBLE); mBackgroundMap.get(direction).setAlpha(dimBackground ? 0.4f : 1); } visibleView = direction; } }
public class class_name { public void showBackground(SwipeDirection direction, boolean dimBackground){ if(SwipeDirection.DIRECTION_NEUTRAL != direction && mBackgroundMap.get(direction) == null) return; if(SwipeDirection.DIRECTION_NEUTRAL != visibleView) mBackgroundMap.get(visibleView).setVisibility(View.INVISIBLE); if(SwipeDirection.DIRECTION_NEUTRAL != direction) { mBackgroundMap.get(direction).setVisibility(View.VISIBLE); // depends on control dependency: [if], data = [direction)] mBackgroundMap.get(direction).setAlpha(dimBackground ? 0.4f : 1); // depends on control dependency: [if], data = [direction)] } visibleView = direction; } }
public class class_name { public static Object get(Map<String, Object> map, String... keys) { Map<String, Object> result = map; for (final String key : keys) { result = (Map<String, Object>) map.get(key); // make sure we don't crash if we get a null somewhere down the line if (result == null) { return result; } } return result; } }
public class class_name { public static Object get(Map<String, Object> map, String... keys) { Map<String, Object> result = map; for (final String key : keys) { result = (Map<String, Object>) map.get(key); // depends on control dependency: [for], data = [key] // make sure we don't crash if we get a null somewhere down the line if (result == null) { return result; // depends on control dependency: [if], data = [none] } } return result; } }
public class class_name { public void addIndexEntry(final OIndex<?> delegate, final String iIndexName, final OTransactionIndexChanges.OPERATION iOperation, final Object key, final OIdentifiable iValue, boolean clientTrackOnly) { OTransactionIndexChanges indexEntry = indexEntries.get(iIndexName); if (indexEntry == null) { indexEntry = new OTransactionIndexChanges(); indexEntries.put(iIndexName, indexEntry); } if (iOperation == OPERATION.CLEAR) indexEntry.setCleared(); else { OTransactionIndexChangesPerKey changes = indexEntry.getChangesPerKey(key); changes.clientTrackOnly = clientTrackOnly; changes.add(iValue, iOperation); if (iValue == null) return; List<OTransactionRecordIndexOperation> transactionIndexOperations = recordIndexOperations.get(iValue.getIdentity()); if (transactionIndexOperations == null) { transactionIndexOperations = new ArrayList<OTransactionRecordIndexOperation>(); recordIndexOperations.put(iValue.getIdentity().copy(), transactionIndexOperations); } transactionIndexOperations.add(new OTransactionRecordIndexOperation(iIndexName, key, iOperation)); } } }
public class class_name { public void addIndexEntry(final OIndex<?> delegate, final String iIndexName, final OTransactionIndexChanges.OPERATION iOperation, final Object key, final OIdentifiable iValue, boolean clientTrackOnly) { OTransactionIndexChanges indexEntry = indexEntries.get(iIndexName); if (indexEntry == null) { indexEntry = new OTransactionIndexChanges(); // depends on control dependency: [if], data = [none] indexEntries.put(iIndexName, indexEntry); // depends on control dependency: [if], data = [none] } if (iOperation == OPERATION.CLEAR) indexEntry.setCleared(); else { OTransactionIndexChangesPerKey changes = indexEntry.getChangesPerKey(key); changes.clientTrackOnly = clientTrackOnly; // depends on control dependency: [if], data = [none] changes.add(iValue, iOperation); // depends on control dependency: [if], data = [none] if (iValue == null) return; List<OTransactionRecordIndexOperation> transactionIndexOperations = recordIndexOperations.get(iValue.getIdentity()); if (transactionIndexOperations == null) { transactionIndexOperations = new ArrayList<OTransactionRecordIndexOperation>(); // depends on control dependency: [if], data = [none] recordIndexOperations.put(iValue.getIdentity().copy(), transactionIndexOperations); // depends on control dependency: [if], data = [none] } transactionIndexOperations.add(new OTransactionRecordIndexOperation(iIndexName, key, iOperation)); // depends on control dependency: [if], data = [none] } } }
public class class_name { void applySourceMap(SourceMapConsumer aSourceMapConsumer, String aSourceFile, String aSourceMapPath) { String sourceFile = aSourceFile; // If aSourceFile is omitted, we will use the file property of the SourceMap if (aSourceFile == null) { if (aSourceMapConsumer.file == null) { throw new RuntimeException("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, " + "or the source map's \"file\" property. Both were omitted."); } sourceFile = aSourceMapConsumer.file; } String sourceRoot = this._sourceRoot; // Make "sourceFile" relative if an absolute Url is passed. if (sourceRoot != null) { sourceFile = Util.relative(sourceRoot, sourceFile); } // Applying the SourceMap can add and remove items from the sources and // the names array. ArraySet<String> newSources = new ArraySet<>(); ArraySet<String> newNames = new ArraySet<>(); final String f_sourceFile = sourceFile; // Find mappings for the "sourceFile" this._mappings.unsortedForEach().forEach(mapping -> { if (mapping.source.equals(f_sourceFile) && mapping.original != null) { // Check if it can be mapped by the source map, then update the mapping. OriginalPosition original = aSourceMapConsumer.originalPositionFor(mapping.original.line, mapping.original.column, null); if (original.source != null) { // Copy mapping mapping.source = original.source; if (aSourceMapPath != null) { mapping.source = Util.join(aSourceMapPath, mapping.source); } if (sourceRoot != null) { mapping.source = Util.relative(sourceRoot, mapping.source); } mapping.original.line = original.line; mapping.original.column = original.column; if (original.name != null) { mapping.name = original.name; } } } String source = mapping.source; if (source != null && !newSources.has(source)) { newSources.add(source, false); } String name = mapping.name; if (name != null && !newNames.has(name)) { newNames.add(name, false); } }); this._sources = newSources; this._names = newNames; // Copy sourcesContents of applied map. aSourceMapConsumer.sources().stream().forEach(source -> { String content = aSourceMapConsumer.sourceContentFor(source, null); if (content != null) { if (aSourceMapPath != null) { source = Util.join(aSourceMapPath, source); } if (sourceRoot != null) { source = Util.relative(sourceRoot, source); } this.setSourceContent(source, content); } }); } }
public class class_name { void applySourceMap(SourceMapConsumer aSourceMapConsumer, String aSourceFile, String aSourceMapPath) { String sourceFile = aSourceFile; // If aSourceFile is omitted, we will use the file property of the SourceMap if (aSourceFile == null) { if (aSourceMapConsumer.file == null) { throw new RuntimeException("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, " + "or the source map's \"file\" property. Both were omitted."); } sourceFile = aSourceMapConsumer.file; // depends on control dependency: [if], data = [none] } String sourceRoot = this._sourceRoot; // Make "sourceFile" relative if an absolute Url is passed. if (sourceRoot != null) { sourceFile = Util.relative(sourceRoot, sourceFile); // depends on control dependency: [if], data = [(sourceRoot] } // Applying the SourceMap can add and remove items from the sources and // the names array. ArraySet<String> newSources = new ArraySet<>(); ArraySet<String> newNames = new ArraySet<>(); final String f_sourceFile = sourceFile; // Find mappings for the "sourceFile" this._mappings.unsortedForEach().forEach(mapping -> { if (mapping.source.equals(f_sourceFile) && mapping.original != null) { // Check if it can be mapped by the source map, then update the mapping. OriginalPosition original = aSourceMapConsumer.originalPositionFor(mapping.original.line, mapping.original.column, null); if (original.source != null) { // Copy mapping mapping.source = original.source; // depends on control dependency: [if], data = [none] if (aSourceMapPath != null) { mapping.source = Util.join(aSourceMapPath, mapping.source); // depends on control dependency: [if], data = [(aSourceMapPath] } if (sourceRoot != null) { mapping.source = Util.relative(sourceRoot, mapping.source); // depends on control dependency: [if], data = [(sourceRoot] } mapping.original.line = original.line; // depends on control dependency: [if], data = [none] mapping.original.column = original.column; // depends on control dependency: [if], data = [none] if (original.name != null) { mapping.name = original.name; // depends on control dependency: [if], data = [none] } } } String source = mapping.source; if (source != null && !newSources.has(source)) { newSources.add(source, false); } String name = mapping.name; if (name != null && !newNames.has(name)) { newNames.add(name, false); } }); this._sources = newSources; this._names = newNames; // Copy sourcesContents of applied map. aSourceMapConsumer.sources().stream().forEach(source -> { String content = aSourceMapConsumer.sourceContentFor(source, null); if (content != null) { if (aSourceMapPath != null) { source = Util.join(aSourceMapPath, source); } if (sourceRoot != null) { source = Util.relative(sourceRoot, source); } this.setSourceContent(source, content); } }); } }
public class class_name { private void appendSuperClassJoin(ClassDescriptor cld, ClassDescriptor cldSuper, StringBuffer stmt, StringBuffer where) { stmt.append(","); appendTable(cldSuper, stmt); if (where != null) { if (where.length() > 0) { where.append(" AND "); } // get reference field in super class // TODO: do not use the superclassfield anymore, just assume that the id is the same in both tables - @see PBroker.storeToDb int superFieldRef = cld.getSuperClassFieldRef(); FieldDescriptor refField = cld.getFieldDescriptorByIndex(superFieldRef); appendTable(cldSuper, where); where.append("."); appendField(cldSuper.getAutoIncrementFields()[0], where); where.append(" = "); appendTable(cld, where); where.append("."); appendField(refField, where); } } }
public class class_name { private void appendSuperClassJoin(ClassDescriptor cld, ClassDescriptor cldSuper, StringBuffer stmt, StringBuffer where) { stmt.append(","); appendTable(cldSuper, stmt); if (where != null) { if (where.length() > 0) { where.append(" AND "); // depends on control dependency: [if], data = [none] } // get reference field in super class // TODO: do not use the superclassfield anymore, just assume that the id is the same in both tables - @see PBroker.storeToDb int superFieldRef = cld.getSuperClassFieldRef(); FieldDescriptor refField = cld.getFieldDescriptorByIndex(superFieldRef); appendTable(cldSuper, where); // depends on control dependency: [if], data = [none] where.append("."); // depends on control dependency: [if], data = [none] appendField(cldSuper.getAutoIncrementFields()[0], where); // depends on control dependency: [if], data = [none] where.append(" = "); // depends on control dependency: [if], data = [none] appendTable(cld, where); // depends on control dependency: [if], data = [none] where.append("."); // depends on control dependency: [if], data = [none] appendField(refField, where); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public List<String> getObjektartZusatz() { if (objektartZusatz == null) { objektartZusatz = new ArrayList<String>(); } return this.objektartZusatz; } }
public class class_name { @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public List<String> getObjektartZusatz() { if (objektartZusatz == null) { objektartZusatz = new ArrayList<String>(); // depends on control dependency: [if], data = [none] } return this.objektartZusatz; } }
public class class_name { public boolean containsKey(Object key) { if (key == null) { return false; } Entry tab[] = mTable; int hash = System.identityHashCode(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; e = e.mNext) { Object entryKey = e.getKey(); if (entryKey == null) { // Clean up after a cleared Reference. mModCount++; if (prev != null) { prev.mNext = e.mNext; } else { tab[index] = e.mNext; } mCount--; } else if (e.mHash == hash && key == entryKey) { return true; } else { prev = e; } } return false; } }
public class class_name { public boolean containsKey(Object key) { if (key == null) { return false; // depends on control dependency: [if], data = [none] } Entry tab[] = mTable; int hash = System.identityHashCode(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; e = e.mNext) { Object entryKey = e.getKey(); if (entryKey == null) { // Clean up after a cleared Reference. mModCount++; // depends on control dependency: [if], data = [none] if (prev != null) { prev.mNext = e.mNext; // depends on control dependency: [if], data = [none] } else { tab[index] = e.mNext; // depends on control dependency: [if], data = [none] } mCount--; // depends on control dependency: [if], data = [none] } else if (e.mHash == hash && key == entryKey) { return true; // depends on control dependency: [if], data = [none] } else { prev = e; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { protected Subject login() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, CLASS_NAME + "login"); } Subject subject = null; try { /* * Only if we have the AuthenticationService running, we can do * Authentication. If it is not present we cannot do any * authentication and hence we have return null, which means * authentication failed */ if (_authenticationService != null) { subject = _authenticationService.authenticate(MESSAGING_JASS_ENTRY_NAME, _authenticationData, _partialSubject); } } catch (AuthenticationException ae) { // No FFDC Required. We will throw exception if the subject is Null later if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { SibTr.debug(tc, "EXCEPTION_OCCURED_DURING_AUTHENTICATION_MSE1001"); SibTr.exception(tc, ae); } } finally { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exit(tc, CLASS_NAME + "login"); } } return subject; } }
public class class_name { protected Subject login() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, CLASS_NAME + "login"); // depends on control dependency: [if], data = [none] } Subject subject = null; try { /* * Only if we have the AuthenticationService running, we can do * Authentication. If it is not present we cannot do any * authentication and hence we have return null, which means * authentication failed */ if (_authenticationService != null) { subject = _authenticationService.authenticate(MESSAGING_JASS_ENTRY_NAME, _authenticationData, _partialSubject); // depends on control dependency: [if], data = [none] } } catch (AuthenticationException ae) { // No FFDC Required. We will throw exception if the subject is Null later if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { SibTr.debug(tc, "EXCEPTION_OCCURED_DURING_AUTHENTICATION_MSE1001"); // depends on control dependency: [if], data = [none] SibTr.exception(tc, ae); // depends on control dependency: [if], data = [none] } } finally { // depends on control dependency: [catch], data = [none] if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exit(tc, CLASS_NAME + "login"); // depends on control dependency: [if], data = [none] } } return subject; } }
public class class_name { public List<IoDevice> getAvailableIoDevices() { List<IoDevice> returnList = new ArrayList<IoDevice>(); for (PriorityIoDeviceTuple compatibleIoDeviceTuple : mCompatibleDevices) { IoDevice compatibleIoDevice = compatibleIoDeviceTuple.getIoDevice(); if (compatibleIoDevice.equals(mIODevice)) { returnList.add(mIODevice); } else { IoDevice ioDevice = mCursorManager.getIoDevice(compatibleIoDevice); if (ioDevice != null) { returnList.add(ioDevice); } } } return returnList; } }
public class class_name { public List<IoDevice> getAvailableIoDevices() { List<IoDevice> returnList = new ArrayList<IoDevice>(); for (PriorityIoDeviceTuple compatibleIoDeviceTuple : mCompatibleDevices) { IoDevice compatibleIoDevice = compatibleIoDeviceTuple.getIoDevice(); if (compatibleIoDevice.equals(mIODevice)) { returnList.add(mIODevice); // depends on control dependency: [if], data = [none] } else { IoDevice ioDevice = mCursorManager.getIoDevice(compatibleIoDevice); if (ioDevice != null) { returnList.add(ioDevice); // depends on control dependency: [if], data = [(ioDevice] } } } return returnList; } }
public class class_name { @Override public void run(BiConsumer<OngoingRequest, RuleMatch<Endpoint>> matchContinuation) { try { matchAndRun(matchContinuation); } catch (Exception e) { LOG.error("Exception when handling request", e); // ensure that we reply with a server error, if possible ongoingRequest.reply(forStatus(INTERNAL_SERVER_ERROR)); } } }
public class class_name { @Override public void run(BiConsumer<OngoingRequest, RuleMatch<Endpoint>> matchContinuation) { try { matchAndRun(matchContinuation); // depends on control dependency: [try], data = [none] } catch (Exception e) { LOG.error("Exception when handling request", e); // ensure that we reply with a server error, if possible ongoingRequest.reply(forStatus(INTERNAL_SERVER_ERROR)); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public final void visitChildren(final Visitor visitor) { for (final DiffNode child : children.values()) { try { child.visit(visitor); } catch (final StopVisitationException e) { return; } } } }
public class class_name { public final void visitChildren(final Visitor visitor) { for (final DiffNode child : children.values()) { try { child.visit(visitor); // depends on control dependency: [try], data = [none] } catch (final StopVisitationException e) { return; } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public static String parentResourceIdFromResourceId(String id) { if (id == null) { return null; } ResourceId resourceId = ResourceId.fromString(id); if (resourceId != null && resourceId.parent() != null) { return ResourceId.fromString(id).parent().id(); } return null; } }
public class class_name { public static String parentResourceIdFromResourceId(String id) { if (id == null) { return null; // depends on control dependency: [if], data = [none] } ResourceId resourceId = ResourceId.fromString(id); if (resourceId != null && resourceId.parent() != null) { return ResourceId.fromString(id).parent().id(); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public String selectHeaderAccept(String[] accepts) { if (accepts.length == 0) { return null; } for (String accept : accepts) { if (isJsonMime(accept)) { return accept; } } return StringUtil.join(accepts, ","); } }
public class class_name { public String selectHeaderAccept(String[] accepts) { if (accepts.length == 0) { return null; // depends on control dependency: [if], data = [none] } for (String accept : accepts) { if (isJsonMime(accept)) { return accept; // depends on control dependency: [if], data = [none] } } return StringUtil.join(accepts, ","); } }
public class class_name { @Override public int getMaximumNumberOfSubtasks() { if (!(this.format instanceof FileOutputFormat<?>)) { return -1; } final FileOutputFormat<?> fileOutputFormat = (FileOutputFormat<?>) this.format; // ----------------- This code applies only to file inputs ------------------ final Path path = fileOutputFormat.getOutputFilePath(); final WriteMode writeMode = fileOutputFormat.getWriteMode(); final OutputDirectoryMode outDirMode = fileOutputFormat.getOutputDirectoryMode(); // Prepare output path and determine max DOP try { int dop = getTaskConfiguration().getInteger(DEGREE_OF_PARALLELISM_KEY, -1); final FileSystem fs = path.getFileSystem(); if(dop == 1 && outDirMode == OutputDirectoryMode.PARONLY) { // output is not written in parallel and should be written to a single file. if(fs.isDistributedFS()) { // prepare distributed output path if(!fs.initOutPathDistFS(path, writeMode, false)) { // output preparation failed! Cancel task. throw new IOException("Output path could not be initialized."); } } return 1; } else { // output should be written to a directory if(fs.isDistributedFS()) { // only distributed file systems can be initialized at start-up time. if(!fs.initOutPathDistFS(path, writeMode, true)) { throw new IOException("Output directory could not be created."); } } return -1; } } catch (IOException e) { LOG.error("Could not access the file system to detemine the status of the output.", e); throw new RuntimeException("I/O Error while accessing file", e); } } }
public class class_name { @Override public int getMaximumNumberOfSubtasks() { if (!(this.format instanceof FileOutputFormat<?>)) { return -1; // depends on control dependency: [if], data = [none] } final FileOutputFormat<?> fileOutputFormat = (FileOutputFormat<?>) this.format; // ----------------- This code applies only to file inputs ------------------ final Path path = fileOutputFormat.getOutputFilePath(); final WriteMode writeMode = fileOutputFormat.getWriteMode(); final OutputDirectoryMode outDirMode = fileOutputFormat.getOutputDirectoryMode(); // Prepare output path and determine max DOP try { int dop = getTaskConfiguration().getInteger(DEGREE_OF_PARALLELISM_KEY, -1); final FileSystem fs = path.getFileSystem(); if(dop == 1 && outDirMode == OutputDirectoryMode.PARONLY) { // output is not written in parallel and should be written to a single file. if(fs.isDistributedFS()) { // prepare distributed output path if(!fs.initOutPathDistFS(path, writeMode, false)) { // output preparation failed! Cancel task. throw new IOException("Output path could not be initialized."); } } return 1; // depends on control dependency: [if], data = [none] } else { // output should be written to a directory if(fs.isDistributedFS()) { // only distributed file systems can be initialized at start-up time. if(!fs.initOutPathDistFS(path, writeMode, true)) { throw new IOException("Output directory could not be created."); } } return -1; // depends on control dependency: [if], data = [none] } } catch (IOException e) { LOG.error("Could not access the file system to detemine the status of the output.", e); throw new RuntimeException("I/O Error while accessing file", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public DescribeBatchPredictionsResult withResults(BatchPrediction... results) { if (this.results == null) { setResults(new com.amazonaws.internal.SdkInternalList<BatchPrediction>(results.length)); } for (BatchPrediction ele : results) { this.results.add(ele); } return this; } }
public class class_name { public DescribeBatchPredictionsResult withResults(BatchPrediction... results) { if (this.results == null) { setResults(new com.amazonaws.internal.SdkInternalList<BatchPrediction>(results.length)); // depends on control dependency: [if], data = [none] } for (BatchPrediction ele : results) { this.results.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { private CmsPreviewInfo getPreviewInfo(CmsObject cms, CmsResource resource, Locale locale) { String title = ""; try { CmsProperty titleProperty = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_TITLE, false); title = titleProperty.getValue(""); } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); } String noPreviewReason = getNoPreviewReason(cms, resource); String previewContent = null; int height = 0; int width = 0; LinkedHashMap<String, String> locales = getAvailableLocales(resource); if (noPreviewReason != null) { previewContent = "<div>" + noPreviewReason + "</div>"; return new CmsPreviewInfo( "<div>" + noPreviewReason + "</div>", null, false, title, cms.getSitePath(resource), locale.toString()); } else if (OpenCms.getResourceManager().matchResourceType( CmsResourceTypeImage.getStaticTypeName(), resource.getTypeId())) { CmsImageScaler scaler = new CmsImageScaler(cms, resource); String imageLink = null; if (resource instanceof I_CmsHistoryResource) { int version = ((I_CmsHistoryResource)resource).getVersion(); imageLink = OpenCms.getLinkManager().substituteLinkForUnknownTarget( cms, CmsHistoryListUtil.getHistoryLink(cms, resource.getStructureId(), "" + version)); } else { imageLink = OpenCms.getLinkManager().substituteLinkForUnknownTarget(cms, resource.getRootPath()); } imageLink = CmsRequestUtil.appendParameter(imageLink, "random", "" + Math.random()); previewContent = "<img src=\"" + imageLink + "\" title=\"" + title + "\" style=\"display:block\" />"; height = scaler.getHeight(); width = scaler.getWidth(); } else if (CmsResourceTypeXmlContainerPage.isContainerPage(resource) || CmsResourceTypeXmlPage.isXmlPage(resource)) { String link = ""; if (resource instanceof I_CmsHistoryResource) { int version = ((I_CmsHistoryResource)resource).getVersion(); link = OpenCms.getLinkManager().substituteLinkForUnknownTarget( cms, CmsHistoryListUtil.getHistoryLink(cms, resource.getStructureId(), "" + version)); } else { link = OpenCms.getLinkManager().substituteLinkForUnknownTarget(cms, resource.getRootPath()); } return new CmsPreviewInfo(null, link, true, null, cms.getSitePath(resource), locale.toString()); } else if (CmsResourceTypeXmlContent.isXmlContent(resource)) { if (!locales.containsKey(locale.toString())) { locale = CmsLocaleManager.getMainLocale(cms, resource); } previewContent = CmsPreviewService.getPreviewContent(getRequest(), getResponse(), cms, resource, locale); } else if (CmsResourceTypePlain.getStaticTypeId() == resource.getTypeId()) { try { previewContent = "<pre><code>" + new String(cms.readFile(resource).getContents()) + "</code></pre>"; } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); previewContent = "<div>" + Messages.get().getBundle(OpenCms.getWorkplaceManager().getWorkplaceLocale(cms)).key( Messages.GUI_NO_PREVIEW_CAN_T_READ_CONTENT_0) + "</div>"; } } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(previewContent)) { CmsPreviewInfo result = new CmsPreviewInfo( previewContent, null, false, title, cms.getSitePath(resource), locale.toString()); result.setHeight(height); result.setWidth(width); result.setLocales(locales); return result; } if (CmsResourceTypeXmlContainerPage.isContainerPage(resource) || CmsResourceTypeXmlPage.isXmlPage(resource)) { CmsPreviewInfo result = new CmsPreviewInfo( null, OpenCms.getLinkManager().substituteLinkForUnknownTarget(cms, resource.getRootPath()) + "?" + CmsGwtConstants.PARAM_DISABLE_DIRECT_EDIT + "=true" + "&__locale=" + locale.toString(), false, title, cms.getSitePath(resource), locale.toString()); result.setLocales(locales); return result; } return new CmsPreviewInfo( null, OpenCms.getLinkManager().substituteLinkForUnknownTarget(cms, resource.getRootPath()) + "?" + CmsGwtConstants.PARAM_DISABLE_DIRECT_EDIT + "=true", true, title, cms.getSitePath(resource), locale.toString()); } }
public class class_name { private CmsPreviewInfo getPreviewInfo(CmsObject cms, CmsResource resource, Locale locale) { String title = ""; try { CmsProperty titleProperty = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_TITLE, false); title = titleProperty.getValue(""); // depends on control dependency: [try], data = [none] } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); } // depends on control dependency: [catch], data = [none] String noPreviewReason = getNoPreviewReason(cms, resource); String previewContent = null; int height = 0; int width = 0; LinkedHashMap<String, String> locales = getAvailableLocales(resource); if (noPreviewReason != null) { previewContent = "<div>" + noPreviewReason + "</div>"; // depends on control dependency: [if], data = [none] return new CmsPreviewInfo( "<div>" + noPreviewReason + "</div>", null, false, title, cms.getSitePath(resource), locale.toString()); // depends on control dependency: [if], data = [none] } else if (OpenCms.getResourceManager().matchResourceType( CmsResourceTypeImage.getStaticTypeName(), resource.getTypeId())) { CmsImageScaler scaler = new CmsImageScaler(cms, resource); String imageLink = null; if (resource instanceof I_CmsHistoryResource) { int version = ((I_CmsHistoryResource)resource).getVersion(); imageLink = OpenCms.getLinkManager().substituteLinkForUnknownTarget( cms, CmsHistoryListUtil.getHistoryLink(cms, resource.getStructureId(), "" + version)); // depends on control dependency: [if], data = [none] } else { imageLink = OpenCms.getLinkManager().substituteLinkForUnknownTarget(cms, resource.getRootPath()); // depends on control dependency: [if], data = [none] } imageLink = CmsRequestUtil.appendParameter(imageLink, "random", "" + Math.random()); // depends on control dependency: [if], data = [none] previewContent = "<img src=\"" + imageLink + "\" title=\"" + title + "\" style=\"display:block\" />"; // depends on control dependency: [if], data = [none] height = scaler.getHeight(); // depends on control dependency: [if], data = [none] width = scaler.getWidth(); // depends on control dependency: [if], data = [none] } else if (CmsResourceTypeXmlContainerPage.isContainerPage(resource) || CmsResourceTypeXmlPage.isXmlPage(resource)) { String link = ""; if (resource instanceof I_CmsHistoryResource) { int version = ((I_CmsHistoryResource)resource).getVersion(); link = OpenCms.getLinkManager().substituteLinkForUnknownTarget( cms, CmsHistoryListUtil.getHistoryLink(cms, resource.getStructureId(), "" + version)); // depends on control dependency: [if], data = [none] } else { link = OpenCms.getLinkManager().substituteLinkForUnknownTarget(cms, resource.getRootPath()); // depends on control dependency: [if], data = [none] } return new CmsPreviewInfo(null, link, true, null, cms.getSitePath(resource), locale.toString()); // depends on control dependency: [if], data = [none] } else if (CmsResourceTypeXmlContent.isXmlContent(resource)) { if (!locales.containsKey(locale.toString())) { locale = CmsLocaleManager.getMainLocale(cms, resource); // depends on control dependency: [if], data = [none] } previewContent = CmsPreviewService.getPreviewContent(getRequest(), getResponse(), cms, resource, locale); // depends on control dependency: [if], data = [none] } else if (CmsResourceTypePlain.getStaticTypeId() == resource.getTypeId()) { try { previewContent = "<pre><code>" + new String(cms.readFile(resource).getContents()) + "</code></pre>"; // depends on control dependency: [try], data = [none] } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); previewContent = "<div>" + Messages.get().getBundle(OpenCms.getWorkplaceManager().getWorkplaceLocale(cms)).key( Messages.GUI_NO_PREVIEW_CAN_T_READ_CONTENT_0) + "</div>"; } // depends on control dependency: [catch], data = [none] } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(previewContent)) { CmsPreviewInfo result = new CmsPreviewInfo( previewContent, null, false, title, cms.getSitePath(resource), locale.toString()); result.setHeight(height); // depends on control dependency: [if], data = [none] result.setWidth(width); // depends on control dependency: [if], data = [none] result.setLocales(locales); // depends on control dependency: [if], data = [none] return result; // depends on control dependency: [if], data = [none] } if (CmsResourceTypeXmlContainerPage.isContainerPage(resource) || CmsResourceTypeXmlPage.isXmlPage(resource)) { CmsPreviewInfo result = new CmsPreviewInfo( null, OpenCms.getLinkManager().substituteLinkForUnknownTarget(cms, resource.getRootPath()) + "?" + CmsGwtConstants.PARAM_DISABLE_DIRECT_EDIT + "=true" + "&__locale=" + locale.toString(), false, title, cms.getSitePath(resource), locale.toString()); result.setLocales(locales); // depends on control dependency: [if], data = [none] return result; // depends on control dependency: [if], data = [none] } return new CmsPreviewInfo( null, OpenCms.getLinkManager().substituteLinkForUnknownTarget(cms, resource.getRootPath()) + "?" + CmsGwtConstants.PARAM_DISABLE_DIRECT_EDIT + "=true", true, title, cms.getSitePath(resource), locale.toString()); } }
public class class_name { public void processTimeout(TimeoutEvent arg0) { synchronized (listeners) { Iterator<SipListener> iter = listeners.iterator(); while (iter.hasNext() == true) { SipListener listener = (SipListener) iter.next(); listener.processTimeout(arg0); } } } }
public class class_name { public void processTimeout(TimeoutEvent arg0) { synchronized (listeners) { Iterator<SipListener> iter = listeners.iterator(); while (iter.hasNext() == true) { SipListener listener = (SipListener) iter.next(); listener.processTimeout(arg0); // depends on control dependency: [while], data = [none] } } } }
public class class_name { @Override public void validate(Message msg, ValidatorLevel validatorLevel) throws AvpNotAllowedException { if (validatorLevel == ValidatorLevel.OFF) { return; } // if its !OFF, we will go down, at least to this section for (AvpRepresentation ap : this.unmuttableMessageAvps.values()) { AvpSet innerSet = msg.getAvps().getAvps(ap.getCode(), ap.getVendorId()); int count = 0; if (innerSet != null) { count = innerSet.size(); } if (!ap.isCountValidForMultiplicity(count)) { throw new AvpNotAllowedException("AVP: \n" + ap + "\n, has wrong count in message - " + (count), ap.getCode(), ap.getVendorId()); } // if its ALL, we need to go down deeper in AVPs if (validatorLevel != ValidatorLevel.ALL) { continue; } if (count != 0 && ap.isGrouped()) { // we are grouped validateGrouped(ap, innerSet); } } } }
public class class_name { @Override public void validate(Message msg, ValidatorLevel validatorLevel) throws AvpNotAllowedException { if (validatorLevel == ValidatorLevel.OFF) { return; } // if its !OFF, we will go down, at least to this section for (AvpRepresentation ap : this.unmuttableMessageAvps.values()) { AvpSet innerSet = msg.getAvps().getAvps(ap.getCode(), ap.getVendorId()); int count = 0; if (innerSet != null) { count = innerSet.size(); // depends on control dependency: [if], data = [none] } if (!ap.isCountValidForMultiplicity(count)) { throw new AvpNotAllowedException("AVP: \n" + ap + "\n, has wrong count in message - " + (count), ap.getCode(), ap.getVendorId()); } // if its ALL, we need to go down deeper in AVPs if (validatorLevel != ValidatorLevel.ALL) { continue; } if (count != 0 && ap.isGrouped()) { // we are grouped validateGrouped(ap, innerSet); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void sendMessage(String handler, List<?> arguments) { if (so != null) { beginUpdate(); try { so.sendMessage(handler, arguments); } catch (Exception ex) { log.warn("Exception on so.sendMessage", ex); } finally { endUpdate(); } // Invoke method on registered handler String serviceName, serviceMethod; // Find out last dot position int dotPos = handler.lastIndexOf('.'); // If any, split service name and service method name if (dotPos != -1) { serviceName = handler.substring(0, dotPos); serviceMethod = handler.substring(dotPos + 1); } else { // Otherwise only service method name is available serviceName = ""; serviceMethod = handler; } // Get previously registered handler for service Object soHandler = getServiceHandler(serviceName); if (soHandler == null && hasParent()) { // No custom handler, check for service defined in the scope's context IContext context = getParent().getContext(); String serviceId = null; try { // The bean must have a name of // "<SharedObjectName>.<DottedServiceName>.soservice" serviceId = so.getName() + '.' + serviceName + ".soservice"; if (context.hasBean(serviceId)) { soHandler = context.getBean(serviceId); } } catch (Exception err) { log.debug("No such bean: {}", serviceId); } } // Once handler is found, find matching method if (soHandler != null) { // With exact params... Object[] methodResult = ReflectionUtils.findMethodWithExactParameters(soHandler, serviceMethod, arguments); // Or at least with suitable list params if (methodResult.length == 0 || methodResult[0] == null) { methodResult = ReflectionUtils.findMethodWithListParameters(soHandler, serviceMethod, arguments); } // If method is found... if (methodResult.length > 0 && methodResult[0] != null) { Method method = (Method) methodResult[0]; Object[] params = (Object[]) methodResult[1]; // ...try to invoke it and handle exceptions try { method.invoke(soHandler, params); } catch (Exception err) { log.error("Error while invoking method {} on shared object handler {}", new Object[] { serviceMethod, handler }, err); } } } // notify server listeners for (ISharedObjectListener listener : serverListeners) { listener.onSharedObjectSend(this, handler, arguments); } } } }
public class class_name { public void sendMessage(String handler, List<?> arguments) { if (so != null) { beginUpdate(); // depends on control dependency: [if], data = [none] try { so.sendMessage(handler, arguments); // depends on control dependency: [try], data = [none] } catch (Exception ex) { log.warn("Exception on so.sendMessage", ex); } finally { // depends on control dependency: [catch], data = [none] endUpdate(); } // Invoke method on registered handler String serviceName, serviceMethod; // Find out last dot position int dotPos = handler.lastIndexOf('.'); // If any, split service name and service method name if (dotPos != -1) { serviceName = handler.substring(0, dotPos); // depends on control dependency: [if], data = [none] serviceMethod = handler.substring(dotPos + 1); // depends on control dependency: [if], data = [(dotPos] } else { // Otherwise only service method name is available serviceName = ""; serviceMethod = handler; // depends on control dependency: [if], data = [none] } // Get previously registered handler for service Object soHandler = getServiceHandler(serviceName); if (soHandler == null && hasParent()) { // No custom handler, check for service defined in the scope's context IContext context = getParent().getContext(); String serviceId = null; try { // The bean must have a name of // "<SharedObjectName>.<DottedServiceName>.soservice" serviceId = so.getName() + '.' + serviceName + ".soservice"; // depends on control dependency: [try], data = [none] if (context.hasBean(serviceId)) { soHandler = context.getBean(serviceId); // depends on control dependency: [if], data = [none] } } catch (Exception err) { log.debug("No such bean: {}", serviceId); } // depends on control dependency: [catch], data = [none] } // Once handler is found, find matching method if (soHandler != null) { // With exact params... Object[] methodResult = ReflectionUtils.findMethodWithExactParameters(soHandler, serviceMethod, arguments); // Or at least with suitable list params if (methodResult.length == 0 || methodResult[0] == null) { methodResult = ReflectionUtils.findMethodWithListParameters(soHandler, serviceMethod, arguments); // depends on control dependency: [if], data = [none] } // If method is found... if (methodResult.length > 0 && methodResult[0] != null) { Method method = (Method) methodResult[0]; Object[] params = (Object[]) methodResult[1]; // ...try to invoke it and handle exceptions try { method.invoke(soHandler, params); // depends on control dependency: [try], data = [none] } catch (Exception err) { log.error("Error while invoking method {} on shared object handler {}", new Object[] { serviceMethod, handler }, err); } // depends on control dependency: [catch], data = [none] } } // notify server listeners for (ISharedObjectListener listener : serverListeners) { listener.onSharedObjectSend(this, handler, arguments); // depends on control dependency: [for], data = [listener] } } } }
public class class_name { static boolean isHttpOnlyReflect(javax.servlet.http.Cookie servletCookie){ try { return (Boolean)servletCookie.getClass().getMethod("isHttpOnly").invoke(servletCookie); } catch (Exception e) { // Cookie.logger.warn("You are trying to get HttpOnly from a cookie, but it appears you are running on Servlet version before 3.0. Returning false.. which can be false!"); return false; //return default. Should we be throwing exception here? } } }
public class class_name { static boolean isHttpOnlyReflect(javax.servlet.http.Cookie servletCookie){ try { return (Boolean)servletCookie.getClass().getMethod("isHttpOnly").invoke(servletCookie); // depends on control dependency: [try], data = [none] } catch (Exception e) { // Cookie.logger.warn("You are trying to get HttpOnly from a cookie, but it appears you are running on Servlet version before 3.0. Returning false.. which can be false!"); return false; //return default. Should we be throwing exception here? } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static String encrypt(String cleartext) { if (cleartext != null) { byte[] result = doFinal(Base64.decode(getBase64Key(), Base64.DEFAULT), Cipher.ENCRYPT_MODE, cleartext.getBytes()); return Base64.encodeToString(result, Base64.DEFAULT); } return null; } }
public class class_name { public static String encrypt(String cleartext) { if (cleartext != null) { byte[] result = doFinal(Base64.decode(getBase64Key(), Base64.DEFAULT), Cipher.ENCRYPT_MODE, cleartext.getBytes()); return Base64.encodeToString(result, Base64.DEFAULT); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public static int encode(byte[] value, byte[] dst, int dstOffset) { if (value == null) { dst[dstOffset] = NULL_BYTE_HIGH; return 1; } return encode(value, 0, value.length, dst, dstOffset); } }
public class class_name { public static int encode(byte[] value, byte[] dst, int dstOffset) { if (value == null) { dst[dstOffset] = NULL_BYTE_HIGH; // depends on control dependency: [if], data = [none] return 1; // depends on control dependency: [if], data = [none] } return encode(value, 0, value.length, dst, dstOffset); } }
public class class_name { @Pure public static Element getElementMatching(Node document, XMLConstraint constraint, boolean caseSensitive, String... path) { assert document != null : AssertMessages.notNullParameter(0); assert constraint != null : AssertMessages.notNullParameter(1); for (final Element element : getElementsFromPath(document, caseSensitive, path)) { if (constraint.isValidElement(element)) { return element; } } return null; } }
public class class_name { @Pure public static Element getElementMatching(Node document, XMLConstraint constraint, boolean caseSensitive, String... path) { assert document != null : AssertMessages.notNullParameter(0); assert constraint != null : AssertMessages.notNullParameter(1); for (final Element element : getElementsFromPath(document, caseSensitive, path)) { if (constraint.isValidElement(element)) { return element; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public final Connection connectNow(Duration timeout) { Objects.requireNonNull(timeout, "timeout"); try { return Objects.requireNonNull(connect().block(timeout), "aborted"); } catch (IllegalStateException e) { if (e.getMessage().contains("blocking read")) { throw new IllegalStateException("TcpClient couldn't be started within " + timeout.toMillis() + "ms"); } throw e; } } }
public class class_name { public final Connection connectNow(Duration timeout) { Objects.requireNonNull(timeout, "timeout"); try { return Objects.requireNonNull(connect().block(timeout), "aborted"); // depends on control dependency: [try], data = [none] } catch (IllegalStateException e) { if (e.getMessage().contains("blocking read")) { throw new IllegalStateException("TcpClient couldn't be started within " + timeout.toMillis() + "ms"); } throw e; } // depends on control dependency: [catch], data = [none] } }
public class class_name { protected void bindNumericColumnConstraints(Column column, PersistentProperty property, ColumnConfig cc) { int scale = Column.DEFAULT_SCALE; int precision = Column.DEFAULT_PRECISION; PropertyConfig constrainedProperty = (PropertyConfig) property.getMapping().getMappedForm(); if( cc != null && cc.getScale() > - 1) { column.setScale(cc.getScale()); } else if (constrainedProperty.getScale() > -1) { scale = constrainedProperty.getScale(); column.setScale(scale); } if( cc != null && cc.getPrecision() > -1) { column.setPrecision(cc.getPrecision()); } else { Comparable<?> minConstraintValue = constrainedProperty.getMin(); Comparable<?> maxConstraintValue = constrainedProperty.getMax(); int minConstraintValueLength = 0; if ((minConstraintValue != null) && (minConstraintValue instanceof Number)) { minConstraintValueLength = Math.max( countDigits((Number) minConstraintValue), countDigits(((Number) minConstraintValue).longValue()) + scale); } int maxConstraintValueLength = 0; if ((maxConstraintValue != null) && (maxConstraintValue instanceof Number)) { maxConstraintValueLength = Math.max( countDigits((Number) maxConstraintValue), countDigits(((Number) maxConstraintValue).longValue()) + scale); } if (minConstraintValueLength > 0 && maxConstraintValueLength > 0) { // If both of min and max constraints are setted we could use // maximum digits number in it as precision precision = Math.max(minConstraintValueLength, maxConstraintValueLength); } else { // Overwise we should also use default precision precision = DefaultGroovyMethods.max(new Integer[]{precision, minConstraintValueLength, maxConstraintValueLength}); } column.setPrecision(precision); } } }
public class class_name { protected void bindNumericColumnConstraints(Column column, PersistentProperty property, ColumnConfig cc) { int scale = Column.DEFAULT_SCALE; int precision = Column.DEFAULT_PRECISION; PropertyConfig constrainedProperty = (PropertyConfig) property.getMapping().getMappedForm(); if( cc != null && cc.getScale() > - 1) { column.setScale(cc.getScale()); // depends on control dependency: [if], data = [none] } else if (constrainedProperty.getScale() > -1) { scale = constrainedProperty.getScale(); // depends on control dependency: [if], data = [none] column.setScale(scale); // depends on control dependency: [if], data = [none] } if( cc != null && cc.getPrecision() > -1) { column.setPrecision(cc.getPrecision()); // depends on control dependency: [if], data = [none] } else { Comparable<?> minConstraintValue = constrainedProperty.getMin(); Comparable<?> maxConstraintValue = constrainedProperty.getMax(); int minConstraintValueLength = 0; if ((minConstraintValue != null) && (minConstraintValue instanceof Number)) { minConstraintValueLength = Math.max( countDigits((Number) minConstraintValue), countDigits(((Number) minConstraintValue).longValue()) + scale); // depends on control dependency: [if], data = [none] } int maxConstraintValueLength = 0; if ((maxConstraintValue != null) && (maxConstraintValue instanceof Number)) { maxConstraintValueLength = Math.max( countDigits((Number) maxConstraintValue), countDigits(((Number) maxConstraintValue).longValue()) + scale); // depends on control dependency: [if], data = [none] } if (minConstraintValueLength > 0 && maxConstraintValueLength > 0) { // If both of min and max constraints are setted we could use // maximum digits number in it as precision precision = Math.max(minConstraintValueLength, maxConstraintValueLength); // depends on control dependency: [if], data = [(minConstraintValueLength] } else { // Overwise we should also use default precision precision = DefaultGroovyMethods.max(new Integer[]{precision, minConstraintValueLength, maxConstraintValueLength}); // depends on control dependency: [if], data = [none] } column.setPrecision(precision); // depends on control dependency: [if], data = [none] } } }
public class class_name { public T get(String componentId) { for (T component : components) { if (component.getId().equals(componentId)) { return component; } } return null; } }
public class class_name { public T get(String componentId) { for (T component : components) { if (component.getId().equals(componentId)) { return component; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public final Properties toProperties() { final Properties retVal = new Properties(); for (int i = 0; i < props.size(); i++) { final Property prop = props.get(i); if (!prop.isDeleted()) { retVal.put(prop.getKey(), prop.getValue()); } } return retVal; } }
public class class_name { public final Properties toProperties() { final Properties retVal = new Properties(); for (int i = 0; i < props.size(); i++) { final Property prop = props.get(i); if (!prop.isDeleted()) { retVal.put(prop.getKey(), prop.getValue()); // depends on control dependency: [if], data = [none] } } return retVal; } }
public class class_name { public void addDirectoryOperation(DirectoryOperation op, File f) { addAll(op.getUpdatedFiles(), updatedFiles); addAll(op.getNewFiles(), newFiles); addAll(op.getUnchangedFiles(), unchangedFiles); addAll(op.getDeletedFiles(), deletedFiles); Object obj; for (Enumeration e = op.failedTransfers.keys(); e.hasMoreElements();) { obj = e.nextElement(); failedTransfers.put(obj, op.failedTransfers.get(obj)); } recursedDirectories.addElement(f); } }
public class class_name { public void addDirectoryOperation(DirectoryOperation op, File f) { addAll(op.getUpdatedFiles(), updatedFiles); addAll(op.getNewFiles(), newFiles); addAll(op.getUnchangedFiles(), unchangedFiles); addAll(op.getDeletedFiles(), deletedFiles); Object obj; for (Enumeration e = op.failedTransfers.keys(); e.hasMoreElements();) { obj = e.nextElement(); // depends on control dependency: [for], data = [e] failedTransfers.put(obj, op.failedTransfers.get(obj)); // depends on control dependency: [for], data = [none] } recursedDirectories.addElement(f); } }
public class class_name { public double centerOfGravity(final Map<HypergraphNode<T>, Integer> nodeOrdering) { int cog = 0; for (final HypergraphNode<T> node : this.nodes) { final Integer level = nodeOrdering.get(node); if (level == null) throw new IllegalStateException("Could not find node " + node + " in the node ordering."); cog += level; } return (double) cog / this.nodes.size(); } }
public class class_name { public double centerOfGravity(final Map<HypergraphNode<T>, Integer> nodeOrdering) { int cog = 0; for (final HypergraphNode<T> node : this.nodes) { final Integer level = nodeOrdering.get(node); if (level == null) throw new IllegalStateException("Could not find node " + node + " in the node ordering."); cog += level; // depends on control dependency: [for], data = [none] } return (double) cog / this.nodes.size(); } }
public class class_name { public AbstractNode getChild(Interval<T> interval) throws MIDDException { for (AbstractEdge<T> e : this.edges) { if (e.containsInterval(interval)) { return e.getSubDiagram(); } } return null; } }
public class class_name { public AbstractNode getChild(Interval<T> interval) throws MIDDException { for (AbstractEdge<T> e : this.edges) { if (e.containsInterval(interval)) { return e.getSubDiagram(); // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public Recipes withDeploy(String... deploy) { if (this.deploy == null) { setDeploy(new com.amazonaws.internal.SdkInternalList<String>(deploy.length)); } for (String ele : deploy) { this.deploy.add(ele); } return this; } }
public class class_name { public Recipes withDeploy(String... deploy) { if (this.deploy == null) { setDeploy(new com.amazonaws.internal.SdkInternalList<String>(deploy.length)); // depends on control dependency: [if], data = [none] } for (String ele : deploy) { this.deploy.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { static boolean isInstanceOfType(Object instance, Class<?> clazz) { if (clazz.isInterface()) { throw new UnsupportedOperationException( "Under GWT, we can't determine whether an object is an instance of an interface Class"); } for (Class<?> current = instance.getClass(); current != null; current = current.getSuperclass()) { if (current.equals(clazz)) { return true; } } return false; } }
public class class_name { static boolean isInstanceOfType(Object instance, Class<?> clazz) { if (clazz.isInterface()) { throw new UnsupportedOperationException( "Under GWT, we can't determine whether an object is an instance of an interface Class"); } for (Class<?> current = instance.getClass(); current != null; current = current.getSuperclass()) { if (current.equals(clazz)) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public List<Collaboration> createCollaboration( List<Collaboration> collaborationsParam ) { CollaborationListing collaborationListing = new CollaborationListing(); collaborationListing.setListing(collaborationsParam); if(this.serviceTicket != null) { collaborationListing.setServiceTicket(this.serviceTicket); } return new CollaborationListing(this.putJson( collaborationListing, WS.Path.Collaboration.Version1.collaborationCreate())).getListing(); } }
public class class_name { public List<Collaboration> createCollaboration( List<Collaboration> collaborationsParam ) { CollaborationListing collaborationListing = new CollaborationListing(); collaborationListing.setListing(collaborationsParam); if(this.serviceTicket != null) { collaborationListing.setServiceTicket(this.serviceTicket); // depends on control dependency: [if], data = [(this.serviceTicket] } return new CollaborationListing(this.putJson( collaborationListing, WS.Path.Collaboration.Version1.collaborationCreate())).getListing(); } }
public class class_name { public void marshall(SalesforceAction salesforceAction, ProtocolMarshaller protocolMarshaller) { if (salesforceAction == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(salesforceAction.getToken(), TOKEN_BINDING); protocolMarshaller.marshall(salesforceAction.getUrl(), URL_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(SalesforceAction salesforceAction, ProtocolMarshaller protocolMarshaller) { if (salesforceAction == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(salesforceAction.getToken(), TOKEN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(salesforceAction.getUrl(), URL_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void removeRadio(JQMRadio radio) { if (radio == null) return; TextBox inp = radio.getInput(); if (inp != null) { radios.remove(radio); fieldset.remove(inp); } if (radio.getLabel() != null) fieldset.remove(radio.getLabel()); } }
public class class_name { public void removeRadio(JQMRadio radio) { if (radio == null) return; TextBox inp = radio.getInput(); if (inp != null) { radios.remove(radio); // depends on control dependency: [if], data = [none] fieldset.remove(inp); // depends on control dependency: [if], data = [(inp] } if (radio.getLabel() != null) fieldset.remove(radio.getLabel()); } }
public class class_name { public @NonNull Query setAroundRadius(Integer radius) { if (radius == Query.RADIUS_ALL) { return set(KEY_AROUND_RADIUS, "all"); } return set(KEY_AROUND_RADIUS, radius); } }
public class class_name { public @NonNull Query setAroundRadius(Integer radius) { if (radius == Query.RADIUS_ALL) { return set(KEY_AROUND_RADIUS, "all"); // depends on control dependency: [if], data = [none] } return set(KEY_AROUND_RADIUS, radius); } }
public class class_name { public static boolean containsStatus(final Status status, final Status[] statusArray) { if (status == null) { return false; } for (Status currentStatus : statusArray) { if (currentStatus == status) { return true; } } return false; } }
public class class_name { public static boolean containsStatus(final Status status, final Status[] statusArray) { if (status == null) { return false; // depends on control dependency: [if], data = [none] } for (Status currentStatus : statusArray) { if (currentStatus == status) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { protected String getDataSourceKey() { if(JeesuiteMybatisInterceptor.isRwRouteEnabled() == false){ return master; } DataSourceContextVals vals = contextVals.get(); if(vals == null){ vals = new DataSourceContextVals(); contextVals.set(vals); return master; } String dsKey = null; if (vals.forceMaster || !vals.userSlave){ dsKey = master; }else{ dsKey = selectSlave(); } vals.dsKey = dsKey; logger.debug("current route rule is:userSlave[{}]|forceMaster[{}], use dataSource key is [{}]!",vals.userSlave,vals.forceMaster,vals.dsKey); return dsKey; } }
public class class_name { protected String getDataSourceKey() { if(JeesuiteMybatisInterceptor.isRwRouteEnabled() == false){ return master; // depends on control dependency: [if], data = [none] } DataSourceContextVals vals = contextVals.get(); if(vals == null){ vals = new DataSourceContextVals(); // depends on control dependency: [if], data = [none] contextVals.set(vals); // depends on control dependency: [if], data = [(vals] return master; // depends on control dependency: [if], data = [none] } String dsKey = null; if (vals.forceMaster || !vals.userSlave){ dsKey = master; // depends on control dependency: [if], data = [none] }else{ dsKey = selectSlave(); // depends on control dependency: [if], data = [none] } vals.dsKey = dsKey; logger.debug("current route rule is:userSlave[{}]|forceMaster[{}], use dataSource key is [{}]!",vals.userSlave,vals.forceMaster,vals.dsKey); return dsKey; } }
public class class_name { @Override public Byte fromBytes(Class targetClass, byte[] b) { try { if (b == null) { return null; } // return new Byte(new String(b, Constants.ENCODING)); return (ByteBuffer.wrap(b).get()); } catch (NumberFormatException e) { log.warn("Number format exception caught!,returning null!"); return null; } } }
public class class_name { @Override public Byte fromBytes(Class targetClass, byte[] b) { try { if (b == null) { return null; // depends on control dependency: [if], data = [none] } // return new Byte(new String(b, Constants.ENCODING)); return (ByteBuffer.wrap(b).get()); // depends on control dependency: [try], data = [none] } catch (NumberFormatException e) { log.warn("Number format exception caught!,returning null!"); return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { @SafeVarargs public static Float[] box(final float... a) { if (a == null) { return null; } return box(a, 0, a.length); } }
public class class_name { @SafeVarargs public static Float[] box(final float... a) { if (a == null) { return null; // depends on control dependency: [if], data = [none] } return box(a, 0, a.length); } }
public class class_name { public void seedUsingPcmAudio(byte[] data) { byte[] key = new byte[64]; for (int i = 0; i < key.length; i++) { int x = 0; //Pick 4 random bytes from the PCM audio data, from each of the bytes //take the two least significant bits and concatenate them to form //the i-th byte in the seed key for (int j = 0; j < 4; j++) { x = (x << 2) | (3 & data[RandomSource.getInt(data.length)]); } key[i] = (byte) x; } seed(key); initialized = true; } }
public class class_name { public void seedUsingPcmAudio(byte[] data) { byte[] key = new byte[64]; for (int i = 0; i < key.length; i++) { int x = 0; //Pick 4 random bytes from the PCM audio data, from each of the bytes //take the two least significant bits and concatenate them to form //the i-th byte in the seed key for (int j = 0; j < 4; j++) { x = (x << 2) | (3 & data[RandomSource.getInt(data.length)]); // depends on control dependency: [for], data = [none] } key[i] = (byte) x; // depends on control dependency: [for], data = [i] } seed(key); initialized = true; } }
public class class_name { public Tag getParent() { if (!parentDetermined) { JspTag adapteeParent = simpleTagAdaptee.getParent(); if (adapteeParent != null) { if (adapteeParent instanceof Tag) { this.parent = (Tag) adapteeParent; } else { // Must be SimpleTag - no other types defined. this.parent = new TagAdapter((SimpleTag) adapteeParent); } } parentDetermined = true; } return this.parent; } }
public class class_name { public Tag getParent() { if (!parentDetermined) { JspTag adapteeParent = simpleTagAdaptee.getParent(); if (adapteeParent != null) { if (adapteeParent instanceof Tag) { this.parent = (Tag) adapteeParent; // depends on control dependency: [if], data = [none] } else { // Must be SimpleTag - no other types defined. this.parent = new TagAdapter((SimpleTag) adapteeParent); // depends on control dependency: [if], data = [none] } } parentDetermined = true; // depends on control dependency: [if], data = [none] } return this.parent; } }
public class class_name { public static void append2digits(StringBuffer buf,int i) { if (i<100) { buf.append((char)(i/10+'0')); buf.append((char)(i%10+'0')); } } }
public class class_name { public static void append2digits(StringBuffer buf,int i) { if (i<100) { buf.append((char)(i/10+'0')); // depends on control dependency: [if], data = [(i] buf.append((char)(i%10+'0')); // depends on control dependency: [if], data = [(i] } } }
public class class_name { private void addPostParams(final Request request) { if (fieldType != null) { request.addPostParam("FieldType", fieldType); } if (uniqueName != null) { request.addPostParam("UniqueName", uniqueName); } } }
public class class_name { private void addPostParams(final Request request) { if (fieldType != null) { request.addPostParam("FieldType", fieldType); // depends on control dependency: [if], data = [none] } if (uniqueName != null) { request.addPostParam("UniqueName", uniqueName); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected AppendRequest buildAppendRequest(MemberState member, long lastIndex) { // If the log is empty then send an empty commit. // If the next index hasn't yet been set then we send an empty commit first. // If the next index is greater than the last index then send an empty commit. // If the member failed to respond to recent communication send an empty commit. This // helps avoid doing expensive work until we can ascertain the member is back up. if (context.getLog().isEmpty() || member.getNextIndex() > lastIndex || member.getFailureCount() > 0) { return buildAppendEmptyRequest(member); } else { return buildAppendEntriesRequest(member, lastIndex); } } }
public class class_name { protected AppendRequest buildAppendRequest(MemberState member, long lastIndex) { // If the log is empty then send an empty commit. // If the next index hasn't yet been set then we send an empty commit first. // If the next index is greater than the last index then send an empty commit. // If the member failed to respond to recent communication send an empty commit. This // helps avoid doing expensive work until we can ascertain the member is back up. if (context.getLog().isEmpty() || member.getNextIndex() > lastIndex || member.getFailureCount() > 0) { return buildAppendEmptyRequest(member); // depends on control dependency: [if], data = [none] } else { return buildAppendEntriesRequest(member, lastIndex); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static String getError(final HttpServletRequest request) { StringBuilder sb = (StringBuilder) request.getAttribute(ERROR_KEY); if (sb == null) { return ""; } return sb.toString(); } }
public class class_name { public static String getError(final HttpServletRequest request) { StringBuilder sb = (StringBuilder) request.getAttribute(ERROR_KEY); if (sb == null) { return ""; // depends on control dependency: [if], data = [none] } return sb.toString(); } }
public class class_name { private void buildCellsForRow(final Row row, final String fullName, final Map<String, Object> context, final ConfigBuildRef configBuildRef, ShiftFormulaRef shiftFormulaRef) { if ((row == null) || !ConfigurationUtility.isStaticRowRef(this, row)) { return; } for (Cell cell : row) { buildSingleCell(cell, context, configBuildRef, shiftFormulaRef); } ConfigurationUtility.setFullNameInHiddenColumn(row, fullName); } }
public class class_name { private void buildCellsForRow(final Row row, final String fullName, final Map<String, Object> context, final ConfigBuildRef configBuildRef, ShiftFormulaRef shiftFormulaRef) { if ((row == null) || !ConfigurationUtility.isStaticRowRef(this, row)) { return; // depends on control dependency: [if], data = [none] } for (Cell cell : row) { buildSingleCell(cell, context, configBuildRef, shiftFormulaRef); // depends on control dependency: [for], data = [cell] } ConfigurationUtility.setFullNameInHiddenColumn(row, fullName); } }
public class class_name { private void remove(Integer layer, Refreshable refreshable) { final Collection<Refreshable> refreshables = getLayer(layer); refreshables.remove(refreshable); if (refreshables.isEmpty()) { indexs.remove(layer); } } }
public class class_name { private void remove(Integer layer, Refreshable refreshable) { final Collection<Refreshable> refreshables = getLayer(layer); refreshables.remove(refreshable); if (refreshables.isEmpty()) { indexs.remove(layer); // depends on control dependency: [if], data = [none] } } }
public class class_name { public boolean evaluate(final LoggingEvent event, Map matches) { String eventTimeStampString = RESOLVER.getValue(LoggingEventFieldResolver.TIMESTAMP_FIELD, event).toString(); long eventTimeStamp = Long.parseLong( eventTimeStampString) / 1000 * 1000; boolean result = false; long first = eventTimeStamp; long second = timeStamp; if ("<".equals(inequalitySymbol)) { result = first < second; } else if (">".equals(inequalitySymbol)) { result = first > second; } else if ("<=".equals(inequalitySymbol)) { result = first <= second; } else if (">=".equals(inequalitySymbol)) { result = first >= second; } if (result && matches != null) { Set entries = (Set) matches.get(LoggingEventFieldResolver.TIMESTAMP_FIELD); if (entries == null) { entries = new HashSet(); matches.put(LoggingEventFieldResolver.TIMESTAMP_FIELD, entries); } entries.add(eventTimeStampString); } return result; } }
public class class_name { public boolean evaluate(final LoggingEvent event, Map matches) { String eventTimeStampString = RESOLVER.getValue(LoggingEventFieldResolver.TIMESTAMP_FIELD, event).toString(); long eventTimeStamp = Long.parseLong( eventTimeStampString) / 1000 * 1000; boolean result = false; long first = eventTimeStamp; long second = timeStamp; if ("<".equals(inequalitySymbol)) { result = first < second; // depends on control dependency: [if], data = [none] } else if (">".equals(inequalitySymbol)) { result = first > second; // depends on control dependency: [if], data = [none] } else if ("<=".equals(inequalitySymbol)) { result = first <= second; // depends on control dependency: [if], data = [none] } else if (">=".equals(inequalitySymbol)) { result = first >= second; // depends on control dependency: [if], data = [none] } if (result && matches != null) { Set entries = (Set) matches.get(LoggingEventFieldResolver.TIMESTAMP_FIELD); if (entries == null) { entries = new HashSet(); // depends on control dependency: [if], data = [none] matches.put(LoggingEventFieldResolver.TIMESTAMP_FIELD, entries); // depends on control dependency: [if], data = [none] } entries.add(eventTimeStampString); // depends on control dependency: [if], data = [none] } return result; } }
public class class_name { public void addRotation(int axis1, int axis2, double angle) { // TODO: throw an exception instead of using assert assert (axis1 >= 0); assert (axis1 < dim); assert (axis1 >= 0); assert (axis2 < dim); assert (axis1 != axis2); // reset inverse transformation - needs recomputation. inv = null; double[][] ht = new double[dim + 1][dim + 1]; // identity matrix for(int i = 0; i < dim + 1; i++) { ht[i][i] = 1.0; } // insert rotation values final DoubleWrapper tmp = new DoubleWrapper(); // To return cosine double s = FastMath.sinAndCos(angle, tmp), c = tmp.value; ht[axis1][axis1] = +c; ht[axis1][axis2] = -s; ht[axis2][axis1] = +s; ht[axis2][axis2] = +c; // Multiply from left trans = times(ht, trans); } }
public class class_name { public void addRotation(int axis1, int axis2, double angle) { // TODO: throw an exception instead of using assert assert (axis1 >= 0); assert (axis1 < dim); assert (axis1 >= 0); assert (axis2 < dim); assert (axis1 != axis2); // reset inverse transformation - needs recomputation. inv = null; double[][] ht = new double[dim + 1][dim + 1]; // identity matrix for(int i = 0; i < dim + 1; i++) { ht[i][i] = 1.0; // depends on control dependency: [for], data = [i] } // insert rotation values final DoubleWrapper tmp = new DoubleWrapper(); // To return cosine double s = FastMath.sinAndCos(angle, tmp), c = tmp.value; ht[axis1][axis1] = +c; ht[axis1][axis2] = -s; ht[axis2][axis1] = +s; ht[axis2][axis2] = +c; // Multiply from left trans = times(ht, trans); } }
public class class_name { protected NodeFilter sharedNodesFilter() { return new NodeFilter() { private final Set<NodeKey> shareableNodeKeys = new HashSet<>(); @Override public boolean includeNode( CachedNode node, NodeCache cache ) { if (nodeTypes.isShareable(node.getPrimaryType(cache), node.getMixinTypes(cache))) { NodeKey key = node.getKey(); if (shareableNodeKeys.contains(key)) { return false; } // we're seeing the original shareable node, so we need to process it shareableNodeKeys.add(key); return true; } return true; } @Override public boolean continueProcessingChildren( CachedNode node, NodeCache cache ) { return !shareableNodeKeys.contains(node.getKey()); } @Override public String toString() { return "(excludes-sharables)"; } }; } }
public class class_name { protected NodeFilter sharedNodesFilter() { return new NodeFilter() { private final Set<NodeKey> shareableNodeKeys = new HashSet<>(); @Override public boolean includeNode( CachedNode node, NodeCache cache ) { if (nodeTypes.isShareable(node.getPrimaryType(cache), node.getMixinTypes(cache))) { NodeKey key = node.getKey(); if (shareableNodeKeys.contains(key)) { return false; // depends on control dependency: [if], data = [none] } // we're seeing the original shareable node, so we need to process it shareableNodeKeys.add(key); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } return true; } @Override public boolean continueProcessingChildren( CachedNode node, NodeCache cache ) { return !shareableNodeKeys.contains(node.getKey()); } @Override public String toString() { return "(excludes-sharables)"; } }; } }
public class class_name { public boolean forwardIfCurrent(short before, String val, short after) { int start = pos; // space before if (before == AT_LEAST_ONE_SPACE) { if (!removeSpace()) return false; } else removeSpace(); // value if (!forwardIfCurrent(val)) { setPos(start); return false; } // space after if (after == AT_LEAST_ONE_SPACE) { if (!removeSpace()) { setPos(start); return false; } } else removeSpace(); return true; } }
public class class_name { public boolean forwardIfCurrent(short before, String val, short after) { int start = pos; // space before if (before == AT_LEAST_ONE_SPACE) { if (!removeSpace()) return false; } else removeSpace(); // value if (!forwardIfCurrent(val)) { setPos(start); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } // space after if (after == AT_LEAST_ONE_SPACE) { if (!removeSpace()) { setPos(start); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } } else removeSpace(); return true; } }
public class class_name { @Override public void doSerialize( JsonWriter writer, I values, JsonSerializationContext ctx, JsonSerializerParameters params ) { Iterator<T> iterator = values.iterator(); if ( !iterator.hasNext() ) { if ( ctx.isWriteEmptyJsonArrays() ) { writer.beginArray(); writer.endArray(); } else { writer.cancelName(); } return; } if ( ctx.isWriteSingleElemArraysUnwrapped() ) { T first = iterator.next(); if ( iterator.hasNext() ) { // there is more than one element, we write the array normally writer.beginArray(); serializer.serialize( writer, first, ctx, params ); while ( iterator.hasNext() ) { serializer.serialize( writer, iterator.next(), ctx, params ); } writer.endArray(); } else { // there is only one element, we write it directly serializer.serialize( writer, first, ctx, params ); } } else { writer.beginArray(); while ( iterator.hasNext() ) { serializer.serialize( writer, iterator.next(), ctx, params ); } writer.endArray(); } } }
public class class_name { @Override public void doSerialize( JsonWriter writer, I values, JsonSerializationContext ctx, JsonSerializerParameters params ) { Iterator<T> iterator = values.iterator(); if ( !iterator.hasNext() ) { if ( ctx.isWriteEmptyJsonArrays() ) { writer.beginArray(); // depends on control dependency: [if], data = [none] writer.endArray(); // depends on control dependency: [if], data = [none] } else { writer.cancelName(); // depends on control dependency: [if], data = [none] } return; // depends on control dependency: [if], data = [none] } if ( ctx.isWriteSingleElemArraysUnwrapped() ) { T first = iterator.next(); if ( iterator.hasNext() ) { // there is more than one element, we write the array normally writer.beginArray(); // depends on control dependency: [if], data = [none] serializer.serialize( writer, first, ctx, params ); // depends on control dependency: [if], data = [none] while ( iterator.hasNext() ) { serializer.serialize( writer, iterator.next(), ctx, params ); // depends on control dependency: [while], data = [none] } writer.endArray(); // depends on control dependency: [if], data = [none] } else { // there is only one element, we write it directly serializer.serialize( writer, first, ctx, params ); // depends on control dependency: [if], data = [none] } } else { writer.beginArray(); // depends on control dependency: [if], data = [none] while ( iterator.hasNext() ) { serializer.serialize( writer, iterator.next(), ctx, params ); // depends on control dependency: [while], data = [none] } writer.endArray(); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public ZoneOffset getOffset(LocalDateTime localDateTime) { Object info = getOffsetInfo(localDateTime); if (info instanceof ZoneOffsetTransition) { return ((ZoneOffsetTransition) info).getOffsetBefore(); } return (ZoneOffset) info; } }
public class class_name { @Override public ZoneOffset getOffset(LocalDateTime localDateTime) { Object info = getOffsetInfo(localDateTime); if (info instanceof ZoneOffsetTransition) { return ((ZoneOffsetTransition) info).getOffsetBefore(); // depends on control dependency: [if], data = [none] } return (ZoneOffset) info; } }
public class class_name { public void setPresence(boolean present) { if (this.present == present) return; this.present = present; updateVague(); if (present) { firePresence(true); } else { fireLeaving(); } } }
public class class_name { public void setPresence(boolean present) { if (this.present == present) return; this.present = present; updateVague(); if (present) { firePresence(true); // depends on control dependency: [if], data = [none] } else { fireLeaving(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static Base64Url encode(byte[] bytes) { if (bytes == null) { return new Base64Url((String) null); } else { return new Base64Url(Base64Util.encodeURLWithoutPadding(bytes)); } } }
public class class_name { public static Base64Url encode(byte[] bytes) { if (bytes == null) { return new Base64Url((String) null); // depends on control dependency: [if], data = [null)] } else { return new Base64Url(Base64Util.encodeURLWithoutPadding(bytes)); // depends on control dependency: [if], data = [(bytes] } } }
public class class_name { public String toBitString(long value, int bits) { StringBuilder sb = new StringBuilder(bits); long lastBit = 1L << 63; for (int i = 0; i < bits; i++) { if ((value & lastBit) == 0) sb.append('0'); else sb.append('1'); value <<= 1; } return sb.toString(); } }
public class class_name { public String toBitString(long value, int bits) { StringBuilder sb = new StringBuilder(bits); long lastBit = 1L << 63; for (int i = 0; i < bits; i++) { if ((value & lastBit) == 0) sb.append('0'); else sb.append('1'); value <<= 1; // depends on control dependency: [for], data = [none] } return sb.toString(); } }