code
stringlengths
73
34.1k
label
stringclasses
1 value
public void setAcquireRetryDelay(long acquireRetryDelay, TimeUnit timeUnit) { this.acquireRetryDelayInMs = TimeUnit.MILLISECONDS.convert(acquireRetryDelay, timeUnit); }
java
public void setQueryExecuteTimeLimit(long queryExecuteTimeLimit, TimeUnit timeUnit) { this.queryExecuteTimeLimitInMs = TimeUnit.MILLISECONDS.convert(queryExecuteTimeLimit, timeUnit); }
java
public void setConnectionTimeout(long connectionTimeout, TimeUnit timeUnit) { this.connectionTimeoutInMs = TimeUnit.MILLISECONDS.convert(connectionTimeout, timeUnit); }
java
public void setCloseConnectionWatchTimeout(long closeConnectionWatchTimeout, TimeUnit timeUnit) { this.closeConnectionWatchTimeoutInMs = TimeUnit.MILLISECONDS.convert(closeConnectionWatchTimeout, timeUnit); }
java
public void setMaxConnectionAge(long maxConnectionAge, TimeUnit timeUnit) { this.maxConnectionAgeInSeconds = TimeUnit.SECONDS.convert(maxConnectionAge, timeUnit); }
java
private Properties parseXML(Document doc, String sectionName) { int found = -1; Properties results = new Properties(); NodeList config = null; if (sectionName == null){ config = doc.getElementsByTagName("default-config"); found = 0; } else { config = doc.getElementsByTagName("named-config"); if(co...
java
protected Class<?> loadClass(String clazz) throws ClassNotFoundException { if (this.classLoader == null){ return Class.forName(clazz); } return Class.forName(clazz, true, this.classLoader); }
java
public boolean hasSameConfiguration(BoneCPConfig that){ if ( that != null && Objects.equal(this.acquireIncrement, that.getAcquireIncrement()) && Objects.equal(this.acquireRetryDelayInMs, that.getAcquireRetryDelayInMs()) && Objects.equal(this.closeConnectionWatch, that.isCloseConnectionWatch()) && Objects....
java
protected long preConnection() throws SQLException{ long statsObtainTime = 0; if (this.pool.poolShuttingDown){ throw new SQLException(this.pool.shutdownStackTrace); } if (this.pool.statisticsEnabled){ statsObtainTime = System.nanoTime(); this.pool.statistics.incrementConnectionsRequested...
java
protected void postConnection(ConnectionHandle handle, long statsObtainTime){ handle.renewConnection(); // mark it as being logically "open" // Give an application a chance to do something with it. if (handle.getConnectionHook() != null){ handle.getConnectionHook().onCheckOut(handle); } if (thi...
java
public BoneCP getPool() { FinalWrapper<BoneCP> wrapper = this.pool; return wrapper == null ? null : wrapper.value; }
java
public void configure(Properties props) throws HibernateException { try{ this.config = new BoneCPConfig(props); // old hibernate config String url = props.getProperty(CONFIG_CONNECTION_URL); String username = props.getProperty(CONFIG_CONNECTION_USERNAME); String password = props.getProperty(CON...
java
protected BoneCP createPool(BoneCPConfig config) { try{ return new BoneCP(config); } catch (SQLException e) { throw new HibernateException(e); } }
java
private Properties mapToProperties(Map<String, String> map) { Properties p = new Properties(); for (Map.Entry<String,String> entry : map.entrySet()) { p.put(entry.getKey(), entry.getValue()); } return p; }
java
protected synchronized void stealExistingAllocations(){ for (ConnectionHandle handle: this.threadFinalizableRefs.keySet()){ // if they're not in use, pretend they are in use now and close them off. // this method assumes that the strategy has been flipped back to non-caching mode // prior to this met...
java
protected void threadWatch(final ConnectionHandle c) { this.threadFinalizableRefs.put(c, new FinalizableWeakReference<Thread>(Thread.currentThread(), this.finalizableRefQueue) { public void finalizeReferent() { try { if (!CachedConnectionStrategy.this.pool.poolShuttingDown){ logger.debug("Mo...
java
public synchronized void shutdown(){ if (!this.poolShuttingDown){ logger.info("Shutting down connection pool..."); this.poolShuttingDown = true; this.shutdownStackTrace = captureStackTrace(SHUTDOWN_LOCATION_TRACE); this.keepAliveScheduler.shutdownNow(); // stop threads from firing. this.maxAliv...
java
protected void unregisterDriver(){ String jdbcURL = this.config.getJdbcUrl(); if ((jdbcURL != null) && this.config.isDeregisterDriverOnClose()){ logger.info("Unregistering JDBC driver for : "+jdbcURL); try { DriverManager.deregisterDriver(DriverManager.getDriver(jdbcURL)); } catch (SQLException e...
java
protected void destroyConnection(ConnectionHandle conn) { postDestroyConnection(conn); conn.setInReplayMode(true); // we're dead, stop attempting to replay anything try { conn.internalClose(); } catch (SQLException e) { logger.error("Error in attempting to close connection", e); } }
java
protected void postDestroyConnection(ConnectionHandle handle){ ConnectionPartition partition = handle.getOriginatingPartition(); if (this.finalizableRefQueue != null && handle.getInternalConnection() != null){ //safety this.finalizableRefs.remove(handle.getInternalConnection()); // assert o != null : ...
java
protected Connection obtainInternalConnection(ConnectionHandle connectionHandle) throws SQLException { boolean tryAgain = false; Connection result = null; Connection oldRawConnection = connectionHandle.getInternalConnection(); String url = this.getConfig().getJdbcUrl(); int acquireRetryAttempts = thi...
java
protected void registerUnregisterJMX(boolean doRegister) { if (this.mbs == null ){ // this way makes it easier for mocking. this.mbs = ManagementFactory.getPlatformMBeanServer(); } try { String suffix = ""; if (this.config.getPoolName()!=null){ suffix="-"+this.config.getPoolName(); } ...
java
protected void watchConnection(ConnectionHandle connectionHandle) { String message = captureStackTrace(UNCLOSED_EXCEPTION_MESSAGE); this.closeConnectionExecutor.submit(new CloseThreadMonitor(Thread.currentThread(), connectionHandle, message, this.closeConnectionWatchTimeoutInMs)); }
java
public ListenableFuture<Connection> getAsyncConnection(){ return this.asyncExecutor.submit(new Callable<Connection>() { public Connection call() throws Exception { return getConnection(); }}); }
java
protected void maybeSignalForMoreConnections(ConnectionPartition connectionPartition) { if (!connectionPartition.isUnableToCreateMoreTransactions() && !this.poolShuttingDown && connectionPartition.getAvailableConnections()*100/connectionPartition.getMaxConnections() <= this.poolAvailabilityThreshold){ ...
java
protected void internalReleaseConnection(ConnectionHandle connectionHandle) throws SQLException { if (!this.cachedPoolStrategy){ connectionHandle.clearStatementCaches(false); } if (connectionHandle.getReplayLog() != null){ connectionHandle.getReplayLog().clear(); connectionHandle.recoveryResult.g...
java
protected void putConnectionBackInPartition(ConnectionHandle connectionHandle) throws SQLException { if (this.cachedPoolStrategy && ((CachedConnectionStrategy)this.connectionStrategy).tlConnections.dumbGet().getValue()){ connectionHandle.logicallyClosed.set(true); ((CachedConnectionStrategy)this.connection...
java
public boolean isConnectionHandleAlive(ConnectionHandle connection) { Statement stmt = null; boolean result = false; boolean logicallyClosed = connection.logicallyClosed.get(); try { connection.logicallyClosed.compareAndSet(true, false); // avoid checks later on if it's marked as closed. String test...
java
public int getTotalLeased(){ int total=0; for (int i=0; i < this.partitionCount && this.partitions[i] != null; i++){ total+=this.partitions[i].getCreatedConnections()-this.partitions[i].getAvailableConnections(); } return total; }
java
public int getTotalCreatedConnections(){ int total=0; for (int i=0; i < this.partitionCount && this.partitions[i] != null; i++){ total+=this.partitions[i].getCreatedConnections(); } return total; }
java
protected void addFreeConnection(ConnectionHandle connectionHandle) throws SQLException{ connectionHandle.setOriginatingPartition(this); // assume success to avoid racing where we insert an item in a queue and having that item immediately // taken and closed off thus decrementing the created connection count. ...
java
public void terminateAllConnections(){ this.terminationLock.lock(); try{ // close off all connections. for (int i=0; i < this.pool.partitionCount; i++) { this.pool.partitions[i].setUnableToCreateMoreTransactions(false); // we can create new ones now, this is an optimization List<ConnectionHandle...
java
protected void queryTimerEnd(String sql, long queryStartTime) { if ((this.queryExecuteTimeLimit != 0) && (this.connectionHook != null)){ long timeElapsed = (System.nanoTime() - queryStartTime); if (timeElapsed > this.queryExecuteTimeLimit){ this.connectionHook.onQueryExecuteTimeLimitExceeded(...
java
public static MBeanServerConnection getMBeanServerConnection(Process p, boolean startAgent) { try { final JMXServiceURL serviceURL = getLocalConnectorAddress(p, startAgent); final JMXConnector connector = JMXConnectorFactory.connect(serviceURL); final MBeanServerConnection mb...
java
public static JMXServiceURL getLocalConnectorAddress(Process p, boolean startAgent) { return getLocalConnectorAddress(Integer.toString(getPid(p)), startAgent); }
java
public final Jar setAttribute(String name, String value) { verifyNotSealed(); if (jos != null) throw new IllegalStateException("Manifest cannot be modified after entries are added."); getManifest().getMainAttributes().putValue(name, value); return this; }
java
public final Jar setAttribute(String section, String name, String value) { verifyNotSealed(); if (jos != null) throw new IllegalStateException("Manifest cannot be modified after entries are added."); Attributes attr = getManifest().getAttributes(section); if (attr == null) { ...
java
public Jar setListAttribute(String name, Collection<?> values) { return setAttribute(name, join(values)); }
java
public Jar setMapAttribute(String name, Map<String, ?> values) { return setAttribute(name, join(values)); }
java
public String getAttribute(String section, String name) { Attributes attr = getManifest().getAttributes(section); return attr != null ? attr.getValue(name) : null; }
java
public List<String> getListAttribute(String section, String name) { return split(getAttribute(section, name)); }
java
public Map<String, String> getMapAttribute(String name, String defaultValue) { return mapSplit(getAttribute(name), defaultValue); }
java
public Jar addClass(Class<?> clazz) throws IOException { final String resource = clazz.getName().replace('.', '/') + ".class"; return addEntry(resource, clazz.getClassLoader().getResourceAsStream(resource)); }
java
public Jar addPackageOf(Class<?> clazz, Filter filter) throws IOException { try { final String path = clazz.getPackage().getName().replace('.', '/'); URL dirURL = clazz.getClassLoader().getResource(path); if (dirURL != null && dirURL.getProtocol().equals("file")) ...
java
public Jar setJarPrefix(String value) { verifyNotSealed(); if (jos != null) throw new IllegalStateException("Really executable cannot be set after entries are added."); if (value != null && jarPrefixFile != null) throw new IllegalStateException("A prefix has already been ...
java
public Jar setJarPrefix(Path file) { verifyNotSealed(); if (jos != null) throw new IllegalStateException("Really executable cannot be set after entries are added."); if (file != null && jarPrefixStr != null) throw new IllegalStateException("A prefix has already been set (...
java
public <T extends OutputStream> T write(T os) throws IOException { close(); if (!(this.os instanceof ByteArrayOutputStream)) throw new IllegalStateException("Cannot write to another target if setOutputStream has been called"); final byte[] content = ((ByteArrayOutputStream) this.os)...
java
public Capsule newCapsule(String mode, Path wrappedJar) { final String oldMode = properties.getProperty(PROP_MODE); final ClassLoader oldCl = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(capsuleClass.getClassLoader()); try { set...
java
@SuppressWarnings("unchecked") public static Map<String, List<Path>> findJavaHomes() { try { return (Map<String, List<Path>>) accessible(Class.forName(CAPSULE_CLASS_NAME).getDeclaredMethod("getJavaHomes")).invoke(null); } catch (ReflectiveOperationException e) { throw new Ass...
java
public static List<String> enableJMX(List<String> jvmArgs) { final String arg = "-D" + OPT_JMX_REMOTE; if (jvmArgs.contains(arg)) return jvmArgs; final List<String> cmdLine2 = new ArrayList<>(jvmArgs); cmdLine2.add(arg); return cmdLine2; }
java
public final void setVolumeByIncrement(float level) throws IOException { Volume volume = this.getStatus().volume; float total = volume.level; if (volume.increment <= 0f) { throw new ChromeCastException("Volume.increment is <= 0"); } // With floating points we always...
java
private void connect() throws IOException, GeneralSecurityException { synchronized (closedSync) { if (socket == null || socket.isClosed()) { SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, new TrustManager[] { new X509TrustAllManager() }, new SecureRandom...
java
public static ExecutorService newSingleThreadDaemonExecutor() { return Executors.newSingleThreadExecutor(r -> { Thread t = Executors.defaultThreadFactory().newThread(r); t.setDaemon(true); return t; }); }
java
public static ScheduledExecutorService newScheduledDaemonThreadPool(int corePoolSize) { return Executors.newScheduledThreadPool(corePoolSize, r -> { Thread t = Executors.defaultThreadFactory().newThread(r); t.setDaemon(true); return t; }); }
java
private static MenuDrawer createMenuDrawer(Activity activity, int dragMode, Position position, Type type) { MenuDrawer drawer; if (type == Type.STATIC) { drawer = new StaticDrawer(activity); } else if (type == Type.OVERLAY) { drawer = new OverlayDrawer(activity, dragMod...
java
private static void attachToContent(Activity activity, MenuDrawer menuDrawer) { /** * Do not call mActivity#setContentView. * E.g. if using with a ListActivity, Activity#setContentView is overridden and dispatched to * MenuDrawer#setContentView, which then again would call Activity#se...
java
private static void attachToDecor(Activity activity, MenuDrawer menuDrawer) { ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView(); ViewGroup decorChild = (ViewGroup) decorView.getChildAt(0); decorView.removeAllViews(); decorView.addView(menuDrawer, LayoutParams.MATCH_P...
java
public void setActiveView(View v, int position) { final View oldView = mActiveView; mActiveView = v; mActivePosition = position; if (mAllowIndicatorAnimation && oldView != null) { startAnimatingIndicator(); } invalidate(); }
java
private int getIndicatorStartPos() { switch (getPosition()) { case TOP: return mIndicatorClipRect.left; case RIGHT: return mIndicatorClipRect.top; case BOTTOM: return mIndicatorClipRect.left; default: ...
java
private void animateIndicatorInvalidate() { if (mIndicatorScroller.computeScrollOffset()) { mIndicatorOffset = mIndicatorScroller.getCurr(); invalidate(); if (!mIndicatorScroller.isFinished()) { postOnAnimation(mIndicatorRunnable); return; ...
java
public void setDropShadowColor(int color) { GradientDrawable.Orientation orientation = getDropShadowOrientation(); final int endColor = color & 0x00FFFFFF; mDropShadowDrawable = new GradientDrawable(orientation, new int[] { color, ...
java
public void setSlideDrawable(Drawable drawable) { mSlideDrawable = new SlideDrawable(drawable); mSlideDrawable.setIsRtl(ViewHelper.getLayoutDirection(this) == LAYOUT_DIRECTION_RTL); if (mActionBarHelper != null) { mActionBarHelper.setDisplayShowHomeAsUpEnabled(true); if...
java
public ViewGroup getContentContainer() { if (mDragMode == MENU_DRAG_CONTENT) { return mContentContainer; } else { return (ViewGroup) findViewById(android.R.id.content); } }
java
public void setMenuView(int layoutResId) { mMenuContainer.removeAllViews(); mMenuView = LayoutInflater.from(getContext()).inflate(layoutResId, mMenuContainer, false); mMenuContainer.addView(mMenuView); }
java
@Override public void onClick(View v) { String tag = (String) v.getTag(); mContentTextView.setText(String.format("%s clicked.", tag)); mMenuDrawer.setActiveView(v); }
java
protected void animateOffsetTo(int position, int velocity, boolean animate) { endDrag(); endPeek(); final int startX = (int) mOffsetPixels; final int dx = position - startX; if (dx == 0 || !animate) { setOffsetPixels(position); setDrawerState(position == ...
java
public ParsedWord pollParsedWord() { if(hasNextWord()) { //set correct next char if(parsedLine.words().size() > (word+1)) character = parsedLine.words().get(word+1).lineIndex(); else character = -1; return parsedLine.words().get(wor...
java
public char pollChar() { if(hasNextChar()) { if(hasNextWord() && character+1 >= parsedLine.words().get(word).lineIndex()+ parsedLine.words().get(word).word().length()) word++; return parsedLine.line().charAt(character++); ...
java
public void updateIteratorPosition(int length) { if(length > 0) { //make sure we dont go OB if((length + character) > parsedLine.line().length()) length = parsedLine.line().length() - character; //move word counter to the correct word while(hasNex...
java
@Override public String printHelp() { List<CommandLineParser<CI>> parsers = getChildParsers(); if (parsers != null && parsers.size() > 0) { StringBuilder sb = new StringBuilder(); sb.append(processedCommand.printHelp(helpNames())) .append(Config.getLineSep...
java
@Override public void parse(String line, Mode mode) { parse(lineParser.parseLine(line, line.length()).iterator(), mode); }
java
@Override public void populateObject(ProcessedCommand<Command<CI>, CI> processedCommand, InvocationProviders invocationProviders, AeshContext aeshContext, CommandLineParser.Mode mode) throws CommandLineParserException, OptionValidatorException { if(processedCommand...
java
public List<TerminalString> getOptionLongNamesWithDash() { List<ProcessedOption> opts = getOptions(); List<TerminalString> names = new ArrayList<>(opts.size()); for (ProcessedOption o : opts) { if(o.getValues().size() == 0 && o.activator().isActivated(new ParsedCo...
java
public String printHelp(String commandName) { int maxLength = 0; int width = 80; List<ProcessedOption> opts = getOptions(); for (ProcessedOption o : opts) { if(o.getFormattedLength() > maxLength) maxLength = o.getFormattedLength(); } StringBui...
java
public boolean hasUniqueLongOption(String optionName) { if(hasLongOption(optionName)) { for(ProcessedOption o : getOptions()) { if(o.name().startsWith(optionName) && !o.name().equals(optionName)) return false; } return true; } ...
java
public void seek(final int position) throws IOException { if (position < 0) { throw new IllegalArgumentException("position < 0: " + position); } if (position > size) { throw new EOFException(); } this.pointer = position; }
java
@Override public EditMode editMode() { if(readInputrc) { try { return EditModeBuilder.builder().parseInputrc(new FileInputStream(inputrc())).create(); } catch(FileNotFoundException e) { return EditModeBuilder.builder(mode()).create(); ...
java
@Override public String logFile() { if(logFile == null) { logFile = Config.getTmpDir()+Config.getPathSeparator()+"aesh.log"; } return logFile; }
java
public void detect(final String... packageNames) throws IOException { final String[] pkgNameFilter = new String[packageNames.length]; for (int i = 0; i < pkgNameFilter.length; ++i) { pkgNameFilter[i] = packageNames[i].replace('.', '/'); if (!pkgNameFilter[i].endsWith("/")) { ...
java
private void addReverse(final File[] files) { for (int i = files.length - 1; i >= 0; --i) { stack.add(files[i]); } }
java
public <C extends Contextual<I>, I> C getContextual(String id) { return this.<C, I>getContextual(new StringBeanIdentifier(id)); }
java
private void processDestructionQueue(HttpServletRequest request) { Object contextsAttribute = request.getAttribute(DESTRUCTION_QUEUE_ATTRIBUTE_NAME); if (contextsAttribute instanceof Map) { Map<String, List<ContextualInstance<?>>> contexts = cast(contextsAttribute); synchronized ...
java
public static void unregisterContextualInstance(EjbDescriptor<?> descriptor) { Set<Class<?>> classes = CONTEXTUAL_SESSION_BEANS.get(); classes.remove(descriptor.getBeanClass()); if (classes.isEmpty()) { CONTEXTUAL_SESSION_BEANS.remove(); } }
java
protected Object[] getParameterValues(Object specialVal, BeanManagerImpl manager, CreationalContext<?> ctx, CreationalContext<?> transientReferenceContext) { if (getInjectionPoints().isEmpty()) { if (specialInjectionPointIndex == -1) { return Arrays2.EMPTY_ARRAY; } else {...
java
public Set<? extends AbstractBean<?, ?>> resolveSpecializedBeans(Bean<?> specializingBean) { if (specializingBean instanceof AbstractClassBean<?>) { AbstractClassBean<?> abstractClassBean = (AbstractClassBean<?>) specializingBean; if (abstractClassBean.isSpecializing()) { ...
java
private void addHandlerInitializerMethod(ClassFile proxyClassType, ClassMethod staticConstructor) throws Exception { ClassMethod classMethod = proxyClassType.addMethod(AccessFlag.PRIVATE, INIT_MH_METHOD_NAME, BytecodeUtils.VOID_CLASS_DESCRIPTOR, LJAVA_LANG_OBJECT); final CodeAttribute b = classMethod.ge...
java
private static boolean isEqual(Method m, Method a) { if (m.getName().equals(a.getName()) && m.getParameterTypes().length == a.getParameterTypes().length && m.getReturnType().isAssignableFrom(a.getReturnType())) { for (int i = 0; i < m.getParameterTypes().length; i++) { if (!(m.getPar...
java
protected CDI11Deployment createDeployment(ServletContext context, CDI11Bootstrap bootstrap) { ImmutableSet.Builder<Metadata<Extension>> extensionsBuilder = ImmutableSet.builder(); extensionsBuilder.addAll(bootstrap.loadExtensions(WeldResourceLoader.getClassLoader())); if (isDevModeEnabled) { ...
java
protected Container findContainer(ContainerContext ctx, StringBuilder dump) { Container container = null; // 1. Custom container class String containerClassName = ctx.getServletContext().getInitParameter(Container.CONTEXT_PARAM_CONTAINER_CLASS); if (containerClassName != null) { ...
java
private Resolvable createMetadataProvider(Class<?> rawType) { Set<Type> types = Collections.<Type>singleton(rawType); return new ResolvableImpl(rawType, types, declaringBean, qualifierInstances, delegate); }
java
private boolean hasAbstractPackagePrivateSuperClassWithImplementation(Class<?> clazz, BridgeMethod bridgeMethod) { Class<?> superClass = clazz.getSuperclass(); while (superClass != null) { if (Modifier.isAbstract(superClass.getModifiers()) && Reflections.isPackagePrivate(superClass.getModifi...
java
protected void addSpecialMethods(ClassFile proxyClassType, ClassMethod staticConstructor) { try { // Add special methods for interceptors for (Method method : LifecycleMixin.class.getMethods()) { BeanLogger.LOG.addingMethodToProxy(method); MethodInformatio...
java
public static void checkDelegateType(Decorator<?> decorator) { Set<Type> types = new HierarchyDiscovery(decorator.getDelegateType()).getTypeClosure(); for (Type decoratedType : decorator.getDecoratedTypes()) { if(!types.contains(decoratedType)) { throw BeanLogger.LOG.delega...
java
public static <T> void checkAbstractMethods(Set<Type> decoratedTypes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { if (decoratedTypes == null) { decoratedTypes = new HashSet<Type>(type.getInterfaceClosure()); decoratedTypes.remove(Serializable.class); } ...
java
public void checkSpecialization() { if (isSpecializing()) { boolean isNameDefined = getAnnotated().isAnnotationPresent(Named.class); String previousSpecializedBeanName = null; for (AbstractBean<?, ?> specializedBean : getSpecializedBeans()) { String name = spe...
java
public void fireEvent(Type eventType, Object event, Annotation... qualifiers) { final EventMetadata metadata = new EventMetadataImpl(eventType, null, qualifiers); notifier.fireEvent(eventType, event, metadata, qualifiers); }
java
@SuppressWarnings("unchecked") public static <T> T getJlsDefaultValue(Class<T> type) { if(!type.isPrimitive()) { return null; } return (T) JLS_PRIMITIVE_DEFAULT_VALUES.get(type); }
java
public void afterDeploymentValidation(@Observes @Priority(1) AfterDeploymentValidation event, BeanManager beanManager) { BeanManagerImpl manager = BeanManagerProxy.unwrap(beanManager); probe.init(manager); if (isJMXSupportEnabled(manager)) { try { MBeanServer mbs = Ma...
java
static boolean matchPath(String[] tokenizedPattern, String[] strDirs, boolean isCaseSensitive) { int patIdxStart = 0; int patIdxEnd = tokenizedPattern.length - 1; int strIdxStart = 0; int strIdxEnd = strDirs.length - 1; // up to first '**' while (patIdxStart <= patIdxEnd...
java
static String[] tokenize(String str) { char sep = '.'; int start = 0; int len = str.length(); int count = 0; for (int pos = 0; pos < len; pos++) { if (str.charAt(pos) == sep) { if (pos != start) { count++; } ...
java