id
stringlengths
7
14
text
stringlengths
1
106k
206322_23
protected Archiver createTarArchiver( final String format, final TarLongFileMode tarLongFileMode ) throws NoSuchArchiverException { final TarArchiver tarArchiver = (TarArchiver) archiverManager.getArchiver( "tar" ); final int index = format.indexOf( '.' ); if ( index >= 0 ) { TarArchiver.Tar...
206322_24
protected Archiver createTarArchiver( final String format, final TarLongFileMode tarLongFileMode ) throws NoSuchArchiverException { final TarArchiver tarArchiver = (TarArchiver) archiverManager.getArchiver( "tar" ); final int index = format.indexOf( '.' ); if ( index >= 0 ) { TarArchiver.Tar...
206322_25
@Nullable public static InputStreamTransformer getFileSetTransformers( final AssemblerConfigurationSource configSource, final boolean isFiltered, String fileSetLineEnding ) throws AssemblyFormattingException { final LineEndings lineEndingToUse = LineE...
206322_26
@Nullable public static InputStreamTransformer getFileSetTransformers( final AssemblerConfigurationSource configSource, final boolean isFiltered, String fileSetLineEnding ) throws AssemblyFormattingException { final LineEndings lineEndingToUse = LineE...
206322_27
@Nullable public static InputStreamTransformer getFileSetTransformers( final AssemblerConfigurationSource configSource, final boolean isFiltered, String fileSetLineEnding ) throws AssemblyFormattingException { final LineEndings lineEndingToUse = LineE...
206322_28
@Nullable public static String getLineEndingCharacters( @Nullable String lineEnding ) throws AssemblyFormattingException { String value = lineEnding; if ( lineEnding != null ) { try { value = LineEndings.valueOf( lineEnding ).getLineEndingCharacters(); } catch...
206322_29
@Nullable public static String getLineEndingCharacters( @Nullable String lineEnding ) throws AssemblyFormattingException { String value = lineEnding; if ( lineEnding != null ) { try { value = LineEndings.valueOf( lineEnding ).getLineEndingCharacters(); } catch...
206322_30
@Nullable public static String getLineEndingCharacters( @Nullable String lineEnding ) throws AssemblyFormattingException { String value = lineEnding; if ( lineEnding != null ) { try { value = LineEndings.valueOf( lineEnding ).getLineEndingCharacters(); } catch...
206322_31
@Nullable public static String getLineEndingCharacters( @Nullable String lineEnding ) throws AssemblyFormattingException { String value = lineEnding; if ( lineEnding != null ) { try { value = LineEndings.valueOf( lineEnding ).getLineEndingCharacters(); } catch...
206322_32
@Nullable public static String getLineEndingCharacters( @Nullable String lineEnding ) throws AssemblyFormattingException { String value = lineEnding; if ( lineEnding != null ) { try { value = LineEndings.valueOf( lineEnding ).getLineEndingCharacters(); } catch...
206322_33
@Nullable public static String getLineEndingCharacters( @Nullable String lineEnding ) throws AssemblyFormattingException { String value = lineEnding; if ( lineEnding != null ) { try { value = LineEndings.valueOf( lineEnding ).getLineEndingCharacters(); } catch...
206322_34
@Nullable public static String getLineEndingCharacters( @Nullable String lineEnding ) throws AssemblyFormattingException { String value = lineEnding; if ( lineEnding != null ) { try { value = LineEndings.valueOf( lineEnding ).getLineEndingCharacters(); } catch...
206322_35
@Nullable public static String getLineEndingCharacters( @Nullable String lineEnding ) throws AssemblyFormattingException { String value = lineEnding; if ( lineEnding != null ) { try { value = LineEndings.valueOf( lineEnding ).getLineEndingCharacters(); } catch...
206322_36
public void write( PlexusConfiguration configuration, File file, String customTaskPrefix, String antTargetName ) throws IOException { MXSerializer serializer = new MXSerializer(); serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator", Syste...
206322_37
public void write( PlexusConfiguration configuration, File file, String customTaskPrefix, String antTargetName ) throws IOException { MXSerializer serializer = new MXSerializer(); serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator", Syste...
206322_38
public void write( PlexusConfiguration configuration, File file, String customTaskPrefix, String antTargetName ) throws IOException { MXSerializer serializer = new MXSerializer(); serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator", Syste...
206322_39
public void write( PlexusConfiguration configuration, File file, String customTaskPrefix, String antTargetName ) throws IOException { MXSerializer serializer = new MXSerializer(); serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator", Syste...
206322_40
public int getSelection( InvokerProperties invokerProperties ) { if ( !invokerProperties.isSelectorDefined( 1 ) ) { return getGlobal( invokerProperties ); } for ( int selectorIndex = 1;; selectorIndex++ ) { if ( selectorIndex > 1 && !invokerProperties.isSelectorDefined( selecto...
206322_41
public int getSelection( InvokerProperties invokerProperties ) { if ( !invokerProperties.isSelectorDefined( 1 ) ) { return getGlobal( invokerProperties ); } for ( int selectorIndex = 1;; selectorIndex++ ) { if ( selectorIndex > 1 && !invokerProperties.isSelectorDefined( selecto...
206322_42
public int getSelection( InvokerProperties invokerProperties ) { if ( !invokerProperties.isSelectorDefined( 1 ) ) { return getGlobal( invokerProperties ); } for ( int selectorIndex = 1;; selectorIndex++ ) { if ( selectorIndex > 1 && !invokerProperties.isSelectorDefined( selecto...
206322_43
public boolean createFile() throws Exception { if ( Boolean.getBoolean( "create_touch_file" ) ) { File touch = new File( System.getProperty( "touch_file_path" ), "touch.txt" ); return touch.createNewFile(); } return false; }
206322_44
static JavadocVersion parse( String s ) { return new JavadocVersion( s ); }
206322_45
protected String generateClassPathEntry( String classPathPrefix ) { final StringBuilder classpath = new StringBuilder(); for ( final EarModule earModule : earModules ) { if ( !earModule.isExcluded() ) { classpath.append( classPathPrefix ).append( earModule.getUri() ).append( " " ...
206322_46
protected String generateClassPathEntry( String classPathPrefix ) { final StringBuilder classpath = new StringBuilder(); for ( final EarModule earModule : earModules ) { if ( !earModule.isExcluded() ) { classpath.append( classPathPrefix ).append( earModule.getUri() ).append( " " ...
206322_47
protected String generateClassPathEntry( String classPathPrefix ) { final StringBuilder classpath = new StringBuilder(); for ( final EarModule earModule : earModules ) { if ( !earModule.isExcluded() ) { classpath.append( classPathPrefix ).append( earModule.getUri() ).append( " " ...
206322_48
public Artifact getUniqueArtifact( String groupId, String artifactId, String type, String classifier ) { final Set<Artifact> candidates = getArtifacts( groupId, artifactId, type ); if ( candidates.size() == 0 ) { return null; } else if ( candidates.size() == 1 && classifier == null ) { ...
206322_49
public Artifact getUniqueArtifact( String groupId, String artifactId, String type, String classifier ) { final Set<Artifact> candidates = getArtifacts( groupId, artifactId, type ); if ( candidates.size() == 0 ) { return null; } else if ( candidates.size() == 1 && classifier == null ) { ...
206322_50
public Artifact getUniqueArtifact( String groupId, String artifactId, String type, String classifier ) { final Set<Artifact> candidates = getArtifacts( groupId, artifactId, type ); if ( candidates.size() == 0 ) { return null; } else if ( candidates.size() == 1 && classifier == null ) { ...
206322_51
public Artifact getUniqueArtifact( String groupId, String artifactId, String type, String classifier ) { final Set<Artifact> candidates = getArtifacts( groupId, artifactId, type ); if ( candidates.size() == 0 ) { return null; } else if ( candidates.size() == 1 && classifier == null ) { ...
206322_52
public Artifact getUniqueArtifact( String groupId, String artifactId, String type, String classifier ) { final Set<Artifact> candidates = getArtifacts( groupId, artifactId, type ); if ( candidates.size() == 0 ) { return null; } else if ( candidates.size() == 1 && classifier == null ) { ...
206322_53
static String convertToRelativePath( File thing, File relativeTo ) { StringBuilder relativePath; if ( thing.getParentFile().equals( relativeTo.getParentFile() ) ) { return thing.getName(); // a very simple relative path. } List<String> thingDirectories = RelativizePath.parentDirs( thing...
206322_54
public void finished() { int classesTotal = classesRemoved + classesKept; if ( classesTotal != 0 ) { log.info( "Minimized " + classesTotal + " -> " + classesKept + " (" + 100 * classesKept / classesTotal + "%)" ); } else { log.info( "Minimized " + classesTotal + " -> ...
206322_55
public void finished() { int classesTotal = classesRemoved + classesKept; if ( classesTotal != 0 ) { log.info( "Minimized " + classesTotal + " -> " + classesKept + " (" + 100 * classesKept / classesTotal + "%)" ); } else { log.info( "Minimized " + classesTotal + " -> ...
206322_56
public void finished() { int classesTotal = classesRemoved + classesKept; if ( classesTotal != 0 ) { log.info( "Minimized " + classesTotal + " -> " + classesKept + " (" + 100 * classesKept / classesTotal + "%)" ); } else { log.info( "Minimized " + classesTotal + " -> ...
206322_57
public void finished() { int classesTotal = classesRemoved + classesKept; if ( classesTotal != 0 ) { log.info( "Minimized " + classesTotal + " -> " + classesKept + " (" + 100 * classesKept / classesTotal + "%)" ); } else { log.info( "Minimized " + classesTotal + " -> ...
206322_58
public boolean canTransformResource( String r ) { if ( resourceBundlePattern != null && resourceBundlePattern.matcher( r ).matches() ) { return true; } return false; }
206350_10
@Override public void init(FilterConfig config) throws ServletException { checkAlreadyConfigured(config.getServletContext()); this.servletContext = config.getServletContext(); WebConfiguration configAdapter = new WebConfiguration(config); String configurationLocation = configAdapter.getConfigurationLoca...
206350_11
@Override public void init(FilterConfig config) throws ServletException { checkAlreadyConfigured(config.getServletContext()); this.servletContext = config.getServletContext(); WebConfiguration configAdapter = new WebConfiguration(config); String configurationLocation = configAdapter.getConfigurationLoca...
206350_12
@Override public void init(FilterConfig config) throws ServletException { checkAlreadyConfigured(config.getServletContext()); this.servletContext = config.getServletContext(); WebConfiguration configAdapter = new WebConfiguration(config); String configurationLocation = configAdapter.getConfigurationLoca...
206350_13
@Override public void init(FilterConfig config) throws ServletException { checkAlreadyConfigured(config.getServletContext()); this.servletContext = config.getServletContext(); WebConfiguration configAdapter = new WebConfiguration(config); String configurationLocation = configAdapter.getConfigurationLoca...
206350_14
@Override public void init(FilterConfig config) throws ServletException { checkAlreadyConfigured(config.getServletContext()); this.servletContext = config.getServletContext(); WebConfiguration configAdapter = new WebConfiguration(config); String configurationLocation = configAdapter.getConfigurationLoca...
206350_15
@Override public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { CayenneRuntime runtime = WebUtil.getCayenneRuntime(servletContext); RequestHandler handler = runtime.getInjector().getInstance(RequestHandler.class)...
206350_16
public static CayenneRuntime getCayenneRuntime(ServletContext context) { return (CayenneRuntime) context.getAttribute(CAYENNE_RUNTIME_KEY); }
206350_17
DbImportConfiguration createConfig(final Logger logger) { DbImportConfiguration config = new DbImportConfiguration(); if (dbImportConfig.getCatalogs().size() == 0 && dbImportConfig.isEmptyContainer()) { config.setUseDataMapReverseEngineering(true); } config.setAdapter(adapter); config.setDef...
206350_18
public ReverseEngineering getReverseEngineering() { return dbImportConfig; }
206350_19
public ReverseEngineering getReverseEngineering() { return reverseEngineering; }
206350_20
public ReverseEngineering getReverseEngineering() { return reverseEngineering; }
206350_21
public ReverseEngineering getReverseEngineering() { return reverseEngineering; }
206350_22
public ReverseEngineering getReverseEngineering() { return reverseEngineering; }
206350_23
public ReverseEngineering getReverseEngineering() { return reverseEngineering; }
206350_24
public ReverseEngineering getReverseEngineering() { return reverseEngineering; }
206350_25
public File getCayenneProject() { return config.getCayenneProject(); }
206350_26
public ClientRuntime build() { Collection<Module> allModules = new ArrayList<>(); // first load default or auto-loaded modules... allModules.addAll(autoLoadModules ? autoLoadedModules() : defaultModules()); // custom modules override default and auto-loaded ... allModules.addAll(modules); // bui...
206350_27
public ClientRuntimeBuilder properties(Map<String, String> properties) { this.properties = properties; return this; }
206350_28
@SuppressWarnings("deprecation") public void configure(Binder binder) { // Contribute always to create binding ServerModule.contributeProperties(binder); binder.bind(ObjectContextFactory.class).to(CayenneContextFactory.class); binder.bind(ROPSerializationService.class).toProvider(ClientHessianSerializat...
206350_29
@SuppressWarnings("deprecation") public void configure(Binder binder) { // Contribute always to create binding ServerModule.contributeProperties(binder); binder.bind(ObjectContextFactory.class).to(CayenneContextFactory.class); binder.bind(ROPSerializationService.class).toProvider(ClientHessianSerializat...
206350_30
public static ClientRuntimeBuilder builder() { return new ClientRuntimeBuilder(); }
206350_31
public static ClientRuntimeBuilder builder() { return new ClientRuntimeBuilder(); }
206350_32
public static ClientRuntimeBuilder builder() { return new ClientRuntimeBuilder(); }
206350_33
@SuppressWarnings("unchecked") public QueryResponse onQuery(ObjectContext context, Query query) { QueryResponse response = send( new QueryMessage(query), QueryResponse.class); // if needed, register objects in provided context, rewriting the response // (assuming all lists are mutable) if (context != nu...
206350_34
@SuppressWarnings("unchecked") public QueryResponse onQuery(ObjectContext context, Query query) { QueryResponse response = send( new QueryMessage(query), QueryResponse.class); // if needed, register objects in provided context, rewriting the response // (assuming all lists are mutable) if (context != nu...
206350_35
@SuppressWarnings("unchecked") public QueryResponse onQuery(ObjectContext context, Query query) { QueryResponse response = send( new QueryMessage(query), QueryResponse.class); // if needed, register objects in provided context, rewriting the response // (assuming all lists are mutable) if (context != nu...
206350_36
public EventBridge createEventBridge( Collection<EventSubject> localSubjects, String externalSubject, Map<String, String> properties) { return new JavaGroupsBridge(localSubjects, externalSubject, properties); }
206350_37
public EventBridge createEventBridge( Collection<EventSubject> localSubjects, String externalSubject, Map<String, String> properties) { return new JavaGroupsBridge(localSubjects, externalSubject, properties); }
206350_38
public EventBridge createEventBridge( Collection<EventSubject> localSubjects, String externalSubject, Map<String, String> properties) { return new JavaGroupsBridge(localSubjects, externalSubject, properties); }
206350_39
public void apply(Project project) { // Add DSL extension project.getExtensions().create("cayenne", GradleCayenneExtension.class, project); // Register tasks Map<String, Object> map = new HashMap<>(1); map.put("type", CgenTask.class); project.task(map, "cgen"); Map<String, Object> map1 = new...
206350_40
ExcludeTable toExcludeTable() { ExcludeTable table = new ExcludeTable(); table.setPattern(pattern); return table; }
206350_41
IncludeColumn toIncludeColumn() { IncludeColumn column = new IncludeColumn(); column.setPattern(pattern); return column; }
206350_42
ExcludeColumn toExcludeColumn() { ExcludeColumn column = new ExcludeColumn(); column.setPattern(pattern); return column; }
206350_43
IncludeProcedure toIncludeProcedure() { IncludeProcedure procedure = new IncludeProcedure(); procedure.setPattern(pattern); return procedure; }
206350_44
ExcludeProcedure toExcludeProcedure() { ExcludeProcedure procedure = new ExcludeProcedure(); procedure.setPattern(pattern); return procedure; }
206350_45
public ReverseEngineering toReverseEngineering() { final ReverseEngineering reverseEngineering = new ReverseEngineering(); reverseEngineering.setSkipRelationshipsLoading(skipRelationshipsLoading); reverseEngineering.setSkipPrimaryKeyLoading(skipPrimaryKeyLoading); reverseEngineering.setForceDataMapCatal...
206350_46
public void includeColumn(String pattern) { includeColumns.add(new PatternParam(pattern)); }
206350_47
public void includeColumns(String... patterns) { for(String pattern: patterns) { includeColumn(pattern); } }
206350_48
public void excludeColumn(String pattern) { excludeColumns.add(new PatternParam(pattern)); }
206350_49
public void excludeColumns(String... patterns) { for(String pattern: patterns) { excludeColumn(pattern); } }
206350_50
public void excludeRelationship(String pattern){ excludeRelationships.add(new PatternParam(pattern)); }
206350_51
org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable toIncludeTable() { org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable table = new org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable(); table.setPattern(getPattern()); for(PatternParam includeColumn : includeColumns) { tab...
206350_52
<C extends org.apache.cayenne.dbsync.reverse.dbimport.FilterContainer> C fillContainer(final C container) { container.setName(name); for(IncludeTable table : includeTables) { container.addIncludeTable(table.toIncludeTable()); } for(PatternParam table : excludeTables) { container.addExclu...
206350_53
@TaskAction public void runImport() { dataSource.validate(); final Injector injector = DIBootstrap.createInjector(new DbSyncModule(), new ToolsModule(getLogger()), new DbImportModule(), binder -> binder.bind(ClassLoaderManager.class).toInstance(new GradlePluginClassLoaderManager(getProject()))); ...
206350_54
public EventBridge createEventBridge(Collection<EventSubject> localSubjects, String externalSubject, Map<String, String> properties) { return new JMSBridge(localSubjects, externalSubject, properties); }
206350_55
public EventBridge createEventBridge(Collection<EventSubject> localSubjects, String externalSubject, Map<String, String> properties) { return new JMSBridge(localSubjects, externalSubject, properties); }
206350_56
public EventBridge createEventBridge(Collection<EventSubject> localSubjects, String externalSubject, Map<String, String> properties) { return new JMSBridge(localSubjects, externalSubject, properties); }
206350_57
@Override protected HttpSession getSession(boolean create) { HttpServletRequest request = (HttpServletRequest) ServiceContext .getContextRequest(); if (request == null) { throw new IllegalStateException( "Attempt to access HttpSession outside the request scope."); } r...
206350_58
public static SerializerFactory createFactory( String[] factoryNames, EntityResolver resolver) { return createFactory(factoryNames, resolver, Collections.emptyList()); }
206350_59
static AbstractSerializerFactory loadFactory( String factoryName, EntityResolver resolver) throws Exception { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class<?> factoryClass = Class.forName(factoryName, true, loader); if (!AbstractSerializerFactory.class.isAssignab...
206350_60
static AbstractSerializerFactory loadFactory( String factoryName, EntityResolver resolver) throws Exception { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class<?> factoryClass = Class.forName(factoryName, true, loader); if (!AbstractSerializerFactory.class.isAssignab...
206350_61
public String getEventBridgeFactoryName() { return eventBridgeFactoryName; }
206350_62
static Object dispatch(DataChannel channel, ClientMessage message) { // do most common messages first... if (message instanceof QueryMessage) { return channel.onQuery(null, ((QueryMessage) message).getQuery()); } else if (message instanceof SyncMessage) { SyncMessage sync = (SyncMessage) mes...
206350_63
static Object dispatch(DataChannel channel, ClientMessage message) { // do most common messages first... if (message instanceof QueryMessage) { return channel.onQuery(null, ((QueryMessage) message).getQuery()); } else if (message instanceof SyncMessage) { SyncMessage sync = (SyncMessage) mes...
206350_64
@Override public int hashCode() { return Objects.hash(sessionId); }
206350_65
@Override public synchronized Object unregisterNode(Object nodeId) { Object node = super.unregisterNode(nodeId); // remove node from other collections... if (node != null) { stateLog.unregisterNode(nodeId); changeLog.unregisterNode(nodeId); Persistent object = (Persistent)node; ...
206350_66
public static byte[] encodeBase64(byte[] binaryData) { return encodeBase64(binaryData, false); }
206350_67
public static byte[] decodeBase64(byte[] base64Data) { // RFC 2045 requires that we discard ALL non-Base64 characters base64Data = discardNonBase64(base64Data); // handle the edge case, so we don't have to worry about it later if (base64Data.length == 0) { return new byte[0]; } int numbe...
206350_68
public static byte[] decodeBase64(byte[] base64Data) { // RFC 2045 requires that we discard ALL non-Base64 characters base64Data = discardNonBase64(base64Data); // handle the edge case, so we don't have to worry about it later if (base64Data.length == 0) { return new byte[0]; } int numbe...
206350_69
public static byte[] decodeBase64(byte[] base64Data) { // RFC 2045 requires that we discard ALL non-Base64 characters base64Data = discardNonBase64(base64Data); // handle the edge case, so we don't have to worry about it later if (base64Data.length == 0) { return new byte[0]; } int numbe...
206350_70
public static byte[] decodeBase64(byte[] base64Data) { // RFC 2045 requires that we discard ALL non-Base64 characters base64Data = discardNonBase64(base64Data); // handle the edge case, so we don't have to worry about it later if (base64Data.length == 0) { return new byte[0]; } int numbe...
206350_71
public static byte[] encodeBase64(byte[] binaryData) { return encodeBase64(binaryData, false); }
206350_72
public static byte[] encodeBase64Chunked(byte[] binaryData) { return encodeBase64(binaryData, true); }
206350_73
public static byte[] encodeBase64(byte[] binaryData) { return encodeBase64(binaryData, false); }