code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public void setMatchingEventTypes(java.util.Collection<String> matchingEventTypes) { if (matchingEventTypes == null) { this.matchingEventTypes = null; return; } this.matchingEventTypes = new java.util.ArrayList<String>(matchingEventTypes); } }
public class class_name { public void setMatchingEventTypes(java.util.Collection<String> matchingEventTypes) { if (matchingEventTypes == null) { this.matchingEventTypes = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.matchingEventTypes = new java.util.ArrayList<String>(matchingEventTypes); } }
public class class_name { @Override public void afterPropertiesSet() { val sysProps = System.getProperties(); val properties = new Properties(); if (CasVersion.getVersion() != null) { properties.put("info.cas.version", CasVersion.getVersion()); } properties.put("info.cas.date", CasVersion.getDateTime()); properties.put("info.cas.java.home", sysProps.get("java.home")); properties.put("info.cas.java.vendor", sysProps.get("java.vendor")); properties.put("info.cas.java.version", sysProps.get("java.version")); val src = new PropertiesPropertySource(CasVersion.class.getName(), properties); this.environment.getPropertySources().addFirst(src); } }
public class class_name { @Override public void afterPropertiesSet() { val sysProps = System.getProperties(); val properties = new Properties(); if (CasVersion.getVersion() != null) { properties.put("info.cas.version", CasVersion.getVersion()); // depends on control dependency: [if], data = [none] } properties.put("info.cas.date", CasVersion.getDateTime()); properties.put("info.cas.java.home", sysProps.get("java.home")); properties.put("info.cas.java.vendor", sysProps.get("java.vendor")); properties.put("info.cas.java.version", sysProps.get("java.version")); val src = new PropertiesPropertySource(CasVersion.class.getName(), properties); this.environment.getPropertySources().addFirst(src); } }
public class class_name { protected void init() { LinkedHashMap<String, String> sortList = getSortList(); if (sortList != null) { m_sortSelectBox = new CmsSelectBox(sortList); m_sortSelectBox.addValueChangeHandler(this); m_sortSelectBox.addStyleName(DIALOG_CSS.selectboxWidth()); m_sortSelectBox.truncate(TM_GALLERY_SORT, 200); m_options.add(m_sortSelectBox); Label infoLabel = new Label(); infoLabel.setStyleName(DIALOG_CSS.infoLabel()); m_infoLabel = infoLabel; m_options.insert(infoLabel, 0); } createQuickBox(); } }
public class class_name { protected void init() { LinkedHashMap<String, String> sortList = getSortList(); if (sortList != null) { m_sortSelectBox = new CmsSelectBox(sortList); // depends on control dependency: [if], data = [(sortList] m_sortSelectBox.addValueChangeHandler(this); // depends on control dependency: [if], data = [none] m_sortSelectBox.addStyleName(DIALOG_CSS.selectboxWidth()); // depends on control dependency: [if], data = [none] m_sortSelectBox.truncate(TM_GALLERY_SORT, 200); // depends on control dependency: [if], data = [none] m_options.add(m_sortSelectBox); // depends on control dependency: [if], data = [none] Label infoLabel = new Label(); infoLabel.setStyleName(DIALOG_CSS.infoLabel()); // depends on control dependency: [if], data = [none] m_infoLabel = infoLabel; // depends on control dependency: [if], data = [none] m_options.insert(infoLabel, 0); // depends on control dependency: [if], data = [none] } createQuickBox(); } }
public class class_name { public void setFindings(java.util.Collection<Finding> findings) { if (findings == null) { this.findings = null; return; } this.findings = new java.util.ArrayList<Finding>(findings); } }
public class class_name { public void setFindings(java.util.Collection<Finding> findings) { if (findings == null) { this.findings = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.findings = new java.util.ArrayList<Finding>(findings); } }
public class class_name { public void setResourceAdaptorContext(ResourceAdaptorContext arg0) { resourceAdaptorContext = arg0; tracer = resourceAdaptorContext.getTracer(HttpClientNIOResourceAdaptor.class.getSimpleName()); try { fireableEventType = resourceAdaptorContext.getEventLookupFacility().getFireableEventType( HttpClientNIOEventTypes.HTTP_CLIENT_NIO_RESPONSE_EVENT_TYPE_ID); } catch (Throwable e) { throw new RuntimeException(e.getMessage(), e); } sbbInterface = new HttpClientNIOResourceAdaptorSbbInterfaceImpl(this); } }
public class class_name { public void setResourceAdaptorContext(ResourceAdaptorContext arg0) { resourceAdaptorContext = arg0; tracer = resourceAdaptorContext.getTracer(HttpClientNIOResourceAdaptor.class.getSimpleName()); try { fireableEventType = resourceAdaptorContext.getEventLookupFacility().getFireableEventType( HttpClientNIOEventTypes.HTTP_CLIENT_NIO_RESPONSE_EVENT_TYPE_ID); // depends on control dependency: [try], data = [none] } catch (Throwable e) { throw new RuntimeException(e.getMessage(), e); } // depends on control dependency: [catch], data = [none] sbbInterface = new HttpClientNIOResourceAdaptorSbbInterfaceImpl(this); } }
public class class_name { @Deprecated public static JsExpr maybeWrapAsSanitizedContent( @Nullable ContentKind contentKind, JsExpr jsExpr) { if (contentKind == null) { return jsExpr; } else { return wrapWithFunction( NodeContentKinds.toJsSanitizedContentOrdainer( SanitizedContentKind.valueOf(contentKind.name())), jsExpr); } } }
public class class_name { @Deprecated public static JsExpr maybeWrapAsSanitizedContent( @Nullable ContentKind contentKind, JsExpr jsExpr) { if (contentKind == null) { return jsExpr; // depends on control dependency: [if], data = [none] } else { return wrapWithFunction( NodeContentKinds.toJsSanitizedContentOrdainer( SanitizedContentKind.valueOf(contentKind.name())), jsExpr); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static String unescapeHtml(final String text) { if (text == null) { return null; } if (text.indexOf('&') < 0) { // Fail fast, avoid more complex (and less JIT-table) method to execute if not needed return text; } return HtmlEscapeUtil.unescape(text); } }
public class class_name { public static String unescapeHtml(final String text) { if (text == null) { return null; // depends on control dependency: [if], data = [none] } if (text.indexOf('&') < 0) { // Fail fast, avoid more complex (and less JIT-table) method to execute if not needed return text; // depends on control dependency: [if], data = [none] } return HtmlEscapeUtil.unescape(text); } }
public class class_name { protected static void applyCommandLine(ConfigArgP cap, ArgP argp) { // --config, --include-config, --help if(argp.has("--help")) { if(cap.hasNonOption("extended")) { System.out.println(cap.getExtendedUsage("tsd extended usage:")); } else { System.out.println(cap.getDefaultUsage("tsd usage:")); } System.exit(0); } if(argp.has("--config")) { loadConfigSource(cap, argp.get("--config").trim()); } if(argp.has("--include")) { String[] sources = argp.get("--include").split(","); for(String s: sources) { loadConfigSource(cap, s.trim()); } } } }
public class class_name { protected static void applyCommandLine(ConfigArgP cap, ArgP argp) { // --config, --include-config, --help if(argp.has("--help")) { if(cap.hasNonOption("extended")) { System.out.println(cap.getExtendedUsage("tsd extended usage:")); // depends on control dependency: [if], data = [none] } else { System.out.println(cap.getDefaultUsage("tsd usage:")); // depends on control dependency: [if], data = [none] } System.exit(0); // depends on control dependency: [if], data = [none] } if(argp.has("--config")) { loadConfigSource(cap, argp.get("--config").trim()); // depends on control dependency: [if], data = [none] } if(argp.has("--include")) { String[] sources = argp.get("--include").split(","); for(String s: sources) { loadConfigSource(cap, s.trim()); // depends on control dependency: [for], data = [s] } } } }
public class class_name { public static List<StringToNodeCollection> getTranslatableStringsV3(final Node node, final boolean allowDuplicates) { if (node == null) return null; final List<StringToNodeCollection> retValue = new LinkedList<StringToNodeCollection>(); final NodeList nodes = node.getChildNodes(); for (int i = 0; i < nodes.getLength(); ++i) { final Node childNode = nodes.item(i); getTranslatableStringsFromNodeV3(childNode, retValue, allowDuplicates, new XMLProperties()); } return retValue; } }
public class class_name { public static List<StringToNodeCollection> getTranslatableStringsV3(final Node node, final boolean allowDuplicates) { if (node == null) return null; final List<StringToNodeCollection> retValue = new LinkedList<StringToNodeCollection>(); final NodeList nodes = node.getChildNodes(); for (int i = 0; i < nodes.getLength(); ++i) { final Node childNode = nodes.item(i); getTranslatableStringsFromNodeV3(childNode, retValue, allowDuplicates, new XMLProperties()); // depends on control dependency: [for], data = [none] } return retValue; } }
public class class_name { public PluginRelease getLastPluginRelease(String id) { PluginInfo pluginInfo = getPluginsMap().get(id); if (pluginInfo == null) { return null; } if (!lastPluginRelease.containsKey(id)) { for (PluginRelease release : pluginInfo.releases) { if (systemVersion.equals("0.0.0") || versionManager.checkVersionConstraint(systemVersion, release.requires)) { if (lastPluginRelease.get(id) == null) { lastPluginRelease.put(id, release); } else if (versionManager.compareVersions(release.version, lastPluginRelease.get(id).version) > 0) { lastPluginRelease.put(id, release); } } } } return lastPluginRelease.get(id); } }
public class class_name { public PluginRelease getLastPluginRelease(String id) { PluginInfo pluginInfo = getPluginsMap().get(id); if (pluginInfo == null) { return null; // depends on control dependency: [if], data = [none] } if (!lastPluginRelease.containsKey(id)) { for (PluginRelease release : pluginInfo.releases) { if (systemVersion.equals("0.0.0") || versionManager.checkVersionConstraint(systemVersion, release.requires)) { if (lastPluginRelease.get(id) == null) { lastPluginRelease.put(id, release); // depends on control dependency: [if], data = [none] } else if (versionManager.compareVersions(release.version, lastPluginRelease.get(id).version) > 0) { lastPluginRelease.put(id, release); // depends on control dependency: [if], data = [none] } } } } return lastPluginRelease.get(id); } }
public class class_name { private boolean addSnapshotReactorDependency(Engine engine, Artifact artifact) { if (!artifact.isSnapshot()) { return false; } return addVirtualDependencyFromReactor(engine, artifact, "Found snapshot reactor project in aggregate for %s - " + "creating a virtual dependency as the snapshot found in the repository may contain outdated dependencies."); } }
public class class_name { private boolean addSnapshotReactorDependency(Engine engine, Artifact artifact) { if (!artifact.isSnapshot()) { return false; // depends on control dependency: [if], data = [none] } return addVirtualDependencyFromReactor(engine, artifact, "Found snapshot reactor project in aggregate for %s - " + "creating a virtual dependency as the snapshot found in the repository may contain outdated dependencies."); } }
public class class_name { private Content getTreeForClassHelper(Type type) { Content li = new HtmlTree(HtmlTag.LI); if (type.equals(classDoc)) { Content typeParameters = getTypeParameterLinks( new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE, classDoc)); if (configuration.shouldExcludeQualifier( classDoc.containingPackage().name())) { li.addContent(type.asClassDoc().name()); li.addContent(typeParameters); } else { li.addContent(type.asClassDoc().qualifiedName()); li.addContent(typeParameters); } } else { Content link = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_TREE_PARENT, type) .label(configuration.getClassName(type.asClassDoc()))); li.addContent(link); } return li; } }
public class class_name { private Content getTreeForClassHelper(Type type) { Content li = new HtmlTree(HtmlTag.LI); if (type.equals(classDoc)) { Content typeParameters = getTypeParameterLinks( new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE, classDoc)); if (configuration.shouldExcludeQualifier( classDoc.containingPackage().name())) { li.addContent(type.asClassDoc().name()); // depends on control dependency: [if], data = [none] li.addContent(typeParameters); // depends on control dependency: [if], data = [none] } else { li.addContent(type.asClassDoc().qualifiedName()); // depends on control dependency: [if], data = [none] li.addContent(typeParameters); // depends on control dependency: [if], data = [none] } } else { Content link = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_TREE_PARENT, type) .label(configuration.getClassName(type.asClassDoc()))); li.addContent(link); // depends on control dependency: [if], data = [none] } return li; } }
public class class_name { public void updateMetricsRecord() { for (Map.Entry<MetricName, Long> entry: counters.entrySet()) { String name = (entry.getKey() + "_" + type).toLowerCase(); record.setMetric(name, entry.getValue()); } record.update(); } }
public class class_name { public void updateMetricsRecord() { for (Map.Entry<MetricName, Long> entry: counters.entrySet()) { String name = (entry.getKey() + "_" + type).toLowerCase(); record.setMetric(name, entry.getValue()); // depends on control dependency: [for], data = [entry] } record.update(); } }
public class class_name { public void marshall(GetAssessmentReportRequest getAssessmentReportRequest, ProtocolMarshaller protocolMarshaller) { if (getAssessmentReportRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getAssessmentReportRequest.getAssessmentRunArn(), ASSESSMENTRUNARN_BINDING); protocolMarshaller.marshall(getAssessmentReportRequest.getReportFileFormat(), REPORTFILEFORMAT_BINDING); protocolMarshaller.marshall(getAssessmentReportRequest.getReportType(), REPORTTYPE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(GetAssessmentReportRequest getAssessmentReportRequest, ProtocolMarshaller protocolMarshaller) { if (getAssessmentReportRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getAssessmentReportRequest.getAssessmentRunArn(), ASSESSMENTRUNARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(getAssessmentReportRequest.getReportFileFormat(), REPORTFILEFORMAT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(getAssessmentReportRequest.getReportType(), REPORTTYPE_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 updateDatesAndCalendar() { if ((this.getEditMode() == DBConstants.EDIT_NONE) || (this.getEditMode() == DBConstants.EDIT_ADD)) return; // Only on initial setup boolean bUpdateDates = false; int iUpdateDays = (int)this.getField(CalendarControl.UPDATE_DAYS).getValue(); Calendar calNow = new GregorianCalendar(); if ((this.getField(CalendarControl.START_ANNIV_DATE).isNull()) || (this.getField(CalendarControl.END_ANNIV_DATE).isNull())) bUpdateDates = true; else { Calendar calCutoff = ((DateTimeField)this.getField(CalendarControl.LAST_UPDATE_DATE)).getCalendar(); calCutoff.add(Calendar.DAY_OF_YEAR, iUpdateDays); if (calNow.after(calCutoff)) bUpdateDates = true; } if (bUpdateDates) { int iBackDays = (int)this.getField(CalendarControl.ANNIV_BACK_DAYS).getValue(); int iRangeDays = (int)this.getField(CalendarControl.ANNIVERSARY_DAYS).getValue(); Calendar calStart = (Calendar)calNow.clone(); calStart.add(Calendar.DAY_OF_YEAR, -iBackDays); Calendar calEnd = (Calendar)calStart.clone(); calEnd.add(Calendar.DAY_OF_YEAR, iRangeDays - iBackDays); Calendar calOldEnd = ((DateTimeField)this.getField(CalendarControl.END_ANNIV_DATE)).getCalendar(); if (calOldEnd == null) calOldEnd = calNow; ((DateTimeField)this.getField(CalendarControl.START_ANNIV_DATE)).setCalendar(calStart, true, DBConstants.SCREEN_MOVE); ((DateTimeField)this.getField(CalendarControl.END_ANNIV_DATE)).setCalendar(calEnd, true, DBConstants.SCREEN_MOVE); ((DateTimeField)this.getField(CalendarControl.LAST_UPDATE_DATE)).setCalendar(calNow, true, DBConstants.SCREEN_MOVE); this.updateCalendar(calOldEnd, calEnd); // Update the calendar try { this.writeAndRefresh(); } catch (DBException ex) { ex.printStackTrace(); } } } }
public class class_name { public void updateDatesAndCalendar() { if ((this.getEditMode() == DBConstants.EDIT_NONE) || (this.getEditMode() == DBConstants.EDIT_ADD)) return; // Only on initial setup boolean bUpdateDates = false; int iUpdateDays = (int)this.getField(CalendarControl.UPDATE_DAYS).getValue(); Calendar calNow = new GregorianCalendar(); if ((this.getField(CalendarControl.START_ANNIV_DATE).isNull()) || (this.getField(CalendarControl.END_ANNIV_DATE).isNull())) bUpdateDates = true; else { Calendar calCutoff = ((DateTimeField)this.getField(CalendarControl.LAST_UPDATE_DATE)).getCalendar(); calCutoff.add(Calendar.DAY_OF_YEAR, iUpdateDays); // depends on control dependency: [if], data = [none] if (calNow.after(calCutoff)) bUpdateDates = true; } if (bUpdateDates) { int iBackDays = (int)this.getField(CalendarControl.ANNIV_BACK_DAYS).getValue(); int iRangeDays = (int)this.getField(CalendarControl.ANNIVERSARY_DAYS).getValue(); Calendar calStart = (Calendar)calNow.clone(); calStart.add(Calendar.DAY_OF_YEAR, -iBackDays); // depends on control dependency: [if], data = [none] Calendar calEnd = (Calendar)calStart.clone(); calEnd.add(Calendar.DAY_OF_YEAR, iRangeDays - iBackDays); // depends on control dependency: [if], data = [none] Calendar calOldEnd = ((DateTimeField)this.getField(CalendarControl.END_ANNIV_DATE)).getCalendar(); if (calOldEnd == null) calOldEnd = calNow; ((DateTimeField)this.getField(CalendarControl.START_ANNIV_DATE)).setCalendar(calStart, true, DBConstants.SCREEN_MOVE); // depends on control dependency: [if], data = [none] ((DateTimeField)this.getField(CalendarControl.END_ANNIV_DATE)).setCalendar(calEnd, true, DBConstants.SCREEN_MOVE); // depends on control dependency: [if], data = [none] ((DateTimeField)this.getField(CalendarControl.LAST_UPDATE_DATE)).setCalendar(calNow, true, DBConstants.SCREEN_MOVE); // depends on control dependency: [if], data = [none] this.updateCalendar(calOldEnd, calEnd); // Update the calendar // depends on control dependency: [if], data = [none] try { this.writeAndRefresh(); // depends on control dependency: [try], data = [none] } catch (DBException ex) { ex.printStackTrace(); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { @Override public List<Column> getColumns(List<String> columnNames) { if (columnsByName.isEmpty()) { Map<String, Column> columnsMap = new HashMap<String, Column>(); List<Column> allColumns = sasFileParser.getColumns(); for (Column column : allColumns) { columnsMap.put(column.getName(), column); } for (String name : columnNames) { if (columnsMap.containsKey(name)) { columnsByName.add(columnsMap.get(name)); } else { throw new NoSuchElementException(UNKNOWN_COLUMN_NAME); } } } return columnsByName; } }
public class class_name { @Override public List<Column> getColumns(List<String> columnNames) { if (columnsByName.isEmpty()) { Map<String, Column> columnsMap = new HashMap<String, Column>(); List<Column> allColumns = sasFileParser.getColumns(); for (Column column : allColumns) { columnsMap.put(column.getName(), column); // depends on control dependency: [for], data = [column] } for (String name : columnNames) { if (columnsMap.containsKey(name)) { columnsByName.add(columnsMap.get(name)); // depends on control dependency: [if], data = [none] } else { throw new NoSuchElementException(UNKNOWN_COLUMN_NAME); } } } return columnsByName; } }
public class class_name { protected void initializeElements() { final BusNetwork network = getBusNetwork(); if (network != null) { int i = 0; for (final BusLine line : network.busLines()) { onBusLineAdded(line, i); ++i; } } } }
public class class_name { protected void initializeElements() { final BusNetwork network = getBusNetwork(); if (network != null) { int i = 0; for (final BusLine line : network.busLines()) { onBusLineAdded(line, i); // depends on control dependency: [for], data = [line] ++i; // depends on control dependency: [for], data = [none] } } } }
public class class_name { private File newSubdirectory(File parentDirectory, String path) { File dir = new File(parentDirectory, path); if (!dir.exists()) { dir.mkdirs(); } return dir; } }
public class class_name { private File newSubdirectory(File parentDirectory, String path) { File dir = new File(parentDirectory, path); if (!dir.exists()) { dir.mkdirs(); // depends on control dependency: [if], data = [none] } return dir; } }
public class class_name { public List<ServerRedirect> deleteServerMapping(int serverMappingId) { ArrayList<ServerRedirect> servers = new ArrayList<ServerRedirect>(); try { JSONArray serverArray = new JSONArray(doDelete(BASE_SERVER + "/" + serverMappingId, null)); for (int i = 0; i < serverArray.length(); i++) { JSONObject jsonServer = serverArray.getJSONObject(i); ServerRedirect server = getServerRedirectFromJSON(jsonServer); if (server != null) { servers.add(server); } } } catch (Exception e) { e.printStackTrace(); return null; } return servers; } }
public class class_name { public List<ServerRedirect> deleteServerMapping(int serverMappingId) { ArrayList<ServerRedirect> servers = new ArrayList<ServerRedirect>(); try { JSONArray serverArray = new JSONArray(doDelete(BASE_SERVER + "/" + serverMappingId, null)); for (int i = 0; i < serverArray.length(); i++) { JSONObject jsonServer = serverArray.getJSONObject(i); ServerRedirect server = getServerRedirectFromJSON(jsonServer); if (server != null) { servers.add(server); // depends on control dependency: [if], data = [(server] } } } catch (Exception e) { e.printStackTrace(); return null; } // depends on control dependency: [catch], data = [none] return servers; } }
public class class_name { public void marshall(UploadMetadata uploadMetadata, ProtocolMarshaller protocolMarshaller) { if (uploadMetadata == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(uploadMetadata.getUploadUrl(), UPLOADURL_BINDING); protocolMarshaller.marshall(uploadMetadata.getSignedHeaders(), SIGNEDHEADERS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(UploadMetadata uploadMetadata, ProtocolMarshaller protocolMarshaller) { if (uploadMetadata == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(uploadMetadata.getUploadUrl(), UPLOADURL_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(uploadMetadata.getSignedHeaders(), SIGNEDHEADERS_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 { @SuppressWarnings("unchecked") public static <T> T instantiateDefault(Class<T> someClass) { if (someClass.isArray()) { return (T) Array.newInstance(someClass.getComponentType(), 0); } else { if (boolean.class.equals(someClass) || Boolean.class.equals(someClass)) { return (T) Boolean.FALSE; } else if (int.class.equals(someClass) || Integer.class.equals(someClass)) { return (T) Integer.valueOf(0); } else if (long.class.equals(someClass) || Long.class.equals(someClass)) { return (T) Long.valueOf(0L); } else if (short.class.equals(someClass) || Short.class.equals(someClass)) { return (T) Short.valueOf((short) 0); } else if (float.class.equals(someClass) || Float.class.equals(someClass)) { return (T) Float.valueOf(0f); } else if (double.class.equals(someClass) || Double.class.equals(someClass)) { return (T) Double.valueOf(0d); } else if (byte.class.equals(someClass) || Byte.class.equals(someClass)) { return (T) Byte.valueOf((byte) 0); } else if (char.class.equals(someClass) || Character.class.equals(someClass)) { return (T) Character.valueOf((char) 0); } else { try { Constructor<T> defaultConstructor = someClass.getDeclaredConstructor(); defaultConstructor.setAccessible(true); return defaultConstructor.newInstance(); } catch (Exception e) { throw ShedException.wrap(e, ShedErrorCode.UNABLE_TO_INSTANTIATE_CLASS) .put("class", someClass); } } } } }
public class class_name { @SuppressWarnings("unchecked") public static <T> T instantiateDefault(Class<T> someClass) { if (someClass.isArray()) { return (T) Array.newInstance(someClass.getComponentType(), 0); // depends on control dependency: [if], data = [none] } else { if (boolean.class.equals(someClass) || Boolean.class.equals(someClass)) { return (T) Boolean.FALSE; // depends on control dependency: [if], data = [none] } else if (int.class.equals(someClass) || Integer.class.equals(someClass)) { return (T) Integer.valueOf(0); // depends on control dependency: [if], data = [none] } else if (long.class.equals(someClass) || Long.class.equals(someClass)) { return (T) Long.valueOf(0L); // depends on control dependency: [if], data = [none] } else if (short.class.equals(someClass) || Short.class.equals(someClass)) { return (T) Short.valueOf((short) 0); // depends on control dependency: [if], data = [none] } else if (float.class.equals(someClass) || Float.class.equals(someClass)) { return (T) Float.valueOf(0f); // depends on control dependency: [if], data = [none] } else if (double.class.equals(someClass) || Double.class.equals(someClass)) { return (T) Double.valueOf(0d); // depends on control dependency: [if], data = [none] } else if (byte.class.equals(someClass) || Byte.class.equals(someClass)) { return (T) Byte.valueOf((byte) 0); // depends on control dependency: [if], data = [none] } else if (char.class.equals(someClass) || Character.class.equals(someClass)) { return (T) Character.valueOf((char) 0); // depends on control dependency: [if], data = [none] } else { try { Constructor<T> defaultConstructor = someClass.getDeclaredConstructor(); defaultConstructor.setAccessible(true); // depends on control dependency: [try], data = [none] return defaultConstructor.newInstance(); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw ShedException.wrap(e, ShedErrorCode.UNABLE_TO_INSTANTIATE_CLASS) .put("class", someClass); } // depends on control dependency: [catch], data = [none] } } } }
public class class_name { public CMASpaceMembership create(String spaceId, CMASpaceMembership membership) { assertNotNull(spaceId, "spaceId"); assertNotNull(membership, "membership"); final CMASystem sys = membership.getSystem(); membership.setSystem(null); try { return service.create(spaceId, membership).blockingFirst(); } finally { membership.setSystem(sys); } } }
public class class_name { public CMASpaceMembership create(String spaceId, CMASpaceMembership membership) { assertNotNull(spaceId, "spaceId"); assertNotNull(membership, "membership"); final CMASystem sys = membership.getSystem(); membership.setSystem(null); try { return service.create(spaceId, membership).blockingFirst(); // depends on control dependency: [try], data = [none] } finally { membership.setSystem(sys); } } }
public class class_name { public int calculateNumberOfImplicitHydrogens(IAtom atom, double bondOrderSum, IBond.Order maxBondOrder, int neighbourCount) throws CDKException { int missingHydrogens = 0; if (atom instanceof IPseudoAtom) { logger.debug("don't figure it out... it simply does not lack H's"); return 0; } logger.debug("Calculating number of missing hydrogen atoms"); // get default atom IAtomType[] atomTypes = getAtomTypeFactory(atom.getBuilder()).getAtomTypes(atom.getSymbol()); if (atomTypes.length == 0) { logger.warn("Element not found in configuration file: ", atom); return 0; } logger.debug("Found atomtypes: ", atomTypes.length); for (int f = 0; f < atomTypes.length; f++) { IAtomType type = atomTypes[f]; if (couldMatchAtomType(atom, bondOrderSum, maxBondOrder, type)) { logger.debug("This type matches: ", type); int formalNeighbourCount = type.getFormalNeighbourCount(); if (type.getHybridization() == CDKConstants.UNSET) { missingHydrogens = (int) (type.getBondOrderSum() - bondOrderSum); } else if (type.getHybridization() == Hybridization.SP3) { missingHydrogens = formalNeighbourCount - neighbourCount; } else if (type.getHybridization() == Hybridization.SP2) { missingHydrogens = formalNeighbourCount - neighbourCount; } else if (type.getHybridization() == Hybridization.SP1) { missingHydrogens = formalNeighbourCount - neighbourCount; } else { missingHydrogens = (int) (type.getBondOrderSum() - bondOrderSum); } break; } } logger.debug("missing hydrogens: ", missingHydrogens); return missingHydrogens; } }
public class class_name { public int calculateNumberOfImplicitHydrogens(IAtom atom, double bondOrderSum, IBond.Order maxBondOrder, int neighbourCount) throws CDKException { int missingHydrogens = 0; if (atom instanceof IPseudoAtom) { logger.debug("don't figure it out... it simply does not lack H's"); return 0; } logger.debug("Calculating number of missing hydrogen atoms"); // get default atom IAtomType[] atomTypes = getAtomTypeFactory(atom.getBuilder()).getAtomTypes(atom.getSymbol()); if (atomTypes.length == 0) { logger.warn("Element not found in configuration file: ", atom); return 0; } logger.debug("Found atomtypes: ", atomTypes.length); for (int f = 0; f < atomTypes.length; f++) { IAtomType type = atomTypes[f]; if (couldMatchAtomType(atom, bondOrderSum, maxBondOrder, type)) { logger.debug("This type matches: ", type); // depends on control dependency: [if], data = [none] int formalNeighbourCount = type.getFormalNeighbourCount(); if (type.getHybridization() == CDKConstants.UNSET) { missingHydrogens = (int) (type.getBondOrderSum() - bondOrderSum); // depends on control dependency: [if], data = [none] } else if (type.getHybridization() == Hybridization.SP3) { missingHydrogens = formalNeighbourCount - neighbourCount; // depends on control dependency: [if], data = [none] } else if (type.getHybridization() == Hybridization.SP2) { missingHydrogens = formalNeighbourCount - neighbourCount; // depends on control dependency: [if], data = [none] } else if (type.getHybridization() == Hybridization.SP1) { missingHydrogens = formalNeighbourCount - neighbourCount; // depends on control dependency: [if], data = [none] } else { missingHydrogens = (int) (type.getBondOrderSum() - bondOrderSum); // depends on control dependency: [if], data = [none] } break; } } logger.debug("missing hydrogens: ", missingHydrogens); return missingHydrogens; } }
public class class_name { private String getCore() { try { return parseMandatoryStringValue(XML_ELEMENT_CORE); } catch (final Exception e) { LOG.info(Messages.get().getBundle().key(Messages.LOG_NO_CORE_SPECIFIED_0), e); return null; } } }
public class class_name { private String getCore() { try { return parseMandatoryStringValue(XML_ELEMENT_CORE); // depends on control dependency: [try], data = [none] } catch (final Exception e) { LOG.info(Messages.get().getBundle().key(Messages.LOG_NO_CORE_SPECIFIED_0), e); return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { private Color buildWebColor(final WebColor wColor) { Color color = null; if (wColor.opacity() >= 1.0) { color = Color.web(HEXA_PREFIX + wColor.hex()); } else { color = Color.web(HEXA_PREFIX + wColor.hex(), wColor.opacity()); } return color; } }
public class class_name { private Color buildWebColor(final WebColor wColor) { Color color = null; if (wColor.opacity() >= 1.0) { color = Color.web(HEXA_PREFIX + wColor.hex()); // depends on control dependency: [if], data = [none] } else { color = Color.web(HEXA_PREFIX + wColor.hex(), wColor.opacity()); // depends on control dependency: [if], data = [none] } return color; } }
public class class_name { protected final void createTagDictionary(final String dictPath) { if (!dictPath.equalsIgnoreCase(Flags.DEFAULT_DICT_PATH)) { try { getPosTaggerFactory().setTagDictionary( getPosTaggerFactory().createTagDictionary(new File(dictPath))); } catch (final IOException e) { throw new TerminateToolException(-1, "IO error while loading POS Dictionary: " + e.getMessage(), e); } } } }
public class class_name { protected final void createTagDictionary(final String dictPath) { if (!dictPath.equalsIgnoreCase(Flags.DEFAULT_DICT_PATH)) { try { getPosTaggerFactory().setTagDictionary( getPosTaggerFactory().createTagDictionary(new File(dictPath))); // depends on control dependency: [try], data = [none] } catch (final IOException e) { throw new TerminateToolException(-1, "IO error while loading POS Dictionary: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { private Paint getFeatureStylePaint(FeatureStyle featureStyle, FeatureDrawType drawType) { Paint paint = null; if (featureStyle != null) { StyleRow style = featureStyle.getStyle(); if (style != null && style.hasColor()) { paint = getStylePaint(style, drawType); } } return paint; } }
public class class_name { private Paint getFeatureStylePaint(FeatureStyle featureStyle, FeatureDrawType drawType) { Paint paint = null; if (featureStyle != null) { StyleRow style = featureStyle.getStyle(); if (style != null && style.hasColor()) { paint = getStylePaint(style, drawType); // depends on control dependency: [if], data = [(style] } } return paint; } }
public class class_name { public void marshall(EnableAWSServiceAccessRequest enableAWSServiceAccessRequest, ProtocolMarshaller protocolMarshaller) { if (enableAWSServiceAccessRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(enableAWSServiceAccessRequest.getServicePrincipal(), SERVICEPRINCIPAL_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(EnableAWSServiceAccessRequest enableAWSServiceAccessRequest, ProtocolMarshaller protocolMarshaller) { if (enableAWSServiceAccessRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(enableAWSServiceAccessRequest.getServicePrincipal(), SERVICEPRINCIPAL_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 String getVerifierString(byte[] verifierBytes) { char[] chars = new char[verifierBytes.length]; for (int i = 0; i < verifierBytes.length; i++) { chars[i] = DEFAULT_CODEC[((verifierBytes[i] & 0xFF) % DEFAULT_CODEC.length)]; } return new String(chars); } }
public class class_name { protected String getVerifierString(byte[] verifierBytes) { char[] chars = new char[verifierBytes.length]; for (int i = 0; i < verifierBytes.length; i++) { chars[i] = DEFAULT_CODEC[((verifierBytes[i] & 0xFF) % DEFAULT_CODEC.length)]; // depends on control dependency: [for], data = [i] } return new String(chars); } }
public class class_name { public java.util.List<String> getFinal() { if (_final == null) { _final = new ArrayList<String>(); } return this._final; } }
public class class_name { public java.util.List<String> getFinal() { if (_final == null) { _final = new ArrayList<String>(); // depends on control dependency: [if], data = [none] } return this._final; } }
public class class_name { DateIntervalFormat.BestMatchInfo getBestSkeleton(String inputSkeleton) { String bestSkeleton = inputSkeleton; int[] inputSkeletonFieldWidth = new int[58]; int[] skeletonFieldWidth = new int[58]; final int DIFFERENT_FIELD = 0x1000; final int STRING_NUMERIC_DIFFERENCE = 0x100; final int BASE = 0x41; // TODO: this is a hack for 'v' and 'z' // resource bundle only have time skeletons ending with 'v', // but not for time skeletons ending with 'z'. boolean replaceZWithV = false; if ( inputSkeleton.indexOf('z') != -1 ) { inputSkeleton = inputSkeleton.replace('z', 'v'); replaceZWithV = true; } parseSkeleton(inputSkeleton, inputSkeletonFieldWidth); int bestDistance = Integer.MAX_VALUE; // 0 means exact the same skeletons; // 1 means having the same field, but with different length, // 2 means only z/v differs // -1 means having different field. int bestFieldDifference = 0; for (String skeleton : fIntervalPatterns.keySet()) { // clear skeleton field width for ( int i = 0; i < skeletonFieldWidth.length; ++i ) { skeletonFieldWidth[i] = 0; } parseSkeleton(skeleton, skeletonFieldWidth); // calculate distance int distance = 0; int fieldDifference = 1; for ( int i = 0; i < inputSkeletonFieldWidth.length; ++i ) { int inputFieldWidth = inputSkeletonFieldWidth[i]; int fieldWidth = skeletonFieldWidth[i]; if ( inputFieldWidth == fieldWidth ) { continue; } if ( inputFieldWidth == 0 ) { fieldDifference = -1; distance += DIFFERENT_FIELD; } else if ( fieldWidth == 0 ) { fieldDifference = -1; distance += DIFFERENT_FIELD; } else if (stringNumeric(inputFieldWidth, fieldWidth, (char)(i+BASE) ) ) { distance += STRING_NUMERIC_DIFFERENCE; } else { distance += Math.abs(inputFieldWidth - fieldWidth); } } if ( distance < bestDistance ) { bestSkeleton = skeleton; bestDistance = distance; bestFieldDifference = fieldDifference; } if ( distance == 0 ) { bestFieldDifference = 0; break; } } if ( replaceZWithV && bestFieldDifference != -1 ) { bestFieldDifference = 2; } return new DateIntervalFormat.BestMatchInfo(bestSkeleton, bestFieldDifference); } }
public class class_name { DateIntervalFormat.BestMatchInfo getBestSkeleton(String inputSkeleton) { String bestSkeleton = inputSkeleton; int[] inputSkeletonFieldWidth = new int[58]; int[] skeletonFieldWidth = new int[58]; final int DIFFERENT_FIELD = 0x1000; final int STRING_NUMERIC_DIFFERENCE = 0x100; final int BASE = 0x41; // TODO: this is a hack for 'v' and 'z' // resource bundle only have time skeletons ending with 'v', // but not for time skeletons ending with 'z'. boolean replaceZWithV = false; if ( inputSkeleton.indexOf('z') != -1 ) { inputSkeleton = inputSkeleton.replace('z', 'v'); // depends on control dependency: [if], data = [none] replaceZWithV = true; // depends on control dependency: [if], data = [none] } parseSkeleton(inputSkeleton, inputSkeletonFieldWidth); int bestDistance = Integer.MAX_VALUE; // 0 means exact the same skeletons; // 1 means having the same field, but with different length, // 2 means only z/v differs // -1 means having different field. int bestFieldDifference = 0; for (String skeleton : fIntervalPatterns.keySet()) { // clear skeleton field width for ( int i = 0; i < skeletonFieldWidth.length; ++i ) { skeletonFieldWidth[i] = 0; // depends on control dependency: [for], data = [i] } parseSkeleton(skeleton, skeletonFieldWidth); // depends on control dependency: [for], data = [skeleton] // calculate distance int distance = 0; int fieldDifference = 1; for ( int i = 0; i < inputSkeletonFieldWidth.length; ++i ) { int inputFieldWidth = inputSkeletonFieldWidth[i]; int fieldWidth = skeletonFieldWidth[i]; if ( inputFieldWidth == fieldWidth ) { continue; } if ( inputFieldWidth == 0 ) { fieldDifference = -1; // depends on control dependency: [if], data = [none] distance += DIFFERENT_FIELD; // depends on control dependency: [if], data = [none] } else if ( fieldWidth == 0 ) { fieldDifference = -1; // depends on control dependency: [if], data = [none] distance += DIFFERENT_FIELD; // depends on control dependency: [if], data = [none] } else if (stringNumeric(inputFieldWidth, fieldWidth, (char)(i+BASE) ) ) { distance += STRING_NUMERIC_DIFFERENCE; // depends on control dependency: [if], data = [none] } else { distance += Math.abs(inputFieldWidth - fieldWidth); // depends on control dependency: [if], data = [none] } } if ( distance < bestDistance ) { bestSkeleton = skeleton; // depends on control dependency: [if], data = [none] bestDistance = distance; // depends on control dependency: [if], data = [none] bestFieldDifference = fieldDifference; // depends on control dependency: [if], data = [none] } if ( distance == 0 ) { bestFieldDifference = 0; // depends on control dependency: [if], data = [none] break; } } if ( replaceZWithV && bestFieldDifference != -1 ) { bestFieldDifference = 2; // depends on control dependency: [if], data = [none] } return new DateIntervalFormat.BestMatchInfo(bestSkeleton, bestFieldDifference); } }
public class class_name { protected final Buckets createBuckets(Stopwatch stopwatch) { if (stopwatch.getCounter() > warmupCounter) { Buckets buckets = createBucketsAfterWarmup(stopwatch); // Add retained splits to buckets buckets.addValues(getBucketsValues(stopwatch)); removeBucketsValues(stopwatch); return buckets; } else { return null; } } }
public class class_name { protected final Buckets createBuckets(Stopwatch stopwatch) { if (stopwatch.getCounter() > warmupCounter) { Buckets buckets = createBucketsAfterWarmup(stopwatch); // Add retained splits to buckets buckets.addValues(getBucketsValues(stopwatch)); // depends on control dependency: [if], data = [none] removeBucketsValues(stopwatch); // depends on control dependency: [if], data = [none] return buckets; // depends on control dependency: [if], data = [none] } else { return null; // depends on control dependency: [if], data = [none] } } }
public class class_name { public long getAlignedVirtualSize() { long virtSize = get(VIRTUAL_SIZE); if (virtSize == (virtSize & ~0xfff)) { return virtSize; } // TODO: corkami: "a section can have a null VirtualSize: in this case, // only the SizeOfRawData is taken into consideration" long result = (virtSize + 0xfff) & ~0xfff; assert result % 4096 == 0; return result; } }
public class class_name { public long getAlignedVirtualSize() { long virtSize = get(VIRTUAL_SIZE); if (virtSize == (virtSize & ~0xfff)) { return virtSize; // depends on control dependency: [if], data = [none] } // TODO: corkami: "a section can have a null VirtualSize: in this case, // only the SizeOfRawData is taken into consideration" long result = (virtSize + 0xfff) & ~0xfff; assert result % 4096 == 0; return result; } }
public class class_name { private boolean detectSpecialInitializationCase(FacesContext facesContext) { boolean result = false; if (null == facesContext) { logNullFacesContext.compareAndSet(false, true); } else { logNonNullFacesContext.compareAndSet(false, true); } result = logNullFacesContext.get() && logNonNullFacesContext.get(); return result; } }
public class class_name { private boolean detectSpecialInitializationCase(FacesContext facesContext) { boolean result = false; if (null == facesContext) { logNullFacesContext.compareAndSet(false, true); // depends on control dependency: [if], data = [none] } else { logNonNullFacesContext.compareAndSet(false, true); // depends on control dependency: [if], data = [none] } result = logNullFacesContext.get() && logNonNullFacesContext.get(); return result; } }
public class class_name { @SuppressWarnings("unused") private int readAMF3IntegerNew() { int b = buf.get() & 0xFF; if (b < 128) { return b; } int value = (b & 0x7F) << 7; b = buf.get() & 0xFF; if (b < 128) { return (value | b); } value = (value | b & 0x7F) << 7; b = buf.get() & 0xFF; if (b < 128) { return (value | b); } value = (value | b & 0x7F) << 8; b = buf.get() & 0xFF; return (value | b); } }
public class class_name { @SuppressWarnings("unused") private int readAMF3IntegerNew() { int b = buf.get() & 0xFF; if (b < 128) { return b; // depends on control dependency: [if], data = [none] } int value = (b & 0x7F) << 7; b = buf.get() & 0xFF; if (b < 128) { return (value | b); // depends on control dependency: [if], data = [none] } value = (value | b & 0x7F) << 7; b = buf.get() & 0xFF; if (b < 128) { return (value | b); // depends on control dependency: [if], data = [none] } value = (value | b & 0x7F) << 8; b = buf.get() & 0xFF; return (value | b); } }
public class class_name { static public void emptyDirectory(File dir) throws Exception { String[] fileNames = dir.list(); if( null != fileNames ) { for(String fileName : fileNames){ File file = new File(dir,fileName); if( file.isDirectory() ) { emptyDirectory(file); } boolean deleted = false; try { deleted = file.delete(); } catch(Exception e) { throw new Exception("Unable to delete: "+file.getAbsolutePath(),e); } if( !deleted ){ throw new Exception("Unable to delete: "+file.getAbsolutePath()); } } } } }
public class class_name { static public void emptyDirectory(File dir) throws Exception { String[] fileNames = dir.list(); if( null != fileNames ) { for(String fileName : fileNames){ File file = new File(dir,fileName); if( file.isDirectory() ) { emptyDirectory(file); // depends on control dependency: [if], data = [none] } boolean deleted = false; try { deleted = file.delete(); // depends on control dependency: [try], data = [none] } catch(Exception e) { throw new Exception("Unable to delete: "+file.getAbsolutePath(),e); } // depends on control dependency: [catch], data = [none] if( !deleted ){ throw new Exception("Unable to delete: "+file.getAbsolutePath()); } } } } }
public class class_name { public void setFullscreen(boolean fullscreen) { if (mBuilder.mScrimInsetsLayout != null) { mBuilder.mScrimInsetsLayout.setTintStatusBar(!fullscreen); mBuilder.mScrimInsetsLayout.setTintNavigationBar(!fullscreen); } } }
public class class_name { public void setFullscreen(boolean fullscreen) { if (mBuilder.mScrimInsetsLayout != null) { mBuilder.mScrimInsetsLayout.setTintStatusBar(!fullscreen); // depends on control dependency: [if], data = [none] mBuilder.mScrimInsetsLayout.setTintNavigationBar(!fullscreen); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void accept(String key, $.Function<WebSocketConnection, ?> visitor) { ConcurrentMap<WebSocketConnection, WebSocketConnection> connections = registry.get(key); if (null == connections) { return; } if (!connections.isEmpty()) { lock.lock(); try { List<WebSocketConnection> toBeCleared = null; for (WebSocketConnection conn : connections.keySet()) { if (conn.closed()) { if (null == toBeCleared) { toBeCleared = new ArrayList<>(); } toBeCleared.add(conn); continue; } visitor.apply(conn); } if (null != toBeCleared) { ConcurrentMap<WebSocketConnection, WebSocketConnection> originalCopy = registry.get(key); originalCopy.keySet().removeAll(toBeCleared); } } finally { lock.unlock(); } } } }
public class class_name { public void accept(String key, $.Function<WebSocketConnection, ?> visitor) { ConcurrentMap<WebSocketConnection, WebSocketConnection> connections = registry.get(key); if (null == connections) { return; // depends on control dependency: [if], data = [none] } if (!connections.isEmpty()) { lock.lock(); // depends on control dependency: [if], data = [none] try { List<WebSocketConnection> toBeCleared = null; for (WebSocketConnection conn : connections.keySet()) { if (conn.closed()) { if (null == toBeCleared) { toBeCleared = new ArrayList<>(); // depends on control dependency: [if], data = [none] } toBeCleared.add(conn); // depends on control dependency: [if], data = [none] continue; } visitor.apply(conn); // depends on control dependency: [for], data = [conn] } if (null != toBeCleared) { ConcurrentMap<WebSocketConnection, WebSocketConnection> originalCopy = registry.get(key); originalCopy.keySet().removeAll(toBeCleared); // depends on control dependency: [if], data = [toBeCleared)] } } finally { lock.unlock(); } } } }
public class class_name { protected static List<String> formatMessageParameters(Object[] parameters) { List<String> stringParameters = new ArrayList<>(parameters.length); for (Object parameter : parameters) { stringParameters.add((parameter != null) ? parameter.toString() : null); } return stringParameters; } }
public class class_name { protected static List<String> formatMessageParameters(Object[] parameters) { List<String> stringParameters = new ArrayList<>(parameters.length); for (Object parameter : parameters) { stringParameters.add((parameter != null) ? parameter.toString() : null); // depends on control dependency: [for], data = [parameter] } return stringParameters; } }
public class class_name { public BUILDER setCapabilityReference(String referencedCapability, RuntimeCapability<?> dependentCapability) { if (dependentCapability.isDynamicallyNamed()) { return setCapabilityReference(referencedCapability, dependentCapability.getName()); } else { //noinspection deprecation return setCapabilityReference(referencedCapability, dependentCapability.getName(), false); } } }
public class class_name { public BUILDER setCapabilityReference(String referencedCapability, RuntimeCapability<?> dependentCapability) { if (dependentCapability.isDynamicallyNamed()) { return setCapabilityReference(referencedCapability, dependentCapability.getName()); // depends on control dependency: [if], data = [none] } else { //noinspection deprecation return setCapabilityReference(referencedCapability, dependentCapability.getName(), false); // depends on control dependency: [if], data = [none] } } }
public class class_name { @SuppressWarnings({"ConstantConditions"}) public static Object evaluate( IType type, Object lhsValue, Object rhsValue, IType lhsType, IType rhsType, int iOperator, boolean bNullSafe ) { boolean bDynamic = false; if( lhsType instanceof IPlaceholder && ((IPlaceholder)lhsType).isPlaceholder() ) { lhsType = TypeSystem.getFromObject( lhsValue ); bDynamic = true; } if( rhsType instanceof IPlaceholder && ((IPlaceholder)rhsType).isPlaceholder() ) { rhsType = TypeSystem.getFromObject( rhsValue ); bDynamic = true; } if( bDynamic ) { ArithmeticExpression overrideMethod = new MultiplicativeExpression(); type = ParserBase.resolveRuntimeType( overrideMethod, lhsType, iOperator, rhsType ); IMethodInfo mi = overrideMethod.getOverride(); if( mi != null ) { return mi.getCallHandler().handleCall( lhsValue, ReflectUtil.coerceArgsIfNecessary( mi.getParameters(), rhsValue ) ); } } if( lhsValue == null ) { if( bNullSafe ) { return null; } throw new NullPointerException("left-hand operand was null"); } if( rhsValue == null ) { if( bNullSafe ) { return null; } throw new NullPointerException("right-hand operand was null"); } IDimension customNumberBase = null; if( JavaTypes.IDIMENSION().isAssignableFrom( type ) ) { DimensionOperandResolver customNumberResolver = DimensionOperandResolver.resolve( type, lhsType, lhsValue, rhsType, rhsValue ); type = customNumberResolver.getRawNumberType(); lhsValue = customNumberResolver.getLhsValue(); rhsValue = customNumberResolver.getRhsValue(); customNumberBase = customNumberResolver.getBase(); } Object retValue; ICoercionManager cm = CommonServices.getCoercionManager(); switch( iOperator ) { case '*': { if( type == JavaTypes.RATIONAL() ) { retValue = cm.makeRationalFrom( lhsValue ).multiply( cm.makeRationalFrom( rhsValue ) ); } else if( type == JavaTypes.BIG_DECIMAL() ) { retValue = cm.makeBigDecimalFrom( lhsValue ).multiply( cm.makeBigDecimalFrom( rhsValue ) ); } else if( type == JavaTypes.BIG_INTEGER() ) { retValue = cm.makeBigIntegerFrom( lhsValue ).multiply( cm.makeBigIntegerFrom( rhsValue ) ); } else if( type == JavaTypes.INTEGER() || type == JavaTypes.pINT() ) { retValue = cm.makeIntegerFrom( lhsValue ) * cm.makeIntegerFrom( rhsValue ); } else if( type == JavaTypes.LONG() || type == JavaTypes.pLONG() ) { retValue = makeLong( cm.makeLongFrom( lhsValue ) * cm.makeLongFrom( rhsValue ) ); } else if( type == JavaTypes.DOUBLE() || type == JavaTypes.pDOUBLE() ) { retValue = makeDoubleValue( makeDoubleValue( lhsValue ) * makeDoubleValue( rhsValue ) ); } else if( type == JavaTypes.FLOAT() || type == JavaTypes.pFLOAT() ) { retValue = makeFloatValue( makeFloatValue( lhsValue ) * makeFloatValue( rhsValue ) ); } else if( type == JavaTypes.SHORT() || type == JavaTypes.pSHORT() ) { retValue = Integer.valueOf( cm.makeIntegerFrom( lhsValue ) * cm.makeIntegerFrom( rhsValue ) ).shortValue(); } else if( type == JavaTypes.BYTE() || type == JavaTypes.pBYTE() ) { retValue = (byte)(cm.makeIntegerFrom( lhsValue ) * cm.makeIntegerFrom( rhsValue )); } else { throw new UnsupportedNumberTypeException(type); } break; } case '/': { if( type == JavaTypes.RATIONAL() ) { retValue = cm.makeRationalFrom( lhsValue ).divide( cm.makeRationalFrom( rhsValue ) ); } else if( type == JavaTypes.BIG_DECIMAL() ) { retValue = cm.makeBigDecimalFrom( lhsValue ).divide( cm.makeBigDecimalFrom( rhsValue ), MathContext.DECIMAL128 ); } else if( type == JavaTypes.BIG_INTEGER() ) { retValue = cm.makeBigIntegerFrom( lhsValue ).divide( cm.makeBigIntegerFrom( rhsValue ) ); } else if( type == JavaTypes.INTEGER() || type == JavaTypes.pINT() ) { retValue = cm.makeIntegerFrom( lhsValue ) / cm.makeIntegerFrom( rhsValue ); } else if( type == JavaTypes.LONG() || type == JavaTypes.pLONG() ) { retValue = makeLong( cm.makeLongFrom( lhsValue ) / cm.makeLongFrom( rhsValue ) ); } else if( type == JavaTypes.DOUBLE() || type == JavaTypes.pDOUBLE() ) { retValue = makeDoubleValue( makeDoubleValue( lhsValue ) / makeDoubleValue( rhsValue ) ); } else if( type == JavaTypes.FLOAT() || type == JavaTypes.pFLOAT() ) { retValue = makeFloatValue( makeFloatValue( lhsValue ) / makeFloatValue( rhsValue ) ); } else if( type == JavaTypes.SHORT() || type == JavaTypes.pSHORT() ) { retValue = Integer.valueOf( cm.makeIntegerFrom( lhsValue ) / cm.makeIntegerFrom( rhsValue ) ).shortValue(); } else if( type == JavaTypes.BYTE() || type == JavaTypes.pBYTE() ) { retValue = (byte)(cm.makeIntegerFrom( lhsValue ) / cm.makeIntegerFrom( rhsValue )); } else { throw new UnsupportedNumberTypeException(type); } break; } case '%': { if( type == JavaTypes.RATIONAL() ) { retValue = cm.makeRationalFrom( lhsValue ).modulo( cm.makeRationalFrom( rhsValue ) ); } else if( type == JavaTypes.BIG_DECIMAL() ) { retValue = cm.makeBigDecimalFrom( lhsValue ).remainder( cm.makeBigDecimalFrom( rhsValue ), MathContext.DECIMAL128 ).abs(); } else if( type == JavaTypes.BIG_INTEGER() ) { retValue = cm.makeBigIntegerFrom( lhsValue ).mod( cm.makeBigIntegerFrom( rhsValue ) ); } else if( type == JavaTypes.INTEGER() || type == JavaTypes.pINT() ) { retValue = cm.makeIntegerFrom( lhsValue ) % cm.makeIntegerFrom( rhsValue ); } else if( type == JavaTypes.LONG() || type == JavaTypes.pLONG() ) { retValue = makeLong( cm.makeLongFrom( lhsValue ) % cm.makeLongFrom( rhsValue ) ); } else if( type == JavaTypes.DOUBLE() || type == JavaTypes.pDOUBLE() ) { retValue = makeDoubleValue( makeDoubleValue( lhsValue ) % makeDoubleValue( rhsValue ) ); } else if( type == JavaTypes.FLOAT() || type == JavaTypes.pFLOAT() ) { retValue = makeFloatValue( makeFloatValue( lhsValue ) % makeFloatValue( rhsValue ) ); } else if( type == JavaTypes.SHORT() || type == JavaTypes.pSHORT() ) { retValue = Integer.valueOf( cm.makeIntegerFrom( lhsValue ) % cm.makeIntegerFrom( rhsValue ) ).shortValue(); } else if( type == JavaTypes.BYTE() || type == JavaTypes.pBYTE() ) { retValue = (byte)(cm.makeIntegerFrom( lhsValue ) % cm.makeIntegerFrom( rhsValue )); } else { throw new UnsupportedNumberTypeException(type); } break; } default: retValue = null; } if( retValue != null ) { if( customNumberBase != null ) { //noinspection unchecked retValue = customNumberBase.fromNumber( (Number)retValue ); } } return retValue; } }
public class class_name { @SuppressWarnings({"ConstantConditions"}) public static Object evaluate( IType type, Object lhsValue, Object rhsValue, IType lhsType, IType rhsType, int iOperator, boolean bNullSafe ) { boolean bDynamic = false; if( lhsType instanceof IPlaceholder && ((IPlaceholder)lhsType).isPlaceholder() ) { lhsType = TypeSystem.getFromObject( lhsValue ); // depends on control dependency: [if], data = [none] bDynamic = true; // depends on control dependency: [if], data = [none] } if( rhsType instanceof IPlaceholder && ((IPlaceholder)rhsType).isPlaceholder() ) { rhsType = TypeSystem.getFromObject( rhsValue ); // depends on control dependency: [if], data = [none] bDynamic = true; // depends on control dependency: [if], data = [none] } if( bDynamic ) { ArithmeticExpression overrideMethod = new MultiplicativeExpression(); type = ParserBase.resolveRuntimeType( overrideMethod, lhsType, iOperator, rhsType ); // depends on control dependency: [if], data = [none] IMethodInfo mi = overrideMethod.getOverride(); if( mi != null ) { return mi.getCallHandler().handleCall( lhsValue, ReflectUtil.coerceArgsIfNecessary( mi.getParameters(), rhsValue ) ); // depends on control dependency: [if], data = [( mi] } } if( lhsValue == null ) { if( bNullSafe ) { return null; // depends on control dependency: [if], data = [none] } throw new NullPointerException("left-hand operand was null"); } if( rhsValue == null ) { if( bNullSafe ) { return null; // depends on control dependency: [if], data = [none] } throw new NullPointerException("right-hand operand was null"); } IDimension customNumberBase = null; if( JavaTypes.IDIMENSION().isAssignableFrom( type ) ) { DimensionOperandResolver customNumberResolver = DimensionOperandResolver.resolve( type, lhsType, lhsValue, rhsType, rhsValue ); type = customNumberResolver.getRawNumberType(); // depends on control dependency: [if], data = [none] lhsValue = customNumberResolver.getLhsValue(); // depends on control dependency: [if], data = [none] rhsValue = customNumberResolver.getRhsValue(); // depends on control dependency: [if], data = [none] customNumberBase = customNumberResolver.getBase(); // depends on control dependency: [if], data = [none] } Object retValue; ICoercionManager cm = CommonServices.getCoercionManager(); switch( iOperator ) { case '*': { if( type == JavaTypes.RATIONAL() ) { retValue = cm.makeRationalFrom( lhsValue ).multiply( cm.makeRationalFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.BIG_DECIMAL() ) { retValue = cm.makeBigDecimalFrom( lhsValue ).multiply( cm.makeBigDecimalFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.BIG_INTEGER() ) { retValue = cm.makeBigIntegerFrom( lhsValue ).multiply( cm.makeBigIntegerFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.INTEGER() || type == JavaTypes.pINT() ) { retValue = cm.makeIntegerFrom( lhsValue ) * cm.makeIntegerFrom( rhsValue ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.LONG() || type == JavaTypes.pLONG() ) { retValue = makeLong( cm.makeLongFrom( lhsValue ) * cm.makeLongFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.DOUBLE() || type == JavaTypes.pDOUBLE() ) { retValue = makeDoubleValue( makeDoubleValue( lhsValue ) * makeDoubleValue( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.FLOAT() || type == JavaTypes.pFLOAT() ) { retValue = makeFloatValue( makeFloatValue( lhsValue ) * makeFloatValue( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.SHORT() || type == JavaTypes.pSHORT() ) { retValue = Integer.valueOf( cm.makeIntegerFrom( lhsValue ) * cm.makeIntegerFrom( rhsValue ) ).shortValue(); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.BYTE() || type == JavaTypes.pBYTE() ) { retValue = (byte)(cm.makeIntegerFrom( lhsValue ) * cm.makeIntegerFrom( rhsValue )); // depends on control dependency: [if], data = [none] } else { throw new UnsupportedNumberTypeException(type); } break; } case '/': { if( type == JavaTypes.RATIONAL() ) { retValue = cm.makeRationalFrom( lhsValue ).divide( cm.makeRationalFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.BIG_DECIMAL() ) { retValue = cm.makeBigDecimalFrom( lhsValue ).divide( cm.makeBigDecimalFrom( rhsValue ), MathContext.DECIMAL128 ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.BIG_INTEGER() ) { retValue = cm.makeBigIntegerFrom( lhsValue ).divide( cm.makeBigIntegerFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.INTEGER() || type == JavaTypes.pINT() ) { retValue = cm.makeIntegerFrom( lhsValue ) / cm.makeIntegerFrom( rhsValue ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.LONG() || type == JavaTypes.pLONG() ) { retValue = makeLong( cm.makeLongFrom( lhsValue ) / cm.makeLongFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.DOUBLE() || type == JavaTypes.pDOUBLE() ) { retValue = makeDoubleValue( makeDoubleValue( lhsValue ) / makeDoubleValue( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.FLOAT() || type == JavaTypes.pFLOAT() ) { retValue = makeFloatValue( makeFloatValue( lhsValue ) / makeFloatValue( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.SHORT() || type == JavaTypes.pSHORT() ) { retValue = Integer.valueOf( cm.makeIntegerFrom( lhsValue ) / cm.makeIntegerFrom( rhsValue ) ).shortValue(); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.BYTE() || type == JavaTypes.pBYTE() ) { retValue = (byte)(cm.makeIntegerFrom( lhsValue ) / cm.makeIntegerFrom( rhsValue )); // depends on control dependency: [if], data = [none] } else { throw new UnsupportedNumberTypeException(type); } break; } case '%': { if( type == JavaTypes.RATIONAL() ) { retValue = cm.makeRationalFrom( lhsValue ).modulo( cm.makeRationalFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.BIG_DECIMAL() ) { retValue = cm.makeBigDecimalFrom( lhsValue ).remainder( cm.makeBigDecimalFrom( rhsValue ), MathContext.DECIMAL128 ).abs(); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.BIG_INTEGER() ) { retValue = cm.makeBigIntegerFrom( lhsValue ).mod( cm.makeBigIntegerFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.INTEGER() || type == JavaTypes.pINT() ) { retValue = cm.makeIntegerFrom( lhsValue ) % cm.makeIntegerFrom( rhsValue ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.LONG() || type == JavaTypes.pLONG() ) { retValue = makeLong( cm.makeLongFrom( lhsValue ) % cm.makeLongFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.DOUBLE() || type == JavaTypes.pDOUBLE() ) { retValue = makeDoubleValue( makeDoubleValue( lhsValue ) % makeDoubleValue( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.FLOAT() || type == JavaTypes.pFLOAT() ) { retValue = makeFloatValue( makeFloatValue( lhsValue ) % makeFloatValue( rhsValue ) ); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.SHORT() || type == JavaTypes.pSHORT() ) { retValue = Integer.valueOf( cm.makeIntegerFrom( lhsValue ) % cm.makeIntegerFrom( rhsValue ) ).shortValue(); // depends on control dependency: [if], data = [none] } else if( type == JavaTypes.BYTE() || type == JavaTypes.pBYTE() ) { retValue = (byte)(cm.makeIntegerFrom( lhsValue ) % cm.makeIntegerFrom( rhsValue )); // depends on control dependency: [if], data = [none] } else { throw new UnsupportedNumberTypeException(type); } break; } default: retValue = null; } if( retValue != null ) { if( customNumberBase != null ) { //noinspection unchecked retValue = customNumberBase.fromNumber( (Number)retValue ); // depends on control dependency: [if], data = [none] } } return retValue; } }
public class class_name { public EClass getIfcRelConnectsPathElements() { if (ifcRelConnectsPathElementsEClass == null) { ifcRelConnectsPathElementsEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(458); } return ifcRelConnectsPathElementsEClass; } }
public class class_name { public EClass getIfcRelConnectsPathElements() { if (ifcRelConnectsPathElementsEClass == null) { ifcRelConnectsPathElementsEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(458); // depends on control dependency: [if], data = [none] } return ifcRelConnectsPathElementsEClass; } }
public class class_name { public Content getNavLinkNext() { Content li; if (next == null) { li = HtmlTree.LI(nextpackageLabel); } else { DocPath path = DocPath.relativePath(packageDoc, next); li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.profilePackageSummary(profileName)), nextpackageLabel, "", "")); } return li; } }
public class class_name { public Content getNavLinkNext() { Content li; if (next == null) { li = HtmlTree.LI(nextpackageLabel); // depends on control dependency: [if], data = [(next] } else { DocPath path = DocPath.relativePath(packageDoc, next); li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.profilePackageSummary(profileName)), nextpackageLabel, "", "")); // depends on control dependency: [if], data = [none] } return li; } }
public class class_name { String expand(String s) { int i1=0; int i2=0; while(s!=null) { i1=s.indexOf("$(",i2); if(i1<0) break; i2=s.indexOf(")",i1+2); if(i2<0) break; String property=System.getProperty(s.substring(i1+2,i2),""); s=s.substring(0,i1)+property+s.substring(i2+1); } return s; } }
public class class_name { String expand(String s) { int i1=0; int i2=0; while(s!=null) { i1=s.indexOf("$(",i2); // depends on control dependency: [while], data = [none] if(i1<0) break; i2=s.indexOf(")",i1+2); // depends on control dependency: [while], data = [none] if(i2<0) break; String property=System.getProperty(s.substring(i1+2,i2),""); s=s.substring(0,i1)+property+s.substring(i2+1); // depends on control dependency: [while], data = [none] } return s; } }
public class class_name { public VerificationResponse fetch(List<String> urls, String userAgent) throws YubicoVerificationException { List<Future<VerificationResponse>> tasks = new ArrayList<Future<VerificationResponse>>(); for(String url : urls) { tasks.add(completionService.submit(createTask(userAgent, url))); } VerificationResponse response = null; try { int tasksDone = 0; Throwable savedException = null; Future<VerificationResponse> futureResponse = completionService.poll(1L, MINUTES); while(futureResponse != null) { try { tasksDone++; tasks.remove(futureResponse); response = futureResponse.get(); /** * If the response returned is REPLAYED_REQUEST keep looking at responses * and hope we get something else. REPLAYED_REQUEST will be returned if a * validation server got sync before it parsed our query (otp and nonce is * the same). * @see https://forum.yubico.com/viewtopic21be.html * * Also if the response is BACKEND_ERROR, keep looking for a server that * sends a valid response * @see https://github.com/Yubico/yubico-java-client/issues/12 */ if(!response.getStatus().equals(REPLAYED_REQUEST) && !response.getStatus().equals(BACKEND_ERROR)) { break; } } catch (CancellationException ignored) { // this would be thrown by old cancelled calls. tasksDone--; } catch (ExecutionException e) { // tuck the real exception away and use it if we don't get any valid answers. savedException = e.getCause(); } if(tasksDone >= urls.size()) { break; } futureResponse = completionService.poll(1L, MINUTES); } if(futureResponse == null || response == null) { if(savedException != null) { throw new YubicoVerificationException( "Exception while executing validation.", savedException); } else { throw new YubicoVerificationException("Validation timeout."); } } } catch (InterruptedException e) { throw new YubicoVerificationException("Validation interrupted.", e); } for(Future<VerificationResponse> task : tasks) { task.cancel(true); } return response; } }
public class class_name { public VerificationResponse fetch(List<String> urls, String userAgent) throws YubicoVerificationException { List<Future<VerificationResponse>> tasks = new ArrayList<Future<VerificationResponse>>(); for(String url : urls) { tasks.add(completionService.submit(createTask(userAgent, url))); } VerificationResponse response = null; try { int tasksDone = 0; Throwable savedException = null; Future<VerificationResponse> futureResponse = completionService.poll(1L, MINUTES); while(futureResponse != null) { try { tasksDone++; // depends on control dependency: [try], data = [none] tasks.remove(futureResponse); // depends on control dependency: [try], data = [none] response = futureResponse.get(); // depends on control dependency: [try], data = [none] /** * If the response returned is REPLAYED_REQUEST keep looking at responses * and hope we get something else. REPLAYED_REQUEST will be returned if a * validation server got sync before it parsed our query (otp and nonce is * the same). * @see https://forum.yubico.com/viewtopic21be.html * * Also if the response is BACKEND_ERROR, keep looking for a server that * sends a valid response * @see https://github.com/Yubico/yubico-java-client/issues/12 */ if(!response.getStatus().equals(REPLAYED_REQUEST) && !response.getStatus().equals(BACKEND_ERROR)) { break; } } catch (CancellationException ignored) { // this would be thrown by old cancelled calls. tasksDone--; } catch (ExecutionException e) { // depends on control dependency: [catch], data = [none] // tuck the real exception away and use it if we don't get any valid answers. savedException = e.getCause(); } // depends on control dependency: [catch], data = [none] if(tasksDone >= urls.size()) { break; } futureResponse = completionService.poll(1L, MINUTES); // depends on control dependency: [while], data = [none] } if(futureResponse == null || response == null) { if(savedException != null) { throw new YubicoVerificationException( "Exception while executing validation.", savedException); } else { throw new YubicoVerificationException("Validation timeout."); } } } catch (InterruptedException e) { throw new YubicoVerificationException("Validation interrupted.", e); } for(Future<VerificationResponse> task : tasks) { task.cancel(true); } return response; } }
public class class_name { public void assertTopmostElement(By by) { if (!isTopmostElementCheckApplicable(by)) { LOGGER.warn("The element identified by '{}' is not a leaf node in the " + "document tree. Thus, it cannot be checked if the element is topmost. " + "The topmost element check cannot be performed and is skipped.", by); return; } LOGGER.info("Checking whether the element identified by '{}' is the topmost element.", by); WebElement topmostElement = findTopmostElement(by); WebElement element = findElement(by); if (!element.equals(topmostElement)) { throw new AssertionError(format("The element '%s' identified by '%s' is covered by '%s'.", outerHtmlPreview(element), by, outerHtmlPreview(topmostElement))); } } }
public class class_name { public void assertTopmostElement(By by) { if (!isTopmostElementCheckApplicable(by)) { LOGGER.warn("The element identified by '{}' is not a leaf node in the " + "document tree. Thus, it cannot be checked if the element is topmost. " + "The topmost element check cannot be performed and is skipped.", by); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } LOGGER.info("Checking whether the element identified by '{}' is the topmost element.", by); WebElement topmostElement = findTopmostElement(by); WebElement element = findElement(by); if (!element.equals(topmostElement)) { throw new AssertionError(format("The element '%s' identified by '%s' is covered by '%s'.", outerHtmlPreview(element), by, outerHtmlPreview(topmostElement))); } } }
public class class_name { public static void closeAll() { synchronized (LoginManager.class) { for (LoginType loginType : new ArrayList<>(CACHED_INSTANCES.keySet())) { LoginManager loginManager = CACHED_INSTANCES.remove(loginType); loginManager.login.shutdown(); } } } }
public class class_name { public static void closeAll() { synchronized (LoginManager.class) { for (LoginType loginType : new ArrayList<>(CACHED_INSTANCES.keySet())) { LoginManager loginManager = CACHED_INSTANCES.remove(loginType); loginManager.login.shutdown(); // depends on control dependency: [for], data = [none] } } } }
public class class_name { private String getLocalizationMessages(CmsMessages messages) { JSONObject result = new JSONObject(); try { result.put("search", messages.key(Messages.GUI_CODEMIRROR_LANG_SEARCH_0)); result.put("hint", messages.key(Messages.GUI_CODEMIRROR_LANG_HINT_0)); result.put("replace", messages.key(Messages.GUI_CODEMIRROR_LANG_REPLACE_0)); result.put("replacewith", messages.key(Messages.GUI_CODEMIRROR_LANG_REPLACE_WITH_0)); result.put("replaceconfirm", messages.key(Messages.GUI_CODEMIRROR_LANG_REPLACE_CONFIRM_0)); result.put("replaceyes", messages.key(Messages.GUI_CODEMIRROR_LANG_REPLACE_YES_0)); result.put("replaceno", messages.key(Messages.GUI_CODEMIRROR_LANG_RELACE_NO_0)); result.put("replacestop", messages.key(Messages.GUI_CODEMIRROR_LANG_REPLACE_STOP_0)); result.put("fontsize", messages.key(Messages.GUI_CODEMIRROR_LANG_FONT_SIZE_0)); } catch (org.opencms.json.JSONException e) { // should never happen } return result.toString(); } }
public class class_name { private String getLocalizationMessages(CmsMessages messages) { JSONObject result = new JSONObject(); try { result.put("search", messages.key(Messages.GUI_CODEMIRROR_LANG_SEARCH_0)); // depends on control dependency: [try], data = [none] result.put("hint", messages.key(Messages.GUI_CODEMIRROR_LANG_HINT_0)); // depends on control dependency: [try], data = [none] result.put("replace", messages.key(Messages.GUI_CODEMIRROR_LANG_REPLACE_0)); // depends on control dependency: [try], data = [none] result.put("replacewith", messages.key(Messages.GUI_CODEMIRROR_LANG_REPLACE_WITH_0)); // depends on control dependency: [try], data = [none] result.put("replaceconfirm", messages.key(Messages.GUI_CODEMIRROR_LANG_REPLACE_CONFIRM_0)); // depends on control dependency: [try], data = [none] result.put("replaceyes", messages.key(Messages.GUI_CODEMIRROR_LANG_REPLACE_YES_0)); // depends on control dependency: [try], data = [none] result.put("replaceno", messages.key(Messages.GUI_CODEMIRROR_LANG_RELACE_NO_0)); // depends on control dependency: [try], data = [none] result.put("replacestop", messages.key(Messages.GUI_CODEMIRROR_LANG_REPLACE_STOP_0)); // depends on control dependency: [try], data = [none] result.put("fontsize", messages.key(Messages.GUI_CODEMIRROR_LANG_FONT_SIZE_0)); // depends on control dependency: [try], data = [none] } catch (org.opencms.json.JSONException e) { // should never happen } // depends on control dependency: [catch], data = [none] return result.toString(); } }
public class class_name { private void adaptTitleContainerVisibility() { if (titleContainer != null) { if (customTitleView == null && customTitleViewId == -1) { titleContainer.setVisibility( !TextUtils.isEmpty(title) || icon != null ? View.VISIBLE : View.GONE); } else { titleContainer.setVisibility(View.VISIBLE); } } } }
public class class_name { private void adaptTitleContainerVisibility() { if (titleContainer != null) { if (customTitleView == null && customTitleViewId == -1) { titleContainer.setVisibility( !TextUtils.isEmpty(title) || icon != null ? View.VISIBLE : View.GONE); // depends on control dependency: [if], data = [none] } else { titleContainer.setVisibility(View.VISIBLE); // depends on control dependency: [if], data = [none] } } } }
public class class_name { @Override public boolean shouldSchedule(Queue.Task p, List<Action> actions) { Item item = Tasks.getItemOf(p); if (item != null) { lock.readLock().lock(); try { return !_contains(item); } finally { lock.readLock().unlock(); } } return true; } }
public class class_name { @Override public boolean shouldSchedule(Queue.Task p, List<Action> actions) { Item item = Tasks.getItemOf(p); if (item != null) { lock.readLock().lock(); // depends on control dependency: [if], data = [none] try { return !_contains(item); // depends on control dependency: [try], data = [none] } finally { lock.readLock().unlock(); } } return true; } }
public class class_name { public static String randomString( char[] values, int len ) { Random rnd = new SecureRandom(); StringBuilder sb = new StringBuilder( len ); for ( int i = 0; i < len; i++ ) { sb.append( values[ rnd.nextInt( values.length )] ); } return sb.toString(); } }
public class class_name { public static String randomString( char[] values, int len ) { Random rnd = new SecureRandom(); StringBuilder sb = new StringBuilder( len ); for ( int i = 0; i < len; i++ ) { sb.append( values[ rnd.nextInt( values.length )] ); // depends on control dependency: [for], data = [none] } return sb.toString(); } }
public class class_name { @Override public boolean enables(DiagnosticGroup group) { for (WarningsGuard guard : guards) { if (guard.enables(group)) { return true; } else if (guard.disables(group)) { return false; } } return false; } }
public class class_name { @Override public boolean enables(DiagnosticGroup group) { for (WarningsGuard guard : guards) { if (guard.enables(group)) { return true; // depends on control dependency: [if], data = [none] } else if (guard.disables(group)) { return false; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public static void shutDownActorSystemForce() { if (!actorSystem.isTerminated()) { logger.info("shutting down actor system..."); actorSystem.shutdown(); actorSystem.awaitTermination(timeOutDuration); logger.info("Actor system has been shut down."); } else { logger.info("Actor system has been terminated already. NO OP."); } } }
public class class_name { public static void shutDownActorSystemForce() { if (!actorSystem.isTerminated()) { logger.info("shutting down actor system..."); // depends on control dependency: [if], data = [none] actorSystem.shutdown(); // depends on control dependency: [if], data = [none] actorSystem.awaitTermination(timeOutDuration); // depends on control dependency: [if], data = [none] logger.info("Actor system has been shut down."); // depends on control dependency: [if], data = [none] } else { logger.info("Actor system has been terminated already. NO OP."); // depends on control dependency: [if], data = [none] } } }
public class class_name { public DescribeBrokerResult withUsers(UserSummary... users) { if (this.users == null) { setUsers(new java.util.ArrayList<UserSummary>(users.length)); } for (UserSummary ele : users) { this.users.add(ele); } return this; } }
public class class_name { public DescribeBrokerResult withUsers(UserSummary... users) { if (this.users == null) { setUsers(new java.util.ArrayList<UserSummary>(users.length)); // depends on control dependency: [if], data = [none] } for (UserSummary ele : users) { this.users.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { private void addNewWorkUnits(MultiWorkUnitWeightedQueue multiWorkUnitWeightedQueue) { try { List<PartitionAwareFileRetriever.FileInfo> filesToPull = retriever.getFilesToProcess(this.lowWaterMark, this.maxFilesPerJob - this.fileCount); Collections.sort(filesToPull); String topicName = this.sourceDir.getName(); String namespace = this.sourceState.getProp(ConfigurationKeys.EXTRACT_NAMESPACE_NAME_KEY); Map<Long, Extract> extractMap = new HashMap<>(); for (PartitionAwareFileRetriever.FileInfo file : filesToPull) { Extract extract = getExtractForFile(file, topicName, namespace, extractMap); LOG.info("Will process file " + file.getFilePath()); WorkUnit singleWorkUnit = WorkUnit.create(extract); singleWorkUnit.setProp(ConfigurationKeys.SOURCE_ENTITY, topicName); singleWorkUnit.setProp(ConfigurationKeys.SOURCE_FILEBASED_FILES_TO_PULL, file.getFilePath()); singleWorkUnit.setProp(ConfigurationKeys.WORK_UNIT_LOW_WATER_MARK_KEY, file.getWatermarkMsSinceEpoch()); singleWorkUnit.setProp(ConfigurationKeys.WORK_UNIT_HIGH_WATER_MARK_KEY, file.getWatermarkMsSinceEpoch()); singleWorkUnit.setProp(ConfigurationKeys.WORK_UNIT_DATE_PARTITION_KEY, file.getWatermarkMsSinceEpoch()); singleWorkUnit.setProp(ConfigurationKeys.WORK_UNIT_DATE_PARTITION_NAME, file.getPartitionName()); if (this.sourceState.getPropAsBoolean(ConfigurationKeys.SCHEMA_IN_SOURCE_DIR, ConfigurationKeys.DEFAULT_SCHEMA_IN_SOURCE_DIR)) { addSchemaFile(file, singleWorkUnit); } multiWorkUnitWeightedQueue.addWorkUnit(singleWorkUnit, file.getFileSize()); this.fileCount++; } LOG.info("Total number of files extracted for the current run: " + filesToPull.size()); } catch (IOException e) { Throwables.propagate(e); } } }
public class class_name { private void addNewWorkUnits(MultiWorkUnitWeightedQueue multiWorkUnitWeightedQueue) { try { List<PartitionAwareFileRetriever.FileInfo> filesToPull = retriever.getFilesToProcess(this.lowWaterMark, this.maxFilesPerJob - this.fileCount); Collections.sort(filesToPull); // depends on control dependency: [try], data = [none] String topicName = this.sourceDir.getName(); String namespace = this.sourceState.getProp(ConfigurationKeys.EXTRACT_NAMESPACE_NAME_KEY); Map<Long, Extract> extractMap = new HashMap<>(); for (PartitionAwareFileRetriever.FileInfo file : filesToPull) { Extract extract = getExtractForFile(file, topicName, namespace, extractMap); LOG.info("Will process file " + file.getFilePath()); // depends on control dependency: [for], data = [file] WorkUnit singleWorkUnit = WorkUnit.create(extract); singleWorkUnit.setProp(ConfigurationKeys.SOURCE_ENTITY, topicName); // depends on control dependency: [for], data = [none] singleWorkUnit.setProp(ConfigurationKeys.SOURCE_FILEBASED_FILES_TO_PULL, file.getFilePath()); // depends on control dependency: [for], data = [file] singleWorkUnit.setProp(ConfigurationKeys.WORK_UNIT_LOW_WATER_MARK_KEY, file.getWatermarkMsSinceEpoch()); // depends on control dependency: [for], data = [file] singleWorkUnit.setProp(ConfigurationKeys.WORK_UNIT_HIGH_WATER_MARK_KEY, file.getWatermarkMsSinceEpoch()); // depends on control dependency: [for], data = [file] singleWorkUnit.setProp(ConfigurationKeys.WORK_UNIT_DATE_PARTITION_KEY, file.getWatermarkMsSinceEpoch()); // depends on control dependency: [for], data = [file] singleWorkUnit.setProp(ConfigurationKeys.WORK_UNIT_DATE_PARTITION_NAME, file.getPartitionName()); // depends on control dependency: [for], data = [file] if (this.sourceState.getPropAsBoolean(ConfigurationKeys.SCHEMA_IN_SOURCE_DIR, ConfigurationKeys.DEFAULT_SCHEMA_IN_SOURCE_DIR)) { addSchemaFile(file, singleWorkUnit); // depends on control dependency: [if], data = [none] } multiWorkUnitWeightedQueue.addWorkUnit(singleWorkUnit, file.getFileSize()); // depends on control dependency: [for], data = [file] this.fileCount++; // depends on control dependency: [for], data = [file] } LOG.info("Total number of files extracted for the current run: " + filesToPull.size()); // depends on control dependency: [try], data = [none] } catch (IOException e) { Throwables.propagate(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { static void addIfSupported(Set<String> supported, List<String> enabled, String... names) { for (String n: names) { if (supported.contains(n)) { enabled.add(n); } } } }
public class class_name { static void addIfSupported(Set<String> supported, List<String> enabled, String... names) { for (String n: names) { if (supported.contains(n)) { enabled.add(n); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public static final Direction getQuadrant(final double cx, final double cy, final double x0, final double y0) { if ((x0 > cx) && (y0 < cy)) { return Direction.NORTH_EAST; } if ((x0 > cx) && (y0 >= cy)) { return Direction.SOUTH_EAST; } if ((x0 <= cx) && (y0 >= cy)) { return Direction.SOUTH_WEST; } // if( x0 <= c.getX() && y0 < c.getY() ) return Direction.NORTH_WEST; } }
public class class_name { public static final Direction getQuadrant(final double cx, final double cy, final double x0, final double y0) { if ((x0 > cx) && (y0 < cy)) { return Direction.NORTH_EAST; // depends on control dependency: [if], data = [none] } if ((x0 > cx) && (y0 >= cy)) { return Direction.SOUTH_EAST; // depends on control dependency: [if], data = [none] } if ((x0 <= cx) && (y0 >= cy)) { return Direction.SOUTH_WEST; // depends on control dependency: [if], data = [none] } // if( x0 <= c.getX() && y0 < c.getY() ) return Direction.NORTH_WEST; } }
public class class_name { public LocalDate plusMonths(long monthsToAdd) { if (monthsToAdd == 0) { return this; } long monthCount = year * 12L + (month - 1); long calcMonths = monthCount + monthsToAdd; // safe overflow int newYear = YEAR.checkValidIntValue(Jdk8Methods.floorDiv(calcMonths, 12)); int newMonth = Jdk8Methods.floorMod(calcMonths, 12) + 1; return resolvePreviousValid(newYear, newMonth, day); } }
public class class_name { public LocalDate plusMonths(long monthsToAdd) { if (monthsToAdd == 0) { return this; // depends on control dependency: [if], data = [none] } long monthCount = year * 12L + (month - 1); long calcMonths = monthCount + monthsToAdd; // safe overflow int newYear = YEAR.checkValidIntValue(Jdk8Methods.floorDiv(calcMonths, 12)); int newMonth = Jdk8Methods.floorMod(calcMonths, 12) + 1; return resolvePreviousValid(newYear, newMonth, day); } }
public class class_name { private Timestamp addMillisForPrecision(long amount, Precision precision, boolean millisecondsPrecision) { // When millisecondsPrecision is true, the caller must do its own short-circuiting because it must // check the fractional precision. if (!millisecondsPrecision && amount == 0 && _precision == precision) return this; // This strips off the local offset, expressing our fields as if they // were UTC. BigDecimal millis = make_localtime().getDecimalMillis(); millis = millis.add(BigDecimal.valueOf(amount)); Precision newPrecision = _precision.includes(precision) ? _precision : precision; Timestamp ts = new Timestamp(millis, newPrecision, _offset); // Anything with courser-than-millis precision will have been extended // to 3 decimal places due to use of getDecimalMillis(). Compensate for // that by setting the scale such that it is never extended unless // milliseconds precision is being added and the fraction does not yet // have milliseconds precision. int newScale = millisecondsPrecision ? 3 : 0; if (_fraction != null) { newScale = Math.max(newScale, _fraction.scale()); } if (ts._fraction != null) { ts._fraction = newScale == 0 ? null : ts._fraction.setScale(newScale, RoundingMode.FLOOR); } if (_offset != null && _offset != 0) { ts.apply_offset(_offset); } return ts; } }
public class class_name { private Timestamp addMillisForPrecision(long amount, Precision precision, boolean millisecondsPrecision) { // When millisecondsPrecision is true, the caller must do its own short-circuiting because it must // check the fractional precision. if (!millisecondsPrecision && amount == 0 && _precision == precision) return this; // This strips off the local offset, expressing our fields as if they // were UTC. BigDecimal millis = make_localtime().getDecimalMillis(); millis = millis.add(BigDecimal.valueOf(amount)); Precision newPrecision = _precision.includes(precision) ? _precision : precision; Timestamp ts = new Timestamp(millis, newPrecision, _offset); // Anything with courser-than-millis precision will have been extended // to 3 decimal places due to use of getDecimalMillis(). Compensate for // that by setting the scale such that it is never extended unless // milliseconds precision is being added and the fraction does not yet // have milliseconds precision. int newScale = millisecondsPrecision ? 3 : 0; if (_fraction != null) { newScale = Math.max(newScale, _fraction.scale()); // depends on control dependency: [if], data = [none] } if (ts._fraction != null) { ts._fraction = newScale == 0 ? null : ts._fraction.setScale(newScale, RoundingMode.FLOOR); // depends on control dependency: [if], data = [none] } if (_offset != null && _offset != 0) { ts.apply_offset(_offset); // depends on control dependency: [if], data = [(_offset] } return ts; } }
public class class_name { public static MethodInvocation create(Object object, String methodName, Object... args) { Assert.notNull(object, "Object required"); Class<?>[] classArgs = null; if (args != null) { classArgs = new Class<?>[args.length]; for (int i = 0; i < args.length; i++) { classArgs[i] = args[i].getClass(); } } // Determine the type that declares the requested method, taking into account // proxies Class<?> target = AopUtils.getTargetClass(object); if (object instanceof Advised) { Advised a = (Advised) object; if (!a.isProxyTargetClass()) { Class<?>[] possibleInterfaces = a.getProxiedInterfaces(); for (Class<?> possibleInterface : possibleInterfaces) { try { possibleInterface.getMethod(methodName, classArgs); // to get here means no exception happened target = possibleInterface; break; } catch (Exception ignored) { // try the next one } } } } return createFromClass(object, target, methodName, classArgs, args); } }
public class class_name { public static MethodInvocation create(Object object, String methodName, Object... args) { Assert.notNull(object, "Object required"); Class<?>[] classArgs = null; if (args != null) { classArgs = new Class<?>[args.length]; // depends on control dependency: [if], data = [none] for (int i = 0; i < args.length; i++) { classArgs[i] = args[i].getClass(); // depends on control dependency: [for], data = [i] } } // Determine the type that declares the requested method, taking into account // proxies Class<?> target = AopUtils.getTargetClass(object); if (object instanceof Advised) { Advised a = (Advised) object; if (!a.isProxyTargetClass()) { Class<?>[] possibleInterfaces = a.getProxiedInterfaces(); for (Class<?> possibleInterface : possibleInterfaces) { try { possibleInterface.getMethod(methodName, classArgs); // depends on control dependency: [try], data = [none] // to get here means no exception happened target = possibleInterface; // depends on control dependency: [try], data = [none] break; } catch (Exception ignored) { // try the next one } // depends on control dependency: [catch], data = [none] } } } return createFromClass(object, target, methodName, classArgs, args); } }
public class class_name { protected String[] getRow(String masterLanguage, ITextNode textNode, IValueNode valueNode) { List<String> row = new ArrayList<>(); row.add(textNode.getKey()); row.add(valueNode.getStatus().getName()); if (!valueNode.getLanguage().equals(masterLanguage)) { IValueNode masterValueNode = textNode.getValueNode(masterLanguage); if (masterValueNode == null) { row.add(""); } else { row.add(masterValueNode.getValue()); } } row.add(valueNode.getValue()); row.add(textNode.getContext()); return row.toArray(new String[row.size()]); } }
public class class_name { protected String[] getRow(String masterLanguage, ITextNode textNode, IValueNode valueNode) { List<String> row = new ArrayList<>(); row.add(textNode.getKey()); row.add(valueNode.getStatus().getName()); if (!valueNode.getLanguage().equals(masterLanguage)) { IValueNode masterValueNode = textNode.getValueNode(masterLanguage); if (masterValueNode == null) { row.add(""); // depends on control dependency: [if], data = [none] } else { row.add(masterValueNode.getValue()); // depends on control dependency: [if], data = [(masterValueNode] } } row.add(valueNode.getValue()); row.add(textNode.getContext()); return row.toArray(new String[row.size()]); } }
public class class_name { public void remove(Node<T> node) { if (first == node) { removeMin(); return; } if (last == node) { removeMax(); return; } // if both children of root are black, set root to red if ((root.left == null || !root.left.red) && (root.right == null || !root.right.red)) root.red = true; root = remove(root, node); if (root != null) root.red = false; else first = last = null; } }
public class class_name { public void remove(Node<T> node) { if (first == node) { removeMin(); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } if (last == node) { removeMax(); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } // if both children of root are black, set root to red if ((root.left == null || !root.left.red) && (root.right == null || !root.right.red)) root.red = true; root = remove(root, node); if (root != null) root.red = false; else first = last = null; } }
public class class_name { private void monitor() { _lastMonitoringStep = _clock.nanoTime(); _nextAllowedLogging = _lastMonitoringStep; while(!_stopped) { try { _clock.sleepNano(_checkIntervalNano); } catch (InterruptedException e) { break; } monitorStep(); } } }
public class class_name { private void monitor() { _lastMonitoringStep = _clock.nanoTime(); _nextAllowedLogging = _lastMonitoringStep; while(!_stopped) { try { _clock.sleepNano(_checkIntervalNano); // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { break; } // depends on control dependency: [catch], data = [none] monitorStep(); // depends on control dependency: [while], data = [none] } } }
public class class_name { public static <T> WebClient resolveAndSetQueryPart(Request<T> request, WebClient webClient) { HashMap<String, String> queryParts = resolveQueryPart(request); Iterator<String> iterator = queryParts.keySet().iterator(); if (!iterator.hasNext()) { return webClient; } else { while (iterator.hasNext()) { String key = iterator.next(); String value = queryParts.get(key); webClient = webClient.replaceQueryParam(key, value); } } return webClient; } }
public class class_name { public static <T> WebClient resolveAndSetQueryPart(Request<T> request, WebClient webClient) { HashMap<String, String> queryParts = resolveQueryPart(request); Iterator<String> iterator = queryParts.keySet().iterator(); if (!iterator.hasNext()) { return webClient; // depends on control dependency: [if], data = [none] } else { while (iterator.hasNext()) { String key = iterator.next(); String value = queryParts.get(key); webClient = webClient.replaceQueryParam(key, value); // depends on control dependency: [while], data = [none] } } return webClient; } }
public class class_name { public static <T extends Serializable> T decode(byte[] bytes, Class<T> t) { Parameters.checkNotNull(t); Parameters.checkNotNull(bytes); ObjectInputStream ois = null; ByteArrayInputStream in = new ByteArrayInputStream(bytes); try { ois = new ObjectInputStream(in); return Parameters.checkType(ois.readObject(), t); } catch (IOException ex) { throw new DecodingException(ex); } catch (ClassNotFoundException ex) { throw new DecodingException(ex); } finally { IO.close(ois); } } }
public class class_name { public static <T extends Serializable> T decode(byte[] bytes, Class<T> t) { Parameters.checkNotNull(t); Parameters.checkNotNull(bytes); ObjectInputStream ois = null; ByteArrayInputStream in = new ByteArrayInputStream(bytes); try { ois = new ObjectInputStream(in); // depends on control dependency: [try], data = [none] return Parameters.checkType(ois.readObject(), t); // depends on control dependency: [try], data = [none] } catch (IOException ex) { throw new DecodingException(ex); } catch (ClassNotFoundException ex) { // depends on control dependency: [catch], data = [none] throw new DecodingException(ex); } finally { // depends on control dependency: [catch], data = [none] IO.close(ois); } } }
public class class_name { public void add (E e) { // is size greater than capacity increase capacity if (size == data.length) { grow(); } data[size++] = e; } }
public class class_name { public void add (E e) { // is size greater than capacity increase capacity if (size == data.length) { grow(); // depends on control dependency: [if], data = [none] } data[size++] = e; } }
public class class_name { public String encodeURL(String relativePath, String scheme) { StringBuffer urlEncoded = new StringBuffer(); // Context SipContextImpl context = (SipContextImpl) sipManager.getContainer(); // ListenersService List<ListenerService<?>> webServerListeners = context.getWebServerListeners(); // Host String hostname = context.getDeploymentInfoFacade().getDeploymentInfo().getHostName(); // kakonyii: get aliases from undrertow's host service! Set<String> aliases = context.getHostOfDeployment().getAllAliases(); // Needed for http://code.google.com/p/sipservlets/issues/detail?id=150 // to pass TCK test com.bea.sipservlet.tck.agents.api.javax_servlet_sip.ConvergedHttpSessionTest.testEncodeURL002 if (aliases.size() >= 1) { // FIXME would be better to try to match the alias by some path or IP but unaware if this is really needed at this // point // or how it can be effectively done hostname = (String) aliases.toArray()[0]; } // retrieving the port corresponding to the specified scheme // TODO ask EG what if the scheme is not supported on the server ? // kakonyii: find out the port from undertow's web server listeners int port = -1; int i = 0; while (i < webServerListeners.size() && port < 0) { ListenerService<?> listener = webServerListeners.get(i); if (scheme != null && ("http".equalsIgnoreCase(scheme) || "https".equalsIgnoreCase(scheme)) && listener instanceof HttpListenerService) { if (listener.getBinding().getValue() != null) { port = listener.getBinding().getValue().getPort(); if (listener.getBinding().getValue().getAddress() != null) { hostname = listener.getBinding().getValue().getAddress().getHostName(); } } } i++; } urlEncoded = urlEncoded.append(scheme); urlEncoded = urlEncoded.append("://"); urlEncoded = urlEncoded.append(hostname); urlEncoded = urlEncoded.append(":"); urlEncoded = urlEncoded.append(port); // check that at SipContextImpl.getPath(): urlEncoded = urlEncoded.append(context.getPath()); urlEncoded = urlEncoded.append(encodeURL(relativePath)); return urlEncoded.toString(); } }
public class class_name { public String encodeURL(String relativePath, String scheme) { StringBuffer urlEncoded = new StringBuffer(); // Context SipContextImpl context = (SipContextImpl) sipManager.getContainer(); // ListenersService List<ListenerService<?>> webServerListeners = context.getWebServerListeners(); // Host String hostname = context.getDeploymentInfoFacade().getDeploymentInfo().getHostName(); // kakonyii: get aliases from undrertow's host service! Set<String> aliases = context.getHostOfDeployment().getAllAliases(); // Needed for http://code.google.com/p/sipservlets/issues/detail?id=150 // to pass TCK test com.bea.sipservlet.tck.agents.api.javax_servlet_sip.ConvergedHttpSessionTest.testEncodeURL002 if (aliases.size() >= 1) { // FIXME would be better to try to match the alias by some path or IP but unaware if this is really needed at this // point // or how it can be effectively done hostname = (String) aliases.toArray()[0]; // depends on control dependency: [if], data = [none] } // retrieving the port corresponding to the specified scheme // TODO ask EG what if the scheme is not supported on the server ? // kakonyii: find out the port from undertow's web server listeners int port = -1; int i = 0; while (i < webServerListeners.size() && port < 0) { ListenerService<?> listener = webServerListeners.get(i); if (scheme != null && ("http".equalsIgnoreCase(scheme) || "https".equalsIgnoreCase(scheme)) && listener instanceof HttpListenerService) { if (listener.getBinding().getValue() != null) { port = listener.getBinding().getValue().getPort(); // depends on control dependency: [if], data = [none] if (listener.getBinding().getValue().getAddress() != null) { hostname = listener.getBinding().getValue().getAddress().getHostName(); // depends on control dependency: [if], data = [none] } } } i++; // depends on control dependency: [while], data = [none] } urlEncoded = urlEncoded.append(scheme); urlEncoded = urlEncoded.append("://"); urlEncoded = urlEncoded.append(hostname); urlEncoded = urlEncoded.append(":"); urlEncoded = urlEncoded.append(port); // check that at SipContextImpl.getPath(): urlEncoded = urlEncoded.append(context.getPath()); urlEncoded = urlEncoded.append(encodeURL(relativePath)); return urlEncoded.toString(); } }
public class class_name { @Override public List<OCRResult> createDocumentsWithResults(String[] filenames, String[] outputbases, List<ITesseract.RenderedFormat> formats, int pageIteratorLevel) throws TesseractException { if (filenames.length != outputbases.length) { throw new RuntimeException("The two arrays must match in length."); } init(); setTessVariables(); List<OCRResult> results = new ArrayList<OCRResult>(); try { for (int i = 0; i < filenames.length; i++) { File inputFile = new File(filenames[i]); File imageFile = null; try { // if PDF, convert to multi-page TIFF imageFile = ImageIOHelper.getImageFile(inputFile); TessResultRenderer renderer = createRenderers(outputbases[i], formats); int meanTextConfidence = createDocuments(imageFile.getPath(), renderer); List<Word> words = meanTextConfidence > 0 ? getRecognizedWords(pageIteratorLevel) : new ArrayList<Word>(); results.add(new OCRResult(meanTextConfidence, words)); TessDeleteResultRenderer(renderer); } catch (Exception e) { // skip the problematic image file logger.warn(e.getMessage(), e); } finally { // delete temporary TIFF image for PDF if (imageFile != null && imageFile.exists() && imageFile != inputFile && imageFile.getName().startsWith("multipage") && imageFile.getName().endsWith(ImageIOHelper.TIFF_EXT)) { imageFile.delete(); } } } } finally { dispose(); } return results; } }
public class class_name { @Override public List<OCRResult> createDocumentsWithResults(String[] filenames, String[] outputbases, List<ITesseract.RenderedFormat> formats, int pageIteratorLevel) throws TesseractException { if (filenames.length != outputbases.length) { throw new RuntimeException("The two arrays must match in length."); } init(); setTessVariables(); List<OCRResult> results = new ArrayList<OCRResult>(); try { for (int i = 0; i < filenames.length; i++) { File inputFile = new File(filenames[i]); File imageFile = null; try { // if PDF, convert to multi-page TIFF imageFile = ImageIOHelper.getImageFile(inputFile); // depends on control dependency: [try], data = [none] TessResultRenderer renderer = createRenderers(outputbases[i], formats); int meanTextConfidence = createDocuments(imageFile.getPath(), renderer); List<Word> words = meanTextConfidence > 0 ? getRecognizedWords(pageIteratorLevel) : new ArrayList<Word>(); results.add(new OCRResult(meanTextConfidence, words)); // depends on control dependency: [try], data = [none] TessDeleteResultRenderer(renderer); // depends on control dependency: [try], data = [none] } catch (Exception e) { // skip the problematic image file logger.warn(e.getMessage(), e); } finally { // depends on control dependency: [catch], data = [none] // delete temporary TIFF image for PDF if (imageFile != null && imageFile.exists() && imageFile != inputFile && imageFile.getName().startsWith("multipage") && imageFile.getName().endsWith(ImageIOHelper.TIFF_EXT)) { imageFile.delete(); // depends on control dependency: [if], data = [none] } } } } finally { dispose(); } return results; } }
public class class_name { protected SortOrder convertSortOrder() { final String sortOrder = getSortOrder(); if (sortOrder == null) { return SortOrder.UNSORTED; } else { final SortOrder result = SortOrder.valueOf(sortOrder.toUpperCase(Locale.ENGLISH)); return result; } } }
public class class_name { protected SortOrder convertSortOrder() { final String sortOrder = getSortOrder(); if (sortOrder == null) { return SortOrder.UNSORTED; // depends on control dependency: [if], data = [none] } else { final SortOrder result = SortOrder.valueOf(sortOrder.toUpperCase(Locale.ENGLISH)); return result; // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(Project project, ProtocolMarshaller protocolMarshaller) { if (project == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(project.getName(), NAME_BINDING); protocolMarshaller.marshall(project.getArn(), ARN_BINDING); protocolMarshaller.marshall(project.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(project.getSource(), SOURCE_BINDING); protocolMarshaller.marshall(project.getSecondarySources(), SECONDARYSOURCES_BINDING); protocolMarshaller.marshall(project.getArtifacts(), ARTIFACTS_BINDING); protocolMarshaller.marshall(project.getSecondaryArtifacts(), SECONDARYARTIFACTS_BINDING); protocolMarshaller.marshall(project.getCache(), CACHE_BINDING); protocolMarshaller.marshall(project.getEnvironment(), ENVIRONMENT_BINDING); protocolMarshaller.marshall(project.getServiceRole(), SERVICEROLE_BINDING); protocolMarshaller.marshall(project.getTimeoutInMinutes(), TIMEOUTINMINUTES_BINDING); protocolMarshaller.marshall(project.getQueuedTimeoutInMinutes(), QUEUEDTIMEOUTINMINUTES_BINDING); protocolMarshaller.marshall(project.getEncryptionKey(), ENCRYPTIONKEY_BINDING); protocolMarshaller.marshall(project.getTags(), TAGS_BINDING); protocolMarshaller.marshall(project.getCreated(), CREATED_BINDING); protocolMarshaller.marshall(project.getLastModified(), LASTMODIFIED_BINDING); protocolMarshaller.marshall(project.getWebhook(), WEBHOOK_BINDING); protocolMarshaller.marshall(project.getVpcConfig(), VPCCONFIG_BINDING); protocolMarshaller.marshall(project.getBadge(), BADGE_BINDING); protocolMarshaller.marshall(project.getLogsConfig(), LOGSCONFIG_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(Project project, ProtocolMarshaller protocolMarshaller) { if (project == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(project.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getArn(), ARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getDescription(), DESCRIPTION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getSource(), SOURCE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getSecondarySources(), SECONDARYSOURCES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getArtifacts(), ARTIFACTS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getSecondaryArtifacts(), SECONDARYARTIFACTS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getCache(), CACHE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getEnvironment(), ENVIRONMENT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getServiceRole(), SERVICEROLE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getTimeoutInMinutes(), TIMEOUTINMINUTES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getQueuedTimeoutInMinutes(), QUEUEDTIMEOUTINMINUTES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getEncryptionKey(), ENCRYPTIONKEY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getTags(), TAGS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getCreated(), CREATED_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getLastModified(), LASTMODIFIED_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getWebhook(), WEBHOOK_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getVpcConfig(), VPCCONFIG_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getBadge(), BADGE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(project.getLogsConfig(), LOGSCONFIG_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 { private void internalCleanup() { if(hasBroker()) { PersistenceBroker broker = getBroker(); if(log.isDebugEnabled()) { log.debug("Do internal cleanup and close the internal used connection without" + " closing the used broker"); } ConnectionManagerIF cm = broker.serviceConnectionManager(); if(cm.isInLocalTransaction()) { /* arminw: in managed environment this call will be ignored because, the JTA transaction manager control the connection status. But to make connectionManager happy we have to complete the "local tx" of the connectionManager before release the connection */ cm.localCommit(); } cm.releaseConnection(); } } }
public class class_name { private void internalCleanup() { if(hasBroker()) { PersistenceBroker broker = getBroker(); if(log.isDebugEnabled()) { log.debug("Do internal cleanup and close the internal used connection without" + " closing the used broker"); // depends on control dependency: [if], data = [none] } ConnectionManagerIF cm = broker.serviceConnectionManager(); if(cm.isInLocalTransaction()) { /* arminw: in managed environment this call will be ignored because, the JTA transaction manager control the connection status. But to make connectionManager happy we have to complete the "local tx" of the connectionManager before release the connection */ cm.localCommit(); // depends on control dependency: [if], data = [none] } cm.releaseConnection(); // depends on control dependency: [if], data = [none] } } }
public class class_name { ServiceEndpoint getServiceEndpoint(String servicePath) { synchronized (serviceMap) { ServiceEndpoint sep = serviceMap.get(servicePath); if (sep == null) { sep = new ServiceEndpoint(endpoint, servicePath); serviceMap.put(servicePath, sep); } return sep; } } }
public class class_name { ServiceEndpoint getServiceEndpoint(String servicePath) { synchronized (serviceMap) { ServiceEndpoint sep = serviceMap.get(servicePath); if (sep == null) { sep = new ServiceEndpoint(endpoint, servicePath); // depends on control dependency: [if], data = [none] serviceMap.put(servicePath, sep); // depends on control dependency: [if], data = [none] } return sep; } } }
public class class_name { public void shutdownNow() { log.tracef("Stopping limited executor %s", name); running = false; lock.lock(); try { queue.clear(); for (Thread t : threads.keySet()) { t.interrupt(); } } finally { lock.unlock(); } } }
public class class_name { public void shutdownNow() { log.tracef("Stopping limited executor %s", name); running = false; lock.lock(); try { queue.clear(); // depends on control dependency: [try], data = [none] for (Thread t : threads.keySet()) { t.interrupt(); // depends on control dependency: [for], data = [t] } } finally { lock.unlock(); } } }
public class class_name { public static double[] solveLinearEquationSymmetric(double[][] matrix, double[] vector) { if(isSolverUseApacheCommonsMath) { DecompositionSolver solver = new LUDecomposition(new Array2DRowRealMatrix(matrix)).getSolver(); return solver.solve(new Array2DRowRealMatrix(vector)).getColumn(0); } else { return org.jblas.Solve.solveSymmetric(new org.jblas.DoubleMatrix(matrix), new org.jblas.DoubleMatrix(vector)).data; /* To use the linear algebra package colt from cern. cern.colt.matrix.linalg.Algebra linearAlgebra = new cern.colt.matrix.linalg.Algebra(); double[] x = linearAlgebra.solve(new DenseDoubleMatrix2D(A), linearAlgebra.transpose(new DenseDoubleMatrix2D(new double[][] { b }))).viewColumn(0).toArray(); return x; */ } } }
public class class_name { public static double[] solveLinearEquationSymmetric(double[][] matrix, double[] vector) { if(isSolverUseApacheCommonsMath) { DecompositionSolver solver = new LUDecomposition(new Array2DRowRealMatrix(matrix)).getSolver(); return solver.solve(new Array2DRowRealMatrix(vector)).getColumn(0); // depends on control dependency: [if], data = [none] } else { return org.jblas.Solve.solveSymmetric(new org.jblas.DoubleMatrix(matrix), new org.jblas.DoubleMatrix(vector)).data; // depends on control dependency: [if], data = [none] /* To use the linear algebra package colt from cern. cern.colt.matrix.linalg.Algebra linearAlgebra = new cern.colt.matrix.linalg.Algebra(); double[] x = linearAlgebra.solve(new DenseDoubleMatrix2D(A), linearAlgebra.transpose(new DenseDoubleMatrix2D(new double[][] { b }))).viewColumn(0).toArray(); return x; */ } } }
public class class_name { @Override public void unregisterConsumer(LocalMessageConsumer consumer) { super.unregisterConsumer(consumer); if (!consumer.isDurable()) { log.debug("Removing non-durable subscription "+consumer.getSubscriberId()); subscriptionsLock.writeLock().lock(); try { LocalTopicSubscription subscription = subscriptionMap.remove(consumer.getSubscriberId()); if (subscription != null) removeSubscription(subscription); } finally { subscriptionsLock.writeLock().unlock(); } } } }
public class class_name { @Override public void unregisterConsumer(LocalMessageConsumer consumer) { super.unregisterConsumer(consumer); if (!consumer.isDurable()) { log.debug("Removing non-durable subscription "+consumer.getSubscriberId()); // depends on control dependency: [if], data = [none] subscriptionsLock.writeLock().lock(); // depends on control dependency: [if], data = [none] try { LocalTopicSubscription subscription = subscriptionMap.remove(consumer.getSubscriberId()); if (subscription != null) removeSubscription(subscription); } finally { subscriptionsLock.writeLock().unlock(); } } } }
public class class_name { private TrieNode buildTrie(BinaryComparable[] splits, int lower, int upper, byte[] prefix, int maxDepth) { final int depth = prefix.length; if (depth >= maxDepth || lower == upper) { return new LeafTrieNode(depth, splits, lower, upper); } InnerTrieNode result = new InnerTrieNode(depth); byte[] trial = Arrays.copyOf(prefix, prefix.length + 1); // append an extra byte on to the prefix int currentBound = lower; for(int ch = 0; ch < 255; ++ch) { trial[depth] = (byte) (ch + 1); lower = currentBound; while (currentBound < upper) { if (splits[currentBound].compareTo(trial, 0, trial.length) >= 0) { break; } currentBound += 1; } trial[depth] = (byte) ch; result.child[0xFF & ch] = buildTrie(splits, lower, currentBound, trial, maxDepth); } // pick up the rest trial[depth] = 127; result.child[255] = buildTrie(splits, currentBound, upper, trial, maxDepth); return result; } }
public class class_name { private TrieNode buildTrie(BinaryComparable[] splits, int lower, int upper, byte[] prefix, int maxDepth) { final int depth = prefix.length; if (depth >= maxDepth || lower == upper) { return new LeafTrieNode(depth, splits, lower, upper); // depends on control dependency: [if], data = [upper)] } InnerTrieNode result = new InnerTrieNode(depth); byte[] trial = Arrays.copyOf(prefix, prefix.length + 1); // append an extra byte on to the prefix int currentBound = lower; for(int ch = 0; ch < 255; ++ch) { trial[depth] = (byte) (ch + 1); // depends on control dependency: [for], data = [ch] lower = currentBound; // depends on control dependency: [for], data = [none] while (currentBound < upper) { if (splits[currentBound].compareTo(trial, 0, trial.length) >= 0) { break; } currentBound += 1; // depends on control dependency: [while], data = [none] } trial[depth] = (byte) ch; // depends on control dependency: [for], data = [ch] result.child[0xFF & ch] = buildTrie(splits, lower, currentBound, trial, maxDepth); // depends on control dependency: [for], data = [ch] } // pick up the rest trial[depth] = 127; result.child[255] = buildTrie(splits, currentBound, upper, trial, maxDepth); return result; } }
public class class_name { private void validateArgumentDefinitions() { for (final NamedArgumentDefinition mutexSourceDef : namedArgumentDefinitions) { for (final String mutexTarget : mutexSourceDef.getMutexTargetList()) { final NamedArgumentDefinition mutexTargetDef = namedArgumentsDefinitionsByAlias.get(mutexTarget); if (mutexTargetDef == null) { throw new CommandLineException.CommandLineParserInternalException( String.format("Argument '%s' references a nonexistent mutex argument '%s'", mutexSourceDef.getArgumentAliasDisplayString(), mutexTarget) ); } else { // Add at least one alias for the mutex source to the mutex target to ensure the // relationship is symmetric for purposes of usage/help doc display. mutexTargetDef.addMutexTarget(mutexSourceDef.getLongName()); } } } } }
public class class_name { private void validateArgumentDefinitions() { for (final NamedArgumentDefinition mutexSourceDef : namedArgumentDefinitions) { for (final String mutexTarget : mutexSourceDef.getMutexTargetList()) { final NamedArgumentDefinition mutexTargetDef = namedArgumentsDefinitionsByAlias.get(mutexTarget); if (mutexTargetDef == null) { throw new CommandLineException.CommandLineParserInternalException( String.format("Argument '%s' references a nonexistent mutex argument '%s'", mutexSourceDef.getArgumentAliasDisplayString(), mutexTarget) ); } else { // Add at least one alias for the mutex source to the mutex target to ensure the // relationship is symmetric for purposes of usage/help doc display. mutexTargetDef.addMutexTarget(mutexSourceDef.getLongName()); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public void removeEntry(Data key, Object value, Index.OperationSource operationSource) { InternalIndex[] indexes = getIndexes(); for (InternalIndex index : indexes) { index.removeEntry(key, value, operationSource); } } }
public class class_name { public void removeEntry(Data key, Object value, Index.OperationSource operationSource) { InternalIndex[] indexes = getIndexes(); for (InternalIndex index : indexes) { index.removeEntry(key, value, operationSource); // depends on control dependency: [for], data = [index] } } }
public class class_name { public static byte[] getBytesUTF8(String string) { if (string == null) { return null; } try { return string.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { // This never happens. return null; } } }
public class class_name { public static byte[] getBytesUTF8(String string) { if (string == null) { return null; // depends on control dependency: [if], data = [none] } try { return string.getBytes("UTF-8"); // depends on control dependency: [try], data = [none] } catch (UnsupportedEncodingException e) { // This never happens. return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public final Object getValue(int varNum) { int index = getValueIndex(varNum); if (index < 0) { return null; } else { return values[index]; } } }
public class class_name { public final Object getValue(int varNum) { int index = getValueIndex(varNum); if (index < 0) { return null; // depends on control dependency: [if], data = [none] } else { return values[index]; // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public boolean accept(final Buffer data) throws IOException { // a RTP packet has at least 12 bytes. Check that if (data.getReadableBytes() < 12) { // not enough bytes but see if we actually could // get another 12 bytes by forcing the underlying // implementation to read further ahead data.markReaderIndex(); try { final Buffer b = data.readBytes(12); if (b.capacity() < 12) { return false; } } catch (final IndexOutOfBoundsException e) { // guess not... return false; } finally { data.resetReaderIndex(); } } // both RTP and RTCP has a 2 in this field // so if that isn't the case then it cannot // be RTP nor RTCP final byte b = data.getByte(0); if (!((b & 0xC0) >> 6 == 0x02)) { return false; } // The second byte is for RTCP equal to the Packet Type (pt) // and if following the guidelines of RFC 5761 (section 4) then // RTP Payload Type + 128 != RTCP Packet Type final byte b2 = data.getByte(1); if (b2 == (byte) 0xc8 || b2 == (byte) 0xc9 || b2 == (byte) 0xca || b2 == (byte) 0xcb || b2 == (byte) 0xcc) { return false; } return true; } }
public class class_name { @Override public boolean accept(final Buffer data) throws IOException { // a RTP packet has at least 12 bytes. Check that if (data.getReadableBytes() < 12) { // not enough bytes but see if we actually could // get another 12 bytes by forcing the underlying // implementation to read further ahead data.markReaderIndex(); try { final Buffer b = data.readBytes(12); if (b.capacity() < 12) { return false; // depends on control dependency: [if], data = [none] } } catch (final IndexOutOfBoundsException e) { // guess not... return false; } finally { data.resetReaderIndex(); } } // both RTP and RTCP has a 2 in this field // so if that isn't the case then it cannot // be RTP nor RTCP final byte b = data.getByte(0); if (!((b & 0xC0) >> 6 == 0x02)) { return false; } // The second byte is for RTCP equal to the Packet Type (pt) // and if following the guidelines of RFC 5761 (section 4) then // RTP Payload Type + 128 != RTCP Packet Type final byte b2 = data.getByte(1); if (b2 == (byte) 0xc8 || b2 == (byte) 0xc9 || b2 == (byte) 0xca || b2 == (byte) 0xcb || b2 == (byte) 0xcc) { return false; } return true; } }
public class class_name { public static <T> T invoke(MethodHandle methodHandle, Object... params) { try { return (T)methodHandle.invokeWithArguments(params); } catch (RuntimeException e) { throw e; } catch (Throwable throwable) { throw new RuntimeException(throwable); } } }
public class class_name { public static <T> T invoke(MethodHandle methodHandle, Object... params) { try { return (T)methodHandle.invokeWithArguments(params); // depends on control dependency: [try], data = [none] } catch (RuntimeException e) { throw e; } catch (Throwable throwable) { // depends on control dependency: [catch], data = [none] throw new RuntimeException(throwable); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private void internalRelease() { // try { // setKey(null); // getNotifier().unlistenAll(getWaveReady()); callAnnotatedMethod(OnRelease.class); if (localFacade() != null) { localFacade().unregister(key()); } // thisObject.ready = false; // Shall also release all InnerComponent if (getInnerComponentMap().isPresent()) { final List<Component<?>> toRemove = new ArrayList<>(); for (final Component<?> innerComponent : getInnerComponentMap().get().values()) { // Release the InnerComponent innerComponent.release(); // Store it to avoid co-modification error toRemove.add(innerComponent); } for (final Component<?> innerComponent : toRemove) { // Remove it from the list // getInnerComponentList().get().remove(innerComponent); // Then remove it from map getInnerComponentMap().get().remove(innerComponent.key()); } } // } catch (final JRebirthThreadException jte) { // LOGGER.error(COMPONENT_RELEASE_ERROR, jte); // } } }
public class class_name { private void internalRelease() { // try { // setKey(null); // getNotifier().unlistenAll(getWaveReady()); callAnnotatedMethod(OnRelease.class); if (localFacade() != null) { localFacade().unregister(key()); // depends on control dependency: [if], data = [none] } // thisObject.ready = false; // Shall also release all InnerComponent if (getInnerComponentMap().isPresent()) { final List<Component<?>> toRemove = new ArrayList<>(); // depends on control dependency: [if], data = [none] for (final Component<?> innerComponent : getInnerComponentMap().get().values()) { // Release the InnerComponent innerComponent.release(); // depends on control dependency: [for], data = [innerComponent] // Store it to avoid co-modification error toRemove.add(innerComponent); // depends on control dependency: [for], data = [innerComponent] } for (final Component<?> innerComponent : toRemove) { // Remove it from the list // getInnerComponentList().get().remove(innerComponent); // Then remove it from map getInnerComponentMap().get().remove(innerComponent.key()); // depends on control dependency: [for], data = [innerComponent] } } // } catch (final JRebirthThreadException jte) { // LOGGER.error(COMPONENT_RELEASE_ERROR, jte); // } } }
public class class_name { public void setExportHeader(String exportHeader) { if (CmsStringUtil.splitAsArray(exportHeader, ':').length == 2) { if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_EXPORT_HEADERS_1, exportHeader)); } m_exportHeaders.add(exportHeader); } else { if (CmsLog.INIT.isWarnEnabled()) { CmsLog.INIT.warn(Messages.get().getBundle().key(Messages.INIT_INVALID_HEADER_1, exportHeader)); } } } }
public class class_name { public void setExportHeader(String exportHeader) { if (CmsStringUtil.splitAsArray(exportHeader, ':').length == 2) { if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_EXPORT_HEADERS_1, exportHeader)); // depends on control dependency: [if], data = [none] } m_exportHeaders.add(exportHeader); // depends on control dependency: [if], data = [none] } else { if (CmsLog.INIT.isWarnEnabled()) { CmsLog.INIT.warn(Messages.get().getBundle().key(Messages.INIT_INVALID_HEADER_1, exportHeader)); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public static void multTransA(ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c ) { if( a.numCols >= EjmlParameters.CMULT_COLUMN_SWITCH || b.numCols >= EjmlParameters.CMULT_COLUMN_SWITCH ) { MatrixMatrixMult_ZDRM.multTransA_reorder(a, b, c); } else { MatrixMatrixMult_ZDRM.multTransA_small(a, b, c); } } }
public class class_name { public static void multTransA(ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c ) { if( a.numCols >= EjmlParameters.CMULT_COLUMN_SWITCH || b.numCols >= EjmlParameters.CMULT_COLUMN_SWITCH ) { MatrixMatrixMult_ZDRM.multTransA_reorder(a, b, c); // depends on control dependency: [if], data = [none] } else { MatrixMatrixMult_ZDRM.multTransA_small(a, b, c); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static MultiStatus lookup(List<MultiStatus> lst, Name name, int status) { for (MultiStatus ms : lst) { if (status == ms.status && name.equals(ms.property.getName())) { return ms; } } return null; } }
public class class_name { public static MultiStatus lookup(List<MultiStatus> lst, Name name, int status) { for (MultiStatus ms : lst) { if (status == ms.status && name.equals(ms.property.getName())) { return ms; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public int chn2Num(String str,Loc loc){ int tempNum; int num=0,init=loc.v,init2=loc.v; int flag=63;//"111111"亿万千百十 int len=str.length(); int chr; while(init<len){ //十的情况比较特殊,故单独判断。如十三 不必如二十三一般有前置数字; if((flag&2)>0 && str.charAt(init)=='十'){//flag>0即允许出现十的状态 flag&=63-14;//出现十之后下个单位不可能是千百十 tempNum=10; init++; } else{ //不接受数字则结束 if((flag&1)==0){ loc.v=init; break; } flag-=1;//置末位0 //判断数字 tempNum=chn2Num(str.charAt(init)); if(tempNum<0){ loc.v=init; break;//不能识别,结束 } init++; if(tempNum==0){ flag|=1; continue; } //判断单位字符是否存在 if(init>=len){ loc.v=init; num+=tempNum; break; } chr=str.charAt(init); //判断十 if((flag&2)>0 && chr=='十'){ flag&=63-14;//出现十之后下个单位不可能是千百十 flag|=1;//可以接受个位 tempNum*=10; init++; } //判断百 else if((flag&4)>0 && chr=='百'){ flag&=63-12;//出现百之后下个单位不可能是千百 flag|=1;//可以接受个位 tempNum*=100; init++; } //判断千 else if((flag&8)>0 && chr=='千'){ flag&=63-8;//出现百之后下个单位不可能是千 flag|=1;//可以接受个位 tempNum*=1000; init++; } } num+=tempNum; //判断单位字符是否存在 并识别万 if(init<len){ chr=str.charAt(init); if((flag&16)>0 && chr=='万'){ flag=15;//万之后不再出现万,也不会有亿 num*=10000; init++; loc.v=init; int numNext=this.chn2Num(str, loc); if(numNext>0) num+=numNext; break; } else if((flag&32)>0 && chr=='亿'){ flag=31;//亿之后不再出现亿 num*=100000000; init++; loc.v=init; int numNext=this.chn2Num(str, loc); if(numNext>0) num+=numNext; break; } } continue; } if(init2!=init) return num; else return -1; } }
public class class_name { public int chn2Num(String str,Loc loc){ int tempNum; int num=0,init=loc.v,init2=loc.v; int flag=63;//"111111"亿万千百十 int len=str.length(); int chr; while(init<len){ //十的情况比较特殊,故单独判断。如十三 不必如二十三一般有前置数字; if((flag&2)>0 && str.charAt(init)=='十'){//flag>0即允许出现十的状态 flag&=63-14;//出现十之后下个单位不可能是千百十 // depends on control dependency: [if], data = [none] tempNum=10; // depends on control dependency: [if], data = [none] init++; // depends on control dependency: [if], data = [none] } else{ //不接受数字则结束 if((flag&1)==0){ loc.v=init; // depends on control dependency: [if], data = [none] break; } flag-=1;//置末位0 // depends on control dependency: [if], data = [none] //判断数字 tempNum=chn2Num(str.charAt(init)); // depends on control dependency: [if], data = [none] if(tempNum<0){ loc.v=init; // depends on control dependency: [if], data = [none] break;//不能识别,结束 } init++; // depends on control dependency: [if], data = [none] if(tempNum==0){ flag|=1; // depends on control dependency: [if], data = [none] continue; } //判断单位字符是否存在 if(init>=len){ loc.v=init; // depends on control dependency: [if], data = [none] num+=tempNum; // depends on control dependency: [if], data = [none] break; } chr=str.charAt(init); // depends on control dependency: [if], data = [none] //判断十 if((flag&2)>0 && chr=='十'){ flag&=63-14;//出现十之后下个单位不可能是千百十 // depends on control dependency: [if], data = [none] flag|=1;//可以接受个位 // depends on control dependency: [if], data = [none] tempNum*=10; // depends on control dependency: [if], data = [none] init++; // depends on control dependency: [if], data = [none] } //判断百 else if((flag&4)>0 && chr=='百'){ flag&=63-12;//出现百之后下个单位不可能是千百 // depends on control dependency: [if], data = [none] flag|=1;//可以接受个位 // depends on control dependency: [if], data = [none] tempNum*=100; // depends on control dependency: [if], data = [none] init++; // depends on control dependency: [if], data = [none] } //判断千 else if((flag&8)>0 && chr=='千'){ flag&=63-8;//出现百之后下个单位不可能是千 // depends on control dependency: [if], data = [none] flag|=1;//可以接受个位 // depends on control dependency: [if], data = [none] tempNum*=1000; // depends on control dependency: [if], data = [none] init++; // depends on control dependency: [if], data = [none] } } num+=tempNum; // depends on control dependency: [while], data = [none] //判断单位字符是否存在 并识别万 if(init<len){ chr=str.charAt(init); // depends on control dependency: [if], data = [(init] if((flag&16)>0 && chr=='万'){ flag=15;//万之后不再出现万,也不会有亿 // depends on control dependency: [if], data = [none] num*=10000; // depends on control dependency: [if], data = [none] init++; // depends on control dependency: [if], data = [none] loc.v=init; // depends on control dependency: [if], data = [none] int numNext=this.chn2Num(str, loc); if(numNext>0) num+=numNext; break; } else if((flag&32)>0 && chr=='亿'){ flag=31;//亿之后不再出现亿 // depends on control dependency: [if], data = [none] num*=100000000; // depends on control dependency: [if], data = [none] init++; // depends on control dependency: [if], data = [none] loc.v=init; // depends on control dependency: [if], data = [none] int numNext=this.chn2Num(str, loc); if(numNext>0) num+=numNext; break; } } continue; } if(init2!=init) return num; else return -1; } }
public class class_name { public void put(Resource resource, Resource.Iterator iterator) { assert (resource != null); Integer key = Integer.valueOf(System.identityHashCode(resource)); if (iterator != null) { map.put(key, iterator); } else { map.remove(key); } } }
public class class_name { public void put(Resource resource, Resource.Iterator iterator) { assert (resource != null); Integer key = Integer.valueOf(System.identityHashCode(resource)); if (iterator != null) { map.put(key, iterator); // depends on control dependency: [if], data = [none] } else { map.remove(key); // depends on control dependency: [if], data = [none] } } }
public class class_name { public synchronized void scavenge() throws InterruptedException { int delta = this.totalCount - config.getMinSize(); if (delta <= 0) return; int removed = 0; long now = System.currentTimeMillis(); Poolable<T> obj; while (delta-- > 0 && (obj = objectQueue.poll()) != null) { // performance trade off: delta always decrease even if the queue is empty, // so it could take several intervals to shrink the pool to the configured min value. if (Log.isDebug()) Log.debug("obj=", obj, ", now-last=", now - obj.getLastAccessTs(), ", max idle=", config.getMaxIdleMilliseconds()); if (now - obj.getLastAccessTs() > config.getMaxIdleMilliseconds() && ThreadLocalRandom.current().nextDouble(1) < config.getScavengeRatio()) { decreaseObject(obj); // shrink the pool size if the object reaches max idle time removed++; } else { objectQueue.put(obj); //put it back } } if (removed > 0) Log.debug(removed, " objects were scavenged."); } }
public class class_name { public synchronized void scavenge() throws InterruptedException { int delta = this.totalCount - config.getMinSize(); if (delta <= 0) return; int removed = 0; long now = System.currentTimeMillis(); Poolable<T> obj; while (delta-- > 0 && (obj = objectQueue.poll()) != null) { // performance trade off: delta always decrease even if the queue is empty, // so it could take several intervals to shrink the pool to the configured min value. if (Log.isDebug()) Log.debug("obj=", obj, ", now-last=", now - obj.getLastAccessTs(), ", max idle=", config.getMaxIdleMilliseconds()); if (now - obj.getLastAccessTs() > config.getMaxIdleMilliseconds() && ThreadLocalRandom.current().nextDouble(1) < config.getScavengeRatio()) { decreaseObject(obj); // shrink the pool size if the object reaches max idle time // depends on control dependency: [if], data = [none] removed++; // depends on control dependency: [if], data = [none] } else { objectQueue.put(obj); //put it back // depends on control dependency: [if], data = [none] } } if (removed > 0) Log.debug(removed, " objects were scavenged."); } }
public class class_name { public QiniuBlockResponseData createBlockInQiniu(int blockSize, int firstChunkSize, final byte[] firstChunkData, int retry) { try { String endPoint = String.format(QINIU_CREATE_BLOCK_EP, this.uploadUrl, blockSize); Request.Builder builder = new Request.Builder(); builder.url(endPoint); builder.addHeader(HEAD_CONTENT_TYPE, DEFAULT_CONTENT_TYPE); builder.addHeader(HEAD_CONTENT_LENGTH, String.valueOf(firstChunkSize)); builder.addHeader(HEAD_AUTHORIZATION, "UpToken " + this.uploadToken); LOGGER.d("createBlockInQiniu with uploadUrl: " + endPoint); RequestBody requestBody = RequestBody.create(MediaType.parse(DEFAULT_CONTENT_TYPE), firstChunkData, 0, firstChunkSize); builder = builder.post(requestBody); Response response = this.client.newCall(builder.build()).execute(); return parseQiniuResponse(response, QiniuBlockResponseData.class); } catch (Exception e) { if (retry-- > 0) { return createBlockInQiniu(blockSize, firstChunkSize, firstChunkData, retry); } else { LOGGER.w(e); } } return null; } }
public class class_name { public QiniuBlockResponseData createBlockInQiniu(int blockSize, int firstChunkSize, final byte[] firstChunkData, int retry) { try { String endPoint = String.format(QINIU_CREATE_BLOCK_EP, this.uploadUrl, blockSize); Request.Builder builder = new Request.Builder(); builder.url(endPoint); // depends on control dependency: [try], data = [none] builder.addHeader(HEAD_CONTENT_TYPE, DEFAULT_CONTENT_TYPE); // depends on control dependency: [try], data = [none] builder.addHeader(HEAD_CONTENT_LENGTH, String.valueOf(firstChunkSize)); // depends on control dependency: [try], data = [none] builder.addHeader(HEAD_AUTHORIZATION, "UpToken " + this.uploadToken); // depends on control dependency: [try], data = [none] LOGGER.d("createBlockInQiniu with uploadUrl: " + endPoint); // depends on control dependency: [try], data = [none] RequestBody requestBody = RequestBody.create(MediaType.parse(DEFAULT_CONTENT_TYPE), firstChunkData, 0, firstChunkSize); builder = builder.post(requestBody); // depends on control dependency: [try], data = [none] Response response = this.client.newCall(builder.build()).execute(); return parseQiniuResponse(response, QiniuBlockResponseData.class); // depends on control dependency: [try], data = [none] } catch (Exception e) { if (retry-- > 0) { return createBlockInQiniu(blockSize, firstChunkSize, firstChunkData, retry); // depends on control dependency: [if], data = [none] } else { LOGGER.w(e); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] return null; } }
public class class_name { public BeanO activateBean(EJBThreadData threadData, ContainerTx tx, BeanId beanId) throws RemoteException { BeanO beanO = null; try { beanO = beanId.getActivationStrategy().atActivate(threadData, tx, beanId); // d630940 } finally { if (beanO != null) { threadData.popCallbackBeanO(); } } return beanO; } }
public class class_name { public BeanO activateBean(EJBThreadData threadData, ContainerTx tx, BeanId beanId) throws RemoteException { BeanO beanO = null; try { beanO = beanId.getActivationStrategy().atActivate(threadData, tx, beanId); // d630940 } finally { if (beanO != null) { threadData.popCallbackBeanO(); // depends on control dependency: [if], data = [none] } } return beanO; } }
public class class_name { @Override public void addAnnotationTypeDeprecationInfo(Content annotationInfoTree) { Content hr = new HtmlTree(HtmlTag.HR); annotationInfoTree.addContent(hr); List<? extends DocTree> deprs = utils.getBlockTags(annotationType, DocTree.Kind.DEPRECATED); if (utils.isDeprecated(annotationType)) { CommentHelper ch = utils.getCommentHelper(annotationType); Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(annotationType)); Content div = HtmlTree.DIV(HtmlStyle.block, deprLabel); if (!deprs.isEmpty()) { List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0)); if (!commentTags.isEmpty()) { div.addContent(Contents.SPACE); addInlineDeprecatedComment(annotationType, deprs.get(0), div); } } annotationInfoTree.addContent(div); } } }
public class class_name { @Override public void addAnnotationTypeDeprecationInfo(Content annotationInfoTree) { Content hr = new HtmlTree(HtmlTag.HR); annotationInfoTree.addContent(hr); List<? extends DocTree> deprs = utils.getBlockTags(annotationType, DocTree.Kind.DEPRECATED); if (utils.isDeprecated(annotationType)) { CommentHelper ch = utils.getCommentHelper(annotationType); Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(annotationType)); Content div = HtmlTree.DIV(HtmlStyle.block, deprLabel); if (!deprs.isEmpty()) { List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0)); // depends on control dependency: [if], data = [none] if (!commentTags.isEmpty()) { div.addContent(Contents.SPACE); // depends on control dependency: [if], data = [none] addInlineDeprecatedComment(annotationType, deprs.get(0), div); // depends on control dependency: [if], data = [none] } } annotationInfoTree.addContent(div); // depends on control dependency: [if], data = [none] } } }
public class class_name { private String[] getMarkType(String label) { String[] types = new String[2]; if(NoSegLabel){ types[0] = ""; types[1] = label; return types; } int idx = label.indexOf('-'); if(idx!=-1){ types[0] = label.substring(0,idx); types[1] = label.substring(idx+1); }else{ types[0] = label; types[1] = ""; } return types; } }
public class class_name { private String[] getMarkType(String label) { String[] types = new String[2]; if(NoSegLabel){ types[0] = ""; types[1] = label; // depends on control dependency: [if], data = [none] return types; // depends on control dependency: [if], data = [none] } int idx = label.indexOf('-'); if(idx!=-1){ types[0] = label.substring(0,idx); // depends on control dependency: [if], data = [none] types[1] = label.substring(idx+1); // depends on control dependency: [if], data = [(idx] }else{ types[0] = label; // depends on control dependency: [if], data = [none] types[1] = ""; // depends on control dependency: [if], data = [none] } return types; } }
public class class_name { public static String removeEndIgnoreCase(String str, String remove) { if (isEmpty(str) || isEmpty(remove)) { return str; } if (endsWithIgnoreCase(str, remove)) { return str.substring(0, str.length() - remove.length()); } return str; } }
public class class_name { public static String removeEndIgnoreCase(String str, String remove) { if (isEmpty(str) || isEmpty(remove)) { return str; // depends on control dependency: [if], data = [none] } if (endsWithIgnoreCase(str, remove)) { return str.substring(0, str.length() - remove.length()); // depends on control dependency: [if], data = [none] } return str; } }
public class class_name { public void apply() { String in = readLineWithMessage("Delete Product with id:"); int id = Integer.parseInt(in); // We don't have a reference to the selected Product. // So first we have to lookup the object, // we do this by a query by example (QBE): // 1. build an example object with matching primary key values: Product example = new Product(); example.setId(id); // 2. build a QueryByIdentity from this sample instance: Query query = new QueryByIdentity(example); try { // start broker transaction broker.beginTransaction(); // lookup the product specified by the QBE Product toBeDeleted = (Product) broker.getObjectByQuery(query); // now ask broker to delete the object broker.delete(toBeDeleted); // commit transaction broker.commitTransaction(); } catch (Throwable t) { // rollback in case of errors broker.abortTransaction(); t.printStackTrace(); } } }
public class class_name { public void apply() { String in = readLineWithMessage("Delete Product with id:"); int id = Integer.parseInt(in); // We don't have a reference to the selected Product. // So first we have to lookup the object, // we do this by a query by example (QBE): // 1. build an example object with matching primary key values: Product example = new Product(); example.setId(id); // 2. build a QueryByIdentity from this sample instance: Query query = new QueryByIdentity(example); try { // start broker transaction broker.beginTransaction(); // depends on control dependency: [try], data = [none] // lookup the product specified by the QBE Product toBeDeleted = (Product) broker.getObjectByQuery(query); // now ask broker to delete the object broker.delete(toBeDeleted); // depends on control dependency: [try], data = [none] // commit transaction broker.commitTransaction(); // depends on control dependency: [try], data = [none] } catch (Throwable t) { // rollback in case of errors broker.abortTransaction(); t.printStackTrace(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static <T> T withBytes(byte[] bytes, TypeReference<T> typeReference) { try { return jsonMapper.readValue(bytes, typeReference); } catch (Exception e) { return JMExceptionManager.handleExceptionAndReturnNull(log, e, "withBytes", new String(bytes)); } } }
public class class_name { public static <T> T withBytes(byte[] bytes, TypeReference<T> typeReference) { try { return jsonMapper.readValue(bytes, typeReference); // depends on control dependency: [try], data = [none] } catch (Exception e) { return JMExceptionManager.handleExceptionAndReturnNull(log, e, "withBytes", new String(bytes)); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void slrem(final String keyspace, final String uid, final String serviceCode, final String key, final String[] values) { final byte[][] bvalues = new byte[values.length][]; for (int i = 0; i < values.length; i++) { bvalues[i] = SafeEncoder.encode(values[i]); } slrem(SafeEncoder.encode(keyspace), SafeEncoder.encode(uid), SafeEncoder.encode(serviceCode), SafeEncoder.encode(key), bvalues); } }
public class class_name { public void slrem(final String keyspace, final String uid, final String serviceCode, final String key, final String[] values) { final byte[][] bvalues = new byte[values.length][]; for (int i = 0; i < values.length; i++) { bvalues[i] = SafeEncoder.encode(values[i]); // depends on control dependency: [for], data = [i] } slrem(SafeEncoder.encode(keyspace), SafeEncoder.encode(uid), SafeEncoder.encode(serviceCode), SafeEncoder.encode(key), bvalues); } }
public class class_name { @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "LII_LIST_INDEXED_ITERATING", justification = "this doesn't iterate over every element, so we can't use a for-each loop") private static boolean hasSimilarParms(List<String> argTypes) { for (int i = 0; i < (argTypes.size() - 1); i++) { if (argTypes.get(i).startsWith(Values.SIG_ARRAY_PREFIX)) { return true; } } String baseType = argTypes.get(argTypes.size() - 1); while (baseType.startsWith(Values.SIG_ARRAY_PREFIX)) { baseType = baseType.substring(1); } for (int i = 0; i < (argTypes.size() - 1); i++) { if (argTypes.get(i).equals(baseType)) { return true; } } return false; } }
public class class_name { @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "LII_LIST_INDEXED_ITERATING", justification = "this doesn't iterate over every element, so we can't use a for-each loop") private static boolean hasSimilarParms(List<String> argTypes) { for (int i = 0; i < (argTypes.size() - 1); i++) { if (argTypes.get(i).startsWith(Values.SIG_ARRAY_PREFIX)) { return true; // depends on control dependency: [if], data = [none] } } String baseType = argTypes.get(argTypes.size() - 1); while (baseType.startsWith(Values.SIG_ARRAY_PREFIX)) { baseType = baseType.substring(1); // depends on control dependency: [while], data = [none] } for (int i = 0; i < (argTypes.size() - 1); i++) { if (argTypes.get(i).equals(baseType)) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public T getTypedItem(int position) { try { return cursorToObject((Cursor) super.getItem(position)); } catch (SQLException e) { throw new RuntimeException(e); } } }
public class class_name { public T getTypedItem(int position) { try { return cursorToObject((Cursor) super.getItem(position)); // depends on control dependency: [try], data = [none] } catch (SQLException e) { throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void setTargetTransportChain(String targetTransportChain) { if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) { SibTr.debug(this, TRACE, "setTargetTransportChain", targetTransportChain); } _targetTransportChain = targetTransportChain; } }
public class class_name { public void setTargetTransportChain(String targetTransportChain) { if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) { SibTr.debug(this, TRACE, "setTargetTransportChain", targetTransportChain); // depends on control dependency: [if], data = [none] } _targetTransportChain = targetTransportChain; } }