code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { private void refresh(final ClientMapInfo mapInfo) { actualRefresh(mapInfo); if (state == State.INITIALIZING) { // only change the initial bounds the first time around Bbox initialBounds = new Bbox(mapInfo.getInitialBounds()); mapView.applyBounds(initialBounds, MapView.ZoomOption.LEVEL_CLOSEST); } state = State.INITIALIZED; fireRefreshEvents(); while (whenInitializedRunnables.size() > 0) { Runnable runnable = whenInitializedRunnables.remove(0); runnable.run(); } } }
public class class_name { private void refresh(final ClientMapInfo mapInfo) { actualRefresh(mapInfo); if (state == State.INITIALIZING) { // only change the initial bounds the first time around Bbox initialBounds = new Bbox(mapInfo.getInitialBounds()); mapView.applyBounds(initialBounds, MapView.ZoomOption.LEVEL_CLOSEST); // depends on control dependency: [if], data = [none] } state = State.INITIALIZED; fireRefreshEvents(); while (whenInitializedRunnables.size() > 0) { Runnable runnable = whenInitializedRunnables.remove(0); runnable.run(); // depends on control dependency: [while], data = [none] } } }
public class class_name { public static void registerOsgiScriptEngineManager(BundleContext context) { OSGiScriptEngineManager scriptEngineManager = new OSGiScriptEngineManager(context); ScriptEngineManagerContext.setScriptEngineManager(scriptEngineManager); if (LOGGER.isFinestEnabled()) { LOGGER.finest(scriptEngineManager.printScriptEngines()); } } }
public class class_name { public static void registerOsgiScriptEngineManager(BundleContext context) { OSGiScriptEngineManager scriptEngineManager = new OSGiScriptEngineManager(context); ScriptEngineManagerContext.setScriptEngineManager(scriptEngineManager); if (LOGGER.isFinestEnabled()) { LOGGER.finest(scriptEngineManager.printScriptEngines()); // depends on control dependency: [if], data = [none] } } }
public class class_name { public Evaluation evaluate(String path, DataSetLoader loader){ JavaRDD<String> data; try { data = SparkUtils.listPaths(sc, path); } catch (IOException e){ throw new RuntimeException("Error listing files for evaluation of files at path: " + path, e); } return (Evaluation) doEvaluation(data, DEFAULT_EVAL_WORKERS, DEFAULT_EVAL_SCORE_BATCH_SIZE, loader, (MultiDataSetLoader)null, new Evaluation())[0]; } }
public class class_name { public Evaluation evaluate(String path, DataSetLoader loader){ JavaRDD<String> data; try { data = SparkUtils.listPaths(sc, path); // depends on control dependency: [try], data = [none] } catch (IOException e){ throw new RuntimeException("Error listing files for evaluation of files at path: " + path, e); } // depends on control dependency: [catch], data = [none] return (Evaluation) doEvaluation(data, DEFAULT_EVAL_WORKERS, DEFAULT_EVAL_SCORE_BATCH_SIZE, loader, (MultiDataSetLoader)null, new Evaluation())[0]; } }
public class class_name { public RequestedGlobalProperties filterByNodesConstantSet(OptimizerNode node, int input) { // check if partitioning survives if (this.ordering != null) { for (int col : this.ordering.getInvolvedIndexes()) { if (!node.isFieldConstant(input, col)) { return null; } } } else if (this.partitioningFields != null) { for (int colIndex : this.partitioningFields) { if (!node.isFieldConstant(input, colIndex)) { return null; } } } if (this.partitioning == PartitioningProperty.FULL_REPLICATION) { return null; } return this; } }
public class class_name { public RequestedGlobalProperties filterByNodesConstantSet(OptimizerNode node, int input) { // check if partitioning survives if (this.ordering != null) { for (int col : this.ordering.getInvolvedIndexes()) { if (!node.isFieldConstant(input, col)) { return null; // depends on control dependency: [if], data = [none] } } } else if (this.partitioningFields != null) { for (int colIndex : this.partitioningFields) { if (!node.isFieldConstant(input, colIndex)) { return null; // depends on control dependency: [if], data = [none] } } } if (this.partitioning == PartitioningProperty.FULL_REPLICATION) { return null; // depends on control dependency: [if], data = [none] } return this; } }
public class class_name { @Override public void removeByG_A(long groupId, boolean active) { for (CommercePaymentMethodGroupRel commercePaymentMethodGroupRel : findByG_A( groupId, active, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commercePaymentMethodGroupRel); } } }
public class class_name { @Override public void removeByG_A(long groupId, boolean active) { for (CommercePaymentMethodGroupRel commercePaymentMethodGroupRel : findByG_A( groupId, active, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commercePaymentMethodGroupRel); // depends on control dependency: [for], data = [commercePaymentMethodGroupRel] } } }
public class class_name { private String sortedEquivalence(final Equivalence equivalence) { final Formula right; final Formula left; if (this.comparator.compare(equivalence.left(), equivalence.right()) <= 0) { right = equivalence.right(); left = equivalence.left(); } else { right = equivalence.left(); left = equivalence.right(); } final String leftString = FType.EQUIV.precedence() < left.type().precedence() ? toString(left) : bracket(left); final String rightString = FType.EQUIV.precedence() < right.type().precedence() ? toString(right) : bracket(right); return String.format("%s%s%s", leftString, equivalence(), rightString); } }
public class class_name { private String sortedEquivalence(final Equivalence equivalence) { final Formula right; final Formula left; if (this.comparator.compare(equivalence.left(), equivalence.right()) <= 0) { right = equivalence.right(); // depends on control dependency: [if], data = [none] left = equivalence.left(); // depends on control dependency: [if], data = [none] } else { right = equivalence.left(); // depends on control dependency: [if], data = [none] left = equivalence.right(); // depends on control dependency: [if], data = [none] } final String leftString = FType.EQUIV.precedence() < left.type().precedence() ? toString(left) : bracket(left); final String rightString = FType.EQUIV.precedence() < right.type().precedence() ? toString(right) : bracket(right); return String.format("%s%s%s", leftString, equivalence(), rightString); } }
public class class_name { @Override public void removeAdapterItemAt(int index) { if(index == getSelectedItemPosition()) { Calendar date = getSelectedDate(); selectTemporary(new DateItem(formatDate(date), date, NO_ID)); } super.removeAdapterItemAt(index); } }
public class class_name { @Override public void removeAdapterItemAt(int index) { if(index == getSelectedItemPosition()) { Calendar date = getSelectedDate(); selectTemporary(new DateItem(formatDate(date), date, NO_ID)); // depends on control dependency: [if], data = [none] } super.removeAdapterItemAt(index); } }
public class class_name { public Drawer build() { if (mUsed) { throw new RuntimeException("you must not reuse a DrawerBuilder builder"); } if (mActivity == null) { throw new RuntimeException("please pass an activity"); } //set that this builder was used. now you have to create a new one mUsed = true; // if the user has not set a drawerLayout use the default one :D if (mDrawerLayout == null) { withDrawerLayout(-1); } //some new Materialize magic ;) mMaterialize = new MaterializeBuilder() .withActivity(mActivity) .withRootView(mRootView) .withFullscreen(mFullscreen) .withSystemUIHidden(mSystemUIHidden) .withUseScrimInsetsLayout(false) .withTransparentStatusBar(mTranslucentStatusBar) .withTranslucentNavigationBarProgrammatically(mTranslucentNavigationBarProgrammatically) .withContainer(mDrawerLayout) .build(); //handle the navigation stuff of the ActionBarDrawerToggle and the drawer in general handleDrawerNavigation(mActivity, false); //build the view which will be set to the drawer Drawer result = buildView(); //define id for the sliderLayout mSliderLayout.setId(R.id.material_drawer_slider_layout); // add the slider to the drawer mDrawerLayout.addView(mSliderLayout, 1); return result; } }
public class class_name { public Drawer build() { if (mUsed) { throw new RuntimeException("you must not reuse a DrawerBuilder builder"); } if (mActivity == null) { throw new RuntimeException("please pass an activity"); } //set that this builder was used. now you have to create a new one mUsed = true; // if the user has not set a drawerLayout use the default one :D if (mDrawerLayout == null) { withDrawerLayout(-1); // depends on control dependency: [if], data = [none] } //some new Materialize magic ;) mMaterialize = new MaterializeBuilder() .withActivity(mActivity) .withRootView(mRootView) .withFullscreen(mFullscreen) .withSystemUIHidden(mSystemUIHidden) .withUseScrimInsetsLayout(false) .withTransparentStatusBar(mTranslucentStatusBar) .withTranslucentNavigationBarProgrammatically(mTranslucentNavigationBarProgrammatically) .withContainer(mDrawerLayout) .build(); //handle the navigation stuff of the ActionBarDrawerToggle and the drawer in general handleDrawerNavigation(mActivity, false); //build the view which will be set to the drawer Drawer result = buildView(); //define id for the sliderLayout mSliderLayout.setId(R.id.material_drawer_slider_layout); // add the slider to the drawer mDrawerLayout.addView(mSliderLayout, 1); return result; } }
public class class_name { public ListCertificatesRequest withCertificateStatuses(String... certificateStatuses) { if (this.certificateStatuses == null) { setCertificateStatuses(new java.util.ArrayList<String>(certificateStatuses.length)); } for (String ele : certificateStatuses) { this.certificateStatuses.add(ele); } return this; } }
public class class_name { public ListCertificatesRequest withCertificateStatuses(String... certificateStatuses) { if (this.certificateStatuses == null) { setCertificateStatuses(new java.util.ArrayList<String>(certificateStatuses.length)); // depends on control dependency: [if], data = [none] } for (String ele : certificateStatuses) { this.certificateStatuses.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public static final StreamConfiguration getUpdateStreamConfig(final UpdateStreamRequest updateStreamRequest) { ScalingPolicy scalingPolicy; if (updateStreamRequest.getScalingPolicy().getType() == ScalingConfig.TypeEnum.FIXED_NUM_SEGMENTS) { scalingPolicy = ScalingPolicy.fixed(updateStreamRequest.getScalingPolicy().getMinSegments()); } else if (updateStreamRequest.getScalingPolicy().getType() == ScalingConfig.TypeEnum.BY_RATE_IN_EVENTS_PER_SEC) { scalingPolicy = ScalingPolicy.byEventRate( updateStreamRequest.getScalingPolicy().getTargetRate(), updateStreamRequest.getScalingPolicy().getScaleFactor(), updateStreamRequest.getScalingPolicy().getMinSegments() ); } else { scalingPolicy = ScalingPolicy.byDataRate( updateStreamRequest.getScalingPolicy().getTargetRate(), updateStreamRequest.getScalingPolicy().getScaleFactor(), updateStreamRequest.getScalingPolicy().getMinSegments() ); } RetentionPolicy retentionPolicy = null; if (updateStreamRequest.getRetentionPolicy() != null) { switch (updateStreamRequest.getRetentionPolicy().getType()) { case LIMITED_SIZE_MB: retentionPolicy = RetentionPolicy.bySizeBytes( updateStreamRequest.getRetentionPolicy().getValue() * 1024 * 1024); break; case LIMITED_DAYS: retentionPolicy = RetentionPolicy.byTime( Duration.ofDays(updateStreamRequest.getRetentionPolicy().getValue())); break; } } return StreamConfiguration.builder() .scalingPolicy(scalingPolicy) .retentionPolicy(retentionPolicy) .build(); } }
public class class_name { public static final StreamConfiguration getUpdateStreamConfig(final UpdateStreamRequest updateStreamRequest) { ScalingPolicy scalingPolicy; if (updateStreamRequest.getScalingPolicy().getType() == ScalingConfig.TypeEnum.FIXED_NUM_SEGMENTS) { scalingPolicy = ScalingPolicy.fixed(updateStreamRequest.getScalingPolicy().getMinSegments()); // depends on control dependency: [if], data = [none] } else if (updateStreamRequest.getScalingPolicy().getType() == ScalingConfig.TypeEnum.BY_RATE_IN_EVENTS_PER_SEC) { scalingPolicy = ScalingPolicy.byEventRate( updateStreamRequest.getScalingPolicy().getTargetRate(), updateStreamRequest.getScalingPolicy().getScaleFactor(), updateStreamRequest.getScalingPolicy().getMinSegments() ); // depends on control dependency: [if], data = [none] } else { scalingPolicy = ScalingPolicy.byDataRate( updateStreamRequest.getScalingPolicy().getTargetRate(), updateStreamRequest.getScalingPolicy().getScaleFactor(), updateStreamRequest.getScalingPolicy().getMinSegments() ); // depends on control dependency: [if], data = [none] } RetentionPolicy retentionPolicy = null; if (updateStreamRequest.getRetentionPolicy() != null) { switch (updateStreamRequest.getRetentionPolicy().getType()) { case LIMITED_SIZE_MB: retentionPolicy = RetentionPolicy.bySizeBytes( updateStreamRequest.getRetentionPolicy().getValue() * 1024 * 1024); break; case LIMITED_DAYS: retentionPolicy = RetentionPolicy.byTime( Duration.ofDays(updateStreamRequest.getRetentionPolicy().getValue())); break; } } return StreamConfiguration.builder() .scalingPolicy(scalingPolicy) .retentionPolicy(retentionPolicy) .build(); } }
public class class_name { void renderFormContent() { initLocaleSelect(); setNativeResourceInfo(m_sitePath, m_locale); m_contentInfoHeader = new CmsInfoHeader(m_title, null, m_sitePath, m_locale, m_iconClasses); m_basePanel.add(m_contentInfoHeader); SimplePanel content = new SimplePanel(); content.setStyleName(org.opencms.acacia.client.css.I_CmsLayoutBundle.INSTANCE.form().formParent()); m_basePanel.add(content); initEntityObserver(); if (m_definitions.get(m_locale).hasEditorChangeHandlers()) { initEditorChangeHandlers(m_definitions.get(m_locale).getEditorChangeScopes()); } renderEntityForm(m_entityId, m_tabInfos, content, m_basePanel.getElement()); if ((m_clientId != null) && (getFormTabs() != null)) { CmsListInfoBean pageInfo = CmsContainerpageController.get().getData().getPageInfo(); m_pageInfoHeader = new CmsInfoHeader( pageInfo.getTitle(), null, pageInfo.getSubTitle(), CmsContainerpageController.get().getData().getLocale(), pageInfo.getBigIconClasses()); updateInfoHeader(CmsContentDefinition.SETTINGS_TAB_ID.equals(getFormTabs().getSelectedId())); getFormTabs().addSelectionHandler(new SelectionHandler<Integer>() { public void onSelection(SelectionEvent<Integer> event) { updateInfoHeader(CmsContentDefinition.SETTINGS_TAB_ID.equals(getFormTabs().getSelectedId())); } }); } } }
public class class_name { void renderFormContent() { initLocaleSelect(); setNativeResourceInfo(m_sitePath, m_locale); m_contentInfoHeader = new CmsInfoHeader(m_title, null, m_sitePath, m_locale, m_iconClasses); m_basePanel.add(m_contentInfoHeader); SimplePanel content = new SimplePanel(); content.setStyleName(org.opencms.acacia.client.css.I_CmsLayoutBundle.INSTANCE.form().formParent()); m_basePanel.add(content); initEntityObserver(); if (m_definitions.get(m_locale).hasEditorChangeHandlers()) { initEditorChangeHandlers(m_definitions.get(m_locale).getEditorChangeScopes()); // depends on control dependency: [if], data = [none] } renderEntityForm(m_entityId, m_tabInfos, content, m_basePanel.getElement()); if ((m_clientId != null) && (getFormTabs() != null)) { CmsListInfoBean pageInfo = CmsContainerpageController.get().getData().getPageInfo(); m_pageInfoHeader = new CmsInfoHeader( pageInfo.getTitle(), null, pageInfo.getSubTitle(), CmsContainerpageController.get().getData().getLocale(), pageInfo.getBigIconClasses()); // depends on control dependency: [if], data = [none] updateInfoHeader(CmsContentDefinition.SETTINGS_TAB_ID.equals(getFormTabs().getSelectedId())); // depends on control dependency: [if], data = [none] getFormTabs().addSelectionHandler(new SelectionHandler<Integer>() { public void onSelection(SelectionEvent<Integer> event) { updateInfoHeader(CmsContentDefinition.SETTINGS_TAB_ID.equals(getFormTabs().getSelectedId())); } }); // depends on control dependency: [if], data = [none] } } }
public class class_name { public String writeStringField() { final List<String> strs = Lists.newArrayList(); if (sub_expressions != null) { for (ExpressionTree sub : sub_expressions) { strs.add(sub.toString()); } } if (sub_metric_queries != null) { final String sub_metrics = clean(sub_metric_queries.values()); if (sub_metrics != null && sub_metrics.length() > 0) { strs.add(sub_metrics); } } final String inner_expression = DOUBLE_COMMA_JOINER.join(strs); return expression.writeStringField(func_params, inner_expression); } }
public class class_name { public String writeStringField() { final List<String> strs = Lists.newArrayList(); if (sub_expressions != null) { for (ExpressionTree sub : sub_expressions) { strs.add(sub.toString()); // depends on control dependency: [for], data = [sub] } } if (sub_metric_queries != null) { final String sub_metrics = clean(sub_metric_queries.values()); if (sub_metrics != null && sub_metrics.length() > 0) { strs.add(sub_metrics); // depends on control dependency: [if], data = [(sub_metrics] } } final String inner_expression = DOUBLE_COMMA_JOINER.join(strs); return expression.writeStringField(func_params, inner_expression); } }
public class class_name { protected void run() { Scheduler.get().scheduleFixedDelay(new RepeatingCommand() { public boolean execute() { if (CmsBroadcastTimer.shouldKeepRunning()) { getBroadcast(); return true; } return false; } }, PING_INTERVAL); } }
public class class_name { protected void run() { Scheduler.get().scheduleFixedDelay(new RepeatingCommand() { public boolean execute() { if (CmsBroadcastTimer.shouldKeepRunning()) { getBroadcast(); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } return false; } }, PING_INTERVAL); } }
public class class_name { protected static String getParameter(HttpServletRequest request, String[] aliases) { final String sourceMethod = "getParameter"; //$NON-NLS-1$ boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(sourceClass, sourceMethod, new Object[]{request.getQueryString(), Arrays.asList(aliases)}); } Map<String, String[]> params = request.getParameterMap(); String result = null; for (Map.Entry<String, String[]> entry : params.entrySet()) { String name = entry.getKey(); for (String alias : aliases) { if (alias.equalsIgnoreCase(name)) { String[] values = entry.getValue(); result = values[values.length-1]; // return last value in array } } } if (isTraceLogging) { log.exiting(sourceClass, sourceMethod, result); } return result; } }
public class class_name { protected static String getParameter(HttpServletRequest request, String[] aliases) { final String sourceMethod = "getParameter"; //$NON-NLS-1$ boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(sourceClass, sourceMethod, new Object[]{request.getQueryString(), Arrays.asList(aliases)}); // depends on control dependency: [if], data = [none] } Map<String, String[]> params = request.getParameterMap(); String result = null; for (Map.Entry<String, String[]> entry : params.entrySet()) { String name = entry.getKey(); for (String alias : aliases) { if (alias.equalsIgnoreCase(name)) { String[] values = entry.getValue(); result = values[values.length-1]; // return last value in array // depends on control dependency: [if], data = [none] } } } if (isTraceLogging) { log.exiting(sourceClass, sourceMethod, result); // depends on control dependency: [if], data = [none] } return result; } }
public class class_name { protected AfterInvocationManager afterInvocationManager() { if (prePostEnabled()) { AfterInvocationProviderManager invocationProviderManager = new AfterInvocationProviderManager(); ExpressionBasedPostInvocationAdvice postAdvice = new ExpressionBasedPostInvocationAdvice( getExpressionHandler()); PostInvocationAdviceProvider postInvocationAdviceProvider = new PostInvocationAdviceProvider( postAdvice); List<AfterInvocationProvider> afterInvocationProviders = new ArrayList<>(); afterInvocationProviders.add(postInvocationAdviceProvider); invocationProviderManager.setProviders(afterInvocationProviders); return invocationProviderManager; } return null; } }
public class class_name { protected AfterInvocationManager afterInvocationManager() { if (prePostEnabled()) { AfterInvocationProviderManager invocationProviderManager = new AfterInvocationProviderManager(); ExpressionBasedPostInvocationAdvice postAdvice = new ExpressionBasedPostInvocationAdvice( getExpressionHandler()); PostInvocationAdviceProvider postInvocationAdviceProvider = new PostInvocationAdviceProvider( postAdvice); List<AfterInvocationProvider> afterInvocationProviders = new ArrayList<>(); afterInvocationProviders.add(postInvocationAdviceProvider); // depends on control dependency: [if], data = [none] invocationProviderManager.setProviders(afterInvocationProviders); // depends on control dependency: [if], data = [none] return invocationProviderManager; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public static int resolveRtlGravity(int gravity) { if (0 != (gravity & ViewBaseCommon.RIGHT)) { gravity &= ~ViewBaseCommon.RIGHT; gravity |= ViewBaseCommon.LEFT; } else if (0 != (gravity & ViewBaseCommon.LEFT)) { gravity &= ~ViewBaseCommon.LEFT; gravity |= ViewBaseCommon.RIGHT; } return gravity; } }
public class class_name { public static int resolveRtlGravity(int gravity) { if (0 != (gravity & ViewBaseCommon.RIGHT)) { gravity &= ~ViewBaseCommon.RIGHT; // depends on control dependency: [if], data = [none] gravity |= ViewBaseCommon.LEFT; // depends on control dependency: [if], data = [none] } else if (0 != (gravity & ViewBaseCommon.LEFT)) { gravity &= ~ViewBaseCommon.LEFT; // depends on control dependency: [if], data = [none] gravity |= ViewBaseCommon.RIGHT; // depends on control dependency: [if], data = [none] } return gravity; } }
public class class_name { @Override public ConciseSet difference(IntSet other) { if (other == this) { return empty(); } if (other == null || other.isEmpty()) { return clone(); } return performOperation(convert(other), Operator.ANDNOT); } }
public class class_name { @Override public ConciseSet difference(IntSet other) { if (other == this) { return empty(); // depends on control dependency: [if], data = [none] } if (other == null || other.isEmpty()) { return clone(); // depends on control dependency: [if], data = [none] } return performOperation(convert(other), Operator.ANDNOT); } }
public class class_name { public TVSeasonInfo getSeasonInfo(int tvID, int seasonNumber, String language, String... appendToResponse) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); parameters.add(Param.SEASON_NUMBER, seasonNumber); parameters.add(Param.LANGUAGE, language); parameters.add(Param.APPEND, appendToResponse); URL url = new ApiUrl(apiKey, MethodBase.SEASON).buildUrl(parameters); String webpage = httpTools.getRequest(url); try { return MAPPER.readValue(webpage, TVSeasonInfo.class); } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get TV Season Info", url, ex); } } }
public class class_name { public TVSeasonInfo getSeasonInfo(int tvID, int seasonNumber, String language, String... appendToResponse) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); parameters.add(Param.SEASON_NUMBER, seasonNumber); parameters.add(Param.LANGUAGE, language); parameters.add(Param.APPEND, appendToResponse); URL url = new ApiUrl(apiKey, MethodBase.SEASON).buildUrl(parameters); String webpage = httpTools.getRequest(url); try { return MAPPER.readValue(webpage, TVSeasonInfo.class); // depends on control dependency: [try], data = [none] } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get TV Season Info", url, ex); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private InputStream findCukedoctorProperties(String baseDir) { List<String> files = FileUtil.findFiles(baseDir,"cukedoctor.properties",true); if(files != null && !files.isEmpty()){ String path = files.get(0); log.fine("Loading cukedoctor resource bundle from: " + path); File file = new File(path); try { return new FileInputStream(file); } catch (Exception e) { log.log(Level.WARNING, "Could not load resource bundle from target folder", e); } } return null; } }
public class class_name { private InputStream findCukedoctorProperties(String baseDir) { List<String> files = FileUtil.findFiles(baseDir,"cukedoctor.properties",true); if(files != null && !files.isEmpty()){ String path = files.get(0); log.fine("Loading cukedoctor resource bundle from: " + path); // depends on control dependency: [if], data = [none] File file = new File(path); try { return new FileInputStream(file); // depends on control dependency: [try], data = [none] } catch (Exception e) { log.log(Level.WARNING, "Could not load resource bundle from target folder", e); } // depends on control dependency: [catch], data = [none] } return null; } }
public class class_name { public Buffer capacity(int capacity) { if (capacity > maxCapacity) { throw new IllegalArgumentException("capacity cannot be greater than maximum capacity"); } else if (capacity < this.capacity) { throw new IllegalArgumentException("capacity cannot be decreased"); } else if (capacity != this.capacity) { // It's possible that the bytes could already meet the requirements of the capacity. if (offset(capacity) > bytes.size()) { bytes.resize((int) Math.min(Memory.Util.toPow2(offset(capacity)), Integer.MAX_VALUE)); } this.capacity = capacity; } return this; } }
public class class_name { public Buffer capacity(int capacity) { if (capacity > maxCapacity) { throw new IllegalArgumentException("capacity cannot be greater than maximum capacity"); } else if (capacity < this.capacity) { throw new IllegalArgumentException("capacity cannot be decreased"); } else if (capacity != this.capacity) { // It's possible that the bytes could already meet the requirements of the capacity. if (offset(capacity) > bytes.size()) { bytes.resize((int) Math.min(Memory.Util.toPow2(offset(capacity)), Integer.MAX_VALUE)); // depends on control dependency: [if], data = [(offset(capacity)] } this.capacity = capacity; // depends on control dependency: [if], data = [none] } return this; } }
public class class_name { public void marshall(CreateHITWithHITTypeRequest createHITWithHITTypeRequest, ProtocolMarshaller protocolMarshaller) { if (createHITWithHITTypeRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createHITWithHITTypeRequest.getHITTypeId(), HITTYPEID_BINDING); protocolMarshaller.marshall(createHITWithHITTypeRequest.getMaxAssignments(), MAXASSIGNMENTS_BINDING); protocolMarshaller.marshall(createHITWithHITTypeRequest.getLifetimeInSeconds(), LIFETIMEINSECONDS_BINDING); protocolMarshaller.marshall(createHITWithHITTypeRequest.getQuestion(), QUESTION_BINDING); protocolMarshaller.marshall(createHITWithHITTypeRequest.getRequesterAnnotation(), REQUESTERANNOTATION_BINDING); protocolMarshaller.marshall(createHITWithHITTypeRequest.getUniqueRequestToken(), UNIQUEREQUESTTOKEN_BINDING); protocolMarshaller.marshall(createHITWithHITTypeRequest.getAssignmentReviewPolicy(), ASSIGNMENTREVIEWPOLICY_BINDING); protocolMarshaller.marshall(createHITWithHITTypeRequest.getHITReviewPolicy(), HITREVIEWPOLICY_BINDING); protocolMarshaller.marshall(createHITWithHITTypeRequest.getHITLayoutId(), HITLAYOUTID_BINDING); protocolMarshaller.marshall(createHITWithHITTypeRequest.getHITLayoutParameters(), HITLAYOUTPARAMETERS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(CreateHITWithHITTypeRequest createHITWithHITTypeRequest, ProtocolMarshaller protocolMarshaller) { if (createHITWithHITTypeRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createHITWithHITTypeRequest.getHITTypeId(), HITTYPEID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createHITWithHITTypeRequest.getMaxAssignments(), MAXASSIGNMENTS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createHITWithHITTypeRequest.getLifetimeInSeconds(), LIFETIMEINSECONDS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createHITWithHITTypeRequest.getQuestion(), QUESTION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createHITWithHITTypeRequest.getRequesterAnnotation(), REQUESTERANNOTATION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createHITWithHITTypeRequest.getUniqueRequestToken(), UNIQUEREQUESTTOKEN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createHITWithHITTypeRequest.getAssignmentReviewPolicy(), ASSIGNMENTREVIEWPOLICY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createHITWithHITTypeRequest.getHITReviewPolicy(), HITREVIEWPOLICY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createHITWithHITTypeRequest.getHITLayoutId(), HITLAYOUTID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createHITWithHITTypeRequest.getHITLayoutParameters(), HITLAYOUTPARAMETERS_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 pacedCall(Runnable call, Runnable orElse) { long now = timeSource.getTimeMillis(); long end = nextLogTime.get(); if(now >= end && nextLogTime.compareAndSet(end, now + delay)) { call.run(); } else { orElse.run(); } } }
public class class_name { public void pacedCall(Runnable call, Runnable orElse) { long now = timeSource.getTimeMillis(); long end = nextLogTime.get(); if(now >= end && nextLogTime.compareAndSet(end, now + delay)) { call.run(); // depends on control dependency: [if], data = [none] } else { orElse.run(); // depends on control dependency: [if], data = [none] } } }
public class class_name { static void extractGenericsConnections(Map<GenericsTypeName, GenericsType> connections, ClassNode type, ClassNode target) { if (target == null || type == target || !isUsingGenericsOrIsArrayUsingGenerics(target)) return; if (type == null || type == UNKNOWN_PARAMETER_TYPE) return; if (type.isArray() && target.isArray()) { extractGenericsConnections(connections, type.getComponentType(), target.getComponentType()); } else if (target.isGenericsPlaceHolder() || type.equals(target) || !implementsInterfaceOrIsSubclassOf(type, target)) { // structural match route if (target.isGenericsPlaceHolder()) { connections.put(new GenericsTypeName(target.getGenericsTypes()[0].getName()), new GenericsType(type)); } else { extractGenericsConnections(connections, type.getGenericsTypes(), target.getGenericsTypes()); } } else { // have first to find matching super class or interface ClassNode superClass = getSuperClass(type, target); if (superClass != null) { ClassNode corrected = getCorrectedClassNode(type, superClass, true); extractGenericsConnections(connections, corrected, target); } else { // if we reach here, we have an unhandled case throw new GroovyBugError("The type " + type + " seems not to normally extend " + target + ". Sorry, I cannot handle this."); } } } }
public class class_name { static void extractGenericsConnections(Map<GenericsTypeName, GenericsType> connections, ClassNode type, ClassNode target) { if (target == null || type == target || !isUsingGenericsOrIsArrayUsingGenerics(target)) return; if (type == null || type == UNKNOWN_PARAMETER_TYPE) return; if (type.isArray() && target.isArray()) { extractGenericsConnections(connections, type.getComponentType(), target.getComponentType()); // depends on control dependency: [if], data = [none] } else if (target.isGenericsPlaceHolder() || type.equals(target) || !implementsInterfaceOrIsSubclassOf(type, target)) { // structural match route if (target.isGenericsPlaceHolder()) { connections.put(new GenericsTypeName(target.getGenericsTypes()[0].getName()), new GenericsType(type)); // depends on control dependency: [if], data = [none] } else { extractGenericsConnections(connections, type.getGenericsTypes(), target.getGenericsTypes()); // depends on control dependency: [if], data = [none] } } else { // have first to find matching super class or interface ClassNode superClass = getSuperClass(type, target); if (superClass != null) { ClassNode corrected = getCorrectedClassNode(type, superClass, true); extractGenericsConnections(connections, corrected, target); // depends on control dependency: [if], data = [none] } else { // if we reach here, we have an unhandled case throw new GroovyBugError("The type " + type + " seems not to normally extend " + target + ". Sorry, I cannot handle this."); } } } }
public class class_name { @Nonnull public EChange assignRoleToUserGroup (@Nullable final String sUserGroupID, @Nonnull @Nonempty final String sRoleID) { // Resolve user group final UserGroup aUserGroup = getOfID (sUserGroupID); if (aUserGroup == null) { AuditHelper.onAuditModifyFailure (UserGroup.OT, sUserGroupID, "no-such-usergroup-id", "assign-role"); return EChange.UNCHANGED; } m_aRWLock.writeLock ().lock (); try { if (aUserGroup.assignRole (sRoleID).isUnchanged ()) return EChange.UNCHANGED; BusinessObjectHelper.setLastModificationNow (aUserGroup); internalUpdateItem (aUserGroup); } finally { m_aRWLock.writeLock ().unlock (); } AuditHelper.onAuditModifySuccess (UserGroup.OT, "assign-role", sUserGroupID, sRoleID); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onUserGroupRoleAssignment (aUserGroup, sRoleID, true)); return EChange.CHANGED; } }
public class class_name { @Nonnull public EChange assignRoleToUserGroup (@Nullable final String sUserGroupID, @Nonnull @Nonempty final String sRoleID) { // Resolve user group final UserGroup aUserGroup = getOfID (sUserGroupID); if (aUserGroup == null) { AuditHelper.onAuditModifyFailure (UserGroup.OT, sUserGroupID, "no-such-usergroup-id", "assign-role"); // depends on control dependency: [if], data = [none] return EChange.UNCHANGED; // depends on control dependency: [if], data = [none] } m_aRWLock.writeLock ().lock (); try { if (aUserGroup.assignRole (sRoleID).isUnchanged ()) return EChange.UNCHANGED; BusinessObjectHelper.setLastModificationNow (aUserGroup); // depends on control dependency: [try], data = [none] internalUpdateItem (aUserGroup); // depends on control dependency: [try], data = [none] } finally { m_aRWLock.writeLock ().unlock (); } AuditHelper.onAuditModifySuccess (UserGroup.OT, "assign-role", sUserGroupID, sRoleID); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onUserGroupRoleAssignment (aUserGroup, sRoleID, true)); return EChange.CHANGED; } }
public class class_name { private void execute(Map<Key, List<TableOperation>> batches) { if (batches != null && !batches.isEmpty()) { try { for (List<TableOperation> batch : batches.values()) { tableAPI.execute(batch, null); } } catch (DurabilityException e) { log.error("Error while executing operations in OracleNOSQL, Caused by:" + e + "."); throw new PersistenceException("Error while Persisting data using batch", e); } catch (TableOpExecutionException e) { log.error("Error while executing operations in OracleNOSQL, Caused by:" + e + "."); throw new PersistenceException("Error while Persisting data using batch", e); } catch (FaultException e) { log.error("Error while executing operations in OracleNOSQL, Caused by:" + e + "."); throw new PersistenceException("Error while Persisting data using batch", e); } finally { batches.clear(); } } } }
public class class_name { private void execute(Map<Key, List<TableOperation>> batches) { if (batches != null && !batches.isEmpty()) { try { for (List<TableOperation> batch : batches.values()) { tableAPI.execute(batch, null); // depends on control dependency: [for], data = [batch] } } catch (DurabilityException e) { log.error("Error while executing operations in OracleNOSQL, Caused by:" + e + "."); throw new PersistenceException("Error while Persisting data using batch", e); } // depends on control dependency: [catch], data = [none] catch (TableOpExecutionException e) { log.error("Error while executing operations in OracleNOSQL, Caused by:" + e + "."); throw new PersistenceException("Error while Persisting data using batch", e); } // depends on control dependency: [catch], data = [none] catch (FaultException e) { log.error("Error while executing operations in OracleNOSQL, Caused by:" + e + "."); throw new PersistenceException("Error while Persisting data using batch", e); } // depends on control dependency: [catch], data = [none] finally { batches.clear(); } } } }
public class class_name { public int size() { if (disposed) { return 0; } synchronized (this) { if (disposed) { return 0; } OpenHashSet<Disposable> set = resources; return set != null ? set.size() : 0; } } }
public class class_name { public int size() { if (disposed) { return 0; // depends on control dependency: [if], data = [none] } synchronized (this) { if (disposed) { return 0; // depends on control dependency: [if], data = [none] } OpenHashSet<Disposable> set = resources; return set != null ? set.size() : 0; } } }
public class class_name { public Matrix4x3f set(Matrix3fc mat) { if (mat instanceof Matrix3f) { MemUtil.INSTANCE.copy((Matrix3f) mat, this); } else { setMatrix3fc(mat); } properties = 0; return this; } }
public class class_name { public Matrix4x3f set(Matrix3fc mat) { if (mat instanceof Matrix3f) { MemUtil.INSTANCE.copy((Matrix3f) mat, this); // depends on control dependency: [if], data = [none] } else { setMatrix3fc(mat); // depends on control dependency: [if], data = [none] } properties = 0; return this; } }
public class class_name { public HppRequest hash(String secret) { // Override payerRef with hppSelectStoredCard if present. if (this.hppSelectStoredCard != null && !"".equalsIgnoreCase(this.hppSelectStoredCard)) { this.payerReference = this.hppSelectStoredCard; } //check for any null values and set them to empty string for hashing String timeStamp = null == this.timeStamp ? "" : this.timeStamp; String merchantId = null == this.merchantId ? "" : this.merchantId; String orderId = null == this.orderId ? "" : this.orderId; String amount = null == this.amount ? "" : this.amount; String currency = null == this.currency ? "" : this.currency; String payerReference = null == this.payerReference ? "" : this.payerReference; String paymentReference = null == this.paymentReference ? "" : this.paymentReference; String hppFraudFilterMode = null == this.hppFraudFilterMode ? "" : this.hppFraudFilterMode; //create String to hash. Check for card storage enable flag to determine if Real Vault transaction StringBuilder toHash = new StringBuilder(); if (Flag.TRUE.getFlag().equals(cardStorageEnable) || (hppSelectStoredCard != null && !hppSelectStoredCard.isEmpty())) { toHash.append(timeStamp).append(".").append(merchantId).append(".").append(orderId).append(".").append(amount).append(".") .append(currency).append(".").append(payerReference).append(".").append(paymentReference); if (!hppFraudFilterMode.equals("")) { toHash.append(".").append(this.hppFraudFilterMode); } } else { toHash.append(timeStamp).append(".").append(merchantId).append(".").append(orderId).append(".").append(amount).append(".") .append(currency); if (!hppFraudFilterMode.equals("")) { toHash.append(".").append(this.hppFraudFilterMode); } } this.hash = GenerationUtils.generateHash(toHash.toString(), secret); return this; } }
public class class_name { public HppRequest hash(String secret) { // Override payerRef with hppSelectStoredCard if present. if (this.hppSelectStoredCard != null && !"".equalsIgnoreCase(this.hppSelectStoredCard)) { this.payerReference = this.hppSelectStoredCard; // depends on control dependency: [if], data = [none] } //check for any null values and set them to empty string for hashing String timeStamp = null == this.timeStamp ? "" : this.timeStamp; String merchantId = null == this.merchantId ? "" : this.merchantId; String orderId = null == this.orderId ? "" : this.orderId; String amount = null == this.amount ? "" : this.amount; String currency = null == this.currency ? "" : this.currency; String payerReference = null == this.payerReference ? "" : this.payerReference; String paymentReference = null == this.paymentReference ? "" : this.paymentReference; String hppFraudFilterMode = null == this.hppFraudFilterMode ? "" : this.hppFraudFilterMode; //create String to hash. Check for card storage enable flag to determine if Real Vault transaction StringBuilder toHash = new StringBuilder(); if (Flag.TRUE.getFlag().equals(cardStorageEnable) || (hppSelectStoredCard != null && !hppSelectStoredCard.isEmpty())) { toHash.append(timeStamp).append(".").append(merchantId).append(".").append(orderId).append(".").append(amount).append(".") .append(currency).append(".").append(payerReference).append(".").append(paymentReference); // depends on control dependency: [if], data = [none] if (!hppFraudFilterMode.equals("")) { toHash.append(".").append(this.hppFraudFilterMode); // depends on control dependency: [if], data = [none] } } else { toHash.append(timeStamp).append(".").append(merchantId).append(".").append(orderId).append(".").append(amount).append(".") .append(currency); // depends on control dependency: [if], data = [none] if (!hppFraudFilterMode.equals("")) { toHash.append(".").append(this.hppFraudFilterMode); // depends on control dependency: [if], data = [none] } } this.hash = GenerationUtils.generateHash(toHash.toString(), secret); return this; } }
public class class_name { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws IOException { final String requestURI = request.getRequestURI(); UserAuthentication userAuth = null; User user = null; if (requestURI.endsWith(OPENID_ACTION)) { Authentication oidAuth = super.attemptAuthentication(request, response); if (oidAuth == null) { // hang on... redirecting to openid provider return null; } else { //success! AuthenticatedUserDetails userDetails = (AuthenticatedUserDetails) oidAuth.getPrincipal(); userAuth = new UserAuthentication(userDetails); user = userDetails.getUser(); } } return SecurityUtils.checkIfActive(userAuth, user, true); } }
public class class_name { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws IOException { final String requestURI = request.getRequestURI(); UserAuthentication userAuth = null; User user = null; if (requestURI.endsWith(OPENID_ACTION)) { Authentication oidAuth = super.attemptAuthentication(request, response); if (oidAuth == null) { // hang on... redirecting to openid provider return null; // depends on control dependency: [if], data = [none] } else { //success! AuthenticatedUserDetails userDetails = (AuthenticatedUserDetails) oidAuth.getPrincipal(); userAuth = new UserAuthentication(userDetails); // depends on control dependency: [if], data = [none] user = userDetails.getUser(); // depends on control dependency: [if], data = [none] } } return SecurityUtils.checkIfActive(userAuth, user, true); } }
public class class_name { public void receiveAudio(boolean receive) { if (engine != null) { // check if engine currently receives audio, returns previous value boolean receiveAudio = engine.receiveAudio(receive); if (receiveAudio && !receive) { // send a blank audio packet to reset the player engine.sendBlankAudio(true); } else if (!receiveAudio && receive) { // do a seek seekToCurrentPlayback(); } } else { log.debug("PlayEngine was null, receiveAudio cannot be modified"); } } }
public class class_name { public void receiveAudio(boolean receive) { if (engine != null) { // check if engine currently receives audio, returns previous value boolean receiveAudio = engine.receiveAudio(receive); if (receiveAudio && !receive) { // send a blank audio packet to reset the player engine.sendBlankAudio(true); // depends on control dependency: [if], data = [none] } else if (!receiveAudio && receive) { // do a seek seekToCurrentPlayback(); // depends on control dependency: [if], data = [none] } } else { log.debug("PlayEngine was null, receiveAudio cannot be modified"); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void openPoolTracer() { this.poolWriteLock.lock(); try { for (AbstractTracer tracer : this.tracerPool.values()) { tracer.open(); } } finally { this.poolWriteLock.unlock(); } } }
public class class_name { public void openPoolTracer() { this.poolWriteLock.lock(); try { for (AbstractTracer tracer : this.tracerPool.values()) { tracer.open(); // depends on control dependency: [for], data = [tracer] } } finally { this.poolWriteLock.unlock(); } } }
public class class_name { public int parseNaturalIntAscii(final int index, final int length) { if (SHOULD_BOUNDS_CHECK) { boundsCheck0(index, length); } final int end = index + length; int tally = 0; for (int i = index; i < end; i++) { tally = (tally * 10) + AsciiEncoding.getDigit(i, getByteWithoutBoundsCheck(i)); } return tally; } }
public class class_name { public int parseNaturalIntAscii(final int index, final int length) { if (SHOULD_BOUNDS_CHECK) { boundsCheck0(index, length); // depends on control dependency: [if], data = [none] } final int end = index + length; int tally = 0; for (int i = index; i < end; i++) { tally = (tally * 10) + AsciiEncoding.getDigit(i, getByteWithoutBoundsCheck(i)); // depends on control dependency: [for], data = [i] } return tally; } }
public class class_name { public void forEach(final IntConsumer action) { requireNonNull(action); final int size = _size; for (int i = 0; i < size; ++i) { action.accept(_data[i]); } } }
public class class_name { public void forEach(final IntConsumer action) { requireNonNull(action); final int size = _size; for (int i = 0; i < size; ++i) { action.accept(_data[i]); // depends on control dependency: [for], data = [i] } } }
public class class_name { @Override public void visit(final Family family) { for (final GedObject gob : family.getAttributes()) { gob.accept(this); } } }
public class class_name { @Override public void visit(final Family family) { for (final GedObject gob : family.getAttributes()) { gob.accept(this); // depends on control dependency: [for], data = [gob] } } }
public class class_name { public List<FacesConfigOrderingType<WebFacesConfigDescriptor>> getAllOrdering() { List<FacesConfigOrderingType<WebFacesConfigDescriptor>> list = new ArrayList<FacesConfigOrderingType<WebFacesConfigDescriptor>>(); List<Node> nodeList = model.get("ordering"); for(Node node: nodeList) { FacesConfigOrderingType<WebFacesConfigDescriptor> type = new FacesConfigOrderingTypeImpl<WebFacesConfigDescriptor>(this, "ordering", model, node); list.add(type); } return list; } }
public class class_name { public List<FacesConfigOrderingType<WebFacesConfigDescriptor>> getAllOrdering() { List<FacesConfigOrderingType<WebFacesConfigDescriptor>> list = new ArrayList<FacesConfigOrderingType<WebFacesConfigDescriptor>>(); List<Node> nodeList = model.get("ordering"); for(Node node: nodeList) { FacesConfigOrderingType<WebFacesConfigDescriptor> type = new FacesConfigOrderingTypeImpl<WebFacesConfigDescriptor>(this, "ordering", model, node); list.add(type); // depends on control dependency: [for], data = [none] } return list; } }
public class class_name { public static void closeEL(InputStream is) { try { if (is != null) is.close(); } // catch (AlwaysThrow at) {throw at;} catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); } } }
public class class_name { public static void closeEL(InputStream is) { try { if (is != null) is.close(); } // catch (AlwaysThrow at) {throw at;} catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @SuppressWarnings("resource") public static void main(String[] allArgs) { int exitStatus = 0; Serializer serializer = null; try { final ArrayDeque<String> args = new ArrayDeque<String>(Arrays.asList(allArgs)); // Options. boolean debugStream = false; boolean flushFrequently = false; File eventsFile = null; boolean suitesOnStdin = false; List<String> testClasses = new ArrayList<>(); String runListeners = null; while (!args.isEmpty()) { String option = args.pop(); if (option.equals(OPTION_FREQUENT_FLUSH)) { flushFrequently = true; } else if (option.equals(OPTION_STDIN)) { suitesOnStdin = true; } else if (option.equals(OPTION_SYSOUTS)) { multiplexStdStreams = true; } else if (option.equals(OPTION_EVENTSFILE)) { eventsFile = new File(args.pop()); if (eventsFile.isFile() && eventsFile.length() > 0) { RandomAccessFile raf = new RandomAccessFile(eventsFile, "rw"); raf.setLength(0); raf.close(); } } else if (option.equals(OPTION_RUN_LISTENERS)) { runListeners = args.pop(); } else if (option.startsWith(OPTION_DEBUGSTREAM)) { debugStream = true; } else if (option.startsWith("@")) { // Append arguments file, one line per option. args.addAll(Arrays.asList(readArgsFile(option.substring(1)))); } else { // The default expectation is a test class. testClasses.add(option); } } // Set up events channel and events serializer. if (eventsFile == null) { throw new IOException("You must specify communication channel for events."); } // Delay the forked JVM a bit (for tests). if (System.getProperty(SYSPROP_FORKEDJVM_DELAY_MS) != null) { Thread.sleep(Integer.parseInt(System.getProperty(SYSPROP_FORKEDJVM_DELAY_MS))); } // Send bootstrap package. serializer = new Serializer(new EventsOutputStream(eventsFile)) .serialize(new BootstrapEvent()) .flush(); // Redirect original streams and start running tests. redirectStreams(serializer, flushFrequently); final SlaveMain main = new SlaveMain(serializer); main.flushFrequently = flushFrequently; main.debugMessagesFile = debugStream ? new File(eventsFile.getAbsolutePath() + ".debug"): null; main.runListeners = runListeners; final Iterator<String> stdInput; if (suitesOnStdin) { stdInput = new StdInLineIterator(main.serializer); } else { stdInput = Collections.<String>emptyList().iterator(); } main.execute(Iterators.concat(testClasses.iterator(), stdInput)); // For unhandled exceptions tests. if (System.getProperty(SYSPROP_FIRERUNNERFAILURE) != null) { throw new Exception(System.getProperty(SYSPROP_FIRERUNNERFAILURE)); } } catch (Throwable t) { lastResortMemory = null; tryWaitingForGC(); if (t.getClass() == oomClass) { exitStatus = ERR_OOM; warn("JVM out of memory.", t); } else { exitStatus = ERR_EXCEPTION; warn("Exception at main loop level.", t); } } try { if (serializer != null) { try { serializer.close(); } catch (Throwable t) { warn("Exception closing serializer.", t); } } } finally { JvmExit.halt(exitStatus); } } }
public class class_name { @SuppressWarnings("resource") public static void main(String[] allArgs) { int exitStatus = 0; Serializer serializer = null; try { final ArrayDeque<String> args = new ArrayDeque<String>(Arrays.asList(allArgs)); // Options. boolean debugStream = false; boolean flushFrequently = false; File eventsFile = null; boolean suitesOnStdin = false; List<String> testClasses = new ArrayList<>(); String runListeners = null; while (!args.isEmpty()) { String option = args.pop(); if (option.equals(OPTION_FREQUENT_FLUSH)) { flushFrequently = true; // depends on control dependency: [if], data = [none] } else if (option.equals(OPTION_STDIN)) { suitesOnStdin = true; // depends on control dependency: [if], data = [none] } else if (option.equals(OPTION_SYSOUTS)) { multiplexStdStreams = true; // depends on control dependency: [if], data = [none] } else if (option.equals(OPTION_EVENTSFILE)) { eventsFile = new File(args.pop()); // depends on control dependency: [if], data = [none] if (eventsFile.isFile() && eventsFile.length() > 0) { RandomAccessFile raf = new RandomAccessFile(eventsFile, "rw"); raf.setLength(0); // depends on control dependency: [if], data = [0)] raf.close(); // depends on control dependency: [if], data = [none] } } else if (option.equals(OPTION_RUN_LISTENERS)) { runListeners = args.pop(); // depends on control dependency: [if], data = [none] } else if (option.startsWith(OPTION_DEBUGSTREAM)) { debugStream = true; // depends on control dependency: [if], data = [none] } else if (option.startsWith("@")) { // Append arguments file, one line per option. args.addAll(Arrays.asList(readArgsFile(option.substring(1)))); // depends on control dependency: [if], data = [none] } else { // The default expectation is a test class. testClasses.add(option); // depends on control dependency: [if], data = [none] } } // Set up events channel and events serializer. if (eventsFile == null) { throw new IOException("You must specify communication channel for events."); } // Delay the forked JVM a bit (for tests). if (System.getProperty(SYSPROP_FORKEDJVM_DELAY_MS) != null) { Thread.sleep(Integer.parseInt(System.getProperty(SYSPROP_FORKEDJVM_DELAY_MS))); // depends on control dependency: [if], data = [(System.getProperty(SYSPROP_FORKEDJVM_DELAY_MS)] } // Send bootstrap package. serializer = new Serializer(new EventsOutputStream(eventsFile)) .serialize(new BootstrapEvent()) .flush(); // depends on control dependency: [try], data = [none] // Redirect original streams and start running tests. redirectStreams(serializer, flushFrequently); // depends on control dependency: [try], data = [none] final SlaveMain main = new SlaveMain(serializer); main.flushFrequently = flushFrequently; // depends on control dependency: [try], data = [none] main.debugMessagesFile = debugStream ? new File(eventsFile.getAbsolutePath() + ".debug"): null; // depends on control dependency: [try], data = [none] main.runListeners = runListeners; // depends on control dependency: [try], data = [none] final Iterator<String> stdInput; if (suitesOnStdin) { stdInput = new StdInLineIterator(main.serializer); // depends on control dependency: [if], data = [none] } else { stdInput = Collections.<String>emptyList().iterator(); // depends on control dependency: [if], data = [none] } main.execute(Iterators.concat(testClasses.iterator(), stdInput)); // depends on control dependency: [try], data = [none] // For unhandled exceptions tests. if (System.getProperty(SYSPROP_FIRERUNNERFAILURE) != null) { throw new Exception(System.getProperty(SYSPROP_FIRERUNNERFAILURE)); } } catch (Throwable t) { lastResortMemory = null; tryWaitingForGC(); if (t.getClass() == oomClass) { exitStatus = ERR_OOM; // depends on control dependency: [if], data = [none] warn("JVM out of memory.", t); // depends on control dependency: [if], data = [none] } else { exitStatus = ERR_EXCEPTION; // depends on control dependency: [if], data = [none] warn("Exception at main loop level.", t); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] try { if (serializer != null) { try { serializer.close(); // depends on control dependency: [try], data = [none] } catch (Throwable t) { warn("Exception closing serializer.", t); } // depends on control dependency: [catch], data = [none] } } finally { JvmExit.halt(exitStatus); } } }
public class class_name { public CertifiedPublicKey convert(X509CertificateHolder cert) { if (cert == null) { return null; } return new BcX509CertifiedPublicKey(cert, this.factory); } }
public class class_name { public CertifiedPublicKey convert(X509CertificateHolder cert) { if (cert == null) { return null; // depends on control dependency: [if], data = [none] } return new BcX509CertifiedPublicKey(cert, this.factory); } }
public class class_name { public void addToDomain(PrologCompiledClause term) { List<PrologCompiledClause> predicate = domain.get(term.getHead().getName()); if (predicate == null) { predicate = new LinkedList<PrologCompiledClause>(); domain.put(term.getHead().getName(), predicate); } predicate.add(term); } }
public class class_name { public void addToDomain(PrologCompiledClause term) { List<PrologCompiledClause> predicate = domain.get(term.getHead().getName()); if (predicate == null) { predicate = new LinkedList<PrologCompiledClause>(); // depends on control dependency: [if], data = [none] domain.put(term.getHead().getName(), predicate); // depends on control dependency: [if], data = [none] } predicate.add(term); } }
public class class_name { public boolean hasNext() { if (tc.isEntryEnabled()) SibTr.entry(tc, "hasNext"); boolean hasNext = false; if (anycastIHIterator != null) { hasNext = anycastIHIterator.hasNext(); } if (tc.isEntryEnabled()) SibTr.exit(tc, "hasNext", new Boolean(hasNext)); return hasNext; } }
public class class_name { public boolean hasNext() { if (tc.isEntryEnabled()) SibTr.entry(tc, "hasNext"); boolean hasNext = false; if (anycastIHIterator != null) { hasNext = anycastIHIterator.hasNext(); // depends on control dependency: [if], data = [none] } if (tc.isEntryEnabled()) SibTr.exit(tc, "hasNext", new Boolean(hasNext)); return hasNext; } }
public class class_name { public void processDrsInbound(long localClock) { // Is dsrClock timestamp from the remote machine missing // or was the CE's timestampls already altered? if (drsClock <= 0) { return; } // Adjust timestamps for this machines clock. long clockDifference = localClock - drsClock; if (expirationTime > 0) expirationTime += clockDifference; if (timeStamp > 0) timeStamp += clockDifference; // Don't allow >1 time alter on this CE. drsClock = -1; } }
public class class_name { public void processDrsInbound(long localClock) { // Is dsrClock timestamp from the remote machine missing // or was the CE's timestampls already altered? if (drsClock <= 0) { return; // depends on control dependency: [if], data = [none] } // Adjust timestamps for this machines clock. long clockDifference = localClock - drsClock; if (expirationTime > 0) expirationTime += clockDifference; if (timeStamp > 0) timeStamp += clockDifference; // Don't allow >1 time alter on this CE. drsClock = -1; } }
public class class_name { public void init() { final String string = getString(); final int bpos = string.indexOf('/'); if (bpos == -1) { prefix = string; surname = ""; suffix = ""; } else { final int epos = string.indexOf('/', bpos + 1); prefix = string.substring(0, bpos); surname = string.substring(bpos + 1, epos); suffix = string.substring(epos + 1); } } }
public class class_name { public void init() { final String string = getString(); final int bpos = string.indexOf('/'); if (bpos == -1) { prefix = string; // depends on control dependency: [if], data = [none] surname = ""; suffix = ""; // depends on control dependency: [if], data = [none] } else { final int epos = string.indexOf('/', bpos + 1); prefix = string.substring(0, bpos); // depends on control dependency: [if], data = [none] surname = string.substring(bpos + 1, epos); // depends on control dependency: [if], data = [(bpos] suffix = string.substring(epos + 1); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override protected Object doExec(Element element, Object scope, String expression, Object... arguments) throws TemplateException { if(expression.isEmpty()) { throw new TemplateException("Invalid ATTR operand. Attribute property path expression is empty."); } Set<Attr> syntheticAttributes = new HashSet<Attr>(); PairsList pairs = new PairsList(expression); for(Pair pair : pairs) { // accordingly this operator expression syntax first value is attribute name and second is property path String value = content.getString(scope, pair.second()); if(value != null) { syntheticAttributes.add(new AttrImpl(pair.first(), value)); } } return syntheticAttributes; } }
public class class_name { @Override protected Object doExec(Element element, Object scope, String expression, Object... arguments) throws TemplateException { if(expression.isEmpty()) { throw new TemplateException("Invalid ATTR operand. Attribute property path expression is empty."); } Set<Attr> syntheticAttributes = new HashSet<Attr>(); PairsList pairs = new PairsList(expression); for(Pair pair : pairs) { // accordingly this operator expression syntax first value is attribute name and second is property path String value = content.getString(scope, pair.second()); if(value != null) { syntheticAttributes.add(new AttrImpl(pair.first(), value)); // depends on control dependency: [if], data = [none] } } return syntheticAttributes; } }
public class class_name { @Override public Operation addCallback(String key, Callback value) { if (value == null) { return this; } if (this.callbacks == null) { this.callbacks = new HashMap<>(); } callbacks.put(key, value); return this; } }
public class class_name { @Override public Operation addCallback(String key, Callback value) { if (value == null) { return this; // depends on control dependency: [if], data = [none] } if (this.callbacks == null) { this.callbacks = new HashMap<>(); // depends on control dependency: [if], data = [none] } callbacks.put(key, value); return this; } }
public class class_name { public Table build(DB db) { if (tableName == null) { throw new InvalidOperationException("The table name has not been set."); } if (tableColumns == null) { tableColumns = ALL_COLUMNS; } return new Table(CallInfo.create(), db, tableName, tableColumns, keyColumns); } }
public class class_name { public Table build(DB db) { if (tableName == null) { throw new InvalidOperationException("The table name has not been set."); } if (tableColumns == null) { tableColumns = ALL_COLUMNS; // depends on control dependency: [if], data = [none] } return new Table(CallInfo.create(), db, tableName, tableColumns, keyColumns); } }
public class class_name { public long pop() { if (count < 0) { return -1; } String key = String.format(Locale.CHINA, TIME_KEY, count); count--; return pop(key); } }
public class class_name { public long pop() { if (count < 0) { return -1; // depends on control dependency: [if], data = [none] } String key = String.format(Locale.CHINA, TIME_KEY, count); count--; return pop(key); } }
public class class_name { public EEnum getGSMXMODE() { if (gsmxmodeEEnum == null) { gsmxmodeEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(148); } return gsmxmodeEEnum; } }
public class class_name { public EEnum getGSMXMODE() { if (gsmxmodeEEnum == null) { gsmxmodeEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(148); // depends on control dependency: [if], data = [none] } return gsmxmodeEEnum; } }
public class class_name { private final void step4() { switch (b[k]) { case 'e': if (ends("icate")) { r("ic"); break; } if (ends("ative")) { r(""); break; } if (ends("alize")) { r("al"); break; } break; case 'i': if (ends("iciti")) { r("ic"); break; } break; case 'l': if (ends("ical")) { r("ic"); break; } if (ends("ful")) { r(""); break; } break; case 's': if (ends("ness")) { r(""); break; } break; } } }
public class class_name { private final void step4() { switch (b[k]) { case 'e': if (ends("icate")) { r("ic"); // depends on control dependency: [if], data = [none] break; } if (ends("ative")) { r(""); // depends on control dependency: [if], data = [none] break; } if (ends("alize")) { r("al"); // depends on control dependency: [if], data = [none] break; } break; case 'i': if (ends("iciti")) { r("ic"); // depends on control dependency: [if], data = [none] break; } break; case 'l': if (ends("ical")) { r("ic"); // depends on control dependency: [if], data = [none] break; } if (ends("ful")) { r(""); // depends on control dependency: [if], data = [none] break; } break; case 's': if (ends("ness")) { r(""); // depends on control dependency: [if], data = [none] break; } break; } } }
public class class_name { public static String calendarIncludes(Locale locale, String style) { StringBuffer result = new StringBuffer(512); String calendarPath = CmsWorkplace.getSkinUri() + "components/js_calendar/"; if (CmsStringUtil.isEmpty(style)) { style = "system"; } result.append("<link rel=\"stylesheet\" type=\"text/css\" href=\""); result.append(calendarPath); result.append("calendar-"); result.append(style); result.append(".css\">\n"); result.append("<script type=\"text/javascript\" src=\""); result.append(calendarPath); result.append("calendar.js\"></script>\n"); result.append("<script type=\"text/javascript\" src=\""); result.append(calendarPath); result.append("lang/calendar-"); result.append(getLanguageSuffix(locale.getLanguage())); result.append(".js\"></script>\n"); result.append("<script type=\"text/javascript\" src=\""); result.append(calendarPath); result.append("calendar-setup.js\"></script>\n"); return result.toString(); } }
public class class_name { public static String calendarIncludes(Locale locale, String style) { StringBuffer result = new StringBuffer(512); String calendarPath = CmsWorkplace.getSkinUri() + "components/js_calendar/"; if (CmsStringUtil.isEmpty(style)) { style = "system"; // depends on control dependency: [if], data = [none] } result.append("<link rel=\"stylesheet\" type=\"text/css\" href=\""); result.append(calendarPath); result.append("calendar-"); result.append(style); result.append(".css\">\n"); result.append("<script type=\"text/javascript\" src=\""); result.append(calendarPath); result.append("calendar.js\"></script>\n"); result.append("<script type=\"text/javascript\" src=\""); result.append(calendarPath); result.append("lang/calendar-"); result.append(getLanguageSuffix(locale.getLanguage())); result.append(".js\"></script>\n"); result.append("<script type=\"text/javascript\" src=\""); result.append(calendarPath); result.append("calendar-setup.js\"></script>\n"); return result.toString(); } }
public class class_name { protected Object getTopRowBean(final List<Integer> row) { // Get root level List<?> lvl = getBeanList(); if (lvl == null || lvl.isEmpty()) { return null; } // Get root row bean (ie top level) int rowIdx = row.get(0); Object rowData = lvl.get(rowIdx); return rowData; } }
public class class_name { protected Object getTopRowBean(final List<Integer> row) { // Get root level List<?> lvl = getBeanList(); if (lvl == null || lvl.isEmpty()) { return null; // depends on control dependency: [if], data = [none] } // Get root row bean (ie top level) int rowIdx = row.get(0); Object rowData = lvl.get(rowIdx); return rowData; } }
public class class_name { public static final Token restore(java.io.DataInputStream dataInputStream, ObjectManagerState objectManagerState) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(cclass , "restore" , new Object[] { dataInputStream, objectManagerState }); int objectStoreIdentifier; long storedObjectIdentifier; try { byte version = dataInputStream.readByte(); if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled()) trace.debug(cclass, "restore", new Object[] { new Byte(version) }); objectStoreIdentifier = dataInputStream.readInt(); storedObjectIdentifier = dataInputStream.readLong(); } catch (java.io.IOException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(cclass, "restore", exception, "1:400:1.14"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(cclass, "restore", "via PermanentIOException"); throw new PermanentIOException(cclass, exception); } // catch (java.io.IOException exception). Token tokenToReturn = new Token(objectManagerState.getObjectStore(objectStoreIdentifier), storedObjectIdentifier); // Swap for the definitive Token. // TODO should have a smarter version of like() which takes a storedObjectIdentifier, // instead of requiring a new Token(). tokenToReturn = tokenToReturn.current(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(cclass , "restore" , "returns token=" + tokenToReturn + "(Token)" ); return tokenToReturn; } }
public class class_name { public static final Token restore(java.io.DataInputStream dataInputStream, ObjectManagerState objectManagerState) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(cclass , "restore" , new Object[] { dataInputStream, objectManagerState }); int objectStoreIdentifier; long storedObjectIdentifier; try { byte version = dataInputStream.readByte(); if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled()) trace.debug(cclass, "restore", new Object[] { new Byte(version) }); objectStoreIdentifier = dataInputStream.readInt(); // depends on control dependency: [try], data = [none] storedObjectIdentifier = dataInputStream.readLong(); // depends on control dependency: [try], data = [none] } catch (java.io.IOException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(cclass, "restore", exception, "1:400:1.14"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(cclass, "restore", "via PermanentIOException"); throw new PermanentIOException(cclass, exception); } // catch (java.io.IOException exception). // depends on control dependency: [catch], data = [none] Token tokenToReturn = new Token(objectManagerState.getObjectStore(objectStoreIdentifier), storedObjectIdentifier); // Swap for the definitive Token. // TODO should have a smarter version of like() which takes a storedObjectIdentifier, // instead of requiring a new Token(). tokenToReturn = tokenToReturn.current(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(cclass , "restore" , "returns token=" + tokenToReturn + "(Token)" ); return tokenToReturn; } }
public class class_name { @Override public Query rewrite(IndexReader reader) throws IOException { Query cQuery = contextQuery.rewrite(reader); // only try to compact if no position is specified if (position == LocationStepQueryNode.NONE) { if (cQuery instanceof DescendantSelfAxisQuery) { DescendantSelfAxisQuery dsaq = (DescendantSelfAxisQuery)cQuery; if (dsaq.subQueryMatchesAll()) { Query sub; if (nameTest == null) { sub = new MatchAllDocsQuery(indexConfig); } else { sub = new NameQuery(nameTest, version, nsMappings); } return new DescendantSelfAxisQuery(dsaq.getContextQuery(), sub, dsaq.getMinLevels() + 1, indexConfig) .rewrite(reader); } } } // if we get here we could not compact the query if (cQuery == contextQuery) // NOSONAR { return this; } else { return new ChildAxisQuery(itemMgr, cQuery, nameTest, position, version, nsMappings, indexConfig); } } }
public class class_name { @Override public Query rewrite(IndexReader reader) throws IOException { Query cQuery = contextQuery.rewrite(reader); // only try to compact if no position is specified if (position == LocationStepQueryNode.NONE) { if (cQuery instanceof DescendantSelfAxisQuery) { DescendantSelfAxisQuery dsaq = (DescendantSelfAxisQuery)cQuery; if (dsaq.subQueryMatchesAll()) { Query sub; if (nameTest == null) { sub = new MatchAllDocsQuery(indexConfig); // depends on control dependency: [if], data = [none] } else { sub = new NameQuery(nameTest, version, nsMappings); // depends on control dependency: [if], data = [(nameTest] } return new DescendantSelfAxisQuery(dsaq.getContextQuery(), sub, dsaq.getMinLevels() + 1, indexConfig) .rewrite(reader); // depends on control dependency: [if], data = [none] } } } // if we get here we could not compact the query if (cQuery == contextQuery) // NOSONAR { return this; } else { return new ChildAxisQuery(itemMgr, cQuery, nameTest, position, version, nsMappings, indexConfig); } } }
public class class_name { @SuppressWarnings("unchecked") public int compareTo(Pair<T1,T2> another) { int comp = ((Comparable<T1>) first()).compareTo(another.first()); if (comp != 0) { return comp; } else { return ((Comparable<T2>) second()).compareTo(another.second()); } } }
public class class_name { @SuppressWarnings("unchecked") public int compareTo(Pair<T1,T2> another) { int comp = ((Comparable<T1>) first()).compareTo(another.first()); if (comp != 0) { return comp; // depends on control dependency: [if], data = [none] } else { return ((Comparable<T2>) second()).compareTo(another.second()); // depends on control dependency: [if], data = [none] } } }
public class class_name { public CsvWriter write(Collection<String[]> lines) throws IORuntimeException { if (CollUtil.isNotEmpty(lines)) { for (final String[] values : lines) { appendLine(values); } flush(); } return this; } }
public class class_name { public CsvWriter write(Collection<String[]> lines) throws IORuntimeException { if (CollUtil.isNotEmpty(lines)) { for (final String[] values : lines) { appendLine(values); // depends on control dependency: [for], data = [values] } flush(); } return this; } }
public class class_name { @Override protected void doSuccessResponse(SipServletResponse resp) throws ServletException, IOException { if (resp.getStatus() == SipServletResponse.SC_OK) { String audioFilePath = (String)getServletContext().getAttribute("audioFilePath"); logger.info("audio file path is " + audioFilePath); try { MsPeer peer = MsPeerFactory.getPeer("org.mobicents.mscontrol.impl.MsPeerImpl"); MsProvider provider = peer.getProvider(); MsSession session = provider.createSession(); MsConnection connection = session.createNetworkConnection(PR_JNDI_NAME); MediaConnectionListener listener = new MediaConnectionListener(); listener.setResponse(resp); listener.setAudioFilePath(audioFilePath); connection.addConnectionListener(listener); Object sdpObj = resp.getContent(); byte[] sdpBytes = (byte[]) sdpObj; String sdp = new String(sdpBytes); connection.modify("$", sdp); } catch (ClassNotFoundException e) { logger.error("class not found ", e); } } } }
public class class_name { @Override protected void doSuccessResponse(SipServletResponse resp) throws ServletException, IOException { if (resp.getStatus() == SipServletResponse.SC_OK) { String audioFilePath = (String)getServletContext().getAttribute("audioFilePath"); logger.info("audio file path is " + audioFilePath); try { MsPeer peer = MsPeerFactory.getPeer("org.mobicents.mscontrol.impl.MsPeerImpl"); MsProvider provider = peer.getProvider(); MsSession session = provider.createSession(); MsConnection connection = session.createNetworkConnection(PR_JNDI_NAME); MediaConnectionListener listener = new MediaConnectionListener(); listener.setResponse(resp); // depends on control dependency: [try], data = [none] listener.setAudioFilePath(audioFilePath); // depends on control dependency: [try], data = [none] connection.addConnectionListener(listener); // depends on control dependency: [try], data = [none] Object sdpObj = resp.getContent(); byte[] sdpBytes = (byte[]) sdpObj; String sdp = new String(sdpBytes); connection.modify("$", sdp); // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException e) { logger.error("class not found ", e); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { private void parsev0CookieDateRFC1123compat(Map<?, ?> props) { Object value = props.get(HttpConfigConstants.PROPNAME_V0_COOKIE_RFC1123_COMPAT); if (null != value) { this.v0CookieDateRFC1123compat = convertBoolean(value); } if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Config: v0CookieDateRFC1123compat is " + isv0CookieDateRFC1123compat() + " this = " + this); } } }
public class class_name { private void parsev0CookieDateRFC1123compat(Map<?, ?> props) { Object value = props.get(HttpConfigConstants.PROPNAME_V0_COOKIE_RFC1123_COMPAT); if (null != value) { this.v0CookieDateRFC1123compat = convertBoolean(value); // depends on control dependency: [if], data = [value)] } if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Config: v0CookieDateRFC1123compat is " + isv0CookieDateRFC1123compat() + " this = " + this); // depends on control dependency: [if], data = [none] } } }
public class class_name { public URI toUri(final String stringUri) { try { final java.net.URI netUri = new java.net.URI(stringUri); return this.toEmfUri(netUri); } catch (Throwable _e) { throw Exceptions.sneakyThrow(_e); } } }
public class class_name { public URI toUri(final String stringUri) { try { final java.net.URI netUri = new java.net.URI(stringUri); return this.toEmfUri(netUri); // depends on control dependency: [try], data = [none] } catch (Throwable _e) { throw Exceptions.sneakyThrow(_e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { void consume(Purchase itemInfo) throws IabException { checkNotDisposed(); checkSetupDone("consume"); if (!itemInfo.mItemType.equals(ITEM_TYPE_INAPP)) { throw new IabException(IABHELPER_INVALID_CONSUMPTION, "Items of type '" + itemInfo.mItemType + "' can't be consumed."); } try { String token = itemInfo.getToken(); String sku = itemInfo.getSku(); if (token == null || token.equals("")) { logError("Can't consume "+ sku + ". No token."); throw new IabException(IABHELPER_MISSING_TOKEN, "PurchaseInfo is missing token for sku: " + sku + " " + itemInfo); } logDebug("Consuming sku: " + sku + ", token: " + token); int response = mService.consumePurchase(3, mContext.getPackageName(), token); if (response == BILLING_RESPONSE_RESULT_OK) { logDebug("Successfully consumed sku: " + sku); } else { logDebug("Error consuming consuming sku " + sku + ". " + getResponseDesc(response)); throw new IabException(response, "Error consuming sku " + sku); } } catch (RemoteException e) { throw new IabException(IABHELPER_REMOTE_EXCEPTION, "Remote exception while consuming. PurchaseInfo: " + itemInfo, e); } } }
public class class_name { void consume(Purchase itemInfo) throws IabException { checkNotDisposed(); checkSetupDone("consume"); if (!itemInfo.mItemType.equals(ITEM_TYPE_INAPP)) { throw new IabException(IABHELPER_INVALID_CONSUMPTION, "Items of type '" + itemInfo.mItemType + "' can't be consumed."); } try { String token = itemInfo.getToken(); String sku = itemInfo.getSku(); if (token == null || token.equals("")) { logError("Can't consume "+ sku + ". No token."); // depends on control dependency: [if], data = [none] throw new IabException(IABHELPER_MISSING_TOKEN, "PurchaseInfo is missing token for sku: " + sku + " " + itemInfo); } logDebug("Consuming sku: " + sku + ", token: " + token); int response = mService.consumePurchase(3, mContext.getPackageName(), token); if (response == BILLING_RESPONSE_RESULT_OK) { logDebug("Successfully consumed sku: " + sku); // depends on control dependency: [if], data = [none] } else { logDebug("Error consuming consuming sku " + sku + ". " + getResponseDesc(response)); // depends on control dependency: [if], data = [(response] throw new IabException(response, "Error consuming sku " + sku); } } catch (RemoteException e) { throw new IabException(IABHELPER_REMOTE_EXCEPTION, "Remote exception while consuming. PurchaseInfo: " + itemInfo, e); } } }
public class class_name { @NonNull @Override public MutableArray setValue(int index, Object value) { synchronized (lock) { if (Fleece.valueWouldChange(value, internalArray.get(index), internalArray) && (!internalArray.set(index, Fleece.toCBLObject(value)))) { throwRangeException(index); } return this; } } }
public class class_name { @NonNull @Override public MutableArray setValue(int index, Object value) { synchronized (lock) { if (Fleece.valueWouldChange(value, internalArray.get(index), internalArray) && (!internalArray.set(index, Fleece.toCBLObject(value)))) { throwRangeException(index); // depends on control dependency: [if], data = [none] } return this; } } }
public class class_name { public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { if (children == null) { children = new HashMap(); } PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName); if (child == null) { child = new PropertyChangeSupport(source); children.put(propertyName, child); } child.addPropertyChangeListener(listener); } }
public class class_name { public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { if (children == null) { children = new HashMap(); // depends on control dependency: [if], data = [none] } PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName); if (child == null) { child = new PropertyChangeSupport(source); // depends on control dependency: [if], data = [none] children.put(propertyName, child); // depends on control dependency: [if], data = [none] } child.addPropertyChangeListener(listener); } }
public class class_name { static Object[] copyAsObjectArray(Object[] elements, int offset, int length) { checkPositionIndexes(offset, offset + length, elements.length); if (length == 0) { return new Object[0]; } Object[] result = new Object[length]; System.arraycopy(elements, offset, result, 0, length); return result; } }
public class class_name { static Object[] copyAsObjectArray(Object[] elements, int offset, int length) { checkPositionIndexes(offset, offset + length, elements.length); if (length == 0) { return new Object[0]; // depends on control dependency: [if], data = [none] } Object[] result = new Object[length]; System.arraycopy(elements, offset, result, 0, length); return result; } }
public class class_name { public DescribeInstancesResult withReservations(Reservation... reservations) { if (this.reservations == null) { setReservations(new com.amazonaws.internal.SdkInternalList<Reservation>(reservations.length)); } for (Reservation ele : reservations) { this.reservations.add(ele); } return this; } }
public class class_name { public DescribeInstancesResult withReservations(Reservation... reservations) { if (this.reservations == null) { setReservations(new com.amazonaws.internal.SdkInternalList<Reservation>(reservations.length)); // depends on control dependency: [if], data = [none] } for (Reservation ele : reservations) { this.reservations.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public CmsMessageContainer validateWithMessage() { if (m_parsingFailed) { return Messages.get().container(Messages.ERR_SERIALDATE_INVALID_VALUE_0); } if (!isStartSet()) { return Messages.get().container(Messages.ERR_SERIALDATE_START_MISSING_0); } if (!isEndValid()) { return Messages.get().container(Messages.ERR_SERIALDATE_END_BEFORE_START_0); } String key = validatePattern(); if (null != key) { return Messages.get().container(key); } key = validateDuration(); if (null != key) { return Messages.get().container(key); } if (hasTooManyEvents()) { return Messages.get().container( Messages.ERR_SERIALDATE_TOO_MANY_EVENTS_1, Integer.valueOf(CmsSerialDateUtil.getMaxEvents())); } return null; } }
public class class_name { public CmsMessageContainer validateWithMessage() { if (m_parsingFailed) { return Messages.get().container(Messages.ERR_SERIALDATE_INVALID_VALUE_0); // depends on control dependency: [if], data = [none] } if (!isStartSet()) { return Messages.get().container(Messages.ERR_SERIALDATE_START_MISSING_0); // depends on control dependency: [if], data = [none] } if (!isEndValid()) { return Messages.get().container(Messages.ERR_SERIALDATE_END_BEFORE_START_0); // depends on control dependency: [if], data = [none] } String key = validatePattern(); if (null != key) { return Messages.get().container(key); // depends on control dependency: [if], data = [key)] } key = validateDuration(); if (null != key) { return Messages.get().container(key); // depends on control dependency: [if], data = [key)] } if (hasTooManyEvents()) { return Messages.get().container( Messages.ERR_SERIALDATE_TOO_MANY_EVENTS_1, Integer.valueOf(CmsSerialDateUtil.getMaxEvents())); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public byte[] getBytes(int columnIndex) { Object fieldValue = data[columnIndex]; if (fieldValue == null) { return null; } if (fieldValue instanceof byte[]) { return (byte[]) fieldValue; } throw new DBFException("Unsupported type for byte[] at column:" + columnIndex + " " + fieldValue.getClass().getCanonicalName()); } }
public class class_name { public byte[] getBytes(int columnIndex) { Object fieldValue = data[columnIndex]; if (fieldValue == null) { return null; // depends on control dependency: [if], data = [none] } if (fieldValue instanceof byte[]) { return (byte[]) fieldValue; // depends on control dependency: [if], data = [none] } throw new DBFException("Unsupported type for byte[] at column:" + columnIndex + " " + fieldValue.getClass().getCanonicalName()); } }
public class class_name { public String getBody() { JsonNode body=getBodyJson(); if(body!=null) { return body.toString(); } else { return null; } } }
public class class_name { public String getBody() { JsonNode body=getBodyJson(); if(body!=null) { return body.toString(); // depends on control dependency: [if], data = [none] } else { return null; // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException { PathAddress address = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SS7Extension.SUBSYSTEM_NAME)); final ModelNode subsystem = new ModelNode(); subsystem.get(OP).set(ADD); subsystem.get(OP_ADDR).set(address.toModelNode()); list.add(subsystem); // mbean elements while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { switch (Namespace.forUri(reader.getNamespaceURI())) { case SS7_1_0: { final String tagName = reader.getLocalName(); if (tagName.equals(SS7MbeanDefinition.MBEAN)) { parseMbean(reader, address, list); } break; } default: { throw unexpectedElement(reader); } } } } }
public class class_name { @Override public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException { PathAddress address = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SS7Extension.SUBSYSTEM_NAME)); final ModelNode subsystem = new ModelNode(); subsystem.get(OP).set(ADD); subsystem.get(OP_ADDR).set(address.toModelNode()); list.add(subsystem); // mbean elements while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { switch (Namespace.forUri(reader.getNamespaceURI())) { case SS7_1_0: { final String tagName = reader.getLocalName(); if (tagName.equals(SS7MbeanDefinition.MBEAN)) { parseMbean(reader, address, list); // depends on control dependency: [if], data = [none] } break; } default: { throw unexpectedElement(reader); } } } } }
public class class_name { @Override @Deprecated public boolean add(T t) { try { return addSync(t); } finally { if(extensions!=null) { fireOnChangeListeners(); } } } }
public class class_name { @Override @Deprecated public boolean add(T t) { try { return addSync(t); // depends on control dependency: [try], data = [none] } finally { if(extensions!=null) { fireOnChangeListeners(); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public static String hypenToCamelNotation(String str) { if (isEmpty(str)) return str; StringBuilder sb = new StringBuilder(); int len = str.length(); char c; for (int i = 0; i < str.length(); i++) { c = str.charAt(i); if (c == '-') { if (len > ++i) sb.append(Character.toUpperCase(str.charAt(i))); } else sb.append(c); } return sb.toString(); } }
public class class_name { public static String hypenToCamelNotation(String str) { if (isEmpty(str)) return str; StringBuilder sb = new StringBuilder(); int len = str.length(); char c; for (int i = 0; i < str.length(); i++) { c = str.charAt(i); // depends on control dependency: [for], data = [i] if (c == '-') { if (len > ++i) sb.append(Character.toUpperCase(str.charAt(i))); } else sb.append(c); } return sb.toString(); } }
public class class_name { protected void setProcessDefinitionVersionsAndIds(ParsedDeployment parsedDeployment, Map<ProcessDefinitionEntity, ProcessDefinitionEntity> mapNewToOldProcessDefinitions) { CommandContext commandContext = Context.getCommandContext(); for (ProcessDefinitionEntity processDefinition : parsedDeployment.getAllProcessDefinitions()) { int version = 1; ProcessDefinitionEntity latest = mapNewToOldProcessDefinitions.get(processDefinition); if (latest != null) { version = latest.getVersion() + 1; } processDefinition.setVersion(version); processDefinition.setId(getIdForNewProcessDefinition(processDefinition)); if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) { commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_CREATED, processDefinition)); } } } }
public class class_name { protected void setProcessDefinitionVersionsAndIds(ParsedDeployment parsedDeployment, Map<ProcessDefinitionEntity, ProcessDefinitionEntity> mapNewToOldProcessDefinitions) { CommandContext commandContext = Context.getCommandContext(); for (ProcessDefinitionEntity processDefinition : parsedDeployment.getAllProcessDefinitions()) { int version = 1; ProcessDefinitionEntity latest = mapNewToOldProcessDefinitions.get(processDefinition); if (latest != null) { version = latest.getVersion() + 1; // depends on control dependency: [if], data = [none] } processDefinition.setVersion(version); // depends on control dependency: [for], data = [processDefinition] processDefinition.setId(getIdForNewProcessDefinition(processDefinition)); // depends on control dependency: [for], data = [processDefinition] if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) { commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_CREATED, processDefinition)); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public static String[] nullifyBadInput(String[] input) { if (input != null) { if (input.length > 0) { return input; } } return null; } }
public class class_name { public static String[] nullifyBadInput(String[] input) { if (input != null) { if (input.length > 0) { return input; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public EClass getIfcMappedItem() { if (ifcMappedItemEClass == null) { ifcMappedItemEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(305); } return ifcMappedItemEClass; } }
public class class_name { public EClass getIfcMappedItem() { if (ifcMappedItemEClass == null) { ifcMappedItemEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(305); // depends on control dependency: [if], data = [none] } return ifcMappedItemEClass; } }
public class class_name { public void bind(ServletRequest request) { MutablePropertyValues mpvs = new MutablePropertyValues(WebUtils.getParametersStartingWith( request, prefix)); MultipartRequest multipartRequest = WebUtils.getNativeRequest(request, MultipartRequest.class); if (multipartRequest != null) { bindMultipart(multipartRequest.getMultiFileMap(), mpvs); } addBindValues(mpvs, request); doBind(mpvs); } }
public class class_name { public void bind(ServletRequest request) { MutablePropertyValues mpvs = new MutablePropertyValues(WebUtils.getParametersStartingWith( request, prefix)); MultipartRequest multipartRequest = WebUtils.getNativeRequest(request, MultipartRequest.class); if (multipartRequest != null) { bindMultipart(multipartRequest.getMultiFileMap(), mpvs); // depends on control dependency: [if], data = [(multipartRequest] } addBindValues(mpvs, request); doBind(mpvs); } }
public class class_name { @Override public void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext) throws UserIdentityUnauthorizedException { try { ChargingStation chargingStation = repository.findOne(chargingStationId); if (chargingStation != null && chargingStation.isAccepted()) { UpdateChargingStationReservableApiCommand command = gson.fromJson(commandObject, UpdateChargingStationReservableApiCommand.class); ChargingStationId csId = new ChargingStationId(chargingStationId); UserIdentity userIdentity = identityContext.getUserIdentity(); if (command.isReservable()) { checkAuthorization(csId, userIdentity, MakeChargingStationReservableCommand.class); commandGateway.send(new MakeChargingStationReservableCommand(csId, identityContext)); } else { checkAuthorization(csId, userIdentity, MakeChargingStationNotReservableCommand.class); commandGateway.send(new MakeChargingStationNotReservableCommand(csId, identityContext)); } } } catch (JsonSyntaxException e) { throw new IllegalArgumentException("Update charging station reservable command not able to parse the payload, is your JSON correctly formatted?", e); } } }
public class class_name { @Override public void handle(String chargingStationId, JsonObject commandObject, IdentityContext identityContext) throws UserIdentityUnauthorizedException { try { ChargingStation chargingStation = repository.findOne(chargingStationId); if (chargingStation != null && chargingStation.isAccepted()) { UpdateChargingStationReservableApiCommand command = gson.fromJson(commandObject, UpdateChargingStationReservableApiCommand.class); ChargingStationId csId = new ChargingStationId(chargingStationId); UserIdentity userIdentity = identityContext.getUserIdentity(); if (command.isReservable()) { checkAuthorization(csId, userIdentity, MakeChargingStationReservableCommand.class); // depends on control dependency: [if], data = [none] commandGateway.send(new MakeChargingStationReservableCommand(csId, identityContext)); // depends on control dependency: [if], data = [none] } else { checkAuthorization(csId, userIdentity, MakeChargingStationNotReservableCommand.class); // depends on control dependency: [if], data = [none] commandGateway.send(new MakeChargingStationNotReservableCommand(csId, identityContext)); // depends on control dependency: [if], data = [none] } } } catch (JsonSyntaxException e) { throw new IllegalArgumentException("Update charging station reservable command not able to parse the payload, is your JSON correctly formatted?", e); } } }
public class class_name { private static String decodeUrl(final String url) { String decoded = url; if (url != null && url.indexOf('%') >= 0) { final int n = url.length(); final StringBuffer buffer = new StringBuffer(); final ByteBuffer bytes = ByteBuffer.allocate(n); for (int i = 0; i < n;) { if (url.charAt(i) == '%') { try { do { final byte octet = (byte) Integer.parseInt(url.substring(i + 1, i + 3), 16); bytes.put(octet); i += 3; } while (i < n && url.charAt(i) == '%'); continue; } catch (final RuntimeException e) { // malformed percent-encoded octet, fall through and // append characters literally } finally { if (bytes.position() > 0) { bytes.flip(); buffer.append(Charsets.UTF_8.decode(bytes).toString()); bytes.clear(); } } } buffer.append(url.charAt(i++)); } decoded = buffer.toString(); } return decoded; } }
public class class_name { private static String decodeUrl(final String url) { String decoded = url; if (url != null && url.indexOf('%') >= 0) { final int n = url.length(); final StringBuffer buffer = new StringBuffer(); final ByteBuffer bytes = ByteBuffer.allocate(n); for (int i = 0; i < n;) { if (url.charAt(i) == '%') { try { do { final byte octet = (byte) Integer.parseInt(url.substring(i + 1, i + 3), 16); bytes.put(octet); i += 3; } while (i < n && url.charAt(i) == '%'); continue; } catch (final RuntimeException e) { // malformed percent-encoded octet, fall through and // append characters literally } finally { // depends on control dependency: [catch], data = [none] if (bytes.position() > 0) { bytes.flip(); // depends on control dependency: [if], data = [none] buffer.append(Charsets.UTF_8.decode(bytes).toString()); // depends on control dependency: [if], data = [none] bytes.clear(); // depends on control dependency: [if], data = [none] } } } buffer.append(url.charAt(i++)); // depends on control dependency: [for], data = [i] } decoded = buffer.toString(); // depends on control dependency: [if], data = [none] } return decoded; } }
public class class_name { public T addPropertiesFile(final String file) { if (file != null) { addPropertiesFile(Paths.get(file)); } return getThis(); } }
public class class_name { public T addPropertiesFile(final String file) { if (file != null) { addPropertiesFile(Paths.get(file)); // depends on control dependency: [if], data = [(file] } return getThis(); } }
public class class_name { public static boolean substringEquals(final String s1, final int fromIndex1, final int toIndex1, final String s2, final int fromIndex2, final int toIndex2) { if (toIndex1 < fromIndex1) { throw new IndexOutOfBoundsException(); } if (toIndex2 < fromIndex2) { throw new IndexOutOfBoundsException(); } final int len1 = toIndex1 - fromIndex1; final int len2 = toIndex2 - fromIndex2; if (len1 != len2) { return false; } for (int i = 0; i < len1; ++i) { if (s1.charAt(fromIndex1 + i) != s2.charAt(fromIndex2 + i)) { return false; } } return true; } }
public class class_name { public static boolean substringEquals(final String s1, final int fromIndex1, final int toIndex1, final String s2, final int fromIndex2, final int toIndex2) { if (toIndex1 < fromIndex1) { throw new IndexOutOfBoundsException(); } if (toIndex2 < fromIndex2) { throw new IndexOutOfBoundsException(); } final int len1 = toIndex1 - fromIndex1; final int len2 = toIndex2 - fromIndex2; if (len1 != len2) { return false; // depends on control dependency: [if], data = [none] } for (int i = 0; i < len1; ++i) { if (s1.charAt(fromIndex1 + i) != s2.charAt(fromIndex2 + i)) { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { public static boolean isRegistered(String name) { if (name == null) { throw new IllegalArgumentException("Device name cannot be null"); } Iterator<IpCamDevice> di = DEVICES.iterator(); while (di.hasNext()) { if (di.next().getName().equals(name)) { return true; } } return false; } }
public class class_name { public static boolean isRegistered(String name) { if (name == null) { throw new IllegalArgumentException("Device name cannot be null"); } Iterator<IpCamDevice> di = DEVICES.iterator(); while (di.hasNext()) { if (di.next().getName().equals(name)) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { static boolean targetsExternalPooledConnectionFactory(String resourceAdapter, ServiceRegistry serviceRegistry) { // if the resourceAdapter is not defined, the default behaviour is to create a pooled-connection-factory. if (resourceAdapter == null || resourceAdapter.isEmpty()) { return false; } //let's look into the external-pooled-connection-factory ServiceName pcfName = JMSServices.getPooledConnectionFactoryBaseServiceName(MessagingServices.getActiveMQServiceName("")).append(resourceAdapter); return serviceRegistry.getServiceNames().contains(pcfName); } }
public class class_name { static boolean targetsExternalPooledConnectionFactory(String resourceAdapter, ServiceRegistry serviceRegistry) { // if the resourceAdapter is not defined, the default behaviour is to create a pooled-connection-factory. if (resourceAdapter == null || resourceAdapter.isEmpty()) { return false; // depends on control dependency: [if], data = [none] } //let's look into the external-pooled-connection-factory ServiceName pcfName = JMSServices.getPooledConnectionFactoryBaseServiceName(MessagingServices.getActiveMQServiceName("")).append(resourceAdapter); return serviceRegistry.getServiceNames().contains(pcfName); } }
public class class_name { public int constrains(GeneralNameInterface inputName) throws UnsupportedOperationException { int constraintType; if (inputName == null) constraintType = NAME_DIFF_TYPE; else if (inputName.getType() != (GeneralNameInterface.NAME_RFC822)) { constraintType = NAME_DIFF_TYPE; } else { //RFC2459 specifies that case is not significant in RFC822Names String inName = (((RFC822Name)inputName).getName()).toLowerCase(Locale.ENGLISH); String thisName = name.toLowerCase(Locale.ENGLISH); if (inName.equals(thisName)) { constraintType = NAME_MATCH; } else if (thisName.endsWith(inName)) { /* if both names contain @, then they had to match exactly */ if (inName.indexOf('@') != -1) { constraintType = NAME_SAME_TYPE; } else if (inName.startsWith(".")) { constraintType = NAME_WIDENS; } else { int inNdx = thisName.lastIndexOf(inName); if (thisName.charAt(inNdx-1) == '@' ) { constraintType = NAME_WIDENS; } else { constraintType = NAME_SAME_TYPE; } } } else if (inName.endsWith(thisName)) { /* if thisName contains @, then they had to match exactly */ if (thisName.indexOf('@') != -1) { constraintType = NAME_SAME_TYPE; } else if (thisName.startsWith(".")) { constraintType = NAME_NARROWS; } else { int ndx = inName.lastIndexOf(thisName); if (inName.charAt(ndx-1) == '@') { constraintType = NAME_NARROWS; } else { constraintType = NAME_SAME_TYPE; } } } else { constraintType = NAME_SAME_TYPE; } } return constraintType; } }
public class class_name { public int constrains(GeneralNameInterface inputName) throws UnsupportedOperationException { int constraintType; if (inputName == null) constraintType = NAME_DIFF_TYPE; else if (inputName.getType() != (GeneralNameInterface.NAME_RFC822)) { constraintType = NAME_DIFF_TYPE; } else { //RFC2459 specifies that case is not significant in RFC822Names String inName = (((RFC822Name)inputName).getName()).toLowerCase(Locale.ENGLISH); String thisName = name.toLowerCase(Locale.ENGLISH); if (inName.equals(thisName)) { constraintType = NAME_MATCH; // depends on control dependency: [if], data = [none] } else if (thisName.endsWith(inName)) { /* if both names contain @, then they had to match exactly */ if (inName.indexOf('@') != -1) { constraintType = NAME_SAME_TYPE; // depends on control dependency: [if], data = [none] } else if (inName.startsWith(".")) { constraintType = NAME_WIDENS; // depends on control dependency: [if], data = [none] } else { int inNdx = thisName.lastIndexOf(inName); if (thisName.charAt(inNdx-1) == '@' ) { constraintType = NAME_WIDENS; // depends on control dependency: [if], data = [none] } else { constraintType = NAME_SAME_TYPE; // depends on control dependency: [if], data = [none] } } } else if (inName.endsWith(thisName)) { /* if thisName contains @, then they had to match exactly */ if (thisName.indexOf('@') != -1) { constraintType = NAME_SAME_TYPE; // depends on control dependency: [if], data = [none] } else if (thisName.startsWith(".")) { constraintType = NAME_NARROWS; // depends on control dependency: [if], data = [none] } else { int ndx = inName.lastIndexOf(thisName); if (inName.charAt(ndx-1) == '@') { constraintType = NAME_NARROWS; // depends on control dependency: [if], data = [none] } else { constraintType = NAME_SAME_TYPE; // depends on control dependency: [if], data = [none] } } } else { constraintType = NAME_SAME_TYPE; // depends on control dependency: [if], data = [none] } } return constraintType; } }
public class class_name { private void extractAndAssignValue(String line, int lineNumber, ColumnInfo<Object> columnInfo, String columnStr, int linePos, Object target, ParseError parseError) { Object value = extractValue(line, lineNumber, columnInfo, columnStr, linePos, target, parseError); if (value == null) { assignParseErrorFields(parseError, columnInfo, columnStr); // either error or no value return; } try { columnInfo.setValue(target, value); } catch (Exception e) { parseError.setErrorType(ErrorType.INTERNAL_ERROR); parseError .setMessage("setting value for field '" + columnInfo.getFieldName() + "' error: " + e.getMessage()); assignParseErrorFields(parseError, columnInfo, columnStr); parseError.setLinePos(linePos); } } }
public class class_name { private void extractAndAssignValue(String line, int lineNumber, ColumnInfo<Object> columnInfo, String columnStr, int linePos, Object target, ParseError parseError) { Object value = extractValue(line, lineNumber, columnInfo, columnStr, linePos, target, parseError); if (value == null) { assignParseErrorFields(parseError, columnInfo, columnStr); // depends on control dependency: [if], data = [none] // either error or no value return; // depends on control dependency: [if], data = [none] } try { columnInfo.setValue(target, value); // depends on control dependency: [try], data = [none] } catch (Exception e) { parseError.setErrorType(ErrorType.INTERNAL_ERROR); parseError .setMessage("setting value for field '" + columnInfo.getFieldName() + "' error: " + e.getMessage()); assignParseErrorFields(parseError, columnInfo, columnStr); parseError.setLinePos(linePos); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public List<FacesConfig> getClassloaderFacesConfig(ExternalContext ectx) { List<FacesConfig> appConfigResources = new ArrayList<FacesConfig>(); try { FacesConfigResourceProvider provider = FacesConfigResourceProviderFactory. getFacesConfigResourceProviderFactory(ectx).createFacesConfigResourceProvider(ectx); Collection<URL> facesConfigs = provider.getMetaInfConfigurationResources(ectx); for (URL url : facesConfigs) { if (MyfacesConfig.getCurrentInstance(ectx).isValidateXML()) { validateFacesConfig(ectx, url); } InputStream stream = null; try { stream = openStreamWithoutCache(url); if (log.isLoggable(Level.INFO)) { log.info("Reading config : " + url.toExternalForm()); } appConfigResources.add(getUnmarshaller(ectx).getFacesConfig(stream, url.toExternalForm())); //getDispenser().feed(getUnmarshaller().getFacesConfig(stream, entry.getKey())); } finally { if (stream != null) { stream.close(); } } } } catch (Throwable e) { throw new FacesException(e); } return appConfigResources; } }
public class class_name { @Override public List<FacesConfig> getClassloaderFacesConfig(ExternalContext ectx) { List<FacesConfig> appConfigResources = new ArrayList<FacesConfig>(); try { FacesConfigResourceProvider provider = FacesConfigResourceProviderFactory. getFacesConfigResourceProviderFactory(ectx).createFacesConfigResourceProvider(ectx); Collection<URL> facesConfigs = provider.getMetaInfConfigurationResources(ectx); for (URL url : facesConfigs) { if (MyfacesConfig.getCurrentInstance(ectx).isValidateXML()) { validateFacesConfig(ectx, url); // depends on control dependency: [if], data = [none] } InputStream stream = null; try { stream = openStreamWithoutCache(url); if (log.isLoggable(Level.INFO)) { log.info("Reading config : " + url.toExternalForm()); } appConfigResources.add(getUnmarshaller(ectx).getFacesConfig(stream, url.toExternalForm())); //getDispenser().feed(getUnmarshaller().getFacesConfig(stream, entry.getKey())); } finally { if (stream != null) { stream.close(); } } } } catch (Throwable e) { throw new FacesException(e); } return appConfigResources; } }
public class class_name { public static long binomial(int n, int k) { checkNonNegative("n", n); checkNonNegative("k", k); checkArgument(k <= n, "k (%s) > n (%s)", k, n); if (k > (n >> 1)) { k = n - k; } switch (k) { case 0: return 1; case 1: return n; default: if (n < factorials.length) { return factorials[n] / (factorials[k] * factorials[n - k]); } else if (k >= biggestBinomials.length || n > biggestBinomials[k]) { return Long.MAX_VALUE; } else if (k < biggestSimpleBinomials.length && n <= biggestSimpleBinomials[k]) { // guaranteed not to overflow long result = n--; for (int i = 2; i <= k; n--, i++) { result *= n; result /= i; } return result; } else { int nBits = LongMath.log2(n, RoundingMode.CEILING); long result = 1; long numerator = n--; long denominator = 1; int numeratorBits = nBits; // This is an upper bound on log2(numerator, ceiling). /* * We want to do this in long math for speed, but want to avoid overflow. We adapt the * technique previously used by BigIntegerMath: maintain separate numerator and * denominator accumulators, multiplying the fraction into result when near overflow. */ for (int i = 2; i <= k; i++, n--) { if (numeratorBits + nBits < Long.SIZE - 1) { // It's definitely safe to multiply into numerator and denominator. numerator *= n; denominator *= i; numeratorBits += nBits; } else { // It might not be safe to multiply into numerator and denominator, // so multiply (numerator / denominator) into result. result = multiplyFraction(result, numerator, denominator); numerator = n; denominator = i; numeratorBits = nBits; } } return multiplyFraction(result, numerator, denominator); } } } }
public class class_name { public static long binomial(int n, int k) { checkNonNegative("n", n); checkNonNegative("k", k); checkArgument(k <= n, "k (%s) > n (%s)", k, n); if (k > (n >> 1)) { k = n - k; // depends on control dependency: [if], data = [none] } switch (k) { case 0: return 1; case 1: return n; default: if (n < factorials.length) { return factorials[n] / (factorials[k] * factorials[n - k]); // depends on control dependency: [if], data = [none] } else if (k >= biggestBinomials.length || n > biggestBinomials[k]) { return Long.MAX_VALUE; // depends on control dependency: [if], data = [none] } else if (k < biggestSimpleBinomials.length && n <= biggestSimpleBinomials[k]) { // guaranteed not to overflow long result = n--; for (int i = 2; i <= k; n--, i++) { result *= n; // depends on control dependency: [for], data = [none] result /= i; // depends on control dependency: [for], data = [i] } return result; // depends on control dependency: [if], data = [none] } else { int nBits = LongMath.log2(n, RoundingMode.CEILING); long result = 1; long numerator = n--; long denominator = 1; int numeratorBits = nBits; // This is an upper bound on log2(numerator, ceiling). /* * We want to do this in long math for speed, but want to avoid overflow. We adapt the * technique previously used by BigIntegerMath: maintain separate numerator and * denominator accumulators, multiplying the fraction into result when near overflow. */ for (int i = 2; i <= k; i++, n--) { if (numeratorBits + nBits < Long.SIZE - 1) { // It's definitely safe to multiply into numerator and denominator. numerator *= n; // depends on control dependency: [if], data = [none] denominator *= i; // depends on control dependency: [if], data = [none] numeratorBits += nBits; // depends on control dependency: [if], data = [none] } else { // It might not be safe to multiply into numerator and denominator, // so multiply (numerator / denominator) into result. result = multiplyFraction(result, numerator, denominator); // depends on control dependency: [if], data = [none] numerator = n; // depends on control dependency: [if], data = [none] denominator = i; // depends on control dependency: [if], data = [none] numeratorBits = nBits; // depends on control dependency: [if], data = [none] } } return multiplyFraction(result, numerator, denominator); // depends on control dependency: [if], data = [none] } } } }
public class class_name { protected void closeDialog(boolean breakingUp) { m_controller.stopEditingGroupcontainer(); m_editingPlaceholder.removeFromParent(); m_editorDialog.hide(); RootPanel.get().removeStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().groupcontainerEditing()); if (!breakingUp) { m_groupContainer.clearEditingPlaceholder(); Style style = m_groupContainer.getElement().getStyle(); style.clearPosition(); style.clearTop(); style.clearLeft(); style.clearZIndex(); style.clearWidth(); m_parentContainer.insert(m_groupContainer, m_indexPosition); m_groupContainer.getElementOptionBar().setVisible(true); if (!m_groupContainer.iterator().hasNext()) { // group-container is empty, mark it m_groupContainer.addStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().emptyGroupContainer()); } } clearInstance(); removeFromParent(); if (!m_controller.getData().isUseClassicEditor()) { for (Widget element : m_groupContainer) { if (element instanceof CmsContainerPageElementPanel) { ((CmsContainerPageElementPanel)element).removeInlineEditor(); } } } m_controller.reinitializeButtons(); m_controller.reInitInlineEditing(); m_controller.fireEvent(new CmsContainerpageEvent(EventType.elementEdited)); } }
public class class_name { protected void closeDialog(boolean breakingUp) { m_controller.stopEditingGroupcontainer(); m_editingPlaceholder.removeFromParent(); m_editorDialog.hide(); RootPanel.get().removeStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().groupcontainerEditing()); if (!breakingUp) { m_groupContainer.clearEditingPlaceholder(); // depends on control dependency: [if], data = [none] Style style = m_groupContainer.getElement().getStyle(); style.clearPosition(); // depends on control dependency: [if], data = [none] style.clearTop(); // depends on control dependency: [if], data = [none] style.clearLeft(); // depends on control dependency: [if], data = [none] style.clearZIndex(); // depends on control dependency: [if], data = [none] style.clearWidth(); // depends on control dependency: [if], data = [none] m_parentContainer.insert(m_groupContainer, m_indexPosition); // depends on control dependency: [if], data = [none] m_groupContainer.getElementOptionBar().setVisible(true); // depends on control dependency: [if], data = [none] if (!m_groupContainer.iterator().hasNext()) { // group-container is empty, mark it m_groupContainer.addStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().emptyGroupContainer()); // depends on control dependency: [if], data = [none] } } clearInstance(); removeFromParent(); if (!m_controller.getData().isUseClassicEditor()) { for (Widget element : m_groupContainer) { if (element instanceof CmsContainerPageElementPanel) { ((CmsContainerPageElementPanel)element).removeInlineEditor(); // depends on control dependency: [if], data = [none] } } } m_controller.reinitializeButtons(); m_controller.reInitInlineEditing(); m_controller.fireEvent(new CmsContainerpageEvent(EventType.elementEdited)); } }
public class class_name { public void marshall(CopyImageRequest copyImageRequest, ProtocolMarshaller protocolMarshaller) { if (copyImageRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(copyImageRequest.getSourceImageName(), SOURCEIMAGENAME_BINDING); protocolMarshaller.marshall(copyImageRequest.getDestinationImageName(), DESTINATIONIMAGENAME_BINDING); protocolMarshaller.marshall(copyImageRequest.getDestinationRegion(), DESTINATIONREGION_BINDING); protocolMarshaller.marshall(copyImageRequest.getDestinationImageDescription(), DESTINATIONIMAGEDESCRIPTION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(CopyImageRequest copyImageRequest, ProtocolMarshaller protocolMarshaller) { if (copyImageRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(copyImageRequest.getSourceImageName(), SOURCEIMAGENAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(copyImageRequest.getDestinationImageName(), DESTINATIONIMAGENAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(copyImageRequest.getDestinationRegion(), DESTINATIONREGION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(copyImageRequest.getDestinationImageDescription(), DESTINATIONIMAGEDESCRIPTION_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 JvmAnnotationReference findOrAddAnnotation(/* @NonNull */ JvmAnnotationTarget annotationTarget, /* @NonNull */ Notifier context, /* @NonNull */ Class<? extends Annotation> type) { JvmAnnotationReference result = findAnnotation(annotationTarget, type); if (result != null) return result; JvmAnnotationType annotationType = findAnnotationType(type, context); if (annotationType != null) { result = typesFactory.createJvmAnnotationReference(); result.setAnnotation(annotationType); return result; } return null; } }
public class class_name { public JvmAnnotationReference findOrAddAnnotation(/* @NonNull */ JvmAnnotationTarget annotationTarget, /* @NonNull */ Notifier context, /* @NonNull */ Class<? extends Annotation> type) { JvmAnnotationReference result = findAnnotation(annotationTarget, type); if (result != null) return result; JvmAnnotationType annotationType = findAnnotationType(type, context); if (annotationType != null) { result = typesFactory.createJvmAnnotationReference(); // depends on control dependency: [if], data = [none] result.setAnnotation(annotationType); // depends on control dependency: [if], data = [(annotationType] return result; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public HttpResponse executeRequest(HttpRequestBase request) { try { return httpClient.execute(host, request, createContext()); } catch (IOException e) { request.abort(); throw new CouchDbException("Error executing request. ", e); } } }
public class class_name { public HttpResponse executeRequest(HttpRequestBase request) { try { return httpClient.execute(host, request, createContext()); // depends on control dependency: [try], data = [none] } catch (IOException e) { request.abort(); throw new CouchDbException("Error executing request. ", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void setAbstract(final String description) { if (description == null && this.description == null) { return; } else if (description == null) { removeChild(this.description); this.description = null; } else if (this.description == null) { this.description = new KeyValueNode<String>(CommonConstants.CS_ABSTRACT_TITLE, description); appendChild(this.description, false); } else { this.description.setValue(description); } } }
public class class_name { public void setAbstract(final String description) { if (description == null && this.description == null) { return; // depends on control dependency: [if], data = [none] } else if (description == null) { removeChild(this.description); // depends on control dependency: [if], data = [none] this.description = null; // depends on control dependency: [if], data = [none] } else if (this.description == null) { this.description = new KeyValueNode<String>(CommonConstants.CS_ABSTRACT_TITLE, description); // depends on control dependency: [if], data = [none] appendChild(this.description, false); // depends on control dependency: [if], data = [(this.description] } else { this.description.setValue(description); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static base_responses update(nitro_service client, tmtrafficaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { tmtrafficaction updateresources[] = new tmtrafficaction[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new tmtrafficaction(); updateresources[i].name = resources[i].name; updateresources[i].apptimeout = resources[i].apptimeout; updateresources[i].sso = resources[i].sso; updateresources[i].formssoaction = resources[i].formssoaction; updateresources[i].persistentcookie = resources[i].persistentcookie; updateresources[i].initiatelogout = resources[i].initiatelogout; updateresources[i].kcdaccount = resources[i].kcdaccount; updateresources[i].samlssoprofile = resources[i].samlssoprofile; } result = update_bulk_request(client, updateresources); } return result; } }
public class class_name { public static base_responses update(nitro_service client, tmtrafficaction resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { tmtrafficaction updateresources[] = new tmtrafficaction[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new tmtrafficaction(); // depends on control dependency: [for], data = [i] updateresources[i].name = resources[i].name; // depends on control dependency: [for], data = [i] updateresources[i].apptimeout = resources[i].apptimeout; // depends on control dependency: [for], data = [i] updateresources[i].sso = resources[i].sso; // depends on control dependency: [for], data = [i] updateresources[i].formssoaction = resources[i].formssoaction; // depends on control dependency: [for], data = [i] updateresources[i].persistentcookie = resources[i].persistentcookie; // depends on control dependency: [for], data = [i] updateresources[i].initiatelogout = resources[i].initiatelogout; // depends on control dependency: [for], data = [i] updateresources[i].kcdaccount = resources[i].kcdaccount; // depends on control dependency: [for], data = [i] updateresources[i].samlssoprofile = resources[i].samlssoprofile; // depends on control dependency: [for], data = [i] } result = update_bulk_request(client, updateresources); } return result; } }
public class class_name { public void setRefreshInterval(final HttpServletRequest request, final HttpServletResponse response, final int refreshInterval, final String refreshAction, final UtilActionForm form) { if (refreshInterval != 0) { StringBuilder sb = new StringBuilder(250); sb.append(refreshInterval); sb.append("; URL="); sb.append(form.getUrlPrefix()); if (!refreshAction.startsWith("/")) { sb.append("/"); } sb.append(refreshAction); response.setHeader("Refresh", sb.toString()); } } }
public class class_name { public void setRefreshInterval(final HttpServletRequest request, final HttpServletResponse response, final int refreshInterval, final String refreshAction, final UtilActionForm form) { if (refreshInterval != 0) { StringBuilder sb = new StringBuilder(250); sb.append(refreshInterval); // depends on control dependency: [if], data = [(refreshInterval] sb.append("; URL="); // depends on control dependency: [if], data = [none] sb.append(form.getUrlPrefix()); // depends on control dependency: [if], data = [none] if (!refreshAction.startsWith("/")) { sb.append("/"); // depends on control dependency: [if], data = [none] } sb.append(refreshAction); // depends on control dependency: [if], data = [none] response.setHeader("Refresh", sb.toString()); // depends on control dependency: [if], data = [none] } } }
public class class_name { public LinkedHashMap<String,S> process(int max) throws IOException { String line = ""; if(this.line != null && this.line.length() > 0){ line=this.line; } String header = ""; if(this.header != null && this.header.length() > 0){ header=this.header; } StringBuilder sb = new StringBuilder(); int processedSequences=0; boolean keepGoing = true; LinkedHashMap<String,S> sequences = new LinkedHashMap<String,S>(); do { line = line.trim(); // nice to have but probably not needed if (line.length() != 0) { if (line.startsWith(">")) {//start of new fasta record if (sb.length() > 0) { //i.e. if there is already a sequence before //logger.info("Sequence index=" + sequenceIndex); try { @SuppressWarnings("unchecked") S sequence = (S)sequenceCreator.getSequence(sb.toString(), sequenceIndex); headerParser.parseHeader(header, sequence); sequences.put(sequence.getAccession().getID(),sequence); processedSequences++; } catch (CompoundNotFoundException e) { logger.warn("Sequence with header '{}' has unrecognised compounds ({}), it will be ignored", header, e.getMessage()); } sb.setLength(0); //this is faster than allocating new buffers, better memory utilization (same buffer) } header = line.substring(1); } else if (line.startsWith(";")) { } else { //mark the start of the sequence with the fileIndex before the line was read if(sb.length() == 0){ sequenceIndex = fileIndex; } sb.append(line); } } fileIndex = br.getBytesRead(); line = br.readLine(); if (line == null) { //i.e. EOF if ( sb.length() == 0 && header.length() != 0 ) { logger.warn("Can't parse sequence {}. Got sequence of length 0!", sequenceIndex); logger.warn("header: {}", header); header = null; } else if ( sb.length() > 0 ) { //logger.info("Sequence index=" + sequenceIndex + " " + fileIndex ); try { @SuppressWarnings("unchecked") S sequence = (S)sequenceCreator.getSequence(sb.toString(), sequenceIndex); headerParser.parseHeader(header, sequence); sequences.put(sequence.getAccession().getID(),sequence); processedSequences++; header = null; } catch (CompoundNotFoundException e) { logger.warn("Sequence with header '{}' has unrecognised compounds ({}), it will be ignored", header, e.getMessage()); } } keepGoing = false; } if (max > -1 && processedSequences>=max) { keepGoing=false; } } while (keepGoing); this.line = line; this.header= header; return max > -1 && sequences.isEmpty() ? null : sequences; } }
public class class_name { public LinkedHashMap<String,S> process(int max) throws IOException { String line = ""; if(this.line != null && this.line.length() > 0){ line=this.line; } String header = ""; if(this.header != null && this.header.length() > 0){ header=this.header; } StringBuilder sb = new StringBuilder(); int processedSequences=0; boolean keepGoing = true; LinkedHashMap<String,S> sequences = new LinkedHashMap<String,S>(); do { line = line.trim(); // nice to have but probably not needed if (line.length() != 0) { if (line.startsWith(">")) {//start of new fasta record if (sb.length() > 0) { //i.e. if there is already a sequence before //logger.info("Sequence index=" + sequenceIndex); try { @SuppressWarnings("unchecked") S sequence = (S)sequenceCreator.getSequence(sb.toString(), sequenceIndex); headerParser.parseHeader(header, sequence); // depends on control dependency: [try], data = [none] sequences.put(sequence.getAccession().getID(),sequence); // depends on control dependency: [try], data = [none] processedSequences++; // depends on control dependency: [try], data = [none] } catch (CompoundNotFoundException e) { logger.warn("Sequence with header '{}' has unrecognised compounds ({}), it will be ignored", header, e.getMessage()); } // depends on control dependency: [catch], data = [none] sb.setLength(0); //this is faster than allocating new buffers, better memory utilization (same buffer) // depends on control dependency: [if], data = [0)] } header = line.substring(1); // depends on control dependency: [if], data = [none] } else if (line.startsWith(";")) { } else { //mark the start of the sequence with the fileIndex before the line was read if(sb.length() == 0){ sequenceIndex = fileIndex; // depends on control dependency: [if], data = [none] } sb.append(line); // depends on control dependency: [if], data = [none] } } fileIndex = br.getBytesRead(); line = br.readLine(); if (line == null) { //i.e. EOF if ( sb.length() == 0 && header.length() != 0 ) { logger.warn("Can't parse sequence {}. Got sequence of length 0!", sequenceIndex); logger.warn("header: {}", header); header = null; } else if ( sb.length() > 0 ) { //logger.info("Sequence index=" + sequenceIndex + " " + fileIndex ); try { @SuppressWarnings("unchecked") S sequence = (S)sequenceCreator.getSequence(sb.toString(), sequenceIndex); headerParser.parseHeader(header, sequence); sequences.put(sequence.getAccession().getID(),sequence); processedSequences++; header = null; } catch (CompoundNotFoundException e) { logger.warn("Sequence with header '{}' has unrecognised compounds ({}), it will be ignored", header, e.getMessage()); } } keepGoing = false; } if (max > -1 && processedSequences>=max) { keepGoing=false; } } while (keepGoing); this.line = line; this.header= header; return max > -1 && sequences.isEmpty() ? null : sequences; } }
public class class_name { @Override public Parameter doParameter(final Parameter parameter) { if (skipFilter || parameter == null) { return parameter; } if (Parameter.class.equals(parameter.getClass())) { // 通常のパラメータの場合 String key = parameter.getParameterName(); if (getCryptParamKeys().contains(CaseFormat.CAMEL_CASE.convert(key))) { Object obj = parameter.getValue(); if (obj != null && obj instanceof String) { String objStr = obj.toString(); if (StringUtils.isNotEmpty(objStr)) { try { synchronized (encryptCipher) { return new Parameter(key, encrypt(encryptCipher, secretKey, objStr)); } } catch (Exception ex) { return parameter; } } } } } return parameter; } }
public class class_name { @Override public Parameter doParameter(final Parameter parameter) { if (skipFilter || parameter == null) { return parameter; // depends on control dependency: [if], data = [none] } if (Parameter.class.equals(parameter.getClass())) { // 通常のパラメータの場合 String key = parameter.getParameterName(); if (getCryptParamKeys().contains(CaseFormat.CAMEL_CASE.convert(key))) { Object obj = parameter.getValue(); if (obj != null && obj instanceof String) { String objStr = obj.toString(); if (StringUtils.isNotEmpty(objStr)) { try { synchronized (encryptCipher) { // depends on control dependency: [try], data = [none] return new Parameter(key, encrypt(encryptCipher, secretKey, objStr)); } } catch (Exception ex) { return parameter; } // depends on control dependency: [catch], data = [none] } } } } return parameter; } }
public class class_name { public static float nextFloat( final float min, final float max, final Random random ) { if (min >= max) { throw new IllegalArgumentException(format( "min >= max: %f >= %f.", min, max )); } float value = random.nextFloat(); if (min < max) { value = value*(max - min) + min; if (value >= max) { value = nextDown(value); } } return value; } }
public class class_name { public static float nextFloat( final float min, final float max, final Random random ) { if (min >= max) { throw new IllegalArgumentException(format( "min >= max: %f >= %f.", min, max )); } float value = random.nextFloat(); if (min < max) { value = value*(max - min) + min; // depends on control dependency: [if], data = [none] if (value >= max) { value = nextDown(value); // depends on control dependency: [if], data = [(value] } } return value; } }
public class class_name { static String typeArgumentsString(DocEnv env, ClassType cl, boolean full) { if (env.legacyDoclet || cl.getTypeArguments().isEmpty()) { return ""; } StringBuilder s = new StringBuilder(); for (Type t : cl.getTypeArguments()) { s.append(s.length() == 0 ? "<" : ", "); s.append(getTypeString(env, t, full)); } s.append(">"); return s.toString(); } }
public class class_name { static String typeArgumentsString(DocEnv env, ClassType cl, boolean full) { if (env.legacyDoclet || cl.getTypeArguments().isEmpty()) { return ""; // depends on control dependency: [if], data = [none] } StringBuilder s = new StringBuilder(); for (Type t : cl.getTypeArguments()) { s.append(s.length() == 0 ? "<" : ", "); // depends on control dependency: [for], data = [t] s.append(getTypeString(env, t, full)); // depends on control dependency: [for], data = [t] } s.append(">"); return s.toString(); } }
public class class_name { @SuppressWarnings("unchecked") private T readReference(Class<T> type, BufferInput<?> buffer, Serializer serializer) { ReferencePool<?> pool = pools.get(type); if (pool == null) { Constructor<?> constructor = constructorMap.get(type); if (constructor == null) { try { constructor = type.getDeclaredConstructor(ReferenceManager.class); constructor.setAccessible(true); constructorMap.put(type, constructor); } catch (NoSuchMethodException e) { throw new SerializationException("failed to instantiate reference: must provide a single argument constructor", e); } } pool = new ReferencePool<>(createFactory(constructor)); pools.put(type, pool); } T object = (T) pool.acquire(); object.readObject(buffer, serializer); return object; } }
public class class_name { @SuppressWarnings("unchecked") private T readReference(Class<T> type, BufferInput<?> buffer, Serializer serializer) { ReferencePool<?> pool = pools.get(type); if (pool == null) { Constructor<?> constructor = constructorMap.get(type); if (constructor == null) { try { constructor = type.getDeclaredConstructor(ReferenceManager.class); // depends on control dependency: [try], data = [none] constructor.setAccessible(true); // depends on control dependency: [try], data = [none] constructorMap.put(type, constructor); // depends on control dependency: [try], data = [none] } catch (NoSuchMethodException e) { throw new SerializationException("failed to instantiate reference: must provide a single argument constructor", e); } // depends on control dependency: [catch], data = [none] } pool = new ReferencePool<>(createFactory(constructor)); // depends on control dependency: [if], data = [none] pools.put(type, pool); // depends on control dependency: [if], data = [none] } T object = (T) pool.acquire(); object.readObject(buffer, serializer); return object; } }
public class class_name { private static Connection connect(final String url, final String user, final String password) throws NamingException, SQLException { if (url.toLowerCase(Locale.ROOT).startsWith("java:")) { DataSource source = (DataSource) new InitialContext().lookup(url); if (user == null) { return source.getConnection(); } else { return source.getConnection(user, password); } } else { if (user == null) { return DriverManager.getConnection(url); } else { return DriverManager.getConnection(url, user, password); } } } }
public class class_name { private static Connection connect(final String url, final String user, final String password) throws NamingException, SQLException { if (url.toLowerCase(Locale.ROOT).startsWith("java:")) { DataSource source = (DataSource) new InitialContext().lookup(url); if (user == null) { return source.getConnection(); // depends on control dependency: [if], data = [none] } else { return source.getConnection(user, password); // depends on control dependency: [if], data = [(user] } } else { if (user == null) { return DriverManager.getConnection(url); // depends on control dependency: [if], data = [none] } else { return DriverManager.getConnection(url, user, password); // depends on control dependency: [if], data = [none] } } } }
public class class_name { private MethodRefAmp findLocalMethod() { ServiceRefAmp serviceRefLocal = _serviceRef.getLocalService(); if (serviceRefLocal == null) { return null; } if (_type != null) { return serviceRefLocal.methodByName(_name, _type); } else { return serviceRefLocal.methodByName(_name); } } }
public class class_name { private MethodRefAmp findLocalMethod() { ServiceRefAmp serviceRefLocal = _serviceRef.getLocalService(); if (serviceRefLocal == null) { return null; // depends on control dependency: [if], data = [none] } if (_type != null) { return serviceRefLocal.methodByName(_name, _type); // depends on control dependency: [if], data = [none] } else { return serviceRefLocal.methodByName(_name); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static KeyStore readKeyStore(String type, InputStream in, char[] password) { KeyStore keyStore = null; try { keyStore = KeyStore.getInstance(type); keyStore.load(in, password); } catch (Exception e) { throw new CryptoException(e); } return keyStore; } }
public class class_name { public static KeyStore readKeyStore(String type, InputStream in, char[] password) { KeyStore keyStore = null; try { keyStore = KeyStore.getInstance(type); // depends on control dependency: [try], data = [none] keyStore.load(in, password); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new CryptoException(e); } // depends on control dependency: [catch], data = [none] return keyStore; } }
public class class_name { @Override public void addEventHandlerWithResyncPeriod( ResourceEventHandler<ApiType> handler, long resyncPeriodMillis) { if (stopped) { log.info( "DefaultSharedIndexInformer#Handler was not added to shared informer because it has stopped already"); return; } if (resyncPeriodMillis > 0) { if (resyncPeriodMillis < MINIMUM_RESYNC_PERIOD_MILLIS) { log.warn( "DefaultSharedIndexInformer#resyncPeriod {} is too small. Changing it to the minimum allowed rule of {}", resyncPeriodMillis, MINIMUM_RESYNC_PERIOD_MILLIS); resyncPeriodMillis = MINIMUM_RESYNC_PERIOD_MILLIS; } if (resyncPeriodMillis < this.resyncCheckPeriodMillis) { if (started) { log.warn( "DefaultSharedIndexInformer#resyncPeriod {} is smaller than resyncCheckPeriod {} and the informer has already started. Changing it to {}", resyncPeriodMillis, resyncCheckPeriodMillis); resyncPeriodMillis = resyncCheckPeriodMillis; } else { // if the event handler's resyncPeriod is smaller than the current resyncCheckPeriod, // update resyncCheckPeriod to match resyncPeriod and adjust the resync periods of all // the listeners accordingly this.resyncCheckPeriodMillis = resyncPeriodMillis; } } } ProcessorListener<ApiType> listener = new ProcessorListener( handler, determineResyncPeriod(resyncCheckPeriodMillis, this.resyncCheckPeriodMillis)); if (!started) { this.processor.addListener(listener); return; } this.processor.addAndStartListener(listener); List<ApiType> objectList = this.indexer.list(); for (Object item : objectList) { listener.add(new ProcessorListener.AddNotification(item)); } } }
public class class_name { @Override public void addEventHandlerWithResyncPeriod( ResourceEventHandler<ApiType> handler, long resyncPeriodMillis) { if (stopped) { log.info( "DefaultSharedIndexInformer#Handler was not added to shared informer because it has stopped already"); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } if (resyncPeriodMillis > 0) { if (resyncPeriodMillis < MINIMUM_RESYNC_PERIOD_MILLIS) { log.warn( "DefaultSharedIndexInformer#resyncPeriod {} is too small. Changing it to the minimum allowed rule of {}", resyncPeriodMillis, MINIMUM_RESYNC_PERIOD_MILLIS); // depends on control dependency: [if], data = [none] resyncPeriodMillis = MINIMUM_RESYNC_PERIOD_MILLIS; // depends on control dependency: [if], data = [none] } if (resyncPeriodMillis < this.resyncCheckPeriodMillis) { if (started) { log.warn( "DefaultSharedIndexInformer#resyncPeriod {} is smaller than resyncCheckPeriod {} and the informer has already started. Changing it to {}", resyncPeriodMillis, resyncCheckPeriodMillis); // depends on control dependency: [if], data = [none] resyncPeriodMillis = resyncCheckPeriodMillis; // depends on control dependency: [if], data = [none] } else { // if the event handler's resyncPeriod is smaller than the current resyncCheckPeriod, // update resyncCheckPeriod to match resyncPeriod and adjust the resync periods of all // the listeners accordingly this.resyncCheckPeriodMillis = resyncPeriodMillis; // depends on control dependency: [if], data = [none] } } } ProcessorListener<ApiType> listener = new ProcessorListener( handler, determineResyncPeriod(resyncCheckPeriodMillis, this.resyncCheckPeriodMillis)); if (!started) { this.processor.addListener(listener); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.processor.addAndStartListener(listener); List<ApiType> objectList = this.indexer.list(); for (Object item : objectList) { listener.add(new ProcessorListener.AddNotification(item)); // depends on control dependency: [for], data = [item] } } }
public class class_name { public synchronized void release() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "release"); super.release(); if (poolManager != null) { poolManager.release(this); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "release"); } }
public class class_name { public synchronized void release() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "release"); super.release(); if (poolManager != null) { poolManager.release(this); // depends on control dependency: [if], data = [none] } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "release"); } }
public class class_name { public List<Permission> getUserPermission(String userName) { ACL acl = getServiceDirectoryClient().getACL(AuthScheme.DIRECTORY, userName); int permissionId = 0; if(acl != null){ permissionId = acl.getPermission(); } return PermissionUtil.id2Permissions(permissionId); } }
public class class_name { public List<Permission> getUserPermission(String userName) { ACL acl = getServiceDirectoryClient().getACL(AuthScheme.DIRECTORY, userName); int permissionId = 0; if(acl != null){ permissionId = acl.getPermission(); // depends on control dependency: [if], data = [none] } return PermissionUtil.id2Permissions(permissionId); } }