name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
druid_OracleOutputVisitor_m1_rdh
// @Override // public boolean visit(VersionsFlashbackQueryClause x) { // print0(ucase ? "VERSIONS BETWEEN " : "versions between "); // print0(x.getType().name()); // print(' '); // x.getBegin().accept(this); // print0(ucase ? " AND " : " and "); // x.getEnd().accept(this); // return false; // } // // @Override // pub...
3.26
druid_OracleOutputVisitor_visit_rdh
// @Override // public boolean visit(AsOfSnapshotClause x) { // print0(ucase ? "AS OF SNAPSHOT(" : "as of snapshot("); // x.getExpr().accept(this); // print(')'); // return false; // } // // @Override // public void endVisit(AsOfSnapshotClause x) { // // } @Override public boolean visit(OracleAlterViewStatement x) { ...
3.26
druid_OscarOutputVisitor_visit_rdh
/** * ************************************************************************* */ // for oracle to postsql /** * ************************************************************************* */ public boolean visit(OracleSysdateExpr x) { print0(ucase ? "CURRENT_TIMESTAMP" : "CURRENT_TIMESTAMP"); return false; }
3.26
druid_NodeListener_update_rdh
/** * Notify the Observer. */ public void update(List<NodeEvent> events) { if ((events != null) && (!events.isEmpty())) {this.lastUpdateTime = new Date(); NodeEvent[] arr = new NodeEvent[events.size()]; for (int i = 0; i < events.size(); i++) { arr[i] = events.get(i); } ...
3.26
druid_ZookeeperNodeRegister_deregister_rdh
/** * Close the current GroupMember. */ public void deregister() { if (member != null) { member.close(); member = null; } if ((client != null) && privateZkClient) { client.close(); } }
3.26
druid_ZookeeperNodeRegister_init_rdh
/** * Init a CuratorFramework if there's no CuratorFramework provided. */ public void init() { if (client == null) { client = CuratorFrameworkFactory.builder().connectionTimeoutMs(5000).connectString(zkConnectString).retryPolicy(new RetryForever(10000)).sessionTimeoutMs(30000).bu...
3.26
druid_ZookeeperNodeRegister_destroy_rdh
/** * * @see #deregister() */ public void destroy() { deregister(); }
3.26
druid_ZookeeperNodeRegister_register_rdh
/** * Register a Node which has a Properties as the payload. * <pre> * CAUTION: only one node can be registered, * if you want to register another one, * call deregister first * </pre> * * @param payload * The information used to generate the payload Properties * @return true, register suc...
3.26
druid_FnvHash_hashCode64_rdh
/** * normalized and lower and fnv1a_64_hash * * @param owner * @param name * @return */ public static long hashCode64(String owner, String name) { long hashCode = BASIC; if (owner != null) { String item = owner; ...
3.26
druid_StringUtils_m0_rdh
/** * Example: subString("abcdc","a","c",true)="bcd" * * @param src * @param start * null while start from index=0 * @param to * null while to index=src.length * @param toLast * true while to index=src.lastIndexOf(to) * @return */ public static String m0(String src, String start, String to, boolean toL...
3.26
druid_StringUtils_subString_rdh
/** * Example: subString("abcd","a","c")="b" * * @param src * @param start * null while start from index=0 * @param to * null while to index=src.length * @return */ public static String subString(String src, String start, String to) { return m0(src, start, to, false); }
3.26
druid_StringUtils_stringToInteger_rdh
/** * * @param in * @return */ public static Integer stringToInteger(String in) { if (in == null) { return null; } in = in.trim(); if (in.length() == 0) { return null; } try { return Integer.parseInt(in); } catch (NumberFormatException e) { LOG.warn("stri...
3.26
druid_StringUtils_subStringToInteger_rdh
/** * Example: subString("12345","1","4")=23 * * @param src * @param start * @param to * @return */ public static Integer subStringToInteger(String src, String start, String to) { return stringToInteger(subString(src, start, to)); }
3.26
druid_FilterChainImpl_callableStatement_registerOutParameter_rdh
// ///////////////////////////////////// @Override public void callableStatement_registerOutParameter(CallableStatementProxy statement, int parameterIndex, int sqlType) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_registerOutParameter(this, statement, parameterIndex, sqlType); ret...
3.26
druid_FilterChainImpl_preparedStatement_executeQuery_rdh
// //////////////// @Override public ResultSetProxy preparedStatement_executeQuery(PreparedStatementProxy statement) throws SQLException {if (this.pos < filterSize) { return nextFilter().preparedStatement_executeQuery(this, statement); } ResultSet resultSet = statement.getRawObject().executeQuery(); if (resultSet == ...
3.26
druid_FilterChainImpl_resultSet_next_rdh
// /////////////////////////////////////// @Override public boolean resultSet_next(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_next(this, rs); } ...
3.26
druid_FilterChainImpl_wrap_rdh
// //////////// public ClobProxy wrap(ConnectionProxy conn, Clob clob) { if (clob == null) { return null; } if (clob instanceof NClob) { return wrap(conn, ((NClob) (clob))); } return new ClobProxyImpl(dataSource, conn, clob); }
3.26
druid_FilterChainImpl_statement_executeQuery_rdh
// //////////////////////////////////////// statement @Override public ResultSetProxy statement_executeQuery(StatementProxy statement, String sql) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_executeQuery(this, statement, sql);} ResultSet resultSet = statement.getRawObject().execute...
3.26
druid_IbatisUtils_getId_rdh
/** * 通过反射的方式得到id,能够兼容2.3.0和2.3.4 * * @return */ protected static String getId(Object statement) { try { if (methodGetId == null) { Class<?> clazz = statement.getClass(); methodGetId = clazz.getMethod("getId"); } Object returnValue = met...
3.26
druid_IbatisUtils_getResource_rdh
/** * 通过反射的方式得到resource,能够兼容2.3.0和2.3.4 * * @return */ protected static String getResource(Object statement) { try { if (methodGetResource == null) {methodGetResource = statement.getClass().getMethod("getResource"); }return ((String) (methodGetResource.invoke(statement))); } catch (E...
3.26
druid_MySqlSelectIntoParser_parseIntoArgs_rdh
/** * parser the select into arguments * * @return */ protected List<SQLExpr> parseIntoArgs() { List<SQLExpr> args = new ArrayList<SQLExpr>(); if (lexer.token() == Token.INTO) { accept(Token.INTO); // lexer.nextToken(); for (; ;) { SQLExpr var = exprParser.pri...
3.26
druid_MysqlShowDbLockStatement_accept0_rdh
/** * * @author lijun.cailj 2017/11/16 */ public class MysqlShowDbLockStatement extends MySqlStatementImpl implements MySqlShowStatement { @Override public void accept0(MySqlASTVisitor visitor) { visitor.visit(this); visitor.endVisit(this); }
3.26
druid_DruidDataSourceC3P0Adapter_isEnable_rdh
// ///////////////// @Override public boolean isEnable() { return dataSource.isEnable(); }
3.26
druid_OracleCreateIndexStatement_getTablespace_rdh
// //////////// public SQLName getTablespace() { return tablespace; }
3.26
druid_DruidDataSourceStatLoggerImpl_configFromProperties_rdh
/** * * @since 0.2.21 */ @Override public void configFromProperties(Properties properties) { if (properties == null) { return; } String property = properties.getProperty("druid.stat.loggerName"); if ((property != null) && (property.length() > 0)) { setLoggerName(property); } }
3.26
druid_OdpsOutputVisitor_visit_rdh
// protected void printSelectList(List<SQLSelectItem> selectList) { // this.indentCount++; // for (int i = 0, size = selectList.size(); i < size; ++i) { // SQLSelectItem selectItem = selectList.get(i); // // if (i != 0) { // SQLSelectItem preSelectItem = selectList.get(i - 1); // if (preSelectItem.hasAfterComment()) {...
3.26
druid_DruidDataSource_close_rdh
/** * close datasource */ public void close() { if (LOG.isInfoEnabled()) { LOG.info(("{dataSource-" + this.getID()) + "} closing ..."); } lock.lock(); try { if (this.closed) { return;} if (!this.inited) { return; } this.closing = true; if (logStatsThread != null) { logStatsThread.interrupt(); } if (createConnectionTh...
3.26
druid_DruidDataSource_discardConnection_rdh
/** * 抛弃连接,不进行回收,而是抛弃 * * @param conn * @deprecated */ public void discardConnection(Connection conn) { if (conn == null) { return; } try { if (!conn.isClosed()) { conn.close(); } } catch (SQLRecoverableException ignored) { discardErrorCountUpdater.incrementAndGet(this); // ignored } catch (Throwable e) { discard...
3.26
druid_DruidDataSource_recycle_rdh
/** * 回收连接 */ protected void recycle(DruidPooledConnection pooledConnection) throws SQLException { final DruidConnectionHolder holder = pooledConnection.holder; if (holder == null) { LOG.warn("connectionHolder is null"); return; } boolean asyncCloseConnectionEnable = this.removeAbandoned || this.asyncCloseConnectionE...
3.26
druid_DruidDataSource_initFromSPIServiceLoader_rdh
/** * load filters from SPI ServiceLoader * * @see ServiceLoader */private void initFromSPIServiceLoader() { if (loadSpifilterSkip) { return; } if (autoFilters == null) { List<Filter> filters = new ArrayList<Filter>(); ServiceLoader<Filter> autoFilterLoader = ServiceLoader.load(Filter.class); for (Filter filter : a...
3.26
druid_DruidDataSource_isMysqlOrMariaDBUrl_rdh
/** * Issue 5192,Issue 5457 * * @see <a href="https://dev.mysql.com/doc/connector-j/8.1/en/connector-j-reference-jdbc-url-format.html">MySQL Connection URL Syntax</a> * @see <a href="https://mariadb.com/kb/en/about-mariadb-connector-j/">About MariaDB Connector/J</a> * @param jdbcUrl * @return */ private static b...
3.26
druid_MySqlLexer_isIdentifierCharForVariable_rdh
/** * employee.code=:employee.code 解析异常 * 修复:变量名支持含符号. * * @param c * @return */ public static boolean isIdentifierCharForVariable(char c) { if (c == '.') { return true; } return isIdentifierChar(c); }
3.26
druid_SQLASTVisitor_m16_rdh
/** * support procedure */ default boolean m16(SQLWhileStatement x) { return true; }
3.26
druid_SchemaResolveVisitorFactory_resolveExpr_rdh
// for performance static void resolveExpr(SchemaResolveVisitor visitor, SQLExpr x) { if (x == null) { return; } Class<?> clazz = x.getClass(); if (clazz == SQLIdentifierExpr.class) { visitor.visit(((SQLIdentifierExpr) (x))); return; } else if ((clazz == SQLIntegerExpr.class) || (clazz == SQLCharExpr.class)) { // skip ...
3.26
druid_SQLCommitStatement_getTransactionName_rdh
// sql server public SQLExpr getTransactionName() { return transactionName; }
3.26
druid_SQLCommitStatement_isWrite_rdh
// oracle public boolean isWrite() { return write; }
3.26
druid_SQLCommitStatement_getChain_rdh
// mysql public Boolean getChain() { return f0; }
3.26
druid_SQLJoinTableSource_rearrangement_rdh
/** * a inner_join (b inner_join c) -&lt; a inner_join b innre_join c */ public void rearrangement() { if ((joinType != JoinType.COMMA) && (joinType != JoinType.INNER_JOIN)) { return; } if (right instanceof SQLJoinTableSource) { SQLJoinTableSource rightJoin = ((SQLJoinTableSource) (right))...
3.26
druid_MySQL8DateTimeResultSetMetaData_getColumnClassName_rdh
/** * 针对8.0.24版本开始,如果把mysql DATETIME映射回Timestamp,就需要把javaClass的类型也改回去 * 相关类在com.mysql.cj.MysqlType 中 * 旧版本jdbc为 * DATETIME("DATETIME", Types.TIMESTAMP, Timestamp.class, 0, MysqlType.IS_NOT_DECIMAL, 26L, "[(fsp)]"), * 8.0.24及以上版本jdbc实现改为 ...
3.26
druid_PGOutputVisitor_visit_rdh
/** * ************************************************************************* */ // for oracle to postsql /** * ************************************************************************ */ public boolean visit(OracleSysdateExpr x) { print0(ucase ? "CURRENT_TIMESTAMP" : "CURRENT_TIMESTAMP"); return false; ...
3.26
druid_FileNodeListener_destroy_rdh
/** * Close the ScheduledExecutorService. */ @Override public void destroy() { if ((executor == null) || executor.isShutdown()) { return; }try { executor.shutdown(); } catch (Exception e) { LOG.error("Can NOT shutdown the ScheduledExecutorService...
3.26
druid_FileNodeListener_init_rdh
/** * Start a Scheduler to check the specified file. * * @see #setIntervalSeconds(int) * @see #update() */ @Override public void init() { super.init(); if (intervalSeconds <= 0) { intervalSeconds = 60; } executor = Executors.newScheduledThreadPool(1); executor.scheduleAtFixedRate(...
3.26
druid_FileNodeListener_refresh_rdh
/** * Load the properties file and diff with the stored Properties. * * @return A List of the modification */ @Override public List<NodeEvent> refresh() { Properties originalProperties = PropertiesUtils.loadProperties(file); List<String> nameList = PropertiesUtils.loadNameList(originalProperties, getPrefix(...
3.26
druid_SQLFunctionBuilder_length_rdh
// for character function public SQLMethodInvokeExpr length(SQLExpr expr) { return new SQLMethodInvokeExpr("length", null, expr); }
3.26
druid_SQLUtils_clearLimit_rdh
/** * * @param query * @param dbType * @return 0:sql.toString, 1: */ public static Object[] clearLimit(String query, DbType dbType) { List stmtList = SQLUtils.parseStatements(query, dbType); SQLLimit limit = null; SQLStatement statement = ((SQLStatement) (stmtList.get(0))); if (statement instanceof SQLSelectStat...
3.26
druid_SQLUtils_buildToDate_rdh
/** * * @param columnName * @param tableAlias * @param pattern * if pattern is null,it will be set {%Y-%m-%d %H:%i:%s} as mysql default value and set {yyyy-mm-dd * hh24:mi:ss} as oracle default valu...
3.26
druid_MySqlOutputVisitor_visit_rdh
// char c0 = alias.charAt(0); // if (!hasSpecial) { // print0(alias); // } else { // print('"'); // // for (int i = 0; i < alias.length(); ++i) { // char ch = alias.charAt(i); // if (ch == '\"') { // print('\\'); // print(ch); // } else if (ch == '\n') { // print0("\\n"); // } else { // print(ch); // } // } // // pri...
3.26
druid_SqlMapClientImplWrapper_queryForPaginatedList_rdh
/** * * @deprecated All paginated list features have been deprecated */ public PaginatedList queryForPaginatedList(String id, int pageSize) throws SQLException { return getLocalSqlMapSessionWrapper().queryForPaginatedList(id, pageSize); }
3.26
druid_StatViewServlet_initJmxConn_rdh
/** * 初始化jmx连接 * * @throws IOException */ private void initJmxConn() throws IOException { if (jmxUrl != null) { JMXServiceURL url = new JMXServiceURL(jmxUrl); Map<String, String[]> env = null; if (jmxUsername != null) { env = new HashMap<String, String[]>(); Stri...
3.26
druid_StatViewServlet_process_rdh
/** * 程序首先判断是否存在jmx连接地址,如果不存在,则直接调用本地的druid服务; 如果存在,则调用远程jmx服务。在进行jmx通信,首先判断一下jmx连接是否已经建立成功,如果已经 * 建立成功,则直接进行通信,如果之前没有成功建立,则会尝试重新建立一遍。. * * @param url * 要连接的服务地址 * @return 调用服务后返回的json字符串 */protected String process(String url) { String resp = null; if (jmxUrl == null) { resp = statService.servi...
3.26
druid_StatViewServlet_getJmxResult_rdh
/** * 根据指定的url来获取jmx服务返回的内容. * * @param connetion * jmx连接 * @param url * url内容 * @return the jmx返回的内容 * @throws Exception * the exception */ private String getJmxResult(MBeanServerConnection connetion, String url) throws Exception { ObjectName name = new ObjectName(DruidStatService.MBEAN_NAME); ...
3.26
druid_StatViewServlet_readInitParam_rdh
/** * 读取servlet中的配置参数. * * @param key * 配置参数名 * @return 配置参数值,如果不存在当前配置参数,或者为配置参数长度为0,将返回null */ private String readInitParam(String key) { String value = null; try { String param = getInitParameter(key); if (param != null) { param = param.trim(); if (param.leng...
3.26
druid_SQLBinaryOpExpr_mergeEqual_rdh
/** * only for parameterized output * * @param a * @param b * @return */ private static boolean mergeEqual(SQLExpr a, SQLExpr b) { if (!(a instanceof SQLBinaryOpExpr)) { return false; } if (!(b instanceof SQLBinaryOpExpr)) { return false; } SQLBinaryOpExpr binaryA = ((SQLBinaryOpExpr) (a)); SQLBinaryOpExpr binary...
3.26
druid_SQLBinaryOpExpr_getMergedList_rdh
/** * only for parameterized output * * @return */ public List<SQLObject> getMergedList() { return mergedList; }
3.26
druid_SQLBinaryOpExpr_addMergedItem_rdh
/** * only for parameterized output * * @param item * @return */ private void addMergedItem(SQLBinaryOpExpr item) { if (mergedList == null) {mergedList = new ArrayList<SQLObject>(); } mergedList.add(item); }
3.26
druid_SQLBinaryOpExpr_merge_rdh
/** * only for parameterized output * * @param v * @param x * @return */ public static SQLBinaryOpExpr merge(ParameterizedVisitor v, SQLBinaryOpExpr x) { SQLObject parent = x.parent; for (; ;) { if (x.right instanceof SQLBinaryOpExpr) { SQLBinaryOpExpr rightBinary = ((SQLBinaryOpExpr) (x.right)); if (x.left inst...
3.26
druid_SQLAggregateExpr_getWithinGroup_rdh
// 为了兼容之前的逻辑 @Deprecated public SQLOrderBy getWithinGroup() { return orderBy; }
3.26
druid_PoolUpdater_update_rdh
/** * Process the given NodeEvent[]. Maybe add / delete some nodes. */ @Override public void update(Observable o, Object arg) { if (!(o instanceof NodeListener)) { return; }if ((arg == null) || (!(arg instanceof NodeEvent[]))) { return; } NodeEvent[] events = ((NodeEvent[]) (arg));...
3.26
druid_PoolUpdater_removeDataSources_rdh
/** * Remove unused DataSources. */ public void removeDataSources() { if ((f0 == null) || f0.isEmpty()) { return;} try { lock.lock(); Map<String, DataSource> map = highAvailableDataSource.getDataSourceMap(); Set<String> copySet = new HashSet<String>(f0); for (String...
3.26
druid_SQLMethodInvokeExpr_addParameter_rdh
/** * deprecated, instead of addArgument * * @deprecated */ public void addParameter(SQLExpr param) { if (param != null) { param.setParent(this); } this.arguments.add(param); }
3.26
druid_SQLMethodInvokeExpr_getParameters_rdh
/** * instead of getArguments * * @deprecated */ public List<SQLExpr> getParameters() { return this.arguments; }
3.26
druid_SQLASTOutputVisitor_setOutputParameters_rdh
/** * * @since 1.1.5 */ public void setOutputParameters(List<Object> parameters) { this.parameters = parameters; }
3.26
druid_SQLASTOutputVisitor_visit_rdh
// /////////// for odps & hive @Override public boolean visit(SQLLateralViewTableSource x) { SQLTableSource tableSource = x.getTableSource(); if (tableSource != null) { tableSource.accept(this); } this.indentCount++; println(); print0(ucase ? "LATERAL VIEW " : "lateral view "); if (x.isOuter()) { print0(ucase ? "OUTER ...
3.26
druid_SQLExprParser_m4_rdh
// for ads public void m4(SQLExpr expr) { if ((lexer.token == Token.HINT) && ((((((expr instanceof SQLInListExpr) || (expr instanceof SQLBinaryOpExpr)) || (expr instanceof SQLInSubQueryExpr)) || (expr instanceof SQLExistsExpr)) || (expr instanceof SQLNotExpr)) || (expr instanceof SQLBetweenExpr))) { String text = le...
3.26
druid_CharTypes_isWhitespace_rdh
/** * * @return false if {@link LayoutCharacters#EOI} */ public static boolean isWhitespace(char c) { return ((c <= whitespaceFlags.length) && whitespaceFlags[c])// || (c == ' ');// Chinese space }
3.26
druid_DruidDriver_getDataSource_rdh
/** * 参数定义: com.alibaba.druid.log.LogFilter=filter com.alibaba.druid.log.LogFilter.p1=prop-value * com.alibaba.druid.log.LogFilter.p2=prop-value * * @param url * @return * @throws SQLException */ private DataSourceProxyImpl getDataSource(String url, Properties info) throws SQLException { DataSourceProxyImpl ...
3.26
druid_MySqlSchemaStatVisitor_visit_rdh
// DUAL public boolean visit(MySqlDeleteStatement x) { if ((repository != null) && (x.getParent() == null)) { repository.resolve(x); } SQLTableSource from = x.getFrom(); if (from != null) { from.accept(this); } SQLTableSource using = x.getUsing(); if (using != nul...
3.26
druid_FilterAdapter_resultSet_getRowId_rdh
// //////////////// @Override public RowId resultSet_getRowId(FilterChain chain, ResultSetProxy result, int columnIndex) throws SQLException { return chain.resultSet_getRowId(result, columnIndex); }
3.26
druid_FilterAdapter_dataSource_releaseConnection_rdh
// /////////////////// @Override public void dataSource_releaseConnection(FilterChain chain, DruidPooledConnection connection) throws SQLException { chain.dataSource_recycle(connection); }
3.26
druid_FilterAdapter_callableStatement_getTime_rdh
// ////////////////////////////// @Override public Time callableStatement_getTime(FilterChain chain, CallableStatementProxy statement, int parameterIndex, Calendar cal) throws SQLException { return chain.callableStatement_getTime(statement, parameterIndex, cal);}
3.26
druid_FilterAdapter_resultSetMetaData_getColumnCount_rdh
// /////////////// @Override public int resultSetMetaData_getColumnCount(FilterChain chain, ResultSetMetaDataProxy metaData) throws SQLException { return chain.resultSetMetaData_getColumnCount(metaData); }
3.26
druid_FilterAdapter_callableStatement_registerOutParameter_rdh
// /////////////// @Override public void callableStatement_registerOutParameter(FilterChain chain, CallableStatementProxy statement, int parameterIndex, int sqlType) throws SQLException { chain.callableStatement_registerOutParameter(statement, parameterIndex, sqlType); }
3.26
druid_FilterAdapter_statement_executeQuery_rdh
// ///////////////////////////// @Override public ResultSetProxy statement_executeQuery(FilterChain chain, StatementProxy statement, String sql) throws SQLException { return chain.statement_executeQuery(statement, sql); }
3.26
druid_MySQL8DateTimeSqlTypeFilter_resultSet_getObject_rdh
/** * 针对mysql jdbc 8.0.23及以上版本,通过该方法控制将对象类型转换成原来的类型 * * @param chain * @param result * @param columnLabel * @return * @throws SQLException * @see java.sql.ResultSet#getObject(String) */ @Override public Object resultSet_getObject(FilterChain chain, ResultSetProxy result, String columnLabel) throws SQLExcepti...
3.26
druid_MySQL8DateTimeSqlTypeFilter_resultSet_getMetaData_rdh
/** * mybatis查询结果为map时, 会自动做类型映射。只有在自动映射前,更改 ResultSetMetaData 里映射的 java 类型,才会生效 * * @param chain * @param resultSet * @return * @throws SQLException */ @Override public ResultSetMetaData resultSet_getMetaData(FilterChain chain, ResultSetProxy resultSet) throws SQLException { return new MySQL8DateTimeResul...
3.26
druid_MySQL8DateTimeSqlTypeFilter_getObjectReplaceLocalDateTime_rdh
/** * 针对mysql jdbc 8.0.23及以上版本,通过该方法控制将对象类型转换成原来的类型 * * @param obj * @return */ public static Object getObjectReplaceLocalDateTime(Object obj) { if (!(obj instanceof LocalDateTime)) { return obj;} // 针对升级到了mysql jdbc 8.0.23以上的情况,转换回老的兼容类型 return Timestamp.valueOf(((L...
3.26
druid_DruidFilterConfiguration_statFilter_rdh
/** * * @author lihengming [89921218@qq.com] */public class DruidFilterConfiguration { @Bean @ConfigurationProperties(FILTER_STAT_PREFIX) @ConditionalOnProperty(prefix = FILTER_STAT_PREFIX, name = "enabled") @ConditionalOnMissingBean public StatFilter statFilter() { return new StatFilter(...
3.26
druid_BeanTypeAutoProxyCreator_setTargetBeanType_rdh
/** * * @param targetClass * the targetClass to set */ public void setTargetBeanType(Class<?> targetClass) { this.targetBeanType = targetClass; }
3.26
druid_BeanTypeAutoProxyCreator_isMatch_rdh
/** * Return if the given bean name matches the mapped name. * <p> * The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. Can be * overridden in subclasses. * * @param beanName * the bean name to check * @param mappedName * the name in the configured list of...
3.26
druid_BeanTypeAutoProxyCreator_getAdvicesAndAdvisorsForBean_rdh
/** * Identify as bean to proxy if the bean name is in the configured list of names. */ @SuppressWarnings("rawtypes") protected Object[] getAdvicesAndAdvisorsForBean(Class beanClass, String beanName, TargetSource targetSource) { for (String mappedName : this.beanNames) { if (FactoryBean.class.isAssignable...
3.26
druid_DruidDataSourceConverter_convert_rdh
/** * * @see org.osjava.sj.loader.convert.Converter#convert(java.util.Properties, java.lang.String) */ @Override public Object convert(Properties properties, String type) { try { DruidDataSource dataSource = new DruidDataSource(); DruidDataSourceFactory.config(dataSource, properties)...
3.26
druid_PhoenixExceptionSorter_isExceptionFatal_rdh
/** * 解决phoenix 的错误 --Connection is null or closed * * @param e * the exception * @return */ @Override public boolean isExceptionFatal(SQLException e) { if (e.getMessage().contains("Connection is null or closed")) { LOG.error("剔除phoenix不可用的连接", e); return true; }return false; }
3.26
druid_ConnectionProxyImpl_createStatement_rdh
// @Override public Statement createStatement(int resultSetType, // int resultSetConcurrency, // int resultSetHoldability) throws SQLException { FilterChainImpl chain = createChain(); Statement stmt = chain.connection_createStatement(this, resultSetType, resultSetConcurrency, resultSetHoldability); recycleFilterCha...
3.26
druid_StatementProxyImpl_getUpdateCount_rdh
// bug fixed for oracle @Override public int getUpdateCount() throws SQLException { if (updateCount == null) { FilterChainImpl chain = createChain(); updateCount = chain.statement_getUpdateCount(this); recycleFilterChain(chain); } return updateCount; }
3.26
druid_CharsetConvert_decode_rdh
/** * 字符串解码 * * @param s * String * @return String * @throws UnsupportedEncodingException */ public String decode(String s) throws UnsupportedEncodingException { if (enable && (!isEmpty(s))) {s = new String(s.getBytes(serverEncoding), clientEncoding); } return s; }
3.26
druid_CharsetConvert_encode_rdh
/** * 字符串编码 * * @param s * String * @return String * @throws UnsupportedEncodingException */ public String encode(String s) throws UnsupportedEncodingException { if (enable && (!isEmpty(s))) { s = new String(s.getBytes(clientEncoding), serverEncoding); } return s;}
3.26
druid_CharsetConvert_isEmpty_rdh
/** * 判断空字符串 * * @param s * String * @return boolean */ public boolean isEmpty(String s) { return (s == null) || "".equals(s); }
3.26
druid_SQLIndexDefinition_addOption_rdh
// // Function for compatibility. // public void addOption(String name, SQLExpr value) { SQLAssignItem assignItem = new SQLAssignItem(new SQLIdentifierExpr(name), value); if (getParent() != null) { assignItem.setParent(getParent()); } else { assignItem.setParent(this); } getCompatib...
3.26
druid_IPAddress_getIPAddress_rdh
// ------------------------------------------------------------------------- /** * Return the integer representation of the IP address. * * @return The IP address. */ public final int getIPAddress() { return ipAddress; }
3.26
druid_IPAddress_parseIPAddress_rdh
// ------------------------------------------------------------------------- /** * Convert a decimal-dotted notation representation of an IP address into an 32 bits interger value. * * @param ipAddressStr * Decimal-dotted notation (xxx.xxx.xxx.xxx) of the IP address. * @return Return the 32 bits integer represen...
3.26
druid_IPAddress_toString_rdh
// ------------------------------------------------------------------------- /** * Return the string representation of the IP Address following the common decimal-dotted notation xxx.xxx.xxx.xxx. * * @return Return the string representation of the IP address. */ public String toString() { StringBuilder v0 = new...
3.26
druid_NodeEvent_m0_rdh
/** * Diff the given two Properties. * * @return A List of AddEvent and DelEvent */ public static List<NodeEvent> m0(Properties previous, Properties next) { List<String> prevNames = PropertiesUtils.loadNameList(previous, ""); List<String> nextNames = PropertiesUtils.loadNameList(next, ""); List<Strin...
3.26
druid_SQLServerStatementParser_parseExecParameter_rdh
/** * SQLServer parse Parameter statement support out type * * @author zz [455910092@qq.com] */ public void parseExecParameter(Collection<SQLServerParameter> exprCol, SQLObject parent) { if ((lexer.token() == Token.RPAREN) || (lexer.token() == Token.RBRACKET)) { return; } if (lexer.token() == To...
3.26
druid_WallConfig_isSelelctAllow_rdh
/** * * @deprecated use isSelectAllow */ public boolean isSelelctAllow() { return isSelectAllow(); }
3.26
druid_WallConfig_setDescribeAllow_rdh
/** * set allow mysql describe statement * * @since 0.2.10 */ public void setDescribeAllow(boolean describeAllow) { this.describeAllow = describeAllow; }
3.26
druid_WallConfig_isDescribeAllow_rdh
/** * allow mysql describe statement * * @return * @since 0.2.10 */ public boolean isDescribeAllow() { return describeAllow; }
3.26
druid_WallConfig_setSelelctAllow_rdh
/** * * @deprecated use setSelelctAllow */public void setSelelctAllow(boolean selelctAllow) { this.setSelectAllow(selelctAllow); }
3.26
druid_WallConfig_isCommentAllow_rdh
// /////////////////// public boolean isCommentAllow() { return commentAllow; }
3.26
druid_WallFilter_statement_execute_rdh
// ////////////// @Override public boolean statement_execute(FilterChain chain, StatementProxy statement, String sql) throws SQLException { WallContext originalContext = WallContext.current(); try { createWallContext(statement); sql = check(sql); boolean firstResult = chain.statement_execute(statement, sql)...
3.26
druid_WallFilter_resultSet_findColumn_rdh
// //////////////// @Override public int resultSet_findColumn(FilterChain chain, ResultSetProxy resultSet, String columnLabel) throws SQLException { int physicalColumn = chain.resultSet_findColumn(resultSet, columnLabel); return resultSet.getLogicColumn(physicalColumn); }
3.26