code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public static JSONCompareResult compareJson(final JSONString expected, final JSONString actual) { final JSONCompareResult result = new JSONCompareResult(); final String expectedJson = expected.toJSONString(); final String actualJson = actual.toJSONString(); if (!expectedJson.equals(actualJson)) { result.fail(""); } return result; } }
public class class_name { public static JSONCompareResult compareJson(final JSONString expected, final JSONString actual) { final JSONCompareResult result = new JSONCompareResult(); final String expectedJson = expected.toJSONString(); final String actualJson = actual.toJSONString(); if (!expectedJson.equals(actualJson)) { result.fail(""); // depends on control dependency: [if], data = [none] } return result; } }
public class class_name { public boolean isTableMin() { // do not support GROUP BY for now if (m_groupByExpressions.isEmpty() == false) { return false; } if (m_aggregateTypes.size() != 1) { return false; } if (m_aggregateTypes.get(0).equals(ExpressionType.AGGREGATE_MIN) == false) { return false; } return true; } }
public class class_name { public boolean isTableMin() { // do not support GROUP BY for now if (m_groupByExpressions.isEmpty() == false) { return false; // depends on control dependency: [if], data = [none] } if (m_aggregateTypes.size() != 1) { return false; // depends on control dependency: [if], data = [none] } if (m_aggregateTypes.get(0).equals(ExpressionType.AGGREGATE_MIN) == false) { return false; // depends on control dependency: [if], data = [none] } return true; } }
public class class_name { protected List<Name> parseSupertypes( TokenStream tokens ) { if (tokens.canConsume('>')) { // There is at least one supertype ... return parseNameList(tokens); } return Collections.emptyList(); } }
public class class_name { protected List<Name> parseSupertypes( TokenStream tokens ) { if (tokens.canConsume('>')) { // There is at least one supertype ... return parseNameList(tokens); // depends on control dependency: [if], data = [none] } return Collections.emptyList(); } }
public class class_name { public void forEach(final Function<T, Void> function) { for ( final ListenerEntry<T> entry : listeners.values() ) { entry.executor.execute ( new Runnable() { @Override public void run() { try { function.apply(entry.listener); } catch ( Throwable e ) { log.error(String.format("Listener (%s) threw an exception", entry.listener), e); } } } ); } } }
public class class_name { public void forEach(final Function<T, Void> function) { for ( final ListenerEntry<T> entry : listeners.values() ) { entry.executor.execute ( new Runnable() { @Override public void run() { try { function.apply(entry.listener); // depends on control dependency: [try], data = [none] } catch ( Throwable e ) { log.error(String.format("Listener (%s) threw an exception", entry.listener), e); } // depends on control dependency: [catch], data = [none] } } ); // depends on control dependency: [for], data = [none] } } }
public class class_name { @Override public boolean deliveryDelayableUnlock(PersistentTransaction tran, long lockID) throws MessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "deliveryDelayableUnlock", "tran=" + tran + "lockID=" + lockID); boolean removeFromDeliveryDelayIndex = false; try { /* * Only if the item is not expiring and its in store and if its not being * removed(removal can happen when destination is being deleted) * we have to unlock. * Else it means the item is being expired and there is no point unlocking an expired item */ if (!isExpired() && isInStore() && isStateLocked()) { //Unlock the item and dont increment the unlock count unlock(lockID, tran, false); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Did not unlock item " + getID() + "whoes item link state is :" + _itemLinkState + " because: either" + "its expired or its not in store or the item link state is not " + "ItemLinkState.STATE_LOCKED"); } // Remove from the unlock index removeFromDeliveryDelayIndex = true; } catch (MessageStoreException e) { //Something wrong has happened.We should not remove from the DeliveryDelayManager so that we can try next time removeFromDeliveryDelayIndex = false; com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.deliveryDelayableUnlock", "1:231:1.145", this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "failed to unlock item " + getID() + " because: " + e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "deliveryDelayableUnlock", removeFromDeliveryDelayIndex); return removeFromDeliveryDelayIndex; } }
public class class_name { @Override public boolean deliveryDelayableUnlock(PersistentTransaction tran, long lockID) throws MessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "deliveryDelayableUnlock", "tran=" + tran + "lockID=" + lockID); boolean removeFromDeliveryDelayIndex = false; try { /* * Only if the item is not expiring and its in store and if its not being * removed(removal can happen when destination is being deleted) * we have to unlock. * Else it means the item is being expired and there is no point unlocking an expired item */ if (!isExpired() && isInStore() && isStateLocked()) { //Unlock the item and dont increment the unlock count unlock(lockID, tran, false); // depends on control dependency: [if], data = [none] } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Did not unlock item " + getID() + "whoes item link state is :" + _itemLinkState + " because: either" + "its expired or its not in store or the item link state is not " + "ItemLinkState.STATE_LOCKED"); } // Remove from the unlock index removeFromDeliveryDelayIndex = true; } catch (MessageStoreException e) { //Something wrong has happened.We should not remove from the DeliveryDelayManager so that we can try next time removeFromDeliveryDelayIndex = false; com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.deliveryDelayableUnlock", "1:231:1.145", this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "failed to unlock item " + getID() + " because: " + e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "deliveryDelayableUnlock", removeFromDeliveryDelayIndex); return removeFromDeliveryDelayIndex; } }
public class class_name { public void setInstanceLevel(int[] enabled, int[] enabledSync, int newLevel, boolean recursive) { // fine grained spec is not defined, use 5.0 level if (newLevel != PmiConstants.LEVEL_FINEGRAIN) { if (newLevel != PmiConstants.LEVEL_UNDEFINED) { setInstanceLevel_V5(newLevel, recursive); /* * not need since PmiConfigManager.updateWithRuntimeSpec is always called before persisting * // Update in-memory EMF object (PMIModule) * if (instance == null) * { * if (PmiConfigManager.isInitialized()) * PmiConfigManager.updateSpec(new String[]{"pmi"}, "", newLevel, recursive, false); * } * else * { * if (PmiConfigManager.isInitialized()) * PmiConfigManager.updateSpec(instance.getPath(), instance.getWCCMStatsType(), newLevel, recursive, false); * } */ } } else { if (enabled != null) setInstanceLevel_FG(enabled, enabledSync, recursive); } // update the statistic set in PMIImpl/config //PMIImpl.setStatisticSet(StatConstants.STATISTIC_SET_CUSTOM); } }
public class class_name { public void setInstanceLevel(int[] enabled, int[] enabledSync, int newLevel, boolean recursive) { // fine grained spec is not defined, use 5.0 level if (newLevel != PmiConstants.LEVEL_FINEGRAIN) { if (newLevel != PmiConstants.LEVEL_UNDEFINED) { setInstanceLevel_V5(newLevel, recursive); // depends on control dependency: [if], data = [(newLevel] /* * not need since PmiConfigManager.updateWithRuntimeSpec is always called before persisting * // Update in-memory EMF object (PMIModule) * if (instance == null) * { * if (PmiConfigManager.isInitialized()) * PmiConfigManager.updateSpec(new String[]{"pmi"}, "", newLevel, recursive, false); * } * else * { * if (PmiConfigManager.isInitialized()) * PmiConfigManager.updateSpec(instance.getPath(), instance.getWCCMStatsType(), newLevel, recursive, false); * } */ } } else { if (enabled != null) setInstanceLevel_FG(enabled, enabledSync, recursive); } // update the statistic set in PMIImpl/config //PMIImpl.setStatisticSet(StatConstants.STATISTIC_SET_CUSTOM); } }
public class class_name { @Override public void decode(FacesContext context) { if (context == null) { throw new NullPointerException(); } // QUESTION can we move forward and support an array? no different than UISelectMany; perhaps need to know // if the value expression is single or multi-valued // ANSWER: I'd rather not right now. String paramValue = context.getExternalContext().getRequestParameterMap().get(getName()); // submitted value will stay as previous value (null on initial request) if a parameter is absent if (paramValue != null) { setSubmittedValue(paramValue); } rawValue = (String) getSubmittedValue(); setValid(true); } }
public class class_name { @Override public void decode(FacesContext context) { if (context == null) { throw new NullPointerException(); } // QUESTION can we move forward and support an array? no different than UISelectMany; perhaps need to know // if the value expression is single or multi-valued // ANSWER: I'd rather not right now. String paramValue = context.getExternalContext().getRequestParameterMap().get(getName()); // submitted value will stay as previous value (null on initial request) if a parameter is absent if (paramValue != null) { setSubmittedValue(paramValue); // depends on control dependency: [if], data = [(paramValue] } rawValue = (String) getSubmittedValue(); setValid(true); } }
public class class_name { protected Set<String> getPrevExpandedRows() { Set<String> prev = getComponentModel().prevExpandedRows; if (prev == null) { return Collections.emptySet(); } else { return Collections.unmodifiableSet(prev); } } }
public class class_name { protected Set<String> getPrevExpandedRows() { Set<String> prev = getComponentModel().prevExpandedRows; if (prev == null) { return Collections.emptySet(); // depends on control dependency: [if], data = [none] } else { return Collections.unmodifiableSet(prev); // depends on control dependency: [if], data = [(prev] } } }
public class class_name { public void visit(Predicate predicate) { if (traverser.isEnteringContext()) { initializePrinters(); } else if (traverser.isLeavingContext()) { printTable(); } super.visit(predicate); } }
public class class_name { public void visit(Predicate predicate) { if (traverser.isEnteringContext()) { initializePrinters(); // depends on control dependency: [if], data = [none] } else if (traverser.isLeavingContext()) { printTable(); // depends on control dependency: [if], data = [none] } super.visit(predicate); } }
public class class_name { public void marshall(PlacedPlayerSession placedPlayerSession, ProtocolMarshaller protocolMarshaller) { if (placedPlayerSession == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(placedPlayerSession.getPlayerId(), PLAYERID_BINDING); protocolMarshaller.marshall(placedPlayerSession.getPlayerSessionId(), PLAYERSESSIONID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(PlacedPlayerSession placedPlayerSession, ProtocolMarshaller protocolMarshaller) { if (placedPlayerSession == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(placedPlayerSession.getPlayerId(), PLAYERID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(placedPlayerSession.getPlayerSessionId(), PLAYERSESSIONID_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 setKey(String key) { if (key == null) { clearKey(); } else { ThreadContext.putContext(dbName, key); } log.debug("set data source key[" + key + "]"); } }
public class class_name { public void setKey(String key) { if (key == null) { clearKey(); // depends on control dependency: [if], data = [none] } else { ThreadContext.putContext(dbName, key); // depends on control dependency: [if], data = [none] } log.debug("set data source key[" + key + "]"); } }
public class class_name { public String getExcludedUsers() { if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_excludedUsers)) { getToNames(); } if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_excludedUsers)) { return ""; } return m_excludedUsers; } }
public class class_name { public String getExcludedUsers() { if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_excludedUsers)) { getToNames(); // depends on control dependency: [if], data = [none] } if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_excludedUsers)) { return ""; // depends on control dependency: [if], data = [none] } return m_excludedUsers; } }
public class class_name { public void marshall(GetIntegrationResponseRequest getIntegrationResponseRequest, ProtocolMarshaller protocolMarshaller) { if (getIntegrationResponseRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getIntegrationResponseRequest.getRestApiId(), RESTAPIID_BINDING); protocolMarshaller.marshall(getIntegrationResponseRequest.getResourceId(), RESOURCEID_BINDING); protocolMarshaller.marshall(getIntegrationResponseRequest.getHttpMethod(), HTTPMETHOD_BINDING); protocolMarshaller.marshall(getIntegrationResponseRequest.getStatusCode(), STATUSCODE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(GetIntegrationResponseRequest getIntegrationResponseRequest, ProtocolMarshaller protocolMarshaller) { if (getIntegrationResponseRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getIntegrationResponseRequest.getRestApiId(), RESTAPIID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(getIntegrationResponseRequest.getResourceId(), RESOURCEID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(getIntegrationResponseRequest.getHttpMethod(), HTTPMETHOD_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(getIntegrationResponseRequest.getStatusCode(), STATUSCODE_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 { @SneakyThrows public static <R> Supplier<R> doIf(final boolean condition, final Supplier<R> trueFunction, final Supplier<R> falseFunction) { return () -> { try { if (condition) { return trueFunction.get(); } return falseFunction.get(); } catch (final Throwable e) { LOGGER.warn(e.getMessage(), e); return falseFunction.get(); } }; } }
public class class_name { @SneakyThrows public static <R> Supplier<R> doIf(final boolean condition, final Supplier<R> trueFunction, final Supplier<R> falseFunction) { return () -> { try { if (condition) { return trueFunction.get(); // depends on control dependency: [if], data = [none] } return falseFunction.get(); // depends on control dependency: [try], data = [none] } catch (final Throwable e) { LOGGER.warn(e.getMessage(), e); return falseFunction.get(); } // depends on control dependency: [catch], data = [none] }; } }
public class class_name { public List<ProjectResourceSpreadType.Period> getPeriod() { if (period == null) { period = new ArrayList<ProjectResourceSpreadType.Period>(); } return this.period; } }
public class class_name { public List<ProjectResourceSpreadType.Period> getPeriod() { if (period == null) { period = new ArrayList<ProjectResourceSpreadType.Period>(); // depends on control dependency: [if], data = [none] } return this.period; } }
public class class_name { @Override public void close() { if (this.closed.compareAndSet(false, true)) { this.connector.close(); log.info("{}: Closed.", this.traceObjectId); } } }
public class class_name { @Override public void close() { if (this.closed.compareAndSet(false, true)) { this.connector.close(); // depends on control dependency: [if], data = [none] log.info("{}: Closed.", this.traceObjectId); // depends on control dependency: [if], data = [none] } } }
public class class_name { private AbstractPolicy matchPolicies(EvaluationCtx eval, Map<String, AbstractPolicy> policyList) throws TopLevelPolicyException { // setup a list of matching policies Map<String, AbstractPolicy> list = new HashMap<String, AbstractPolicy>(); // get an iterator over all the identifiers for (String policyId : policyList.keySet()) { AbstractPolicy policy = policyList.get(policyId); MatchResult match = policy.match(eval); int result = match.getResult(); if (result == MatchResult.INDETERMINATE) { throw new TopLevelPolicyException(match.getStatus()); } // if we matched, we keep track of the matching policy... if (result == MatchResult.MATCH) { // ...first checking if this is the first match and if // we automatically nest policies if (m_combiningAlg == null && list.size() > 0) { ArrayList<String> code = new ArrayList<String>(); code.add(Status.STATUS_PROCESSING_ERROR); Status status = new Status(code, "too many applicable" + " top-level policies"); throw new TopLevelPolicyException(status); } if (logger.isDebugEnabled()) { logger.debug("Matched policy: {}", policyId); } list.put(policyId, policy); } } // no errors happened during the search, so now take the right // action based on how many policies we found switch (list.size()) { case 0: return null; case 1: Iterator<AbstractPolicy> i = list.values().iterator(); AbstractPolicy p = i.next(); return p; default: return new PolicySet(parentPolicyId, m_combiningAlg, m_target, new ArrayList<AbstractPolicy>(list .values())); } } }
public class class_name { private AbstractPolicy matchPolicies(EvaluationCtx eval, Map<String, AbstractPolicy> policyList) throws TopLevelPolicyException { // setup a list of matching policies Map<String, AbstractPolicy> list = new HashMap<String, AbstractPolicy>(); // get an iterator over all the identifiers for (String policyId : policyList.keySet()) { AbstractPolicy policy = policyList.get(policyId); MatchResult match = policy.match(eval); int result = match.getResult(); if (result == MatchResult.INDETERMINATE) { throw new TopLevelPolicyException(match.getStatus()); } // if we matched, we keep track of the matching policy... if (result == MatchResult.MATCH) { // ...first checking if this is the first match and if // we automatically nest policies if (m_combiningAlg == null && list.size() > 0) { ArrayList<String> code = new ArrayList<String>(); code.add(Status.STATUS_PROCESSING_ERROR); // depends on control dependency: [if], data = [none] Status status = new Status(code, "too many applicable" + " top-level policies"); throw new TopLevelPolicyException(status); } if (logger.isDebugEnabled()) { logger.debug("Matched policy: {}", policyId); // depends on control dependency: [if], data = [none] } list.put(policyId, policy); } } // no errors happened during the search, so now take the right // action based on how many policies we found switch (list.size()) { case 0: return null; case 1: Iterator<AbstractPolicy> i = list.values().iterator(); AbstractPolicy p = i.next(); return p; default: return new PolicySet(parentPolicyId, m_combiningAlg, m_target, new ArrayList<AbstractPolicy>(list .values())); } } }
public class class_name { public static Integer getInteger(String propertyName, String envName, Integer defaultValue) { checkEnvName(envName); Integer propertyValue = NumberUtil.toIntObject(System.getProperty(propertyName), null); if (propertyValue != null) { return propertyValue; } else { propertyValue = NumberUtil.toIntObject(System.getenv(envName), null); return propertyValue != null ? propertyValue : defaultValue; } } }
public class class_name { public static Integer getInteger(String propertyName, String envName, Integer defaultValue) { checkEnvName(envName); Integer propertyValue = NumberUtil.toIntObject(System.getProperty(propertyName), null); if (propertyValue != null) { return propertyValue; // depends on control dependency: [if], data = [none] } else { propertyValue = NumberUtil.toIntObject(System.getenv(envName), null); // depends on control dependency: [if], data = [null)] return propertyValue != null ? propertyValue : defaultValue; // depends on control dependency: [if], data = [none] } } }
public class class_name { public static Throwable getThrowable(ServletRequest request) { Throwable error = (Throwable) request.getAttribute(SERVLET_EXCEPTION); if (error == null) { error = (Throwable) request.getAttribute(JSP_EXCEPTION); if (error != null) { /* * The only place that sets JSP_EXCEPTION is * PageContextImpl.handlePageException(). It really should set * SERVLET_EXCEPTION, but that would interfere with the * ErrorReportValve. Therefore, if JSP_EXCEPTION is set, we * need to set SERVLET_EXCEPTION. */ request.setAttribute(SERVLET_EXCEPTION, error); } } return error; } }
public class class_name { public static Throwable getThrowable(ServletRequest request) { Throwable error = (Throwable) request.getAttribute(SERVLET_EXCEPTION); if (error == null) { error = (Throwable) request.getAttribute(JSP_EXCEPTION); // depends on control dependency: [if], data = [none] if (error != null) { /* * The only place that sets JSP_EXCEPTION is * PageContextImpl.handlePageException(). It really should set * SERVLET_EXCEPTION, but that would interfere with the * ErrorReportValve. Therefore, if JSP_EXCEPTION is set, we * need to set SERVLET_EXCEPTION. */ request.setAttribute(SERVLET_EXCEPTION, error); // depends on control dependency: [if], data = [none] } } return error; } }
public class class_name { private List<StyleFilter> initStyleFilters(List<FeatureStyleInfo> styleDefinitions) throws GeomajasException { List<StyleFilter> styleFilters = new ArrayList<StyleFilter>(); if (styleDefinitions == null || styleDefinitions.size() == 0) { styleFilters.add(new StyleFilterImpl()); // use default. } else { for (FeatureStyleInfo styleDef : styleDefinitions) { StyleFilterImpl styleFilterImpl = null; String formula = styleDef.getFormula(); if (null != formula && formula.length() > 0) { styleFilterImpl = new StyleFilterImpl(filterService.parseFilter(formula), styleDef); } else { styleFilterImpl = new StyleFilterImpl(Filter.INCLUDE, styleDef); } styleFilters.add(styleFilterImpl); } } return styleFilters; } }
public class class_name { private List<StyleFilter> initStyleFilters(List<FeatureStyleInfo> styleDefinitions) throws GeomajasException { List<StyleFilter> styleFilters = new ArrayList<StyleFilter>(); if (styleDefinitions == null || styleDefinitions.size() == 0) { styleFilters.add(new StyleFilterImpl()); // use default. } else { for (FeatureStyleInfo styleDef : styleDefinitions) { StyleFilterImpl styleFilterImpl = null; String formula = styleDef.getFormula(); if (null != formula && formula.length() > 0) { styleFilterImpl = new StyleFilterImpl(filterService.parseFilter(formula), styleDef); // depends on control dependency: [if], data = [none] } else { styleFilterImpl = new StyleFilterImpl(Filter.INCLUDE, styleDef); // depends on control dependency: [if], data = [none] } styleFilters.add(styleFilterImpl); // depends on control dependency: [for], data = [none] } } return styleFilters; } }
public class class_name { protected void clearLine() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < terminal.getWidth(); i++) { sb.append(" "); } console.out().print(sb.toString()); } }
public class class_name { protected void clearLine() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < terminal.getWidth(); i++) { sb.append(" "); // depends on control dependency: [for], data = [none] } console.out().print(sb.toString()); } }
public class class_name { public final String entryRuleOperators() throws RecognitionException { String current = null; AntlrDatatypeRuleToken iv_ruleOperators = null; try { // InternalSARL.g:9544:49: (iv_ruleOperators= ruleOperators EOF ) // InternalSARL.g:9545:2: iv_ruleOperators= ruleOperators EOF { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getOperatorsRule()); } pushFollow(FOLLOW_1); iv_ruleOperators=ruleOperators(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { current =iv_ruleOperators.getText(); } match(input,EOF,FOLLOW_2); if (state.failed) return current; } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; } }
public class class_name { public final String entryRuleOperators() throws RecognitionException { String current = null; AntlrDatatypeRuleToken iv_ruleOperators = null; try { // InternalSARL.g:9544:49: (iv_ruleOperators= ruleOperators EOF ) // InternalSARL.g:9545:2: iv_ruleOperators= ruleOperators EOF { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getOperatorsRule()); // depends on control dependency: [if], data = [none] } pushFollow(FOLLOW_1); iv_ruleOperators=ruleOperators(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { current =iv_ruleOperators.getText(); // depends on control dependency: [if], data = [none] } match(input,EOF,FOLLOW_2); if (state.failed) return current; } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; } }
public class class_name { void add( LessExtend lessExtend, String[] mainSelector ) { if( mainSelector == null || mainSelector[0].startsWith( "@media" ) ) { mainSelector = lessExtend.getSelectors(); } else { mainSelector = SelectorUtils.merge( mainSelector, lessExtend.getSelectors() ); } String extendingSelector = lessExtend.getExtendingSelector(); if( lessExtend.isAll() ) { LessExtendResult extend = new LessExtendResult( mainSelector, extendingSelector ); SelectorTokenizer tokenizer = tokenizers.pollLast().init( extendingSelector ); do { String token = tokenizer.next(); if( token == null ) { break; } all.add( token, extend ); } while( true ); tokenizers.addLast( tokenizer ); } else { exact.add( extendingSelector, mainSelector ); } } }
public class class_name { void add( LessExtend lessExtend, String[] mainSelector ) { if( mainSelector == null || mainSelector[0].startsWith( "@media" ) ) { mainSelector = lessExtend.getSelectors(); // depends on control dependency: [if], data = [none] } else { mainSelector = SelectorUtils.merge( mainSelector, lessExtend.getSelectors() ); // depends on control dependency: [if], data = [( mainSelector] } String extendingSelector = lessExtend.getExtendingSelector(); if( lessExtend.isAll() ) { LessExtendResult extend = new LessExtendResult( mainSelector, extendingSelector ); SelectorTokenizer tokenizer = tokenizers.pollLast().init( extendingSelector ); do { String token = tokenizer.next(); if( token == null ) { break; } all.add( token, extend ); } while( true ); tokenizers.addLast( tokenizer ); // depends on control dependency: [if], data = [none] } else { exact.add( extendingSelector, mainSelector ); // depends on control dependency: [if], data = [none] } } }
public class class_name { public NumberFormat getNumberFormat(char field) { Character ovrField; ovrField = Character.valueOf(field); if (overrideMap != null && overrideMap.containsKey(ovrField)) { String nsName = overrideMap.get(ovrField).toString(); NumberFormat nf = numberFormatters.get(nsName); return nf; } else { return numberFormat; } } }
public class class_name { public NumberFormat getNumberFormat(char field) { Character ovrField; ovrField = Character.valueOf(field); if (overrideMap != null && overrideMap.containsKey(ovrField)) { String nsName = overrideMap.get(ovrField).toString(); NumberFormat nf = numberFormatters.get(nsName); return nf; // depends on control dependency: [if], data = [none] } else { return numberFormat; // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(MemberDefinition memberDefinition, ProtocolMarshaller protocolMarshaller) { if (memberDefinition == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(memberDefinition.getCognitoMemberDefinition(), COGNITOMEMBERDEFINITION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(MemberDefinition memberDefinition, ProtocolMarshaller protocolMarshaller) { if (memberDefinition == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(memberDefinition.getCognitoMemberDefinition(), COGNITOMEMBERDEFINITION_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 addPredicate(final INodeReadTrx mTransaction) { assert getPipeStack().size() >= 2; final AbsAxis mPredicate = getPipeStack().pop().getExpr(); if (mPredicate instanceof LiteralExpr) { mPredicate.hasNext(); // if is numeric literal -> abbrev for position() final int type = mTransaction.getNode().getTypeKey(); if (type == NamePageHash.generateHashForString("xs:integer") || type == NamePageHash.generateHashForString("xs:double") || type == NamePageHash.generateHashForString("xs:float") || type == NamePageHash.generateHashForString("xs:decimal")) { throw new IllegalStateException("function fn:position() is not implemented yet."); // getExpression().add( // new PosFilter(transaction, (int) // Double.parseDouble(transaction // .getValue()))); // return; // TODO: YES! it is dirty! // AtomicValue pos = // new AtomicValue(mTransaction.getNode().getRawValue(), // mTransaction // .keyForName("xs:integer")); // long position = mTransaction.getItemList().addItem(pos); // mPredicate.reset(mTransaction.getNode().getNodeKey()); // IAxis function = // new FNPosition(mTransaction, new ArrayList<IAxis>(), // FuncDef.POS.getMin(), FuncDef.POS // .getMax(), // mTransaction.keyForName(FuncDef.POS.getReturnType())); // IAxis expectedPos = new LiteralExpr(mTransaction, position); // // mPredicate = new ValueComp(mTransaction, function, // expectedPos, CompKind.EQ); } } getExpression().add(new PredicateFilterAxis(mTransaction, mPredicate)); } }
public class class_name { public void addPredicate(final INodeReadTrx mTransaction) { assert getPipeStack().size() >= 2; final AbsAxis mPredicate = getPipeStack().pop().getExpr(); if (mPredicate instanceof LiteralExpr) { mPredicate.hasNext(); // depends on control dependency: [if], data = [none] // if is numeric literal -> abbrev for position() final int type = mTransaction.getNode().getTypeKey(); if (type == NamePageHash.generateHashForString("xs:integer") || type == NamePageHash.generateHashForString("xs:double") || type == NamePageHash.generateHashForString("xs:float") || type == NamePageHash.generateHashForString("xs:decimal")) { throw new IllegalStateException("function fn:position() is not implemented yet."); // getExpression().add( // new PosFilter(transaction, (int) // Double.parseDouble(transaction // .getValue()))); // return; // TODO: YES! it is dirty! // AtomicValue pos = // new AtomicValue(mTransaction.getNode().getRawValue(), // mTransaction // .keyForName("xs:integer")); // long position = mTransaction.getItemList().addItem(pos); // mPredicate.reset(mTransaction.getNode().getNodeKey()); // IAxis function = // new FNPosition(mTransaction, new ArrayList<IAxis>(), // FuncDef.POS.getMin(), FuncDef.POS // .getMax(), // mTransaction.keyForName(FuncDef.POS.getReturnType())); // IAxis expectedPos = new LiteralExpr(mTransaction, position); // // mPredicate = new ValueComp(mTransaction, function, // expectedPos, CompKind.EQ); } } getExpression().add(new PredicateFilterAxis(mTransaction, mPredicate)); } }
public class class_name { public double learn(double[] x, double[] y, double weight) { setInput(x); propagate(); double err = weight * computeOutputError(y); if (weight != 1.0) { for (int i = 0; i < outputLayer.units; i++) { outputLayer.error[i] *= weight; } } backpropagate(); adjustWeights(); return err; } }
public class class_name { public double learn(double[] x, double[] y, double weight) { setInput(x); propagate(); double err = weight * computeOutputError(y); if (weight != 1.0) { for (int i = 0; i < outputLayer.units; i++) { outputLayer.error[i] *= weight; // depends on control dependency: [for], data = [i] } } backpropagate(); adjustWeights(); return err; } }
public class class_name { private void plan() { // Mapping of stealer node to list of primary partitions being moved final TreeMultimap<Integer, Integer> stealerToStolenPrimaryPartitions = TreeMultimap.create(); // Output initial and final cluster if(outputDir != null) RebalanceUtils.dumpClusters(currentCluster, finalCluster, outputDir); // Determine which partitions must be stolen for(Node stealerNode: finalCluster.getNodes()) { List<Integer> stolenPrimaryPartitions = RebalanceUtils.getStolenPrimaryPartitions(currentCluster, finalCluster, stealerNode.getId()); if(stolenPrimaryPartitions.size() > 0) { numPrimaryPartitionMoves += stolenPrimaryPartitions.size(); stealerToStolenPrimaryPartitions.putAll(stealerNode.getId(), stolenPrimaryPartitions); } } // Determine plan batch-by-batch int batches = 0; Cluster batchCurrentCluster = Cluster.cloneCluster(currentCluster); List<StoreDefinition> batchCurrentStoreDefs = this.currentStoreDefs; List<StoreDefinition> batchFinalStoreDefs = this.finalStoreDefs; Cluster batchFinalCluster = RebalanceUtils.getInterimCluster(this.currentCluster, this.finalCluster); while(!stealerToStolenPrimaryPartitions.isEmpty()) { int partitions = 0; List<Entry<Integer, Integer>> partitionsMoved = Lists.newArrayList(); for(Entry<Integer, Integer> stealerToPartition: stealerToStolenPrimaryPartitions.entries()) { partitionsMoved.add(stealerToPartition); batchFinalCluster = UpdateClusterUtils.createUpdatedCluster(batchFinalCluster, stealerToPartition.getKey(), Lists.newArrayList(stealerToPartition.getValue())); partitions++; if(partitions == batchSize) break; } // Remove the partitions moved for(Iterator<Entry<Integer, Integer>> partitionMoved = partitionsMoved.iterator(); partitionMoved.hasNext();) { Entry<Integer, Integer> entry = partitionMoved.next(); stealerToStolenPrimaryPartitions.remove(entry.getKey(), entry.getValue()); } if(outputDir != null) RebalanceUtils.dumpClusters(batchCurrentCluster, batchFinalCluster, outputDir, "batch-" + Integer.toString(batches) + "."); // Generate a plan to compute the tasks final RebalanceBatchPlan RebalanceBatchPlan = new RebalanceBatchPlan(batchCurrentCluster, batchCurrentStoreDefs, batchFinalCluster, batchFinalStoreDefs); batchPlans.add(RebalanceBatchPlan); numXZonePartitionStoreMoves += RebalanceBatchPlan.getCrossZonePartitionStoreMoves(); numPartitionStoreMoves += RebalanceBatchPlan.getPartitionStoreMoves(); nodeMoveMap.add(RebalanceBatchPlan.getNodeMoveMap()); zoneMoveMap.add(RebalanceBatchPlan.getZoneMoveMap()); batches++; batchCurrentCluster = Cluster.cloneCluster(batchFinalCluster); // batchCurrentStoreDefs can only be different from // batchFinalStoreDefs for the initial batch. batchCurrentStoreDefs = batchFinalStoreDefs; } logger.info(this); } }
public class class_name { private void plan() { // Mapping of stealer node to list of primary partitions being moved final TreeMultimap<Integer, Integer> stealerToStolenPrimaryPartitions = TreeMultimap.create(); // Output initial and final cluster if(outputDir != null) RebalanceUtils.dumpClusters(currentCluster, finalCluster, outputDir); // Determine which partitions must be stolen for(Node stealerNode: finalCluster.getNodes()) { List<Integer> stolenPrimaryPartitions = RebalanceUtils.getStolenPrimaryPartitions(currentCluster, finalCluster, stealerNode.getId()); if(stolenPrimaryPartitions.size() > 0) { numPrimaryPartitionMoves += stolenPrimaryPartitions.size(); // depends on control dependency: [if], data = [none] stealerToStolenPrimaryPartitions.putAll(stealerNode.getId(), stolenPrimaryPartitions); // depends on control dependency: [if], data = [none] } } // Determine plan batch-by-batch int batches = 0; Cluster batchCurrentCluster = Cluster.cloneCluster(currentCluster); List<StoreDefinition> batchCurrentStoreDefs = this.currentStoreDefs; List<StoreDefinition> batchFinalStoreDefs = this.finalStoreDefs; Cluster batchFinalCluster = RebalanceUtils.getInterimCluster(this.currentCluster, this.finalCluster); while(!stealerToStolenPrimaryPartitions.isEmpty()) { int partitions = 0; List<Entry<Integer, Integer>> partitionsMoved = Lists.newArrayList(); for(Entry<Integer, Integer> stealerToPartition: stealerToStolenPrimaryPartitions.entries()) { partitionsMoved.add(stealerToPartition); // depends on control dependency: [for], data = [stealerToPartition] batchFinalCluster = UpdateClusterUtils.createUpdatedCluster(batchFinalCluster, stealerToPartition.getKey(), Lists.newArrayList(stealerToPartition.getValue())); // depends on control dependency: [for], data = [none] partitions++; // depends on control dependency: [for], data = [none] if(partitions == batchSize) break; } // Remove the partitions moved for(Iterator<Entry<Integer, Integer>> partitionMoved = partitionsMoved.iterator(); partitionMoved.hasNext();) { Entry<Integer, Integer> entry = partitionMoved.next(); stealerToStolenPrimaryPartitions.remove(entry.getKey(), entry.getValue()); // depends on control dependency: [for], data = [none] } if(outputDir != null) RebalanceUtils.dumpClusters(batchCurrentCluster, batchFinalCluster, outputDir, "batch-" + Integer.toString(batches) + "."); // Generate a plan to compute the tasks final RebalanceBatchPlan RebalanceBatchPlan = new RebalanceBatchPlan(batchCurrentCluster, batchCurrentStoreDefs, batchFinalCluster, batchFinalStoreDefs); batchPlans.add(RebalanceBatchPlan); // depends on control dependency: [while], data = [none] numXZonePartitionStoreMoves += RebalanceBatchPlan.getCrossZonePartitionStoreMoves(); // depends on control dependency: [while], data = [none] numPartitionStoreMoves += RebalanceBatchPlan.getPartitionStoreMoves(); // depends on control dependency: [while], data = [none] nodeMoveMap.add(RebalanceBatchPlan.getNodeMoveMap()); // depends on control dependency: [while], data = [none] zoneMoveMap.add(RebalanceBatchPlan.getZoneMoveMap()); // depends on control dependency: [while], data = [none] batches++; // depends on control dependency: [while], data = [none] batchCurrentCluster = Cluster.cloneCluster(batchFinalCluster); // depends on control dependency: [while], data = [none] // batchCurrentStoreDefs can only be different from // batchFinalStoreDefs for the initial batch. batchCurrentStoreDefs = batchFinalStoreDefs; // depends on control dependency: [while], data = [none] } logger.info(this); } }
public class class_name { public EClass getMMO() { if (mmoEClass == null) { mmoEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(300); } return mmoEClass; } }
public class class_name { public EClass getMMO() { if (mmoEClass == null) { mmoEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(300); // depends on control dependency: [if], data = [none] } return mmoEClass; } }
public class class_name { public TableRef create(String primaryKeyName, StorageDataType primaryKeyDataType, String secondaryKeyName, StorageDataType secondaryKeyDataType, StorageProvisionType provisionType, StorageProvisionLoad provisionLoad, OnTableCreation onTableCreation, OnError onError){ PostBodyBuilder pbb = new PostBodyBuilder(context); pbb.addObject("table", this.name); pbb.addObject("provisionLoad", provisionLoad.getValue()); pbb.addObject("provisionType", provisionType.getValue()); Map <String, Object> key = new HashMap<String, Object>(); Map <String, Object> primary = new HashMap<String, Object>(); primary.put("name", primaryKeyName); primary.put("dataType", primaryKeyDataType.toString()); key.put("primary", primary); if(secondaryKeyName != null && secondaryKeyDataType != null){ Map <String, Object> secondary = new HashMap<String, Object>(); secondary.put("name", secondaryKeyName); secondary.put("dataType", secondaryKeyDataType.toString()); key.put("secondary", secondary); } pbb.addObject("key", key); Rest r = new Rest(context, RestType.CREATETABLE, pbb, null); r.onError = onError; r.onTableCreation = onTableCreation; context.processRest(r); return this; } }
public class class_name { public TableRef create(String primaryKeyName, StorageDataType primaryKeyDataType, String secondaryKeyName, StorageDataType secondaryKeyDataType, StorageProvisionType provisionType, StorageProvisionLoad provisionLoad, OnTableCreation onTableCreation, OnError onError){ PostBodyBuilder pbb = new PostBodyBuilder(context); pbb.addObject("table", this.name); pbb.addObject("provisionLoad", provisionLoad.getValue()); pbb.addObject("provisionType", provisionType.getValue()); Map <String, Object> key = new HashMap<String, Object>(); Map <String, Object> primary = new HashMap<String, Object>(); primary.put("name", primaryKeyName); primary.put("dataType", primaryKeyDataType.toString()); key.put("primary", primary); if(secondaryKeyName != null && secondaryKeyDataType != null){ Map <String, Object> secondary = new HashMap<String, Object>(); secondary.put("name", secondaryKeyName); // depends on control dependency: [if], data = [none] secondary.put("dataType", secondaryKeyDataType.toString()); // depends on control dependency: [if], data = [none] key.put("secondary", secondary); // depends on control dependency: [if], data = [none] } pbb.addObject("key", key); Rest r = new Rest(context, RestType.CREATETABLE, pbb, null); r.onError = onError; r.onTableCreation = onTableCreation; context.processRest(r); return this; } }
public class class_name { public static String addObjects( Object... objects ) { int length = 0; for ( Object obj : objects ) { if ( obj == null ) { continue; } length += obj.toString().length(); } CharBuf builder = CharBuf.createExact( length ); for ( Object str : objects ) { if ( str == null ) { continue; } builder.add( str.toString() ); } return builder.toString(); } }
public class class_name { public static String addObjects( Object... objects ) { int length = 0; for ( Object obj : objects ) { if ( obj == null ) { continue; } length += obj.toString().length(); // depends on control dependency: [for], data = [obj] } CharBuf builder = CharBuf.createExact( length ); for ( Object str : objects ) { if ( str == null ) { continue; } builder.add( str.toString() ); // depends on control dependency: [for], data = [str] } return builder.toString(); } }
public class class_name { public void marshall(UpdateBranchRequest updateBranchRequest, ProtocolMarshaller protocolMarshaller) { if (updateBranchRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateBranchRequest.getAppId(), APPID_BINDING); protocolMarshaller.marshall(updateBranchRequest.getBranchName(), BRANCHNAME_BINDING); protocolMarshaller.marshall(updateBranchRequest.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(updateBranchRequest.getFramework(), FRAMEWORK_BINDING); protocolMarshaller.marshall(updateBranchRequest.getStage(), STAGE_BINDING); protocolMarshaller.marshall(updateBranchRequest.getEnableNotification(), ENABLENOTIFICATION_BINDING); protocolMarshaller.marshall(updateBranchRequest.getEnableAutoBuild(), ENABLEAUTOBUILD_BINDING); protocolMarshaller.marshall(updateBranchRequest.getEnvironmentVariables(), ENVIRONMENTVARIABLES_BINDING); protocolMarshaller.marshall(updateBranchRequest.getBasicAuthCredentials(), BASICAUTHCREDENTIALS_BINDING); protocolMarshaller.marshall(updateBranchRequest.getEnableBasicAuth(), ENABLEBASICAUTH_BINDING); protocolMarshaller.marshall(updateBranchRequest.getBuildSpec(), BUILDSPEC_BINDING); protocolMarshaller.marshall(updateBranchRequest.getTtl(), TTL_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(UpdateBranchRequest updateBranchRequest, ProtocolMarshaller protocolMarshaller) { if (updateBranchRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateBranchRequest.getAppId(), APPID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBranchRequest.getBranchName(), BRANCHNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBranchRequest.getDescription(), DESCRIPTION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBranchRequest.getFramework(), FRAMEWORK_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBranchRequest.getStage(), STAGE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBranchRequest.getEnableNotification(), ENABLENOTIFICATION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBranchRequest.getEnableAutoBuild(), ENABLEAUTOBUILD_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBranchRequest.getEnvironmentVariables(), ENVIRONMENTVARIABLES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBranchRequest.getBasicAuthCredentials(), BASICAUTHCREDENTIALS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBranchRequest.getEnableBasicAuth(), ENABLEBASICAUTH_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBranchRequest.getBuildSpec(), BUILDSPEC_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBranchRequest.getTtl(), TTL_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private void calculateMenuItemPosition() { float itemRadius = (expandedRadius + collapsedRadius) / 2, f; RectF area = new RectF( center.x - itemRadius, center.y - itemRadius, center.x + itemRadius, center.y + itemRadius); Path path = new Path(); path.addArc(area, (float) fromAngle, (float) (toAngle - fromAngle)); PathMeasure measure = new PathMeasure(path, false); float len = measure.getLength(); int divisor = getChildCount(); float divider = len / divisor; for (int i = 0; i < getChildCount(); i++) { float[] coords = new float[2]; measure.getPosTan(i * divider + divider * .5f, coords, null); FilterMenu.Item item = (FilterMenu.Item) getChildAt(i).getTag(); item.setX((int) coords[0] - item.getView().getMeasuredWidth() / 2); item.setY((int) coords[1] - item.getView().getMeasuredHeight() / 2); } } }
public class class_name { private void calculateMenuItemPosition() { float itemRadius = (expandedRadius + collapsedRadius) / 2, f; RectF area = new RectF( center.x - itemRadius, center.y - itemRadius, center.x + itemRadius, center.y + itemRadius); Path path = new Path(); path.addArc(area, (float) fromAngle, (float) (toAngle - fromAngle)); PathMeasure measure = new PathMeasure(path, false); float len = measure.getLength(); int divisor = getChildCount(); float divider = len / divisor; for (int i = 0; i < getChildCount(); i++) { float[] coords = new float[2]; measure.getPosTan(i * divider + divider * .5f, coords, null); // depends on control dependency: [for], data = [i] FilterMenu.Item item = (FilterMenu.Item) getChildAt(i).getTag(); item.setX((int) coords[0] - item.getView().getMeasuredWidth() / 2); // depends on control dependency: [for], data = [none] item.setY((int) coords[1] - item.getView().getMeasuredHeight() / 2); // depends on control dependency: [for], data = [none] } } }
public class class_name { @Override public final void encryptLogs() throws Exception { if (this.logDir != null && this.logDir.exists() && !this.logDir.isFile()) { File[] files = this.logDir.listFiles(); if (files != null) { for (File fl : files) { if (fl.getName().endsWith(".log")) { this.cryptoHelper.encryptFile(fl.getPath(), this.backupDir + File.separator + fl.getName() + "en"); } } } } } }
public class class_name { @Override public final void encryptLogs() throws Exception { if (this.logDir != null && this.logDir.exists() && !this.logDir.isFile()) { File[] files = this.logDir.listFiles(); if (files != null) { for (File fl : files) { if (fl.getName().endsWith(".log")) { this.cryptoHelper.encryptFile(fl.getPath(), this.backupDir + File.separator + fl.getName() + "en"); // depends on control dependency: [if], data = [none] } } } } } }
public class class_name { public static double getDoubleParameter(final ServletRequest pReq, final String pName, final double pDefault) { String str = pReq.getParameter(pName); try { return str != null ? Double.parseDouble(str) : pDefault; } catch (NumberFormatException nfe) { return pDefault; } } }
public class class_name { public static double getDoubleParameter(final ServletRequest pReq, final String pName, final double pDefault) { String str = pReq.getParameter(pName); try { return str != null ? Double.parseDouble(str) : pDefault; // depends on control dependency: [try], data = [none] } catch (NumberFormatException nfe) { return pDefault; } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public int size() { try { lockAllSegments(); int size = 0; for (LinkedHashMapSegment<K, V> seg : segments) { size += seg.size(); } return size; } finally { unlockAllSegments(); } } }
public class class_name { @Override public int size() { try { lockAllSegments(); // depends on control dependency: [try], data = [none] int size = 0; for (LinkedHashMapSegment<K, V> seg : segments) { size += seg.size(); // depends on control dependency: [for], data = [seg] } return size; // depends on control dependency: [try], data = [none] } finally { unlockAllSegments(); } } }
public class class_name { public int lookForSelectablePosition(int position, boolean lookDown) { final ListAdapter adapter = getAdapter(); if (adapter == null || isInTouchMode()) { return INVALID_POSITION; } final int count = adapter.getCount(); if (!getAdapter().areAllItemsEnabled()) { if (lookDown) { position = Math.max(0, position); while (position < count && !adapter.isEnabled(position)) { position++; } } else { position = Math.min(position, count - 1); while (position >= 0 && !adapter.isEnabled(position)) { position--; } } if (position < 0 || position >= count) { return INVALID_POSITION; } return position; } else { if (position < 0 || position >= count) { return INVALID_POSITION; } return position; } } }
public class class_name { public int lookForSelectablePosition(int position, boolean lookDown) { final ListAdapter adapter = getAdapter(); if (adapter == null || isInTouchMode()) { return INVALID_POSITION; // depends on control dependency: [if], data = [none] } final int count = adapter.getCount(); if (!getAdapter().areAllItemsEnabled()) { if (lookDown) { position = Math.max(0, position); // depends on control dependency: [if], data = [none] while (position < count && !adapter.isEnabled(position)) { position++; // depends on control dependency: [while], data = [none] } } else { position = Math.min(position, count - 1); // depends on control dependency: [if], data = [none] while (position >= 0 && !adapter.isEnabled(position)) { position--; // depends on control dependency: [while], data = [none] } } if (position < 0 || position >= count) { return INVALID_POSITION; // depends on control dependency: [if], data = [none] } return position; // depends on control dependency: [if], data = [none] } else { if (position < 0 || position >= count) { return INVALID_POSITION; // depends on control dependency: [if], data = [none] } return position; // depends on control dependency: [if], data = [none] } } }
public class class_name { void addTranscoderAt(Transcoder transcoder, int i) { if (numTranscoders == elements.length) { EConvElement[] tmp = new EConvElement[elements.length * 2]; System.arraycopy(elements, 0, tmp, 0, i); System.arraycopy(elements, i, tmp, i + 1, elements.length - i); elements = tmp; } else { System.arraycopy(elements, i, elements, i + 1, elements.length - i - 1); } elements[i] = new EConvElement(transcoder.transcoding(0)); elements[i].allocate(4096); numTranscoders++; if (!decorator(transcoder.source, transcoder.destination)) { for (int j = numTranscoders - 1; i <= j; j--) { Transcoding tc = elements[j].transcoding; Transcoder tr = tc.transcoder; if (!decorator(tr.source, tr.destination)) { lastTranscoding = tc; break; } } } } }
public class class_name { void addTranscoderAt(Transcoder transcoder, int i) { if (numTranscoders == elements.length) { EConvElement[] tmp = new EConvElement[elements.length * 2]; System.arraycopy(elements, 0, tmp, 0, i); // depends on control dependency: [if], data = [none] System.arraycopy(elements, i, tmp, i + 1, elements.length - i); // depends on control dependency: [if], data = [none] elements = tmp; // depends on control dependency: [if], data = [none] } else { System.arraycopy(elements, i, elements, i + 1, elements.length - i - 1); // depends on control dependency: [if], data = [none] } elements[i] = new EConvElement(transcoder.transcoding(0)); elements[i].allocate(4096); numTranscoders++; if (!decorator(transcoder.source, transcoder.destination)) { for (int j = numTranscoders - 1; i <= j; j--) { Transcoding tc = elements[j].transcoding; Transcoder tr = tc.transcoder; if (!decorator(tr.source, tr.destination)) { lastTranscoding = tc; // depends on control dependency: [if], data = [none] break; } } } } }
public class class_name { public List<String> getPossiblePaths(int maxDepth) { if (allDissectors.isEmpty()) { return Collections.emptyList(); // nothing to do. } try { assembleDissectors(); } catch (MissingDissectorsException | InvalidDissectorException e) { // Simply swallow this one } List<String> paths = new ArrayList<>(); Map<String, List<String>> pathNodes = new HashMap<>(); for (Dissector dissector : allDissectors) { final String inputType = dissector.getInputType(); if (inputType == null) { LOG.error("Dissector returns null on getInputType(): [{}]", dissector.getClass().getCanonicalName()); return Collections.emptyList(); } final List<String> outputs = dissector.getPossibleOutput(); if (LOG.isDebugEnabled()) { LOG.debug("------------------------------------"); LOG.debug("Possible: Dissector IN {}", inputType); for (String output: outputs) { LOG.debug("Possible: --> {}", output); } } List<String> existingOutputs = pathNodes.get(inputType); if (existingOutputs != null) { outputs.addAll(existingOutputs); } pathNodes.put(inputType, outputs); } findAdditionalPossiblePaths(pathNodes, paths, "", rootType, maxDepth, ""); for (Entry<String, Set<String>> typeRemappingSet: typeRemappings.entrySet()) { for (String typeRemapping: typeRemappingSet.getValue()) { String remappedPath = typeRemapping + ':' + typeRemappingSet.getKey(); LOG.debug("Adding remapped path: {}", remappedPath); paths.add(remappedPath); findAdditionalPossiblePaths(pathNodes, paths, typeRemappingSet.getKey(), typeRemapping, maxDepth - 1, ""); } } return paths; } }
public class class_name { public List<String> getPossiblePaths(int maxDepth) { if (allDissectors.isEmpty()) { return Collections.emptyList(); // nothing to do. // depends on control dependency: [if], data = [none] } try { assembleDissectors(); // depends on control dependency: [try], data = [none] } catch (MissingDissectorsException | InvalidDissectorException e) { // Simply swallow this one } // depends on control dependency: [catch], data = [none] List<String> paths = new ArrayList<>(); Map<String, List<String>> pathNodes = new HashMap<>(); for (Dissector dissector : allDissectors) { final String inputType = dissector.getInputType(); if (inputType == null) { LOG.error("Dissector returns null on getInputType(): [{}]", dissector.getClass().getCanonicalName()); // depends on control dependency: [if], data = [none] return Collections.emptyList(); // depends on control dependency: [if], data = [none] } final List<String> outputs = dissector.getPossibleOutput(); if (LOG.isDebugEnabled()) { LOG.debug("------------------------------------"); LOG.debug("Possible: Dissector IN {}", inputType); // depends on control dependency: [if], data = [none] for (String output: outputs) { LOG.debug("Possible: --> {}", output); // depends on control dependency: [for], data = [output] } } List<String> existingOutputs = pathNodes.get(inputType); if (existingOutputs != null) { outputs.addAll(existingOutputs); // depends on control dependency: [if], data = [(existingOutputs] } pathNodes.put(inputType, outputs); // depends on control dependency: [for], data = [none] } findAdditionalPossiblePaths(pathNodes, paths, "", rootType, maxDepth, ""); for (Entry<String, Set<String>> typeRemappingSet: typeRemappings.entrySet()) { for (String typeRemapping: typeRemappingSet.getValue()) { String remappedPath = typeRemapping + ':' + typeRemappingSet.getKey(); LOG.debug("Adding remapped path: {}", remappedPath); // depends on control dependency: [for], data = [none] paths.add(remappedPath); // depends on control dependency: [for], data = [none] findAdditionalPossiblePaths(pathNodes, paths, typeRemappingSet.getKey(), typeRemapping, maxDepth - 1, ""); // depends on control dependency: [for], data = [typeRemapping] } } return paths; } }
public class class_name { protected <Y> T getUniqueByAttribute(String attributeName, Y value) { try { return getDatabaseSupport().getUniqueByAttribute(getEntityClass(), attributeName, value); } catch (NoResultException ex) { return null; } } }
public class class_name { protected <Y> T getUniqueByAttribute(String attributeName, Y value) { try { return getDatabaseSupport().getUniqueByAttribute(getEntityClass(), attributeName, value); // depends on control dependency: [try], data = [none] } catch (NoResultException ex) { return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { private String buildMapClickMessage(LatLng latLng, double zoom, BoundingBox boundingBox, double tolerance, Projection projection) { String message = null; // Verify the features are indexed and we are getting information if (isIndexed() && (maxFeaturesInfo || featuresInfo)) { if (isOnAtCurrentZoom(zoom, latLng)) { // Get the number of features in the tile location long tileFeatureCount = tileFeatureCount(latLng, zoom); // If more than a configured max features to draw if (isMoreThanMaxFeatures(tileFeatureCount)) { // Build the max features message if (maxFeaturesInfo) { message = buildMaxFeaturesInfoMessage(tileFeatureCount); } } // Else, query for the features near the click else if (featuresInfo) { // Query for results and build the message FeatureIndexResults results = queryFeatures(boundingBox, projection); message = featureInfoBuilder.buildResultsInfoMessageAndClose(results, tolerance, latLng, projection); } } } return message; } }
public class class_name { private String buildMapClickMessage(LatLng latLng, double zoom, BoundingBox boundingBox, double tolerance, Projection projection) { String message = null; // Verify the features are indexed and we are getting information if (isIndexed() && (maxFeaturesInfo || featuresInfo)) { if (isOnAtCurrentZoom(zoom, latLng)) { // Get the number of features in the tile location long tileFeatureCount = tileFeatureCount(latLng, zoom); // If more than a configured max features to draw if (isMoreThanMaxFeatures(tileFeatureCount)) { // Build the max features message if (maxFeaturesInfo) { message = buildMaxFeaturesInfoMessage(tileFeatureCount); // depends on control dependency: [if], data = [none] } } // Else, query for the features near the click else if (featuresInfo) { // Query for results and build the message FeatureIndexResults results = queryFeatures(boundingBox, projection); message = featureInfoBuilder.buildResultsInfoMessageAndClose(results, tolerance, latLng, projection); // depends on control dependency: [if], data = [none] } } } return message; } }
public class class_name { @SuppressWarnings("unchecked") public static <T> T invoke(Object object, Class<?> clazz, String methodName, Object... arguments) throws Exception { Params.notNull(clazz, "Class"); Params.notNullOrEmpty(methodName, "Method name"); Class<?>[] parameterTypes = getParameterTypes(arguments); try { Method method = clazz.getDeclaredMethod(methodName, parameterTypes); return (T)invoke(object, method, arguments); } catch(NoSuchMethodException e) { // optimistic attempt to locate the method has failed // maybe because method parameters list includes interfaces, primitives or null // there is no other option but to search through all object methods methodsLoop: for(Method method : clazz.getDeclaredMethods()) { Class<?>[] methodParameters = method.getParameterTypes(); if(!method.getName().equals(methodName)) { continue; } if(methodParameters.length != arguments.length) { continue; } // test if concrete arguments list match method formal parameters; if not continue methods loop // null is accepted as any type for(int i = 0; i < arguments.length; i++) { if(arguments[i] != null && !Types.isInstanceOf(arguments[i], methodParameters[i])) { continue methodsLoop; } } return (T)invoke(object, method, arguments); } throw new NoSuchBeingException("Method %s(%s) not found.", methodName, parameterTypes); } } }
public class class_name { @SuppressWarnings("unchecked") public static <T> T invoke(Object object, Class<?> clazz, String methodName, Object... arguments) throws Exception { Params.notNull(clazz, "Class"); Params.notNullOrEmpty(methodName, "Method name"); Class<?>[] parameterTypes = getParameterTypes(arguments); try { Method method = clazz.getDeclaredMethod(methodName, parameterTypes); return (T)invoke(object, method, arguments); // depends on control dependency: [try], data = [none] } catch(NoSuchMethodException e) { // optimistic attempt to locate the method has failed // maybe because method parameters list includes interfaces, primitives or null // there is no other option but to search through all object methods methodsLoop: for(Method method : clazz.getDeclaredMethods()) { Class<?>[] methodParameters = method.getParameterTypes(); if(!method.getName().equals(methodName)) { continue; } if(methodParameters.length != arguments.length) { continue; } // test if concrete arguments list match method formal parameters; if not continue methods loop // null is accepted as any type for(int i = 0; i < arguments.length; i++) { if(arguments[i] != null && !Types.isInstanceOf(arguments[i], methodParameters[i])) { continue methodsLoop; } } return (T)invoke(object, method, arguments); // depends on control dependency: [for], data = [method] } throw new NoSuchBeingException("Method %s(%s) not found.", methodName, parameterTypes); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Nullable public ExpressionStatement rewrite(ExpressionStatement stat) { try { if (!isInteraction(stat)) return null; createBuilder(); setCount(); setCall(); addResponses(); build(); return register(); } catch (InvalidSpecCompileException e) { resources.getErrorReporter().error(e); return null; } } }
public class class_name { @Nullable public ExpressionStatement rewrite(ExpressionStatement stat) { try { if (!isInteraction(stat)) return null; createBuilder(); // depends on control dependency: [try], data = [none] setCount(); // depends on control dependency: [try], data = [none] setCall(); // depends on control dependency: [try], data = [none] addResponses(); // depends on control dependency: [try], data = [none] build(); // depends on control dependency: [try], data = [none] return register(); // depends on control dependency: [try], data = [none] } catch (InvalidSpecCompileException e) { resources.getErrorReporter().error(e); return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { private static void listResourceNotes(ProjectFile file) { for (Resource resource : file.getResources()) { String notes = resource.getNotes(); if (notes.length() != 0) { System.out.println("Notes for " + resource.getName() + ": " + notes); } } System.out.println(); } }
public class class_name { private static void listResourceNotes(ProjectFile file) { for (Resource resource : file.getResources()) { String notes = resource.getNotes(); if (notes.length() != 0) { System.out.println("Notes for " + resource.getName() + ": " + notes); // depends on control dependency: [if], data = [none] } } System.out.println(); } }
public class class_name { protected void fireMySelectionChanged(MyListSelectionEvent event) { this.selectionChanged(event.getSource(), event.getRow(), event.getRow(), event.getType()); // Make sure model knows // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i] == MyListSelectionListener.class) if (listeners[i] != event.getSource()) // Don't send it back to source { // Send this message ((MyListSelectionListener)listeners[i+1]).selectionChanged(event); } } } }
public class class_name { protected void fireMySelectionChanged(MyListSelectionEvent event) { this.selectionChanged(event.getSource(), event.getRow(), event.getRow(), event.getType()); // Make sure model knows // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i] == MyListSelectionListener.class) if (listeners[i] != event.getSource()) // Don't send it back to source { // Send this message ((MyListSelectionListener)listeners[i+1]).selectionChanged(event); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public String getDatabasePlatformClassName(PUInfoImpl pui) { SessionLog traceLogger = new TraceLog(); Properties properties = pui.getProperties(); String productName = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_PRODUCT_NAME); String vendorNameAndVersion = null; // check persistent properties if (productName != null) { vendorNameAndVersion = productName; String majorVersion = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_MAJOR_VERSION); if (majorVersion != null) { vendorNameAndVersion += majorVersion; String minorVersion = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_MINOR_VERSION); if (minorVersion != null) { vendorNameAndVersion += minorVersion; } } } else { vendorNameAndVersion = getVendorNameAndVersion(pui.getJtaDataSource()); if (vendorNameAndVersion == null) { getVendorNameAndVersion(pui.getNonJtaDataSource()); } } return DBPlatformHelper.getDBPlatform(vendorNameAndVersion, traceLogger); } }
public class class_name { public String getDatabasePlatformClassName(PUInfoImpl pui) { SessionLog traceLogger = new TraceLog(); Properties properties = pui.getProperties(); String productName = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_PRODUCT_NAME); String vendorNameAndVersion = null; // check persistent properties if (productName != null) { vendorNameAndVersion = productName; // depends on control dependency: [if], data = [none] String majorVersion = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_MAJOR_VERSION); if (majorVersion != null) { vendorNameAndVersion += majorVersion; // depends on control dependency: [if], data = [none] String minorVersion = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_MINOR_VERSION); if (minorVersion != null) { vendorNameAndVersion += minorVersion; // depends on control dependency: [if], data = [none] } } } else { vendorNameAndVersion = getVendorNameAndVersion(pui.getJtaDataSource()); // depends on control dependency: [if], data = [none] if (vendorNameAndVersion == null) { getVendorNameAndVersion(pui.getNonJtaDataSource()); // depends on control dependency: [if], data = [none] } } return DBPlatformHelper.getDBPlatform(vendorNameAndVersion, traceLogger); } }
public class class_name { @GwtIncompatible("incompatible method") private static boolean memberEquals(final Class<?> type, final Object o1, final Object o2) { if (o1 == o2) { return true; } if (o1 == null || o2 == null) { return false; } if (type.isArray()) { return arrayMemberEquals(type.getComponentType(), o1, o2); } if (type.isAnnotation()) { return equals((Annotation) o1, (Annotation) o2); } return o1.equals(o2); } }
public class class_name { @GwtIncompatible("incompatible method") private static boolean memberEquals(final Class<?> type, final Object o1, final Object o2) { if (o1 == o2) { return true; // depends on control dependency: [if], data = [none] } if (o1 == null || o2 == null) { return false; // depends on control dependency: [if], data = [none] } if (type.isArray()) { return arrayMemberEquals(type.getComponentType(), o1, o2); // depends on control dependency: [if], data = [none] } if (type.isAnnotation()) { return equals((Annotation) o1, (Annotation) o2); // depends on control dependency: [if], data = [none] } return o1.equals(o2); } }
public class class_name { public UnassignIpv6AddressesRequest withIpv6Addresses(String... ipv6Addresses) { if (this.ipv6Addresses == null) { setIpv6Addresses(new com.amazonaws.internal.SdkInternalList<String>(ipv6Addresses.length)); } for (String ele : ipv6Addresses) { this.ipv6Addresses.add(ele); } return this; } }
public class class_name { public UnassignIpv6AddressesRequest withIpv6Addresses(String... ipv6Addresses) { if (this.ipv6Addresses == null) { setIpv6Addresses(new com.amazonaws.internal.SdkInternalList<String>(ipv6Addresses.length)); // depends on control dependency: [if], data = [none] } for (String ele : ipv6Addresses) { this.ipv6Addresses.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { @Override public int prestartAllCoreThreads() { int answer = 0; synchronized (workers) { for (int i = super.getCorePoolSize() - workers.size() ; i > 0; i --) { addWorker(); answer ++; } } return answer; } }
public class class_name { @Override public int prestartAllCoreThreads() { int answer = 0; synchronized (workers) { for (int i = super.getCorePoolSize() - workers.size() ; i > 0; i --) { addWorker(); // depends on control dependency: [for], data = [none] answer ++; // depends on control dependency: [for], data = [none] } } return answer; } }
public class class_name { public void addChildTask(Task child, int childOutlineLevel) { int outlineLevel = NumberHelper.getInt(getOutlineLevel()); if ((outlineLevel + 1) == childOutlineLevel) { m_children.add(child); setSummary(true); } else { if (m_children.isEmpty() == false) { (m_children.get(m_children.size() - 1)).addChildTask(child, childOutlineLevel); } } } }
public class class_name { public void addChildTask(Task child, int childOutlineLevel) { int outlineLevel = NumberHelper.getInt(getOutlineLevel()); if ((outlineLevel + 1) == childOutlineLevel) { m_children.add(child); // depends on control dependency: [if], data = [none] setSummary(true); // depends on control dependency: [if], data = [none] } else { if (m_children.isEmpty() == false) { (m_children.get(m_children.size() - 1)).addChildTask(child, childOutlineLevel); // depends on control dependency: [if], data = [none] } } } }
public class class_name { @SuppressWarnings("unchecked") public List<String> getModuleParamList(String moduleName, String paramName) { Map<String, Object> moduleParams = getModuleParams(moduleName); if (moduleParams == null || !moduleParams.containsKey(paramName)) { return null; } Object paramValue = moduleParams.get(paramName); if (!(paramValue instanceof List)) { throw new IllegalArgumentException("Parameter '" + paramName + "' must be a list: " + paramValue); } return (List<String>)paramValue; } }
public class class_name { @SuppressWarnings("unchecked") public List<String> getModuleParamList(String moduleName, String paramName) { Map<String, Object> moduleParams = getModuleParams(moduleName); if (moduleParams == null || !moduleParams.containsKey(paramName)) { return null; // depends on control dependency: [if], data = [none] } Object paramValue = moduleParams.get(paramName); if (!(paramValue instanceof List)) { throw new IllegalArgumentException("Parameter '" + paramName + "' must be a list: " + paramValue); } return (List<String>)paramValue; } }
public class class_name { public static int weekCount(Date start, Date end) { final Calendar startCalendar = Calendar.getInstance(); startCalendar.setTime(start); final Calendar endCalendar = Calendar.getInstance(); endCalendar.setTime(end); final int startWeekofYear = startCalendar.get(Calendar.WEEK_OF_YEAR); final int endWeekofYear = endCalendar.get(Calendar.WEEK_OF_YEAR); int count = endWeekofYear - startWeekofYear + 1; if (Calendar.SUNDAY != startCalendar.get(Calendar.DAY_OF_WEEK)) { count--; } return count; } }
public class class_name { public static int weekCount(Date start, Date end) { final Calendar startCalendar = Calendar.getInstance(); startCalendar.setTime(start); final Calendar endCalendar = Calendar.getInstance(); endCalendar.setTime(end); final int startWeekofYear = startCalendar.get(Calendar.WEEK_OF_YEAR); final int endWeekofYear = endCalendar.get(Calendar.WEEK_OF_YEAR); int count = endWeekofYear - startWeekofYear + 1; if (Calendar.SUNDAY != startCalendar.get(Calendar.DAY_OF_WEEK)) { count--; // depends on control dependency: [if], data = [none] } return count; } }
public class class_name { public static boolean allowDefaultDataSourceUse(PersistenceUnitMetadata pu) { boolean result = true; if (pu.getProperties().containsKey(Configuration.JPA_ALLOW_DEFAULT_DATA_SOURCE_USE)) { result = Boolean.parseBoolean(pu.getProperties().getProperty(Configuration.JPA_ALLOW_DEFAULT_DATA_SOURCE_USE)); } return result; } }
public class class_name { public static boolean allowDefaultDataSourceUse(PersistenceUnitMetadata pu) { boolean result = true; if (pu.getProperties().containsKey(Configuration.JPA_ALLOW_DEFAULT_DATA_SOURCE_USE)) { result = Boolean.parseBoolean(pu.getProperties().getProperty(Configuration.JPA_ALLOW_DEFAULT_DATA_SOURCE_USE)); // depends on control dependency: [if], data = [none] } return result; } }
public class class_name { private boolean isUUID(String uuid) { try { UUID.fromString(uuid); return true; } catch (Exception ex) { return false; } } }
public class class_name { private boolean isUUID(String uuid) { try { UUID.fromString(uuid); // depends on control dependency: [try], data = [none] return true; // depends on control dependency: [try], data = [none] } catch (Exception ex) { return false; } // depends on control dependency: [catch], data = [none] } }
public class class_name { private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); } else { gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } sectionCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); sectionCtx = sectionCanvas.getGraphicsContext2D(); barBackground = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.4, PREFERRED_HEIGHT * 0.4, gauge.getStartAngle() + 150, ANGLE_RANGE); barBackground.setType(ArcType.OPEN); barBackground.setStroke(gauge.getBarBackgroundColor()); barBackground.setStrokeWidth(PREFERRED_WIDTH * 0.125); barBackground.setStrokeLineCap(StrokeLineCap.BUTT); barBackground.setFill(null); bar = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.4, PREFERRED_HEIGHT * 0.4, gauge.getStartAngle() + 90, 0); bar.setType(ArcType.OPEN); bar.setStroke(gauge.getBarColor()); bar.setStrokeWidth(PREFERRED_WIDTH * 0.125); bar.setStrokeLineCap(StrokeLineCap.BUTT); bar.setFill(null); titleText = new Text(gauge.getTitle()); titleText.setFill(gauge.getTitleColor()); Helper.enableNode(titleText, !gauge.getTitle().isEmpty()); valueText = new Text(); valueText.setStroke(null); valueText.setFill(gauge.getValueColor()); Helper.enableNode(valueText, gauge.isValueVisible()); unitText = new Text(); unitText.setStroke(null); unitText.setFill(gauge.getUnitColor()); Helper.enableNode(unitText, gauge.isValueVisible() && !gauge.getUnit().isEmpty()); pane = new Pane(barBackground, sectionCanvas, titleText, valueText, unitText, bar); getChildren().setAll(pane); } }
public class class_name { private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); // depends on control dependency: [if], data = [(gauge.getPrefWidth()] } else { gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); // depends on control dependency: [if], data = [none] } } sectionCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); sectionCtx = sectionCanvas.getGraphicsContext2D(); barBackground = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.4, PREFERRED_HEIGHT * 0.4, gauge.getStartAngle() + 150, ANGLE_RANGE); barBackground.setType(ArcType.OPEN); barBackground.setStroke(gauge.getBarBackgroundColor()); barBackground.setStrokeWidth(PREFERRED_WIDTH * 0.125); barBackground.setStrokeLineCap(StrokeLineCap.BUTT); barBackground.setFill(null); bar = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.4, PREFERRED_HEIGHT * 0.4, gauge.getStartAngle() + 90, 0); bar.setType(ArcType.OPEN); bar.setStroke(gauge.getBarColor()); bar.setStrokeWidth(PREFERRED_WIDTH * 0.125); bar.setStrokeLineCap(StrokeLineCap.BUTT); bar.setFill(null); titleText = new Text(gauge.getTitle()); titleText.setFill(gauge.getTitleColor()); Helper.enableNode(titleText, !gauge.getTitle().isEmpty()); valueText = new Text(); valueText.setStroke(null); valueText.setFill(gauge.getValueColor()); Helper.enableNode(valueText, gauge.isValueVisible()); unitText = new Text(); unitText.setStroke(null); unitText.setFill(gauge.getUnitColor()); Helper.enableNode(unitText, gauge.isValueVisible() && !gauge.getUnit().isEmpty()); pane = new Pane(barBackground, sectionCanvas, titleText, valueText, unitText, bar); getChildren().setAll(pane); } }
public class class_name { void selectView(String viewName) { if (DETAILS.equals(viewName)) { getList().removeStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().tilingList()); } else if (SMALL.equals(viewName)) { getList().addStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().tilingList()); getList().addStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().smallThumbnails()); } else if (BIG.equals(viewName)) { getList().addStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().tilingList()); getList().removeStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().smallThumbnails()); } } }
public class class_name { void selectView(String viewName) { if (DETAILS.equals(viewName)) { getList().removeStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().tilingList()); // depends on control dependency: [if], data = [none] } else if (SMALL.equals(viewName)) { getList().addStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().tilingList()); // depends on control dependency: [if], data = [none] getList().addStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().smallThumbnails()); // depends on control dependency: [if], data = [none] } else if (BIG.equals(viewName)) { getList().addStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().tilingList()); // depends on control dependency: [if], data = [none] getList().removeStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().smallThumbnails()); // depends on control dependency: [if], data = [none] } } }
public class class_name { private void updateComplex(String string) { if (string != null && StringUtils.getExpressionKey(string) != null && !string.equals(StringUtils.getExpressionKey(string))) { complex = true; } } }
public class class_name { private void updateComplex(String string) { if (string != null && StringUtils.getExpressionKey(string) != null && !string.equals(StringUtils.getExpressionKey(string))) { complex = true; // depends on control dependency: [if], data = [none] } } }
public class class_name { public static File[] getVersionDirs(File rootDir, final long minId, final long maxId) { return rootDir.listFiles(new FileFilter() { public boolean accept(File pathName) { if(checkVersionDirName(pathName)) { long versionId = getVersionId(pathName); if(versionId != -1 && versionId <= maxId && versionId >= minId) { return true; } } return false; } }); } }
public class class_name { public static File[] getVersionDirs(File rootDir, final long minId, final long maxId) { return rootDir.listFiles(new FileFilter() { public boolean accept(File pathName) { if(checkVersionDirName(pathName)) { long versionId = getVersionId(pathName); if(versionId != -1 && versionId <= maxId && versionId >= minId) { return true; // depends on control dependency: [if], data = [none] } } return false; } }); } }
public class class_name { public boolean renderPickedItemStack(ItemStack itemStack) { if (itemStack == null || itemStack == ItemStack.EMPTY) return false; int size = itemStack.getCount(); String label = null; if (size == 0) { itemStack.setCount(size != 0 ? size : 1); label = TextFormatting.YELLOW + "0"; } itemRenderer.zLevel = 100; drawItemStack(itemStack, MalisisGui.MOUSE_POSITION.x() - 8, MalisisGui.MOUSE_POSITION.y() - 8, label, null, false); itemRenderer.zLevel = 0; return true; } }
public class class_name { public boolean renderPickedItemStack(ItemStack itemStack) { if (itemStack == null || itemStack == ItemStack.EMPTY) return false; int size = itemStack.getCount(); String label = null; if (size == 0) { itemStack.setCount(size != 0 ? size : 1); // depends on control dependency: [if], data = [(size] label = TextFormatting.YELLOW + "0"; // depends on control dependency: [if], data = [none] } itemRenderer.zLevel = 100; drawItemStack(itemStack, MalisisGui.MOUSE_POSITION.x() - 8, MalisisGui.MOUSE_POSITION.y() - 8, label, null, false); itemRenderer.zLevel = 0; return true; } }
public class class_name { public static boolean isVersion(Node node) { try { if (node.isNodeType("nt:version")) return true; return false; } catch (RepositoryException exc) { LOG.error(exc.getMessage(), exc); return false; } } }
public class class_name { public static boolean isVersion(Node node) { try { if (node.isNodeType("nt:version")) return true; return false; // depends on control dependency: [try], data = [none] } catch (RepositoryException exc) { LOG.error(exc.getMessage(), exc); return false; } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public List<EnhanceEntity> populateRelation(EntityMetadata m, Client client, int maxResults) { // TODO: maxresults to be taken care after work on pagination. List<EnhanceEntity> ls = null; List<String> relationNames = m.getRelationNames(); boolean isParent = m.isParent(); if (!isParent) { // if it is not a parent. String sqlQuery = null; if (MetadataUtils.useSecondryIndex(((ClientBase) client).getClientMetadata())) { sqlQuery = getSqlQueryFromJPA(m, relationNames, null); } else { // prepare lucene query and find. Set<String> rSet = fetchDataFromLucene(m.getEntityClazz(), client); if (rSet != null && !rSet.isEmpty()) { filter = "WHERE"; } sqlQuery = getSqlQueryFromJPA(m, relationNames, rSet); } // call client with relation name list and convert to sql query. ls = populateEnhanceEntities(m, relationNames, client, sqlQuery); } else { if (MetadataUtils.useSecondryIndex(((ClientBase) client).getClientMetadata())) { try { List entities = ((HibernateClient) client).find(getSqlQueryFromJPA(m, relationNames, null), new ArrayList<String>(), m); ls = new ArrayList<EnhanceEntity>(entities.size()); ls = transform(m, ls, entities); } catch (Exception e) { log.error("Error while executing handleAssociation for RDBMS, Caused by {}.", e); throw new QueryHandlerException(e); } } else { ls = onAssociationUsingLucene(m, client, ls); } } return ls; } }
public class class_name { @Override public List<EnhanceEntity> populateRelation(EntityMetadata m, Client client, int maxResults) { // TODO: maxresults to be taken care after work on pagination. List<EnhanceEntity> ls = null; List<String> relationNames = m.getRelationNames(); boolean isParent = m.isParent(); if (!isParent) { // if it is not a parent. String sqlQuery = null; if (MetadataUtils.useSecondryIndex(((ClientBase) client).getClientMetadata())) { sqlQuery = getSqlQueryFromJPA(m, relationNames, null); // depends on control dependency: [if], data = [none] } else { // prepare lucene query and find. Set<String> rSet = fetchDataFromLucene(m.getEntityClazz(), client); if (rSet != null && !rSet.isEmpty()) { filter = "WHERE"; // depends on control dependency: [if], data = [none] } sqlQuery = getSqlQueryFromJPA(m, relationNames, rSet); // depends on control dependency: [if], data = [none] } // call client with relation name list and convert to sql query. ls = populateEnhanceEntities(m, relationNames, client, sqlQuery); // depends on control dependency: [if], data = [none] } else { if (MetadataUtils.useSecondryIndex(((ClientBase) client).getClientMetadata())) { try { List entities = ((HibernateClient) client).find(getSqlQueryFromJPA(m, relationNames, null), new ArrayList<String>(), m); ls = new ArrayList<EnhanceEntity>(entities.size()); // depends on control dependency: [try], data = [none] ls = transform(m, ls, entities); // depends on control dependency: [try], data = [none] } catch (Exception e) { log.error("Error while executing handleAssociation for RDBMS, Caused by {}.", e); throw new QueryHandlerException(e); } // depends on control dependency: [catch], data = [none] } else { ls = onAssociationUsingLucene(m, client, ls); // depends on control dependency: [if], data = [none] } } return ls; } }
public class class_name { public static Date nextDay(Date date, int day) { Calendar cal = Calendar.getInstance(); if (date != null) { cal.setTime(date); } cal.add(Calendar.DAY_OF_YEAR, day); return cal.getTime(); } }
public class class_name { public static Date nextDay(Date date, int day) { Calendar cal = Calendar.getInstance(); if (date != null) { cal.setTime(date); // depends on control dependency: [if], data = [(date] } cal.add(Calendar.DAY_OF_YEAR, day); return cal.getTime(); } }
public class class_name { public List<AssetPath> getAssetPaths() { ArrayList<AssetPath> assetPaths = new ArrayList<>(apk_assets_.size()); for (CppApkAssets apkAssets : apk_assets_) { Path path = Fs.fromUrl(apkAssets.GetPath()); assetPaths.add(new AssetPath(path, apkAssets.GetLoadedArsc().IsSystem())); } return assetPaths; } }
public class class_name { public List<AssetPath> getAssetPaths() { ArrayList<AssetPath> assetPaths = new ArrayList<>(apk_assets_.size()); for (CppApkAssets apkAssets : apk_assets_) { Path path = Fs.fromUrl(apkAssets.GetPath()); assetPaths.add(new AssetPath(path, apkAssets.GetLoadedArsc().IsSystem())); // depends on control dependency: [for], data = [apkAssets] } return assetPaths; } }
public class class_name { @Override public int countByG_S_A(long groupId, boolean shippingAllowed, boolean active) { FinderPath finderPath = FINDER_PATH_COUNT_BY_G_S_A; Object[] finderArgs = new Object[] { groupId, shippingAllowed, active }; Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler query = new StringBundler(4); query.append(_SQL_COUNT_COMMERCECOUNTRY_WHERE); query.append(_FINDER_COLUMN_G_S_A_GROUPID_2); query.append(_FINDER_COLUMN_G_S_A_SHIPPINGALLOWED_2); query.append(_FINDER_COLUMN_G_S_A_ACTIVE_2); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(groupId); qPos.add(shippingAllowed); qPos.add(active); count = (Long)q.uniqueResult(); finderCache.putResult(finderPath, finderArgs, count); } catch (Exception e) { finderCache.removeResult(finderPath, finderArgs); throw processException(e); } finally { closeSession(session); } } return count.intValue(); } }
public class class_name { @Override public int countByG_S_A(long groupId, boolean shippingAllowed, boolean active) { FinderPath finderPath = FINDER_PATH_COUNT_BY_G_S_A; Object[] finderArgs = new Object[] { groupId, shippingAllowed, active }; Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler query = new StringBundler(4); query.append(_SQL_COUNT_COMMERCECOUNTRY_WHERE); // depends on control dependency: [if], data = [none] query.append(_FINDER_COLUMN_G_S_A_GROUPID_2); // depends on control dependency: [if], data = [none] query.append(_FINDER_COLUMN_G_S_A_SHIPPINGALLOWED_2); // depends on control dependency: [if], data = [none] query.append(_FINDER_COLUMN_G_S_A_ACTIVE_2); // depends on control dependency: [if], data = [none] String sql = query.toString(); Session session = null; try { session = openSession(); // depends on control dependency: [try], data = [none] Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(groupId); // depends on control dependency: [try], data = [none] qPos.add(shippingAllowed); // depends on control dependency: [try], data = [none] qPos.add(active); // depends on control dependency: [try], data = [none] count = (Long)q.uniqueResult(); // depends on control dependency: [try], data = [none] finderCache.putResult(finderPath, finderArgs, count); // depends on control dependency: [try], data = [none] } catch (Exception e) { finderCache.removeResult(finderPath, finderArgs); throw processException(e); } // depends on control dependency: [catch], data = [none] finally { closeSession(session); } } return count.intValue(); } }
public class class_name { @Override @Async public void onOsgiApplicationEvent(OsgiBundleApplicationContextEvent event) { // We need to use the generic OsgiBundleApplicationContextEvent here and test // for instanceof since gemini-blueprint does not correctly determine // the event type we are listening for. if (event instanceof OsgiBundleContextFailedEvent) { final Bundle bundle = event.getBundle(); handleStop(bundle); stop(bundle); } } }
public class class_name { @Override @Async public void onOsgiApplicationEvent(OsgiBundleApplicationContextEvent event) { // We need to use the generic OsgiBundleApplicationContextEvent here and test // for instanceof since gemini-blueprint does not correctly determine // the event type we are listening for. if (event instanceof OsgiBundleContextFailedEvent) { final Bundle bundle = event.getBundle(); handleStop(bundle); // depends on control dependency: [if], data = [none] stop(bundle); // depends on control dependency: [if], data = [none] } } }
public class class_name { public ProviderConfiguration discover() { Map responseAttributes = this.restTemplate.getForObject(this.providerLocation, Map.class); ProviderConfiguration.Builder builder = new ProviderConfiguration.Builder(); builder.issuer((String)responseAttributes.get(ISSUER_ATTR_NAME)); builder.authorizationEndpoint((String)responseAttributes.get(AUTHORIZATION_ENDPOINT_ATTR_NAME)); if (responseAttributes.containsKey(TOKEN_ENDPOINT_ATTR_NAME)) { builder.tokenEndpoint((String)responseAttributes.get(TOKEN_ENDPOINT_ATTR_NAME)); } if (responseAttributes.containsKey(USERINFO_ENDPOINT_ATTR_NAME)) { builder.userInfoEndpoint((String)responseAttributes.get(USERINFO_ENDPOINT_ATTR_NAME)); } if (responseAttributes.containsKey(JWK_SET_URI_ATTR_NAME)) { builder.jwkSetUri((String)responseAttributes.get(JWK_SET_URI_ATTR_NAME)); } return builder.build(); } }
public class class_name { public ProviderConfiguration discover() { Map responseAttributes = this.restTemplate.getForObject(this.providerLocation, Map.class); ProviderConfiguration.Builder builder = new ProviderConfiguration.Builder(); builder.issuer((String)responseAttributes.get(ISSUER_ATTR_NAME)); builder.authorizationEndpoint((String)responseAttributes.get(AUTHORIZATION_ENDPOINT_ATTR_NAME)); if (responseAttributes.containsKey(TOKEN_ENDPOINT_ATTR_NAME)) { builder.tokenEndpoint((String)responseAttributes.get(TOKEN_ENDPOINT_ATTR_NAME)); // depends on control dependency: [if], data = [none] } if (responseAttributes.containsKey(USERINFO_ENDPOINT_ATTR_NAME)) { builder.userInfoEndpoint((String)responseAttributes.get(USERINFO_ENDPOINT_ATTR_NAME)); // depends on control dependency: [if], data = [none] } if (responseAttributes.containsKey(JWK_SET_URI_ATTR_NAME)) { builder.jwkSetUri((String)responseAttributes.get(JWK_SET_URI_ATTR_NAME)); // depends on control dependency: [if], data = [none] } return builder.build(); } }
public class class_name { @SuppressWarnings("unchecked") protected <T> Class<T> getClassOrDefault(final String className, final Class<T> defaultResult) { try { return className == null ? defaultResult : (Class<T>)Class.forName(className); } catch (final ClassNotFoundException e) { LOG.error("ClassNotFoundException for {} - defaulting to {}", className, defaultResult); return defaultResult; } } }
public class class_name { @SuppressWarnings("unchecked") protected <T> Class<T> getClassOrDefault(final String className, final Class<T> defaultResult) { try { return className == null ? defaultResult : (Class<T>)Class.forName(className); // depends on control dependency: [try], data = [none] } catch (final ClassNotFoundException e) { LOG.error("ClassNotFoundException for {} - defaulting to {}", className, defaultResult); return defaultResult; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static BufferedImage getIndexedImage(BufferedImage pImage, IndexColorModel pColors, Color pMatte, int pHints) { // TODO: Consider: /* if (pImage.getType() == BufferedImage.TYPE_BYTE_INDEXED || pImage.getType() == BufferedImage.TYPE_BYTE_BINARY) { pImage = ImageUtil.toBufferedImage(pImage, BufferedImage.TYPE_INT_ARGB); } */ // Get dimensions final int width = pImage.getWidth(); final int height = pImage.getHeight(); // Support transparency? boolean transparency = isTransparent(pHints) && (pImage.getColorModel().getTransparency() != Transparency.OPAQUE) && (pColors.getTransparency() != Transparency.OPAQUE); // Create image with solid background BufferedImage solid = pImage; if (pMatte != null) { // transparency doesn't really matter solid = createSolid(pImage, pMatte); } BufferedImage indexed; // Support TYPE_BYTE_BINARY, but only for 2 bit images, as the default // dither does not work with TYPE_BYTE_BINARY it seems... if (pColors.getMapSize() > 2) { indexed = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_INDEXED, pColors); } else { indexed = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY, pColors); } // Apply dither if requested switch (pHints & DITHER_MASK) { case DITHER_DIFFUSION: case DITHER_DIFFUSION_ALTSCANS: // Create a DiffusionDither to apply dither to indexed DiffusionDither dither = new DiffusionDither(pColors); if ((pHints & DITHER_MASK) == DITHER_DIFFUSION_ALTSCANS) { dither.setAlternateScans(true); } dither.filter(solid, indexed); break; case DITHER_NONE: // Just copy pixels, without dither // NOTE: This seems to be slower than the method below, using // Graphics2D.drawImage, and VALUE_DITHER_DISABLE, // however you possibly end up getting a dithered image anyway, // therefore, do it slower and produce correct result. :-) CopyDither copy = new CopyDither(pColors); copy.filter(solid, indexed); break; case DITHER_DEFAULT: // This is the default default: // Render image data onto indexed image, using default // (probably we get dither, but it depends on the GFX engine). Graphics2D g2d = indexed.createGraphics(); try { RenderingHints hints = new RenderingHints(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE); g2d.setRenderingHints(hints); g2d.drawImage(solid, 0, 0, null); } finally { g2d.dispose(); } break; } // Transparency support, this approach seems lame, but it's the only // solution I've found until now (that actually works). if (transparency) { // Re-apply the alpha-channel of the original image applyAlpha(indexed, pImage); } // Return the indexed BufferedImage return indexed; } }
public class class_name { public static BufferedImage getIndexedImage(BufferedImage pImage, IndexColorModel pColors, Color pMatte, int pHints) { // TODO: Consider: /* if (pImage.getType() == BufferedImage.TYPE_BYTE_INDEXED || pImage.getType() == BufferedImage.TYPE_BYTE_BINARY) { pImage = ImageUtil.toBufferedImage(pImage, BufferedImage.TYPE_INT_ARGB); } */ // Get dimensions final int width = pImage.getWidth(); final int height = pImage.getHeight(); // Support transparency? boolean transparency = isTransparent(pHints) && (pImage.getColorModel().getTransparency() != Transparency.OPAQUE) && (pColors.getTransparency() != Transparency.OPAQUE); // Create image with solid background BufferedImage solid = pImage; if (pMatte != null) { // transparency doesn't really matter solid = createSolid(pImage, pMatte); // depends on control dependency: [if], data = [none] } BufferedImage indexed; // Support TYPE_BYTE_BINARY, but only for 2 bit images, as the default // dither does not work with TYPE_BYTE_BINARY it seems... if (pColors.getMapSize() > 2) { indexed = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_INDEXED, pColors); // depends on control dependency: [if], data = [none] } else { indexed = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY, pColors); // depends on control dependency: [if], data = [none] } // Apply dither if requested switch (pHints & DITHER_MASK) { case DITHER_DIFFUSION: case DITHER_DIFFUSION_ALTSCANS: // Create a DiffusionDither to apply dither to indexed DiffusionDither dither = new DiffusionDither(pColors); if ((pHints & DITHER_MASK) == DITHER_DIFFUSION_ALTSCANS) { dither.setAlternateScans(true); // depends on control dependency: [if], data = [none] } dither.filter(solid, indexed); break; case DITHER_NONE: // Just copy pixels, without dither // NOTE: This seems to be slower than the method below, using // Graphics2D.drawImage, and VALUE_DITHER_DISABLE, // however you possibly end up getting a dithered image anyway, // therefore, do it slower and produce correct result. :-) CopyDither copy = new CopyDither(pColors); copy.filter(solid, indexed); break; case DITHER_DEFAULT: // This is the default default: // Render image data onto indexed image, using default // (probably we get dither, but it depends on the GFX engine). Graphics2D g2d = indexed.createGraphics(); try { RenderingHints hints = new RenderingHints(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE); g2d.setRenderingHints(hints); // depends on control dependency: [try], data = [none] g2d.drawImage(solid, 0, 0, null); // depends on control dependency: [try], data = [none] } finally { g2d.dispose(); } break; } // Transparency support, this approach seems lame, but it's the only // solution I've found until now (that actually works). if (transparency) { // Re-apply the alpha-channel of the original image applyAlpha(indexed, pImage); } // Return the indexed BufferedImage return indexed; } }
public class class_name { public static synchronized void startMsg() { Log.startZeit.setTime(System.currentTimeMillis()); Log.versionMsg(Const.PROGRAMMNAME); Log.sysLog(Log.LILNE); Log.sysLog(""); Log.sysLog("Programmpfad: " + Functions.getPathJar()); Log.sysLog("Filmliste: " + getPathFilmlist_json_akt(true /*aktDate*/)); Log.sysLog("Useragent: " + Config.getUserAgent()); Log.sysLog(""); Log.sysLog(Log.LILNE); Log.sysLog(""); if (loadLongMax()) { Log.sysLog("Laden: alles"); } else { Log.sysLog("Laden: nur update"); } if (CrawlerConfig.updateFilmliste) { Log.sysLog("Filmliste: nur updaten"); } else { Log.sysLog("Filmliste: neu erstellen"); } Log.sysLog("ImportURL 1: " + CrawlerConfig.importUrl_1__anhaengen); Log.sysLog("ImportURL 2: " + CrawlerConfig.importUrl_2__anhaengen); Log.sysLog("ImportOLD: " + CrawlerConfig.importOld); Log.sysLog("ImportAkt: " + CrawlerConfig.importAkt); if (CrawlerConfig.nurSenderLaden != null) { Log.sysLog("Nur Sender laden: " + StringUtils.join(CrawlerConfig.nurSenderLaden, ',')); } Log.sysLog(""); Log.sysLog(Log.LILNE); } }
public class class_name { public static synchronized void startMsg() { Log.startZeit.setTime(System.currentTimeMillis()); Log.versionMsg(Const.PROGRAMMNAME); Log.sysLog(Log.LILNE); Log.sysLog(""); Log.sysLog("Programmpfad: " + Functions.getPathJar()); Log.sysLog("Filmliste: " + getPathFilmlist_json_akt(true /*aktDate*/)); Log.sysLog("Useragent: " + Config.getUserAgent()); Log.sysLog(""); Log.sysLog(Log.LILNE); Log.sysLog(""); if (loadLongMax()) { Log.sysLog("Laden: alles"); // depends on control dependency: [if], data = [none] } else { Log.sysLog("Laden: nur update"); // depends on control dependency: [if], data = [none] } if (CrawlerConfig.updateFilmliste) { Log.sysLog("Filmliste: nur updaten"); // depends on control dependency: [if], data = [none] } else { Log.sysLog("Filmliste: neu erstellen"); // depends on control dependency: [if], data = [none] } Log.sysLog("ImportURL 1: " + CrawlerConfig.importUrl_1__anhaengen); Log.sysLog("ImportURL 2: " + CrawlerConfig.importUrl_2__anhaengen); Log.sysLog("ImportOLD: " + CrawlerConfig.importOld); Log.sysLog("ImportAkt: " + CrawlerConfig.importAkt); if (CrawlerConfig.nurSenderLaden != null) { Log.sysLog("Nur Sender laden: " + StringUtils.join(CrawlerConfig.nurSenderLaden, ',')); // depends on control dependency: [if], data = [(CrawlerConfig.nurSenderLaden] } Log.sysLog(""); Log.sysLog(Log.LILNE); } }
public class class_name { public void addMemberDescription(VariableElement field, DocTree serialFieldTag, Content contentTree) { CommentHelper ch = utils.getCommentHelper(field); List<? extends DocTree> description = ch.getDescription(configuration, serialFieldTag); if (!description.isEmpty()) { Content serialFieldContent = new RawHtml(ch.getText(description)); Content div = HtmlTree.DIV(HtmlStyle.block, serialFieldContent); contentTree.addContent(div); } } }
public class class_name { public void addMemberDescription(VariableElement field, DocTree serialFieldTag, Content contentTree) { CommentHelper ch = utils.getCommentHelper(field); List<? extends DocTree> description = ch.getDescription(configuration, serialFieldTag); if (!description.isEmpty()) { Content serialFieldContent = new RawHtml(ch.getText(description)); Content div = HtmlTree.DIV(HtmlStyle.block, serialFieldContent); contentTree.addContent(div); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected T createInstance() { try { return ObjectUtils.newInstance(tClass); } catch (Exception e) { throw new IllegalStateException("Some of default marshallers, chosen for the type\n" + tClass + " by default, delegate to \n" + this.getClass().getName() + " which assumes the type has a public no-arg\n" + "constructor. If this is not true, you should either extend the marshaller,\n" + "overriding createInstance() and copy() (if defined), and the extending\n" + "class shouldn't be inner, because such classes couldn't be Serializable\n" + "that is a requirement for marshaller classes, or write and configure your\n" + "own marshaller for " + tClass + " type from scratch, and configure for the\n" + "Chronicle Map via keyMarshaller[s]() or valueMarshaller[s]() methods", e); } } }
public class class_name { protected T createInstance() { try { return ObjectUtils.newInstance(tClass); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new IllegalStateException("Some of default marshallers, chosen for the type\n" + tClass + " by default, delegate to \n" + this.getClass().getName() + " which assumes the type has a public no-arg\n" + "constructor. If this is not true, you should either extend the marshaller,\n" + "overriding createInstance() and copy() (if defined), and the extending\n" + "class shouldn't be inner, because such classes couldn't be Serializable\n" + "that is a requirement for marshaller classes, or write and configure your\n" + "own marshaller for " + tClass + " type from scratch, and configure for the\n" + "Chronicle Map via keyMarshaller[s]() or valueMarshaller[s]() methods", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private static Set<Method> findLockedMethods(ClassContext classContext, SelfCalls selfCalls, Set<CallSite> obviouslyLockedSites) { JavaClass javaClass = classContext.getJavaClass(); Method[] methodList = javaClass.getMethods(); CallGraph callGraph = selfCalls.getCallGraph(); // Initially, assume all methods are locked Set<Method> lockedMethodSet = new HashSet<>(); // Assume all public methods are unlocked for (Method method : methodList) { if (method.isSynchronized()) { lockedMethodSet.add(method); } } // Explore the self-call graph to find nonpublic methods // that can be called from an unlocked context. boolean change; do { change = false; for (Iterator<CallGraphEdge> i = callGraph.edgeIterator(); i.hasNext();) { CallGraphEdge edge = i.next(); CallSite callSite = edge.getCallSite(); if (obviouslyLockedSites.contains(callSite) || lockedMethodSet.contains(callSite.getMethod())) { // Calling method is locked, so the called method // is also locked. CallGraphNode target = edge.getTarget(); if (lockedMethodSet.add(target.getMethod())) { change = true; } } } } while (change); if (DEBUG) { System.out.println("Apparently locked methods:"); for (Method method : lockedMethodSet) { System.out.println("\t" + method.getName()); } } // We assume that any methods left in the locked set // are called only from a locked context. return lockedMethodSet; } }
public class class_name { private static Set<Method> findLockedMethods(ClassContext classContext, SelfCalls selfCalls, Set<CallSite> obviouslyLockedSites) { JavaClass javaClass = classContext.getJavaClass(); Method[] methodList = javaClass.getMethods(); CallGraph callGraph = selfCalls.getCallGraph(); // Initially, assume all methods are locked Set<Method> lockedMethodSet = new HashSet<>(); // Assume all public methods are unlocked for (Method method : methodList) { if (method.isSynchronized()) { lockedMethodSet.add(method); // depends on control dependency: [if], data = [none] } } // Explore the self-call graph to find nonpublic methods // that can be called from an unlocked context. boolean change; do { change = false; for (Iterator<CallGraphEdge> i = callGraph.edgeIterator(); i.hasNext();) { CallGraphEdge edge = i.next(); CallSite callSite = edge.getCallSite(); if (obviouslyLockedSites.contains(callSite) || lockedMethodSet.contains(callSite.getMethod())) { // Calling method is locked, so the called method // is also locked. CallGraphNode target = edge.getTarget(); if (lockedMethodSet.add(target.getMethod())) { change = true; // depends on control dependency: [if], data = [none] } } } } while (change); if (DEBUG) { System.out.println("Apparently locked methods:"); // depends on control dependency: [if], data = [none] for (Method method : lockedMethodSet) { System.out.println("\t" + method.getName()); // depends on control dependency: [for], data = [method] } } // We assume that any methods left in the locked set // are called only from a locked context. return lockedMethodSet; } }
public class class_name { public boolean processThisRecord(Record record) { if (record == null) return false; boolean bPhysicalName = true; if (DBConstants.TRUE.equalsIgnoreCase(this.getProperty(USE_DATABASE_NAME))) bPhysicalName = false; String strFilename = record.getArchiveFilename(bPhysicalName); if (this.getProperty(ConvertCode.DIR_PREFIX) != null) strFilename = Utility.addToPath(this.getProperty(ConvertCode.DIR_PREFIX), strFilename); String strMode = this.getProperty(TRANSFER_MODE); boolean bExport = true; if (strMode != null) if (strMode.equalsIgnoreCase(IMPORT)) bExport = false; if (bExport) { int oldOpenMode = record.getOpenMode(); record.setOpenMode(oldOpenMode & ~DBConstants.OPEN_DONT_CREATE); // Make sure the record exists try { record.open(); if ((record.getEditMode() != DBConstants.EDIT_CURRENT) && (!record.hasNext())) // Control file would read current if (!DBConstants.TRUE.equalsIgnoreCase(this.getProperty("importEmptyFiles"))) return false; // Skip empty files (default) record.close(); } catch (DBException e) { return false; // Record doesn't exist } if (this.getProperty(LOCALE) != null) { if (!record.getTable().getDatabase().getDatabaseName(false).endsWith("_" + this.getProperty(LOCALE).toString())) return false; // If locale is set, only do locale tables if (DatabaseInfo.DATABASE_INFO_FILE.equalsIgnoreCase(record.getTable().getDatabase().getDatabaseName(false))) return false; // This is a special file type } } else { // Import must have file. if (!(new File(strFilename).exists())) return false; if (this.getProperty(LOCALE) != null) { if (!record.getTable().getDatabase().getDatabaseName(false).endsWith("_" + this.getProperty(LOCALE).toString())) return false; // If locale is set, only do locale tables if (DatabaseInfo.DATABASE_INFO_FILE.equalsIgnoreCase(record.getTable().getDatabase().getDatabaseName(false))) return false; // This is a special file type } } XmlInOut xml = new XmlInOut(this, null, null); //0 v boolean bSuccess = false; if (bExport) bSuccess = xml.exportXML(record.getTable(), strFilename); else bSuccess = xml.importXML(record.getTable(), strFilename, null); xml.free(); return bSuccess; } }
public class class_name { public boolean processThisRecord(Record record) { if (record == null) return false; boolean bPhysicalName = true; if (DBConstants.TRUE.equalsIgnoreCase(this.getProperty(USE_DATABASE_NAME))) bPhysicalName = false; String strFilename = record.getArchiveFilename(bPhysicalName); if (this.getProperty(ConvertCode.DIR_PREFIX) != null) strFilename = Utility.addToPath(this.getProperty(ConvertCode.DIR_PREFIX), strFilename); String strMode = this.getProperty(TRANSFER_MODE); boolean bExport = true; if (strMode != null) if (strMode.equalsIgnoreCase(IMPORT)) bExport = false; if (bExport) { int oldOpenMode = record.getOpenMode(); record.setOpenMode(oldOpenMode & ~DBConstants.OPEN_DONT_CREATE); // depends on control dependency: [if], data = [none] // Make sure the record exists try { record.open(); // depends on control dependency: [try], data = [none] if ((record.getEditMode() != DBConstants.EDIT_CURRENT) && (!record.hasNext())) // Control file would read current if (!DBConstants.TRUE.equalsIgnoreCase(this.getProperty("importEmptyFiles"))) return false; // Skip empty files (default) record.close(); // depends on control dependency: [try], data = [none] } catch (DBException e) { return false; // Record doesn't exist } // depends on control dependency: [catch], data = [none] if (this.getProperty(LOCALE) != null) { if (!record.getTable().getDatabase().getDatabaseName(false).endsWith("_" + this.getProperty(LOCALE).toString())) return false; // If locale is set, only do locale tables if (DatabaseInfo.DATABASE_INFO_FILE.equalsIgnoreCase(record.getTable().getDatabase().getDatabaseName(false))) return false; // This is a special file type } } else { // Import must have file. if (!(new File(strFilename).exists())) return false; if (this.getProperty(LOCALE) != null) { if (!record.getTable().getDatabase().getDatabaseName(false).endsWith("_" + this.getProperty(LOCALE).toString())) return false; // If locale is set, only do locale tables if (DatabaseInfo.DATABASE_INFO_FILE.equalsIgnoreCase(record.getTable().getDatabase().getDatabaseName(false))) return false; // This is a special file type } } XmlInOut xml = new XmlInOut(this, null, null); //0 v boolean bSuccess = false; if (bExport) bSuccess = xml.exportXML(record.getTable(), strFilename); else bSuccess = xml.importXML(record.getTable(), strFilename, null); xml.free(); return bSuccess; } }
public class class_name { private boolean processLoginSession(String loginContent) { LoginSession loginSession = bot.session(); Matcher matcher = PROCESS_LOGIN_PATTERN.matcher(loginContent); if (matcher.find()) { loginSession.setUrl(matcher.group(1)); } ApiResponse response = this.client.send(new StringRequest(loginSession.getUrl()).noRedirect()); loginSession.setUrl(loginSession.getUrl().substring(0, loginSession.getUrl().lastIndexOf("/"))); String body = response.getRawBody(); List<String> fileUrl = new ArrayList<>(); List<String> syncUrl = new ArrayList<>(); for (int i = 0; i < FILE_URL.size(); i++) { fileUrl.add(String.format("https://%s/cgi-bin/mmwebwx-bin", FILE_URL.get(i))); syncUrl.add(String.format("https://%s/cgi-bin/mmwebwx-bin", WEB_PUSH_URL.get(i))); } boolean flag = false; for (int i = 0; i < FILE_URL.size(); i++) { String indexUrl = INDEX_URL.get(i); if (loginSession.getUrl().contains(indexUrl)) { loginSession.setFileUrl(fileUrl.get(i)); loginSession.setSyncUrl(syncUrl.get(i)); flag = true; break; } } if (!flag) { loginSession.setFileUrl(loginSession.getUrl()); loginSession.setSyncUrl(loginSession.getUrl()); } loginSession.setDeviceId("e" + String.valueOf(System.currentTimeMillis())); BaseRequest baseRequest = new BaseRequest(); loginSession.setBaseRequest(baseRequest); loginSession.setSKey(WeChatUtils.match("<skey>(\\S+)</skey>", body)); loginSession.setWxSid(WeChatUtils.match("<wxsid>(\\S+)</wxsid>", body)); loginSession.setWxUin(WeChatUtils.match("<wxuin>(\\S+)</wxuin>", body)); loginSession.setPassTicket(WeChatUtils.match("<pass_ticket>(\\S+)</pass_ticket>", body)); baseRequest.setSkey(loginSession.getSKey()); baseRequest.setSid(loginSession.getWxSid()); baseRequest.setUin(loginSession.getWxUin()); baseRequest.setDeviceID(loginSession.getDeviceId()); return true; } }
public class class_name { private boolean processLoginSession(String loginContent) { LoginSession loginSession = bot.session(); Matcher matcher = PROCESS_LOGIN_PATTERN.matcher(loginContent); if (matcher.find()) { loginSession.setUrl(matcher.group(1)); // depends on control dependency: [if], data = [none] } ApiResponse response = this.client.send(new StringRequest(loginSession.getUrl()).noRedirect()); loginSession.setUrl(loginSession.getUrl().substring(0, loginSession.getUrl().lastIndexOf("/"))); String body = response.getRawBody(); List<String> fileUrl = new ArrayList<>(); List<String> syncUrl = new ArrayList<>(); for (int i = 0; i < FILE_URL.size(); i++) { fileUrl.add(String.format("https://%s/cgi-bin/mmwebwx-bin", FILE_URL.get(i))); syncUrl.add(String.format("https://%s/cgi-bin/mmwebwx-bin", WEB_PUSH_URL.get(i))); } boolean flag = false; for (int i = 0; i < FILE_URL.size(); i++) { String indexUrl = INDEX_URL.get(i); if (loginSession.getUrl().contains(indexUrl)) { loginSession.setFileUrl(fileUrl.get(i)); loginSession.setSyncUrl(syncUrl.get(i)); flag = true; break; } } if (!flag) { loginSession.setFileUrl(loginSession.getUrl()); loginSession.setSyncUrl(loginSession.getUrl()); } loginSession.setDeviceId("e" + String.valueOf(System.currentTimeMillis())); BaseRequest baseRequest = new BaseRequest(); loginSession.setBaseRequest(baseRequest); loginSession.setSKey(WeChatUtils.match("<skey>(\\S+)</skey>", body)); loginSession.setWxSid(WeChatUtils.match("<wxsid>(\\S+)</wxsid>", body)); loginSession.setWxUin(WeChatUtils.match("<wxuin>(\\S+)</wxuin>", body)); loginSession.setPassTicket(WeChatUtils.match("<pass_ticket>(\\S+)</pass_ticket>", body)); baseRequest.setSkey(loginSession.getSKey()); baseRequest.setSid(loginSession.getWxSid()); baseRequest.setUin(loginSession.getWxUin()); baseRequest.setDeviceID(loginSession.getDeviceId()); return true; } }
public class class_name { public static ComputationGraphConfiguration.GraphBuilder inceptionV1ResC( ComputationGraphConfiguration.GraphBuilder graph, String blockName, int scale, double activationScale, String input) { // loop and add each subsequent resnet blocks String previousBlock = input; for (int i = 1; i <= scale; i++) { graph // 1x1 .addLayer(nameLayer(blockName, "cnn1", i), new ConvolutionLayer.Builder(new int[] {1, 1}) .convolutionMode(ConvolutionMode.Same).nIn(1344).nOut(192) .cudnnAlgoMode(ConvolutionLayer.AlgoMode.NO_WORKSPACE) .build(), previousBlock) .addLayer(nameLayer(blockName, "batch1", i), new BatchNormalization.Builder(false).decay(0.995).eps(0.001).nIn(192) .nOut(192).build(), nameLayer(blockName, "cnn1", i)) // 1x1 -> 1x3 -> 3x1 .addLayer(nameLayer(blockName, "cnn2", i), new ConvolutionLayer.Builder(new int[] {1, 1}) .convolutionMode(ConvolutionMode.Same).nIn(1344).nOut(192) .cudnnAlgoMode(ConvolutionLayer.AlgoMode.NO_WORKSPACE) .build(), previousBlock) .addLayer(nameLayer(blockName, "batch2", i), new BatchNormalization.Builder(false).decay(0.995).eps(0.001).nIn(192) .nOut(192).build(), nameLayer(blockName, "cnn2", i)) .addLayer(nameLayer(blockName, "cnn3", i), new ConvolutionLayer.Builder(new int[] {1, 3}) .convolutionMode(ConvolutionMode.Same).nIn(192).nOut(192) .cudnnAlgoMode(ConvolutionLayer.AlgoMode.NO_WORKSPACE) .build(), nameLayer(blockName, "batch2", i)) .addLayer(nameLayer(blockName, "batch3", i), new BatchNormalization.Builder(false).decay(0.995).eps(0.001).nIn(192) .nOut(192).build(), nameLayer(blockName, "cnn3", i)) .addLayer(nameLayer(blockName, "cnn4", i), new ConvolutionLayer.Builder(new int[] {3, 1}) .convolutionMode(ConvolutionMode.Same).nIn(192).nOut(192) .cudnnAlgoMode(ConvolutionLayer.AlgoMode.NO_WORKSPACE) .build(), nameLayer(blockName, "batch3", i)) .addLayer(nameLayer(blockName, "batch4", i), new BatchNormalization.Builder(false).decay(0.995).eps(0.001) .activation(Activation.TANH).nIn(192).nOut(192).build(), nameLayer(blockName, "cnn4", i)) // --> 1x1 --> scale --> .addVertex(nameLayer(blockName, "merge1", i), new MergeVertex(), nameLayer(blockName, "batch1", i), nameLayer(blockName, "batch4", i)) .addLayer(nameLayer(blockName, "cnn5", i), new ConvolutionLayer.Builder(new int[] {1, 1}) .convolutionMode(ConvolutionMode.Same).nIn(384).nOut(1344) .cudnnAlgoMode(ConvolutionLayer.AlgoMode.NO_WORKSPACE) .build(), nameLayer(blockName, "merge1", i)) .addLayer(nameLayer(blockName, "batch5", i), new BatchNormalization.Builder(false).decay(0.995).eps(0.001) .activation(Activation.TANH).nIn(1344).nOut(1344).build(), nameLayer(blockName, "cnn5", i)) .addVertex(nameLayer(blockName, "scaling", i), new ScaleVertex(activationScale), nameLayer(blockName, "batch5", i)) // --> .addLayer(nameLayer(blockName, "shortcut-identity", i), new ActivationLayer.Builder().activation(Activation.IDENTITY).build(), previousBlock) .addVertex(nameLayer(blockName, "shortcut", i), new ElementWiseVertex(ElementWiseVertex.Op.Add), nameLayer(blockName, "scaling", i), nameLayer(blockName, "shortcut-identity", i)); // leave the last vertex as the block name for convenience if (i == scale) graph.addLayer(blockName, new ActivationLayer.Builder().activation(Activation.TANH).build(), nameLayer(blockName, "shortcut", i)); else graph.addLayer(nameLayer(blockName, "activation", i), new ActivationLayer.Builder().activation(Activation.TANH).build(), nameLayer(blockName, "shortcut", i)); previousBlock = nameLayer(blockName, "activation", i); } return graph; } }
public class class_name { public static ComputationGraphConfiguration.GraphBuilder inceptionV1ResC( ComputationGraphConfiguration.GraphBuilder graph, String blockName, int scale, double activationScale, String input) { // loop and add each subsequent resnet blocks String previousBlock = input; for (int i = 1; i <= scale; i++) { graph // 1x1 .addLayer(nameLayer(blockName, "cnn1", i), new ConvolutionLayer.Builder(new int[] {1, 1}) .convolutionMode(ConvolutionMode.Same).nIn(1344).nOut(192) .cudnnAlgoMode(ConvolutionLayer.AlgoMode.NO_WORKSPACE) .build(), previousBlock) .addLayer(nameLayer(blockName, "batch1", i), new BatchNormalization.Builder(false).decay(0.995).eps(0.001).nIn(192) .nOut(192).build(), nameLayer(blockName, "cnn1", i)) // 1x1 -> 1x3 -> 3x1 .addLayer(nameLayer(blockName, "cnn2", i), new ConvolutionLayer.Builder(new int[] {1, 1}) .convolutionMode(ConvolutionMode.Same).nIn(1344).nOut(192) .cudnnAlgoMode(ConvolutionLayer.AlgoMode.NO_WORKSPACE) .build(), previousBlock) .addLayer(nameLayer(blockName, "batch2", i), new BatchNormalization.Builder(false).decay(0.995).eps(0.001).nIn(192) .nOut(192).build(), nameLayer(blockName, "cnn2", i)) .addLayer(nameLayer(blockName, "cnn3", i), new ConvolutionLayer.Builder(new int[] {1, 3}) .convolutionMode(ConvolutionMode.Same).nIn(192).nOut(192) .cudnnAlgoMode(ConvolutionLayer.AlgoMode.NO_WORKSPACE) .build(), nameLayer(blockName, "batch2", i)) .addLayer(nameLayer(blockName, "batch3", i), new BatchNormalization.Builder(false).decay(0.995).eps(0.001).nIn(192) .nOut(192).build(), nameLayer(blockName, "cnn3", i)) .addLayer(nameLayer(blockName, "cnn4", i), new ConvolutionLayer.Builder(new int[] {3, 1}) .convolutionMode(ConvolutionMode.Same).nIn(192).nOut(192) .cudnnAlgoMode(ConvolutionLayer.AlgoMode.NO_WORKSPACE) .build(), nameLayer(blockName, "batch3", i)) .addLayer(nameLayer(blockName, "batch4", i), new BatchNormalization.Builder(false).decay(0.995).eps(0.001) .activation(Activation.TANH).nIn(192).nOut(192).build(), nameLayer(blockName, "cnn4", i)) // --> 1x1 --> scale --> .addVertex(nameLayer(blockName, "merge1", i), new MergeVertex(), nameLayer(blockName, "batch1", i), nameLayer(blockName, "batch4", i)) .addLayer(nameLayer(blockName, "cnn5", i), new ConvolutionLayer.Builder(new int[] {1, 1}) .convolutionMode(ConvolutionMode.Same).nIn(384).nOut(1344) .cudnnAlgoMode(ConvolutionLayer.AlgoMode.NO_WORKSPACE) .build(), nameLayer(blockName, "merge1", i)) .addLayer(nameLayer(blockName, "batch5", i), new BatchNormalization.Builder(false).decay(0.995).eps(0.001) .activation(Activation.TANH).nIn(1344).nOut(1344).build(), nameLayer(blockName, "cnn5", i)) .addVertex(nameLayer(blockName, "scaling", i), new ScaleVertex(activationScale), nameLayer(blockName, "batch5", i)) // --> .addLayer(nameLayer(blockName, "shortcut-identity", i), new ActivationLayer.Builder().activation(Activation.IDENTITY).build(), previousBlock) .addVertex(nameLayer(blockName, "shortcut", i), new ElementWiseVertex(ElementWiseVertex.Op.Add), nameLayer(blockName, "scaling", i), nameLayer(blockName, "shortcut-identity", i)); // depends on control dependency: [for], data = [none] // leave the last vertex as the block name for convenience if (i == scale) graph.addLayer(blockName, new ActivationLayer.Builder().activation(Activation.TANH).build(), nameLayer(blockName, "shortcut", i)); else graph.addLayer(nameLayer(blockName, "activation", i), new ActivationLayer.Builder().activation(Activation.TANH).build(), nameLayer(blockName, "shortcut", i)); previousBlock = nameLayer(blockName, "activation", i); // depends on control dependency: [for], data = [i] } return graph; } }
public class class_name { private void createRelationshipForCollectionOfPrimitivesOrMap(AssociationKey associationKey, String collectionRole, String[] columnNames, StringBuilder queryBuilder) { String relationshipType = collectionRole; if ( isPartOfEmbedded( collectionRole ) ) { queryBuilder.append( " MERGE (owner) " ); String[] pathToEmbedded = appendEmbeddedNodes( collectionRole, queryBuilder ); relationshipType = pathToEmbedded[pathToEmbedded.length - 1]; queryBuilder.append( " CREATE (e) -[r:" ); } else { queryBuilder.append( " CREATE (owner) -[r:" ); } escapeIdentifier( queryBuilder, relationshipType ); int offset = ownerEntityKeyMetadata.getColumnNames().length; appendProperties( queryBuilder, associationKey.getMetadata().getRowKeyIndexColumnNames(), offset ); queryBuilder.append( "]-> (new:" ); queryBuilder.append( EMBEDDED ); queryBuilder.append( ":" ); escapeIdentifier( queryBuilder, associationKey.getTable() ); queryBuilder.append( " {" ); // THe name of the property is the same as the relationship type escapeIdentifier( queryBuilder, relationshipType ); queryBuilder.append( ": {" ); offset += associationKey.getMetadata().getRowKeyIndexColumnNames().length; queryBuilder.append( offset ); queryBuilder.append( "}" ); queryBuilder.append( "}" ); queryBuilder.append( ")" ); queryBuilder.append( " RETURN r" ); } }
public class class_name { private void createRelationshipForCollectionOfPrimitivesOrMap(AssociationKey associationKey, String collectionRole, String[] columnNames, StringBuilder queryBuilder) { String relationshipType = collectionRole; if ( isPartOfEmbedded( collectionRole ) ) { queryBuilder.append( " MERGE (owner) " ); // depends on control dependency: [if], data = [none] String[] pathToEmbedded = appendEmbeddedNodes( collectionRole, queryBuilder ); relationshipType = pathToEmbedded[pathToEmbedded.length - 1]; // depends on control dependency: [if], data = [none] queryBuilder.append( " CREATE (e) -[r:" ); // depends on control dependency: [if], data = [none] } else { queryBuilder.append( " CREATE (owner) -[r:" ); // depends on control dependency: [if], data = [none] } escapeIdentifier( queryBuilder, relationshipType ); int offset = ownerEntityKeyMetadata.getColumnNames().length; appendProperties( queryBuilder, associationKey.getMetadata().getRowKeyIndexColumnNames(), offset ); queryBuilder.append( "]-> (new:" ); queryBuilder.append( EMBEDDED ); queryBuilder.append( ":" ); escapeIdentifier( queryBuilder, associationKey.getTable() ); queryBuilder.append( " {" ); // THe name of the property is the same as the relationship type escapeIdentifier( queryBuilder, relationshipType ); queryBuilder.append( ": {" ); offset += associationKey.getMetadata().getRowKeyIndexColumnNames().length; queryBuilder.append( offset ); queryBuilder.append( "}" ); queryBuilder.append( "}" ); queryBuilder.append( ")" ); queryBuilder.append( " RETURN r" ); } }
public class class_name { public static File appendToFile(String filename, String extraContent, boolean onNewLine){ PrintWriter pw = null; try { pw = new PrintWriter( new BufferedWriter( new OutputStreamWriter( new FileOutputStream(filename, true), FILE_ENCODING) ) ); if (onNewLine) { pw.println(); } pw.print(extraContent); } catch (FileNotFoundException e) { throw new IllegalArgumentException("Unable to write to: " + filename, e); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } finally { if (pw != null) { pw.close(); } } return new File(filename); } }
public class class_name { public static File appendToFile(String filename, String extraContent, boolean onNewLine){ PrintWriter pw = null; try { pw = new PrintWriter( new BufferedWriter( new OutputStreamWriter( new FileOutputStream(filename, true), FILE_ENCODING) ) ); // depends on control dependency: [try], data = [none] if (onNewLine) { pw.println(); // depends on control dependency: [if], data = [none] } pw.print(extraContent); // depends on control dependency: [try], data = [none] } catch (FileNotFoundException e) { throw new IllegalArgumentException("Unable to write to: " + filename, e); } catch (UnsupportedEncodingException e) { // depends on control dependency: [catch], data = [none] throw new RuntimeException(e); } finally { // depends on control dependency: [catch], data = [none] if (pw != null) { pw.close(); // depends on control dependency: [if], data = [none] } } return new File(filename); } }
public class class_name { public void loadWithTimeout(int timeout) { for (String stylesheet : m_stylesheets) { boolean alreadyLoaded = checkStylesheet(stylesheet); if (alreadyLoaded) { m_loadCounter += 1; } else { appendStylesheet(stylesheet, m_jsCallback); } } checkAllLoaded(); if (timeout > 0) { Timer timer = new Timer() { @SuppressWarnings("synthetic-access") @Override public void run() { callCallback(); } }; timer.schedule(timeout); } } }
public class class_name { public void loadWithTimeout(int timeout) { for (String stylesheet : m_stylesheets) { boolean alreadyLoaded = checkStylesheet(stylesheet); if (alreadyLoaded) { m_loadCounter += 1; // depends on control dependency: [if], data = [none] } else { appendStylesheet(stylesheet, m_jsCallback); // depends on control dependency: [if], data = [none] } } checkAllLoaded(); if (timeout > 0) { Timer timer = new Timer() { @SuppressWarnings("synthetic-access") @Override public void run() { callCallback(); } }; timer.schedule(timeout); // depends on control dependency: [if], data = [(timeout] } } }
public class class_name { public void setMetaDataSlotService(MetaDataSlotService slotService) { JaxWsMetaDataManager.jaxwsApplicationSlot = slotService.reserveMetaDataSlot(ApplicationMetaData.class); JaxWsMetaDataManager.jaxwsModuleSlot = slotService.reserveMetaDataSlot(ModuleMetaData.class); JaxWsMetaDataManager.jaxwsComponentSlot = slotService.reserveMetaDataSlot(ComponentMetaData.class); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "setMetaDataSlotService : applicationSlot=" + JaxWsMetaDataManager.jaxwsApplicationSlot); Tr.debug(tc, "setMetaDataSlotService : moduleSlot=" + JaxWsMetaDataManager.jaxwsModuleSlot); Tr.debug(tc, "setMetaDataSlotService : componentSlot=" + JaxWsMetaDataManager.jaxwsComponentSlot); } } }
public class class_name { public void setMetaDataSlotService(MetaDataSlotService slotService) { JaxWsMetaDataManager.jaxwsApplicationSlot = slotService.reserveMetaDataSlot(ApplicationMetaData.class); JaxWsMetaDataManager.jaxwsModuleSlot = slotService.reserveMetaDataSlot(ModuleMetaData.class); JaxWsMetaDataManager.jaxwsComponentSlot = slotService.reserveMetaDataSlot(ComponentMetaData.class); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "setMetaDataSlotService : applicationSlot=" + JaxWsMetaDataManager.jaxwsApplicationSlot); // depends on control dependency: [if], data = [none] Tr.debug(tc, "setMetaDataSlotService : moduleSlot=" + JaxWsMetaDataManager.jaxwsModuleSlot); // depends on control dependency: [if], data = [none] Tr.debug(tc, "setMetaDataSlotService : componentSlot=" + JaxWsMetaDataManager.jaxwsComponentSlot); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override protected final void checkIntegrity () throws InternetSCSIException { String exceptionMessage; do { if (status != LoginStatus.SUCCESS && statusSequenceNumber != 0) { exceptionMessage = "While no successful login is preformed, the StatusSequenceNumber must be 0."; break; } // message is checked correctly return; } while (false); throw new InternetSCSIException(exceptionMessage); } }
public class class_name { @Override protected final void checkIntegrity () throws InternetSCSIException { String exceptionMessage; do { if (status != LoginStatus.SUCCESS && statusSequenceNumber != 0) { exceptionMessage = "While no successful login is preformed, the StatusSequenceNumber must be 0."; // depends on control dependency: [if], data = [none] break; } // message is checked correctly return; } while (false); throw new InternetSCSIException(exceptionMessage); } }
public class class_name { public boolean setTypeface(GVRContext gvrContext, String font, fontStyleTypes style) { if ( !font.equals(DEFAULT_FONT) ) { try { Context context = gvrContext.getContext(); int styleType = Typeface.NORMAL; if (style == fontStyleTypes.BOLD) styleType = Typeface.BOLD; else if (style == fontStyleTypes.ITALIC) styleType = Typeface.ITALIC; else if (style == fontStyleTypes.BOLDITALIC) styleType = Typeface.BOLD_ITALIC; Typeface typeface = Typeface.createFromAsset(context.getAssets(), font); if (typeface != null) { mTextView.setTypeface(typeface, styleType); mIsChanged = true; } } catch (java.lang.RuntimeException e) { org.gearvrf.utility.Log.e(TAG, "Runtime error: " + font + "; " + e); return false; } catch (Exception e) { org.gearvrf.utility.Log.e(TAG, "Exception: " + e); return false; } } return true; } }
public class class_name { public boolean setTypeface(GVRContext gvrContext, String font, fontStyleTypes style) { if ( !font.equals(DEFAULT_FONT) ) { try { Context context = gvrContext.getContext(); int styleType = Typeface.NORMAL; if (style == fontStyleTypes.BOLD) styleType = Typeface.BOLD; else if (style == fontStyleTypes.ITALIC) styleType = Typeface.ITALIC; else if (style == fontStyleTypes.BOLDITALIC) styleType = Typeface.BOLD_ITALIC; Typeface typeface = Typeface.createFromAsset(context.getAssets(), font); if (typeface != null) { mTextView.setTypeface(typeface, styleType); // depends on control dependency: [if], data = [(typeface] mIsChanged = true; // depends on control dependency: [if], data = [none] } } catch (java.lang.RuntimeException e) { org.gearvrf.utility.Log.e(TAG, "Runtime error: " + font + "; " + e); return false; } // depends on control dependency: [catch], data = [none] catch (Exception e) { org.gearvrf.utility.Log.e(TAG, "Exception: " + e); return false; } // depends on control dependency: [catch], data = [none] } return true; } }
public class class_name { private String getRealmName() { String realm = "defaultRealm"; try { UserRegistry ur = RegistryHelper.getUserRegistry(null); if (ur != null) { String r = ur.getRealm(); if (r != null) { realm = r; } } } catch (Exception ex) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Cannot get the UR service since it may not be available so use the default value for the realm.", ex); } } return realm; } }
public class class_name { private String getRealmName() { String realm = "defaultRealm"; try { UserRegistry ur = RegistryHelper.getUserRegistry(null); if (ur != null) { String r = ur.getRealm(); if (r != null) { realm = r; // depends on control dependency: [if], data = [none] } } } catch (Exception ex) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Cannot get the UR service since it may not be available so use the default value for the realm.", ex); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] return realm; } }
public class class_name { String[] polled_device() { Util.out4.println("In polled_device command"); final int nb_class = class_list.size(); final Vector dev_name = new Vector(); for (int i = 0; i < nb_class; i++) { final DeviceClass dc = (DeviceClass) class_list.elementAt(i); final int nb_dev = dc.get_device_list().size(); for (int j = 0; j < nb_dev; j++) { // Get DS name if it is polled final DeviceImpl dev = dc.get_device_at(j); if (dev.is_polled() == true) { dev_name.add(dev.get_name()); } } } // Return an empty sequence if no devices are polled if (dev_name.size() == 0) { Util.out4.println("Return an empty sequence because no devices are polled"); return new String[0]; } // Returned device name list to caller (sorted) final MyComp comp = new MyComp(); Collections.sort(dev_name, comp); final int nb_dev = dev_name.size(); final String[] ret = new String[nb_dev]; for (int i = 0; i < nb_dev; i++) { ret[i] = (String) dev_name.elementAt(i); } return ret; } }
public class class_name { String[] polled_device() { Util.out4.println("In polled_device command"); final int nb_class = class_list.size(); final Vector dev_name = new Vector(); for (int i = 0; i < nb_class; i++) { final DeviceClass dc = (DeviceClass) class_list.elementAt(i); final int nb_dev = dc.get_device_list().size(); for (int j = 0; j < nb_dev; j++) { // Get DS name if it is polled final DeviceImpl dev = dc.get_device_at(j); if (dev.is_polled() == true) { dev_name.add(dev.get_name()); // depends on control dependency: [if], data = [none] } } } // Return an empty sequence if no devices are polled if (dev_name.size() == 0) { Util.out4.println("Return an empty sequence because no devices are polled"); // depends on control dependency: [if], data = [none] return new String[0]; // depends on control dependency: [if], data = [none] } // Returned device name list to caller (sorted) final MyComp comp = new MyComp(); Collections.sort(dev_name, comp); final int nb_dev = dev_name.size(); final String[] ret = new String[nb_dev]; for (int i = 0; i < nb_dev; i++) { ret[i] = (String) dev_name.elementAt(i); // depends on control dependency: [for], data = [i] } return ret; } }
public class class_name { protected void addStepFailureContextData( StepExecutionResult stepResult, ExecutionContextImpl.Builder builder ) { HashMap<String, String> resultData = new HashMap<>(); if (null != stepResult.getFailureData()) { //convert values to string for (final Map.Entry<String, Object> entry : stepResult.getFailureData().entrySet()) { resultData.put(entry.getKey(), entry.getValue().toString()); } } FailureReason reason = stepResult.getFailureReason(); if (null == reason) { reason = StepFailureReason.Unknown; } resultData.put("reason", reason.toString()); String message = stepResult.getFailureMessage(); if (null == message) { message = "No message"; } resultData.put("message", message); //add to data context builder.setContext("result", resultData); } }
public class class_name { protected void addStepFailureContextData( StepExecutionResult stepResult, ExecutionContextImpl.Builder builder ) { HashMap<String, String> resultData = new HashMap<>(); if (null != stepResult.getFailureData()) { //convert values to string for (final Map.Entry<String, Object> entry : stepResult.getFailureData().entrySet()) { resultData.put(entry.getKey(), entry.getValue().toString()); // depends on control dependency: [for], data = [entry] } } FailureReason reason = stepResult.getFailureReason(); if (null == reason) { reason = StepFailureReason.Unknown; // depends on control dependency: [if], data = [none] } resultData.put("reason", reason.toString()); String message = stepResult.getFailureMessage(); if (null == message) { message = "No message"; // depends on control dependency: [if], data = [none] } resultData.put("message", message); //add to data context builder.setContext("result", resultData); } }
public class class_name { public static String getUniqueNameProtocol(ProviderConfig providerConfig, String protocol) { if (StringUtils.isNotEmpty(protocol)) { return getUniqueName(providerConfig) + "@" + protocol; } else { return getUniqueName(providerConfig); } } }
public class class_name { public static String getUniqueNameProtocol(ProviderConfig providerConfig, String protocol) { if (StringUtils.isNotEmpty(protocol)) { return getUniqueName(providerConfig) + "@" + protocol; // depends on control dependency: [if], data = [none] } else { return getUniqueName(providerConfig); // depends on control dependency: [if], data = [none] } } }
public class class_name { private RedBlackTreeNode<Key, Value> floor(RedBlackTreeNode<Key, Value> x, Key key) { if (x == null) { return null; } int cmp = key.compareTo(x.getKey()); if (cmp == 0) { return x; } if (cmp < 0) { return floor(x.getLeft(), key); } RedBlackTreeNode<Key, Value> t = floor(x.getRight(), key); if (t != null) { return t; } else { return x; } } }
public class class_name { private RedBlackTreeNode<Key, Value> floor(RedBlackTreeNode<Key, Value> x, Key key) { if (x == null) { return null; // depends on control dependency: [if], data = [none] } int cmp = key.compareTo(x.getKey()); if (cmp == 0) { return x; // depends on control dependency: [if], data = [none] } if (cmp < 0) { return floor(x.getLeft(), key); // depends on control dependency: [if], data = [none] } RedBlackTreeNode<Key, Value> t = floor(x.getRight(), key); if (t != null) { return t; // depends on control dependency: [if], data = [none] } else { return x; // depends on control dependency: [if], data = [none] } } }
public class class_name { public static String getShortDateString(long time, String format) { if (format == null || format.isEmpty()) { format = "yyyy-MM-dd"; } SimpleDateFormat smpf = new SimpleDateFormat(format); return smpf.format(new Date(time)); } }
public class class_name { public static String getShortDateString(long time, String format) { if (format == null || format.isEmpty()) { format = "yyyy-MM-dd"; // depends on control dependency: [if], data = [none] } SimpleDateFormat smpf = new SimpleDateFormat(format); return smpf.format(new Date(time)); } }
public class class_name { public final void containsNoDuplicates() { List<Entry<?>> duplicates = newArrayList(); for (Multiset.Entry<?> entry : LinkedHashMultiset.create(actual()).entrySet()) { if (entry.getCount() > 1) { duplicates.add(entry); } } if (!duplicates.isEmpty()) { failWithoutActual( simpleFact("expected not to contain duplicates"), fact("but contained", duplicates), fullContents()); } } }
public class class_name { public final void containsNoDuplicates() { List<Entry<?>> duplicates = newArrayList(); for (Multiset.Entry<?> entry : LinkedHashMultiset.create(actual()).entrySet()) { if (entry.getCount() > 1) { duplicates.add(entry); // depends on control dependency: [if], data = [none] } } if (!duplicates.isEmpty()) { failWithoutActual( simpleFact("expected not to contain duplicates"), fact("but contained", duplicates), fullContents()); // depends on control dependency: [if], data = [none] } } }
public class class_name { public RoundedMoney pow(int n) { MathContext mc = monetaryContext.get(MathContext.class); if(mc==null){ mc = MathContext.DECIMAL64; } return new RoundedMoney(number.pow(n, mc), currency, rounding).with(rounding); } }
public class class_name { public RoundedMoney pow(int n) { MathContext mc = monetaryContext.get(MathContext.class); if(mc==null){ mc = MathContext.DECIMAL64; // depends on control dependency: [if], data = [none] } return new RoundedMoney(number.pow(n, mc), currency, rounding).with(rounding); } }
public class class_name { public static String toHeaderValue(long timeoutNanos) { final long cutoff = 100000000; if (timeoutNanos < 0) { throw new IllegalArgumentException("Timeout too small"); } else if (timeoutNanos < cutoff) { return TimeUnit.NANOSECONDS.toNanos(timeoutNanos) + "n"; } else if (timeoutNanos < cutoff * 1000L) { return TimeUnit.NANOSECONDS.toMicros(timeoutNanos) + "u"; } else if (timeoutNanos < cutoff * 1000L * 1000L) { return TimeUnit.NANOSECONDS.toMillis(timeoutNanos) + "m"; } else if (timeoutNanos < cutoff * 1000L * 1000L * 1000L) { return TimeUnit.NANOSECONDS.toSeconds(timeoutNanos) + "S"; } else if (timeoutNanos < cutoff * 1000L * 1000L * 1000L * 60L) { return TimeUnit.NANOSECONDS.toMinutes(timeoutNanos) + "M"; } else { return TimeUnit.NANOSECONDS.toHours(timeoutNanos) + "H"; } } }
public class class_name { public static String toHeaderValue(long timeoutNanos) { final long cutoff = 100000000; if (timeoutNanos < 0) { throw new IllegalArgumentException("Timeout too small"); } else if (timeoutNanos < cutoff) { return TimeUnit.NANOSECONDS.toNanos(timeoutNanos) + "n"; // depends on control dependency: [if], data = [(timeoutNanos] } else if (timeoutNanos < cutoff * 1000L) { return TimeUnit.NANOSECONDS.toMicros(timeoutNanos) + "u"; // depends on control dependency: [if], data = [(timeoutNanos] } else if (timeoutNanos < cutoff * 1000L * 1000L) { return TimeUnit.NANOSECONDS.toMillis(timeoutNanos) + "m"; // depends on control dependency: [if], data = [(timeoutNanos] } else if (timeoutNanos < cutoff * 1000L * 1000L * 1000L) { return TimeUnit.NANOSECONDS.toSeconds(timeoutNanos) + "S"; // depends on control dependency: [if], data = [(timeoutNanos] } else if (timeoutNanos < cutoff * 1000L * 1000L * 1000L * 60L) { return TimeUnit.NANOSECONDS.toMinutes(timeoutNanos) + "M"; // depends on control dependency: [if], data = [(timeoutNanos] } else { return TimeUnit.NANOSECONDS.toHours(timeoutNanos) + "H"; // depends on control dependency: [if], data = [(timeoutNanos] } } }
public class class_name { public void normalize() { if (llx > urx) { float a = llx; llx = urx; urx = a; } if (lly > ury) { float a = lly; lly = ury; ury = a; } } }
public class class_name { public void normalize() { if (llx > urx) { float a = llx; llx = urx; // depends on control dependency: [if], data = [none] urx = a; // depends on control dependency: [if], data = [none] } if (lly > ury) { float a = lly; lly = ury; // depends on control dependency: [if], data = [none] ury = a; // depends on control dependency: [if], data = [none] } } }
public class class_name { public ListResourcesForTagOptionResult withResourceDetails(ResourceDetail... resourceDetails) { if (this.resourceDetails == null) { setResourceDetails(new java.util.ArrayList<ResourceDetail>(resourceDetails.length)); } for (ResourceDetail ele : resourceDetails) { this.resourceDetails.add(ele); } return this; } }
public class class_name { public ListResourcesForTagOptionResult withResourceDetails(ResourceDetail... resourceDetails) { if (this.resourceDetails == null) { setResourceDetails(new java.util.ArrayList<ResourceDetail>(resourceDetails.length)); // depends on control dependency: [if], data = [none] } for (ResourceDetail ele : resourceDetails) { this.resourceDetails.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { private void enforceCorrectLoadOrder(UIViewRoot root, FacesContext context) { // // first, handle the CSS files. // // Put BootsFaces.css or BootsFaces.min.css first, // // theme.css second // // and everything else behind them. List<UIComponent> resources = new ArrayList<UIComponent>(); List<UIComponent> first = new ArrayList<UIComponent>(); List<UIComponent> middle = new ArrayList<UIComponent>(); List<UIComponent> last = new ArrayList<UIComponent>(); List<UIComponent> datatable = new ArrayList<UIComponent>(); for (UIComponent resource : root.getComponentResources(context, "head")) { String name = (String) resource.getAttributes().get("name"); String position = (String) resource.getAttributes().get("position"); if ("first".equals(position)) { first.add(resource); } else if ("last".equals(position)) { last.add(resource); } else if ("middle".equals(position)) { middle.add(resource); } else { if (resource instanceof InternalJavaScriptResource) { datatable.add(resource); } else if (name != null && (name.endsWith(".js"))) { if (name.contains("dataTables")) { datatable.add(resource); } else { resources.add(resource); } } } } // add the JavaScript files in correct order. Collections.sort(resources, new ResourceFileComparator()); for (UIComponent c : first) { root.removeComponentResource(context, c); } for (UIComponent c : resources) { root.removeComponentResource(context, c); } for (UIComponent c : last) { root.removeComponentResource(context, c); } for (UIComponent c : datatable) { root.removeComponentResource(context, c); } // for (UIComponent resource : root.getComponentResources(context, "head")) { // System.out.println(resource.getClass().getName()); // } for (UIComponent c : root.getComponentResources(context, "head")) { middle.add(c); } for (UIComponent c : middle) { root.removeComponentResource(context, c); } for (UIComponent c : first) { root.addComponentResource(context, c, "head"); } for (UIComponent c : middle) { root.addComponentResource(context, c, "head"); } for (UIComponent c : resources) { root.addComponentResource(context, c, "head"); } for (UIComponent c : last) { root.addComponentResource(context, c, "head"); } for (UIComponent c : datatable) { root.addComponentResource(context, c, "head"); } } }
public class class_name { private void enforceCorrectLoadOrder(UIViewRoot root, FacesContext context) { // // first, handle the CSS files. // // Put BootsFaces.css or BootsFaces.min.css first, // // theme.css second // // and everything else behind them. List<UIComponent> resources = new ArrayList<UIComponent>(); List<UIComponent> first = new ArrayList<UIComponent>(); List<UIComponent> middle = new ArrayList<UIComponent>(); List<UIComponent> last = new ArrayList<UIComponent>(); List<UIComponent> datatable = new ArrayList<UIComponent>(); for (UIComponent resource : root.getComponentResources(context, "head")) { String name = (String) resource.getAttributes().get("name"); String position = (String) resource.getAttributes().get("position"); if ("first".equals(position)) { first.add(resource); // depends on control dependency: [if], data = [none] } else if ("last".equals(position)) { last.add(resource); // depends on control dependency: [if], data = [none] } else if ("middle".equals(position)) { middle.add(resource); // depends on control dependency: [if], data = [none] } else { if (resource instanceof InternalJavaScriptResource) { datatable.add(resource); // depends on control dependency: [if], data = [none] } else if (name != null && (name.endsWith(".js"))) { if (name.contains("dataTables")) { datatable.add(resource); // depends on control dependency: [if], data = [none] } else { resources.add(resource); // depends on control dependency: [if], data = [none] } } } } // add the JavaScript files in correct order. Collections.sort(resources, new ResourceFileComparator()); for (UIComponent c : first) { root.removeComponentResource(context, c); // depends on control dependency: [for], data = [c] } for (UIComponent c : resources) { root.removeComponentResource(context, c); // depends on control dependency: [for], data = [c] } for (UIComponent c : last) { root.removeComponentResource(context, c); // depends on control dependency: [for], data = [c] } for (UIComponent c : datatable) { root.removeComponentResource(context, c); // depends on control dependency: [for], data = [c] } // for (UIComponent resource : root.getComponentResources(context, "head")) { // System.out.println(resource.getClass().getName()); // } for (UIComponent c : root.getComponentResources(context, "head")) { middle.add(c); // depends on control dependency: [for], data = [c] } for (UIComponent c : middle) { root.removeComponentResource(context, c); // depends on control dependency: [for], data = [c] } for (UIComponent c : first) { root.addComponentResource(context, c, "head"); // depends on control dependency: [for], data = [c] } for (UIComponent c : middle) { root.addComponentResource(context, c, "head"); // depends on control dependency: [for], data = [c] } for (UIComponent c : resources) { root.addComponentResource(context, c, "head"); // depends on control dependency: [for], data = [c] } for (UIComponent c : last) { root.addComponentResource(context, c, "head"); // depends on control dependency: [for], data = [c] } for (UIComponent c : datatable) { root.addComponentResource(context, c, "head"); // depends on control dependency: [for], data = [c] } } }
public class class_name { public static boolean isIntValue(final String value) { try { Integer.parseInt(value); return true; } catch (final NumberFormatException ex) { return false; } } }
public class class_name { public static boolean isIntValue(final String value) { try { Integer.parseInt(value); // depends on control dependency: [try], data = [none] return true; // depends on control dependency: [try], data = [none] } catch (final NumberFormatException ex) { return false; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static RetentionPolicy getRetentionPolicy(Class<? extends Annotation> annotationType) { final Retention retention = annotationType.getAnnotation(Retention.class); if (null == retention) { return RetentionPolicy.CLASS; } return retention.value(); } }
public class class_name { public static RetentionPolicy getRetentionPolicy(Class<? extends Annotation> annotationType) { final Retention retention = annotationType.getAnnotation(Retention.class); if (null == retention) { return RetentionPolicy.CLASS; // depends on control dependency: [if], data = [none] } return retention.value(); } }
public class class_name { String determineAvd() { String avd; if ( emulatorAvd != null ) { avd = emulatorAvd; } else { avd = "Default"; } return avd; } }
public class class_name { String determineAvd() { String avd; if ( emulatorAvd != null ) { avd = emulatorAvd; // depends on control dependency: [if], data = [none] } else { avd = "Default"; // depends on control dependency: [if], data = [none] } return avd; } }
public class class_name { private static void printTargetPathList(FileStatus[] targetTmpFiles) { StringBuilder builder = new StringBuilder(); builder.append("Preprocess target files:"); String lineSeparator = System.getProperty("line.separator"); for (FileStatus targetFile : targetTmpFiles) { builder.append(targetFile.getPath() + lineSeparator); } logger.info(builder.toString()); } }
public class class_name { private static void printTargetPathList(FileStatus[] targetTmpFiles) { StringBuilder builder = new StringBuilder(); builder.append("Preprocess target files:"); String lineSeparator = System.getProperty("line.separator"); for (FileStatus targetFile : targetTmpFiles) { builder.append(targetFile.getPath() + lineSeparator); // depends on control dependency: [for], data = [targetFile] } logger.info(builder.toString()); } }
public class class_name { private static InetAddress[] getByReflection() { try { Class<?> SystemProperties = Class.forName("android.os.SystemProperties"); Method method = SystemProperties.getMethod("get", new Class<?>[]{String.class}); ArrayList<InetAddress> servers = new ArrayList<InetAddress>(5); for (String propKey : new String[]{ "net.dns1", "net.dns2", "net.dns3", "net.dns4"}) { String value = (String) method.invoke(null, propKey); if (value == null) continue; if (value.length() == 0) continue; InetAddress ip = InetAddress.getByName(value); if (ip == null) continue; value = ip.getHostAddress(); if (value == null) continue; if (value.length() == 0) continue; if (servers.contains(ip)) continue; servers.add(ip); } if (servers.size() > 0) { return servers.toArray(new InetAddress[servers.size()]); } } catch (Exception e) { // we might trigger some problems this way Logger.getLogger("AndroidDnsServer").log(Level.WARNING, "Exception in findDNSByReflection", e); } return null; } }
public class class_name { private static InetAddress[] getByReflection() { try { Class<?> SystemProperties = Class.forName("android.os.SystemProperties"); Method method = SystemProperties.getMethod("get", new Class<?>[]{String.class}); ArrayList<InetAddress> servers = new ArrayList<InetAddress>(5); for (String propKey : new String[]{ "net.dns1", "net.dns2", "net.dns3", "net.dns4"}) { String value = (String) method.invoke(null, propKey); if (value == null) continue; if (value.length() == 0) continue; InetAddress ip = InetAddress.getByName(value); if (ip == null) continue; value = ip.getHostAddress(); if (value == null) continue; if (value.length() == 0) continue; if (servers.contains(ip)) continue; servers.add(ip); } if (servers.size() > 0) { return servers.toArray(new InetAddress[servers.size()]); // depends on control dependency: [if], data = [none] } } catch (Exception e) { // we might trigger some problems this way Logger.getLogger("AndroidDnsServer").log(Level.WARNING, "Exception in findDNSByReflection", e); } // depends on control dependency: [catch], data = [none] return null; } }
public class class_name { protected ExecutorService initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) { this.scheduledExecutor = createExecutor(this.poolSize, threadFactory, rejectedExecutionHandler); if (this.removeOnCancelPolicy) { if (setRemoveOnCancelPolicyAvailable && this.scheduledExecutor instanceof ScheduledThreadPoolExecutor) { ((ScheduledThreadPoolExecutor) this.scheduledExecutor).setRemoveOnCancelPolicy(true); } else { // logger.info("Could not apply remove-on-cancel policy - not a Java 7+ ScheduledThreadPoolExecutor"); } } return this.scheduledExecutor; } }
public class class_name { protected ExecutorService initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) { this.scheduledExecutor = createExecutor(this.poolSize, threadFactory, rejectedExecutionHandler); if (this.removeOnCancelPolicy) { if (setRemoveOnCancelPolicyAvailable && this.scheduledExecutor instanceof ScheduledThreadPoolExecutor) { ((ScheduledThreadPoolExecutor) this.scheduledExecutor).setRemoveOnCancelPolicy(true); // depends on control dependency: [if], data = [none] } else { // logger.info("Could not apply remove-on-cancel policy - not a Java 7+ ScheduledThreadPoolExecutor"); } } return this.scheduledExecutor; } }
public class class_name { synchronized void activateLazily() { if (cacheManager != null) return; // lazy initialization has already completed final boolean trace = TraceComponent.isAnyTracingEnabled(); Properties vendorProperties = new Properties(); String uriValue = (String) configurationProperties.get("uri"); final URI uri; if (uriValue != null) try { uri = new URI(uriValue); } catch (URISyntaxException e) { throw new IllegalArgumentException(Tr.formatMessage(tc, "INCORRECT_URI_SYNTAX", e), e); } else uri = null; for (Map.Entry<String, Object> entry : configurationProperties.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); //properties start with properties.0. if (key.length () > TOTAL_PREFIX_LENGTH && key.charAt(BASE_PREFIX_LENGTH) == '.' && key.startsWith(BASE_PREFIX)) { key = key.substring(TOTAL_PREFIX_LENGTH); if (!key.equals("config.referenceType")) vendorProperties.setProperty(key, (String) value); } } // load JCache provider from configured library, which is either specified as a libraryRef or via a bell final ClassLoader cl = library.getClassLoader(); try { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { ClassLoader loader = new CachingProviderClassLoader(cl); if (trace && tc.isDebugEnabled()) CacheHashMap.tcInvoke("Caching", "getCachingProvider", loader); cachingProvider = Caching.getCachingProvider(loader); tcCachingProvider = "CachingProvider" + Integer.toHexString(System.identityHashCode(cachingProvider)); if (trace && tc.isDebugEnabled()) { CacheHashMap.tcReturn("Caching", "getCachingProvider", tcCachingProvider, cachingProvider); Tr.debug(this, tc, "caching provider class is " + cachingProvider.getClass().getName()); CacheHashMap.tcInvoke(tcCachingProvider, "getCacheManager", uri, null, vendorProperties); } cacheManager = cachingProvider.getCacheManager(uri, null, vendorProperties); return null; }); tcCacheManager = "CacheManager" + Integer.toHexString(System.identityHashCode(cacheManager)); if (trace && tc.isDebugEnabled()) { CacheHashMap.tcReturn(tcCachingProvider, "getCacheManager", tcCacheManager, cacheManager); CacheHashMap.tcInvoke(tcCachingProvider, "isSupported", "STORE_BY_REFERENCE"); } supportsStoreByReference = cachingProvider.isSupported(OptionalFeature.STORE_BY_REFERENCE); if (trace && tc.isDebugEnabled()) CacheHashMap.tcReturn(tcCachingProvider, "isSupported", supportsStoreByReference); } catch (CacheException x) { if (library.getFiles().isEmpty()) { Tr.error(tc, "ERROR_CONFIG_EMPTY_LIBRARY", library.id(), Tr.formatMessage(tc, "SESSION_CACHE_CONFIG_MESSAGE", RuntimeUpdateListenerImpl.sampleConfig)); } throw x; } catch (Error | RuntimeException x) { // deactivate will not be invoked if activate fails, so ensure CachingProvider is closed on error paths if (cachingProvider != null) { CacheHashMap.tcInvoke(tcCachingProvider, "close"); cachingProvider.close(); CacheHashMap.tcReturn(tcCachingProvider, "close"); } throw x; } } }
public class class_name { synchronized void activateLazily() { if (cacheManager != null) return; // lazy initialization has already completed final boolean trace = TraceComponent.isAnyTracingEnabled(); Properties vendorProperties = new Properties(); String uriValue = (String) configurationProperties.get("uri"); final URI uri; if (uriValue != null) try { uri = new URI(uriValue); // depends on control dependency: [try], data = [none] } catch (URISyntaxException e) { throw new IllegalArgumentException(Tr.formatMessage(tc, "INCORRECT_URI_SYNTAX", e), e); } // depends on control dependency: [catch], data = [none] else uri = null; for (Map.Entry<String, Object> entry : configurationProperties.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); //properties start with properties.0. if (key.length () > TOTAL_PREFIX_LENGTH && key.charAt(BASE_PREFIX_LENGTH) == '.' && key.startsWith(BASE_PREFIX)) { key = key.substring(TOTAL_PREFIX_LENGTH); // depends on control dependency: [if], data = [none] if (!key.equals("config.referenceType")) vendorProperties.setProperty(key, (String) value); } } // load JCache provider from configured library, which is either specified as a libraryRef or via a bell final ClassLoader cl = library.getClassLoader(); try { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { ClassLoader loader = new CachingProviderClassLoader(cl); if (trace && tc.isDebugEnabled()) CacheHashMap.tcInvoke("Caching", "getCachingProvider", loader); cachingProvider = Caching.getCachingProvider(loader); tcCachingProvider = "CachingProvider" + Integer.toHexString(System.identityHashCode(cachingProvider)); if (trace && tc.isDebugEnabled()) { CacheHashMap.tcReturn("Caching", "getCachingProvider", tcCachingProvider, cachingProvider); Tr.debug(this, tc, "caching provider class is " + cachingProvider.getClass().getName()); CacheHashMap.tcInvoke(tcCachingProvider, "getCacheManager", uri, null, vendorProperties); } cacheManager = cachingProvider.getCacheManager(uri, null, vendorProperties); return null; }); // depends on control dependency: [try], data = [none] tcCacheManager = "CacheManager" + Integer.toHexString(System.identityHashCode(cacheManager)); // depends on control dependency: [try], data = [none] if (trace && tc.isDebugEnabled()) { CacheHashMap.tcReturn(tcCachingProvider, "getCacheManager", tcCacheManager, cacheManager); // depends on control dependency: [if], data = [none] CacheHashMap.tcInvoke(tcCachingProvider, "isSupported", "STORE_BY_REFERENCE"); // depends on control dependency: [if], data = [none] } supportsStoreByReference = cachingProvider.isSupported(OptionalFeature.STORE_BY_REFERENCE); // depends on control dependency: [try], data = [none] if (trace && tc.isDebugEnabled()) CacheHashMap.tcReturn(tcCachingProvider, "isSupported", supportsStoreByReference); } catch (CacheException x) { if (library.getFiles().isEmpty()) { Tr.error(tc, "ERROR_CONFIG_EMPTY_LIBRARY", library.id(), Tr.formatMessage(tc, "SESSION_CACHE_CONFIG_MESSAGE", RuntimeUpdateListenerImpl.sampleConfig)); // depends on control dependency: [if], data = [none] } throw x; } catch (Error | RuntimeException x) { // depends on control dependency: [catch], data = [none] // deactivate will not be invoked if activate fails, so ensure CachingProvider is closed on error paths if (cachingProvider != null) { CacheHashMap.tcInvoke(tcCachingProvider, "close"); // depends on control dependency: [if], data = [none] cachingProvider.close(); // depends on control dependency: [if], data = [none] CacheHashMap.tcReturn(tcCachingProvider, "close"); // depends on control dependency: [if], data = [none] } throw x; } // depends on control dependency: [catch], data = [none] } }