id
int32 0
3k
| input
stringlengths 43
33.8k
| gt
stringclasses 1
value |
---|---|---|
500 | <s> package edsdk . utils . commands ; import java . awt . image . BufferedImage ; import edsdk . utils . CanonTask ; import edsdk . utils . CanonUtils ; public class LiveViewTask { public static class Begin extends CanonTask < Boolean > { @ Override public void run ( ) { setResult ( CanonUtils . beginLiveView ( camera . getEdsCamera ( ) ) ) ; } } public static class End extends CanonTask < Boolean > { @ Override public void run ( ) | |
501 | <s> package com . asakusafw . runtime . directio . hadoop ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . File ; import java . io . IOException ; import java . net . URI ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . Iterator ; import java . util . List ; import java . util . Map ; import org . apache . hadoop . conf . Configuration ; import org . apache . hadoop . fs . FileStatus ; import org . apache . hadoop . fs . FileSystem ; import org . apache . hadoop . fs . LocalFileSystem ; import org . apache . hadoop . fs . Path ; import org . hamcrest . BaseMatcher ; import org . hamcrest . Description ; import org . hamcrest . Matcher ; import org . junit . Rule ; import org . junit . Test ; import org . junit . rules . TemporaryFolder ; import com . asakusafw . runtime . directio . Counter ; import com . asakusafw . runtime . directio . DirectDataSource ; import com . asakusafw . runtime . directio . DirectDataSourceProfile ; import com . asakusafw . runtime . directio . DirectDataSourceRepository ; import com . asakusafw . runtime . directio . FilePattern ; public class HadoopDataSourceUtilTest { @ Rule public final TemporaryFolder folder = new TemporaryFolder ( ) ; @ Test public void loadProfiles_simple ( ) { Configuration conf = new Configuration ( ) ; conf . set ( key ( "root" ) , MockHadoopDataSource . class . getName ( ) ) ; conf . set ( key ( "root" , "path" ) , "/" ) ; List < DirectDataSourceProfile > profiles = HadoopDataSourceUtil . loadProfiles ( conf ) ; assertThat ( profiles . size ( ) , is ( 1 ) ) ; DirectDataSourceProfile profile = find ( profiles , "" ) ; assertThat ( profile . getTargetClass ( ) , equalTo ( ( Object ) MockHadoopDataSource . class ) ) ; assertThat ( profile . getAttributes ( ) , is ( map ( ) ) ) ; } @ Test public void loadProfiles_path ( ) { Configuration conf = new Configuration ( ) ; conf . set ( key ( "root" ) , MockHadoopDataSource . class . getName ( ) ) ; conf . set ( key ( "root" , "path" ) , "example/path" ) ; List < DirectDataSourceProfile > profiles = HadoopDataSourceUtil . loadProfiles ( conf ) ; assertThat ( profiles . size ( ) , is ( 1 ) ) ; DirectDataSourceProfile profile = find ( profiles , "example/path" ) ; assertThat ( profile . getTargetClass ( ) , equalTo ( ( Object ) MockHadoopDataSource . class ) ) ; assertThat ( profile . getAttributes ( ) , is ( map ( ) ) ) ; } @ Test public void loadProfiles_attribute ( ) { Configuration conf = new Configuration ( ) ; conf . set ( key ( "root" ) , MockHadoopDataSource . class . getName ( ) ) ; conf . set ( key ( "root" , "path" ) , "/" ) ; conf . set ( key ( "root" , "hello1" ) , "world1" ) ; conf . set ( key ( "root" , "hello2" ) , "world2" ) ; conf . set ( key ( "root" , "hello3" ) , "world3" ) ; List < DirectDataSourceProfile > profiles = HadoopDataSourceUtil . loadProfiles ( conf ) ; assertThat ( profiles . size ( ) , is ( 1 ) ) ; DirectDataSourceProfile profile = find ( profiles , "" ) ; assertThat ( profile . getTargetClass ( ) , equalTo ( ( Object ) MockHadoopDataSource . class ) ) ; assertThat ( profile . getAttributes ( ) , is ( map ( "hello1" , "world1" , "hello2" , "world2" , "hello3" , "world3" ) ) ) ; } @ Test public void loadProfiles_multiple ( ) { Configuration conf = new Configuration ( ) ; conf . set ( key ( "a" ) , MockHadoopDataSource . class . getName ( ) ) ; conf . set ( key ( "a" , "path" ) , "aaa" ) ; conf . set ( key ( "b" ) , MockHadoopDataSource . class . getName ( ) ) ; conf . set ( key ( "b" , "path" ) , "bbb" ) ; conf . set ( key ( "c" ) , MockHadoopDataSource . class . getName ( ) ) ; conf . set ( key ( "c" , "path" ) , "ccc" ) ; List < DirectDataSourceProfile > profiles = HadoopDataSourceUtil . loadProfiles ( conf ) ; assertThat ( profiles . size ( ) , is ( 3 ) ) ; DirectDataSourceProfile a = find ( profiles , "aaa" ) ; assertThat ( a . getTargetClass ( ) , equalTo ( ( Object ) MockHadoopDataSource . class ) ) ; assertThat ( a . getAttributes ( ) , is ( map ( ) ) ) ; DirectDataSourceProfile b = find ( profiles , "bbb" ) ; assertThat ( b . getTargetClass ( ) , equalTo ( ( Object ) MockHadoopDataSource . class ) ) ; assertThat ( b . getAttributes ( ) , is ( map ( ) ) ) ; DirectDataSourceProfile c = find ( profiles , "ccc" ) ; assertThat ( c . getTargetClass ( ) , equalTo ( ( Object ) MockHadoopDataSource . class ) ) ; assertThat ( c . getAttributes ( ) , is ( map ( ) ) ) ; } private Map < String , String > map ( String ... kvs ) { assertThat ( kvs . length % 2 , is ( 0 ) ) ; Map < String , String > results = new HashMap < String , String > ( ) ; for ( int i = 0 ; i < kvs . length ; i += 2 ) { results . put ( kvs [ i ] , kvs [ i + 1 ] ) ; } return results ; } private DirectDataSourceProfile find ( List < DirectDataSourceProfile > profiles , String path ) { for ( DirectDataSourceProfile p : profiles ) { if ( p . getPath ( ) . equals ( path ) ) { return p ; } } throw new AssertionError ( path ) ; } private String key ( String first , String ... rest ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( HadoopDataSourceUtil . PREFIX ) ; buf . append ( first ) ; for ( String s : rest ) { buf . append ( "." ) ; buf . append ( s ) ; } return buf . toString ( ) ; } @ Test public void loadRepository ( ) throws Exception { Configuration conf = new Configuration ( ) ; conf . set ( key ( "testing" ) , MockHadoopDataSource . class . getName ( ) ) ; conf . set ( key ( "testing" , "path" ) , "testing" ) ; conf . set ( key ( "testing" , "hello" ) , "world" ) ; DirectDataSourceRepository repo = HadoopDataSourceUtil . loadRepository ( conf ) ; DirectDataSource ds = repo . getRelatedDataSource ( "testing" ) ; assertThat ( ds , instanceOf ( MockHadoopDataSource . class ) ) ; MockHadoopDataSource mock = ( MockHadoopDataSource ) ds ; assertThat ( mock . conf , is ( notNullValue ( ) ) ) ; assertThat ( mock . profile . getPath ( ) , is ( "testing" ) ) ; } @ Test public void transactionInfo ( ) throws Exception { Configuration conf = new Configuration ( ) ; conf . set ( HadoopDataSourceUtil . KEY_SYSTEM_DIR , folder . getRoot ( ) . getAbsoluteFile ( ) . toURI ( ) . toString ( ) ) ; assertThat ( "" , folder . getRoot ( ) . listFiles ( ) , is ( new File [ 0 ] ) ) ; assertThat ( HadoopDataSourceUtil . findAllTransactionInfoFiles ( conf ) . size ( ) , is ( 0 ) ) ; Path t1 = HadoopDataSourceUtil . getTransactionInfoPath ( conf , "ex1" ) ; assertThat ( HadoopDataSourceUtil . getTransactionInfoExecutionId ( t1 ) , is ( "ex1" ) ) ; t1 . getFileSystem ( conf ) . create ( t1 ) . close ( ) ; assertThat ( folder . getRoot ( ) . listFiles ( ) . length , is ( greaterThan ( 0 ) ) ) ; Path t2 = HadoopDataSourceUtil . getTransactionInfoPath ( conf , "ex2" ) ; assertThat ( t2 , is ( not ( t1 ) ) ) ; assertThat ( HadoopDataSourceUtil . getTransactionInfoExecutionId ( t2 ) , is ( "ex2" ) ) ; t2 . getFileSystem ( conf ) . create ( t2 ) . close ( ) ; Path c2 = HadoopDataSourceUtil . getCommitMarkPath ( conf , "ex2" ) ; assertThat ( c2 , is ( not ( t2 ) ) ) ; c2 . getFileSystem ( conf ) . create ( c2 ) . close ( ) ; List < Path > paths = new ArrayList < Path > ( ) ; for ( FileStatus stat : HadoopDataSourceUtil . findAllTransactionInfoFiles ( conf ) ) { paths . add ( stat . getPath ( ) ) ; } assertThat ( paths . size ( ) , is ( 2 ) ) ; assertThat ( paths , hasItem ( t1 ) ) ; assertThat ( paths , hasItem ( t2 ) ) ; } @ Test public void search_direct ( ) throws Exception { touch ( "a.csv" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > results = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "a.csv" ) ) ; assertThat ( normalize ( results ) , is ( path ( "a.csv" ) ) ) ; } @ Test public void search_direct_deep ( ) throws Exception { touch ( "a.csv" ) ; touch ( "a/a.csv" ) ; touch ( "a/a/a.csv" ) ; touch ( "a/a/a/a.csv" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > results = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "a/a/a.csv" ) ) ; assertThat ( normalize ( results ) , is ( path ( "a/a/a.csv" ) ) ) ; } @ Test public void search_wildcard ( ) throws Exception { touch ( "a.csv" ) ; touch ( "b.tsv" ) ; touch ( "c.csv" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > results = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "*.csv" ) ) ; assertThat ( normalize ( results ) , is ( path ( "a.csv" , "c.csv" ) ) ) ; } @ Test public void search_wildcard_dir ( ) throws Exception { touch ( "a/a.csv" ) ; touch ( "b/b/b.csv" ) ; touch ( "c/c.csv" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > results = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "*/*.csv" ) ) ; assertThat ( normalize ( results ) , is ( path ( "a/a.csv" , "c/c.csv" ) ) ) ; } @ Test public void search_selection ( ) throws Exception { touch ( "a.csv" ) ; touch ( "b.csv" ) ; touch ( "c.csv" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > results = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "{a|b}.csv" ) ) ; assertThat ( normalize ( results ) , is ( path ( "a.csv" , "b.csv" ) ) ) ; } @ Test public void search_selection_multiple ( ) throws Exception { touch ( "a/a.csv" ) ; touch ( "a/b.csv" ) ; touch ( "a/c.csv" ) ; touch ( "b/a.csv" ) ; touch ( "b/b.csv" ) ; touch ( "b/c.csv" ) ; touch ( "c/a.csv" ) ; touch ( "c/b.csv" ) ; touch ( "c/c.csv" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > results = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "" ) ) ; assertThat ( normalize ( results ) , is ( path ( "a/b.csv" , "a/c.csv" , "b/b.csv" , "b/c.csv" ) ) ) ; } @ Test public void search_selection_complex ( ) throws Exception { for ( int year = 2001 ; year <= 2010 ; year ++ ) { for ( int month = 1 ; month <= 12 ; month ++ ) { touch ( String . format ( "" , year , month , ".csv" ) ) ; } } FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > results = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "" ) ) ; assertThat ( normalize ( results ) , is ( path ( "" , "" ) ) ) ; } @ Test public void search_traverse ( ) throws Exception { touch ( "a/a.csv" ) ; touch ( "b/b.csv" ) ; touch ( "c/c.csv" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > results = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "**" ) ) ; assertThat ( normalize ( results ) , is ( path ( "" , "a" , "b" , "c" , "a/a.csv" , "b/b.csv" , "c/c.csv" ) ) ) ; } @ Test public void search_traverse_file ( ) throws Exception { touch ( "a/a.csv" ) ; touch ( "b/b.csv" ) ; touch ( "c/c.csv" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > results = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "**/*.csv" ) ) ; assertThat ( normalize ( results ) , is ( path ( "a/a.csv" , "b/b.csv" , "c/c.csv" ) ) ) ; } @ Test public void minimalCovered_trivial ( ) throws Exception { touch ( "a.csv" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > raw = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "**/*.csv" ) ) ; assertThat ( raw . size ( ) , is ( 1 ) ) ; List < FileStatus > results = HadoopDataSourceUtil . onlyMinimalCovered ( raw ) ; assertThat ( normalize ( results ) , is ( path ( "a.csv" ) ) ) ; } @ Test public void minimalCovered_siblings ( ) throws Exception { touch ( "dir/a.csv" ) ; touch ( "dir/b.csv" ) ; touch ( "dir/c.csv" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > raw = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "**/*.csv" ) ) ; assertThat ( raw . size ( ) , is ( 3 ) ) ; List < FileStatus > results = HadoopDataSourceUtil . onlyMinimalCovered ( raw ) ; assertThat ( normalize ( results ) , is ( path ( "dir/a.csv" , "dir/b.csv" , "dir/c.csv" ) ) ) ; } @ Test public void minimalCovered_parent ( ) throws Exception { touch ( "dir/a.csv" ) ; touch ( "dir/b.csv" ) ; touch ( "dir/c.csv" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > raw = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "*/**" ) ) ; assertThat ( raw . size ( ) , is ( 4 ) ) ; List < FileStatus > results = HadoopDataSourceUtil . onlyMinimalCovered ( raw ) ; assertThat ( normalize ( results ) , is ( path ( "dir" ) ) ) ; } @ Test public void minimalCovered_deep ( ) throws Exception { touch ( "dir/a.csv" ) ; touch ( "dir/a/b.csv" ) ; touch ( "" ) ; FileSystem fs = getTempFileSystem ( ) ; List < FileStatus > raw = HadoopDataSourceUtil . search ( fs , getBase ( ) , FilePattern . compile ( "dir/**" ) ) ; for ( Iterator < FileStatus > iterator = raw . iterator ( ) ; iterator . hasNext ( ) ; ) { FileStatus fileStatus = iterator . next ( ) ; if ( fileStatus . getPath ( ) . getName ( ) . equals ( "dir" ) ) { iterator . remove ( ) ; } } assertThat ( raw . size ( ) , is ( 5 ) ) ; List < FileStatus > results = HadoopDataSourceUtil . | |
502 | <s> package org . rubypeople . rdt . refactoring . core . generateaccessors ; import java . util . ArrayList ; import java . util . Collection ; import org . jruby . ast . BlockNode ; import org . jruby . ast . FCallNode ; import org . jruby . ast . Node ; import org . rubypeople . rdt . refactoring . core . NodeFactory ; import org . rubypeople . rdt . refactoring . editprovider . InsertEditProvider ; import org . rubypeople . rdt . refactoring . nodewrapper . AttrAccessorNodeWrapper ; import org . rubypeople . rdt . refactoring . nodewrapper . ClassNodeWrapper ; import org . rubypeople . rdt . refactoring . nodewrapper . VisibilityNodeWrapper ; import org . rubypeople . rdt . refactoring . offsetprovider . IOffsetProvider ; public class GeneratedAccessor extends InsertEditProvider { public static final int TYPE_SIMPLE_ACCESSOR = 1 ; public static final int TYPE_METHOD_ACCESSOR = 2 ; public static final int DEFAULT_TYPE = TYPE_SIMPLE_ACCESSOR ; public String definitionName ; private int type ; private String attrName ; private ClassNodeWrapper classNode ; public GeneratedAccessor ( String definitionName , String instVarName , int type , ClassNodeWrapper classNode ) { super ( true ) ; this . definitionName = definitionName ; this . attrName = instVarName ; this . type = type ; this . classNode = classNode ; } public boolean isWriter ( ) { return definitionName . equals ( AttrAccessorNodeWrapper . ATTR_WRITER ) ; } public boolean isReader ( ) { return definitionName . equals ( AttrAccessorNodeWrapper . ATTR_READER ) ; } public boolean isAccessor ( ) { return definitionName . equals ( AttrAccessorNodeWrapper . ATTR_ACCESSOR ) ; } protected BlockNode getInsertNode ( int offset , String document ) { boolean needsNewLineAtEndOfBlock = lastEditInGroup && ! isNextLineEmpty ( offset , document ) ; if ( type == TYPE_SIMPLE_ACCESSOR ) { return NodeFactory . createBlockNode ( needsNewLineAtEndOfBlock , getSimpleInsertNode ( ) ) ; } return NodeFactory . createBlockNode ( needsNewLineAtEndOfBlock , getMethodInsertNode ( ) ) ; } private Node getSimpleInsertNode ( ) { FCallNode accessorNode = NodeFactory . createSimpleAccessorNode ( definitionName , attrName ) ; return NodeFactory . createNewLineNode ( accessorNode ) ; } private Node [ ] getMethodInsertNode ( ) { Collection < Node > methodNodes = | |
503 | <s> package com . asakusafw . windgate . stream ; import java . io . IOException ; import java . io . InputStream ; public final class CountingInputStream extends InputStream { private final InputStream target ; private long count ; public CountingInputStream ( InputStream target ) { if ( target == null ) { throw new IllegalArgumentException ( "" ) ; } this . target = target ; } public long getCount ( ) { return count ; } @ Override public int read ( ) | |
504 | <s> package test . modelgen . table . model ; import java . io . DataInput ; import java . io . DataOutput ; import java . io . IOException ; import javax . annotation . Generated ; import org . apache . hadoop . io . Writable ; import com . asakusafw . runtime . value . LongOption ; import com . asakusafw . vocabulary . model . DataModel ; import com . asakusafw . vocabulary . model . Property ; import com . asakusafw . vocabulary . model . TableModel ; @ Generated ( "" ) @ DataModel @ TableModel ( name = "" , columns = { "SID" , "JOBFLOW_SID" } , primary = { "SID" } ) @ SuppressWarnings ( "deprecation" ) public class ImportTarget1Rl implements Writable { @ Property ( name | |
505 | <s> package org . rubypeople . rdt . internal . debug . core . model ; import java . io . File ; import java . io . FileWriter ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . List ; import java . util . Set ; import java . util . TreeSet ; import org . eclipse . core . resources . IMarkerDelta ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . Status ; import org . eclipse . debug . core . DebugEvent ; import org . eclipse . debug . core . DebugException ; import org . eclipse . debug . core . DebugPlugin ; import org . eclipse . debug . core . IBreakpointManager ; import org . eclipse . debug . core . ILaunch ; import org . eclipse . debug . core . model . IBreakpoint ; import org . eclipse . debug . core . model . IDebugTarget ; import org . eclipse . debug . core . model . IMemoryBlock ; import org . eclipse . debug . core . model . IProcess ; import org . eclipse . debug . core . model . IThread ; import org . rubypeople . rdt . debug . core . IRubyLineBreakpoint ; import org . rubypeople . rdt . debug . core . RdtDebugCorePlugin ; import org . rubypeople . rdt . debug . core . RdtDebugModel ; import org . rubypeople . rdt . internal . debug . core . RubyDebuggerProxy ; import org . rubypeople . rdt . internal . debug . core . SuspensionPoint ; public class RubyDebugTarget extends RubyDebugElement implements IRubyDebugTarget { public static int DEFAULT_PORT = 1098 ; private IProcess process ; private boolean isTerminated ; private ILaunch launch ; private RubyThread [ ] threads ; private RubyDebuggerProxy rubyDebuggerProxy ; private int port ; private File debugParameterFile ; private ArrayList < IBreakpoint > fBreakPoints ; private String host ; private RubyDebugTarget ( ILaunch launch , IProcess process , String host , int port ) { super ( null ) ; this . launch = launch ; this . host = host ; this . port = port ; this . process = process ; this . threads = new RubyThread [ 0 ] ; this . fBreakPoints = new ArrayList < IBreakpoint > ( 5 ) ; this . isTerminated = false ; if ( DebugPlugin . getDefault ( ) != null ) { initializeBreakpoints ( ) ; } addDebugParameter ( "" + port ) ; } public RubyDebugTarget | |
506 | <s> package test . modelgen . table . io ; import java . io . IOException ; import javax . annotation . Generated ; import test . modelgen . table . model . ImportTarget2Rl ; import com . asakusafw . runtime . io . ModelInput ; import com . asakusafw . runtime . io . RecordParser ; @ Generated ( "" ) @ SuppressWarnings ( "deprecation" ) public final class ImportTarget2RlModelInput implements ModelInput < ImportTarget2Rl > { private final RecordParser parser ; public ImportTarget2RlModelInput ( RecordParser parser ) { if ( parser == null ) { throw new IllegalArgumentException ( ) ; } this . parser = parser ; } @ Override public boolean readTo ( ImportTarget2Rl model ) throws IOException { if ( parser . next ( ) == false ) { return | |
507 | <s> package com . asakusafw . compiler . operator . model ; import java . io . DataInput ; import java . io . DataOutput ; import java . io . IOException ; import org . apache . hadoop . io . Text ; import org . apache . hadoop . io . Writable ; import com . asakusafw . compiler . operator . io . MockKeyValue1Input ; import com . asakusafw . compiler . operator . io . MockKeyValue1Output ; import com . asakusafw . runtime . model . DataModel ; import com . asakusafw . runtime . model . DataModelKind ; import com . asakusafw . runtime . model . ModelInputLocation ; import com . asakusafw . runtime . model . ModelOutputLocation ; import com . asakusafw . runtime . value . IntOption ; import com . asakusafw . runtime . value . StringOption ; @ DataModelKind ( "DMDL" ) @ ModelInputLocation ( MockKeyValue1Input . class ) @ ModelOutputLocation ( MockKeyValue1Output . class ) public class MockKeyValue1 implements DataModel < MockKeyValue1 > , MockKey , MockProjection , Writable { private final StringOption key = new StringOption ( ) ; private final IntOption | |
508 | <s> package org . rubypeople . rdt . internal . ui . rubyeditor ; import java . util . ArrayList ; import java . util . Iterator ; import java . util . List ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . resources . IMarker ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . NullProgressMonitor ; import org . eclipse . core . runtime . SubProgressMonitor ; import org . eclipse . core . runtime . jobs . ISchedulingRule ; import org . eclipse . jface . preference . IPreferenceStore ; import org . eclipse . jface . text . Assert ; import org . eclipse . jface . text . BadLocationException ; import org . eclipse . jface . text . DefaultLineTracker ; import org . eclipse . jface . text . IDocument ; import org . eclipse . jface . text . ILineTracker ; import org . eclipse . jface . text . ISynchronizable ; import org . eclipse . jface . text . Position ; import org . eclipse . jface . text . source . Annotation ; import org . eclipse . jface . text . source . AnnotationModelEvent ; import org . eclipse . jface . text . source . IAnnotationAccessExtension ; import org . eclipse . jface . text . source . IAnnotationModel ; import org . eclipse . jface . text . source . IAnnotationModelListener ; import org . eclipse . jface . text . source . IAnnotationModelListenerExtension ; import org . eclipse . jface . text . source . IAnnotationPresentation ; import org . eclipse . jface . text . source . ImageUtilities ; import org . eclipse . jface . util . IPropertyChangeListener ; import org . eclipse . jface . util . ListenerList ; import org . eclipse . jface . util . PropertyChangeEvent ; import org . eclipse . swt . SWT ; import org . eclipse . swt . graphics . GC ; import org . eclipse . swt . graphics . Image ; import org . eclipse . swt . graphics . Rectangle ; import org . eclipse . swt . widgets . Canvas ; import org . eclipse . swt . widgets . Display ; import org . eclipse . ui . IFileEditorInput ; import org . eclipse . ui . editors . text . EditorsUI ; import org . eclipse . ui . editors . text . TextFileDocumentProvider ; import org . eclipse . ui . texteditor . AbstractMarkerAnnotationModel ; import org . eclipse . ui . texteditor . AnnotationPreference ; import org . eclipse . ui . texteditor . AnnotationPreferenceLookup ; import org . eclipse . ui . texteditor . IDocumentProvider ; import org . eclipse . ui . texteditor . MarkerAnnotation ; import org . eclipse . ui . texteditor . MarkerUtilities ; import org . eclipse . ui . texteditor . ResourceMarkerAnnotationModel ; import org . rubypeople . rdt . core . IProblemRequestor ; import org . rubypeople . rdt . core . IRubyScript ; import org . rubypeople . rdt . core . RubyCore ; import org . rubypeople . rdt . core . RubyModelException ; import org . rubypeople . rdt . core . compiler . CategorizedProblem ; import org . rubypeople . rdt . core . compiler . IProblem ; import org . rubypeople . rdt . internal . core . RubyProject ; import org . rubypeople . rdt . internal . ui . RubyPlugin ; import org . rubypeople . rdt . internal . ui . RubyPluginImages ; import org . rubypeople . rdt . internal . ui . text . ruby . IProblemRequestorExtension ; import org . rubypeople . rdt . ui . PreferenceConstants ; public class RubyDocumentProvider extends TextFileDocumentProvider implements IRubyScriptDocumentProvider { static protected class RubyScriptInfo extends FileInfo { public IRubyScript fCopy ; } protected static class GlobalAnnotationModelListener implements IAnnotationModelListener , IAnnotationModelListenerExtension { private ListenerList fListenerList ; public GlobalAnnotationModelListener ( ) { fListenerList = new ListenerList ( ) ; } public void modelChanged ( IAnnotationModel model ) { Object [ ] listeners = fListenerList . getListeners ( ) ; for ( int i = 0 ; i < listeners . length ; i ++ ) { ( ( IAnnotationModelListener ) listeners [ i ] ) . modelChanged ( model ) ; } } public void modelChanged ( AnnotationModelEvent event ) { Object [ ] listeners = fListenerList . getListeners ( ) ; for ( int i = 0 ; i < listeners . length ; i ++ ) { Object curr = listeners [ i ] ; if ( curr instanceof IAnnotationModelListenerExtension ) { ( ( IAnnotationModelListenerExtension ) curr ) . modelChanged ( event ) ; } } } public void addListener ( IAnnotationModelListener listener ) { fListenerList . add ( listener ) ; } public void removeListener ( IAnnotationModelListener listener ) { fListenerList . remove ( listener ) ; } } private final static String HANDLE_TEMPORARY_PROBLEMS = PreferenceConstants . EDITOR_EVALUTE_TEMPORARY_PROBLEMS ; private boolean fIsAboutToSave = false ; private ISavePolicy fSavePolicy ; private IPropertyChangeListener fPropertyListener ; private GlobalAnnotationModelListener fGlobalAnnotationModelListener ; public RubyDocumentProvider ( ) { IDocumentProvider provider = new TextFileDocumentProvider ( ) ; setParentDocumentProvider ( provider ) ; fGlobalAnnotationModelListener = new GlobalAnnotationModelListener ( ) ; fPropertyListener = new IPropertyChangeListener ( ) { public void propertyChange ( PropertyChangeEvent event ) { if ( HANDLE_TEMPORARY_PROBLEMS . equals ( event . getProperty ( ) ) ) enableHandlingTemporaryProblems ( ) ; } } ; RubyPlugin . getDefault ( ) . getPreferenceStore ( ) . addPropertyChangeListener ( fPropertyListener ) ; } protected IAnnotationModel createAnnotationModel ( IFile file ) { return new RubyScriptAnnotationModel ( file ) ; } protected IRubyScript createRubyScript ( IFile file ) { Object element = RubyCore . create ( file ) ; if ( element instanceof IRubyScript ) return ( IRubyScript ) element ; return null ; } protected FileInfo createEmptyFileInfo ( ) { return new RubyScriptInfo ( ) ; } protected void enableHandlingTemporaryProblems ( ) { boolean enable = isHandlingTemporaryProblems ( ) ; for ( Iterator iter = getFileInfosIterator ( ) ; iter . hasNext ( ) ; ) { FileInfo info = ( FileInfo ) iter . next ( ) ; if ( info . fModel instanceof IProblemRequestorExtension ) { IProblemRequestorExtension extension = ( IProblemRequestorExtension ) info . fModel ; extension . setIsHandlingTemporaryProblems ( enable ) ; } } } public void addGlobalAnnotationModelListener ( IAnnotationModelListener listener ) { fGlobalAnnotationModelListener . addListener ( listener ) ; } public void removeGlobalAnnotationModelListener ( IAnnotationModelListener listener ) { fGlobalAnnotationModelListener . removeListener ( listener ) ; } protected FileInfo createFileInfo ( Object element ) throws CoreException { if ( ! ( element instanceof IFileEditorInput ) ) return null ; IFileEditorInput input = ( IFileEditorInput ) element ; IRubyScript original = createRubyScript ( input . getFile ( ) ) ; if ( original == null ) return null ; FileInfo info = super . createFileInfo ( element ) ; if ( ! ( info instanceof RubyScriptInfo ) ) return null ; RubyScriptInfo cuInfo = ( RubyScriptInfo ) info ; setUpSynchronization ( cuInfo ) ; IProblemRequestor requestor = cuInfo . fModel instanceof IProblemRequestor ? ( IProblemRequestor ) cuInfo . fModel : null ; if ( requestor instanceof IProblemRequestorExtension ) { IProblemRequestorExtension extension = ( IProblemRequestorExtension ) requestor ; extension . setIsActive ( false ) ; extension . setIsHandlingTemporaryProblems ( isHandlingTemporaryProblems ( ) ) ; } IProject iProject = input . getFile ( ) . getProject ( ) ; if ( ! RubyProject . hasRubyNature ( iProject ) ) { RubyCore . addRubyNature ( iProject , null ) ; } original . becomeWorkingCopy ( requestor , getProgressMonitor ( ) ) ; cuInfo . fCopy = original ; if ( cuInfo . fModel instanceof RubyScriptAnnotationModel ) { RubyScriptAnnotationModel model = ( RubyScriptAnnotationModel ) cuInfo . fModel ; model . setRubyScript ( cuInfo . fCopy ) ; } if ( cuInfo . fModel != null ) cuInfo . fModel . addAnnotationModelListener ( fGlobalAnnotationModelListener ) ; return cuInfo ; } protected boolean isHandlingTemporaryProblems ( ) { IPreferenceStore store = RubyPlugin . getDefault ( ) . getPreferenceStore ( ) ; return store . getBoolean ( HANDLE_TEMPORARY_PROBLEMS ) ; } public void saveDocumentContent ( IProgressMonitor monitor , Object element , IDocument document , boolean overwrite ) throws CoreException { if ( ! fIsAboutToSave ) return ; super . saveDocument ( monitor , element , document , overwrite ) ; } private void setUpSynchronization ( RubyScriptInfo cuInfo ) { IDocument document = cuInfo . fTextFileBuffer . getDocument ( ) ; IAnnotationModel model = cuInfo . fModel ; if ( document instanceof ISynchronizable && model instanceof ISynchronizable ) { Object lock = ( ( ISynchronizable ) document ) . getLockObject ( ) ; ( ( ISynchronizable ) model ) . setLockObject ( lock ) ; } } protected void disposeFileInfo ( Object element , FileInfo info ) { if ( info instanceof RubyScriptInfo ) { RubyScriptInfo cuInfo = ( RubyScriptInfo ) info ; try { cuInfo . fCopy . discardWorkingCopy ( ) ; } catch ( RubyModelException x ) { handleCoreException ( x , x . getMessage ( ) ) ; } if ( cuInfo . fModel != null ) cuInfo . fModel . removeAnnotationModelListener ( fGlobalAnnotationModelListener ) ; } super . disposeFileInfo ( element , info ) ; } protected DocumentProviderOperation createSaveOperation ( final Object element , final IDocument document , final boolean overwrite ) throws CoreException { final FileInfo info = getFileInfo ( element ) ; if ( info instanceof RubyScriptInfo ) { return new DocumentProviderOperation ( ) { protected void execute ( IProgressMonitor monitor ) throws CoreException { commitWorkingCopy ( monitor , element , ( RubyScriptInfo ) info , overwrite ) ; } public ISchedulingRule getSchedulingRule ( ) { if ( info . fElement instanceof IFileEditorInput ) { IFile file = ( ( IFileEditorInput ) info . fElement ) . getFile ( ) ; return computeSchedulingRule ( file ) ; } return null ; } } ; } return null ; } protected void commitWorkingCopy ( IProgressMonitor monitor , Object element , RubyScriptInfo info , boolean overwrite ) throws CoreException { if ( monitor == null ) monitor = new NullProgressMonitor ( ) ; monitor . beginTask ( "" , 100 ) ; try { IProgressMonitor subMonitor = getSubProgressMonitor ( monitor , 50 ) ; try { synchronized ( info . fCopy ) { info . fCopy . reconcile ( false , null , subMonitor ) ; } } catch ( RubyModelException ex ) { } finally { subMonitor . done ( ) ; } IDocument document = info . fTextFileBuffer . getDocument ( ) ; IResource resource = info . fCopy . getResource ( ) ; Assert . isTrue ( resource instanceof IFile ) ; if ( ! resource . exists ( ) ) { subMonitor = getSubProgressMonitor ( monitor , 50 ) ; try { createFileFromDocument ( subMonitor , ( IFile ) resource , document ) ; } finally { subMonitor . done ( ) ; } return ; } if ( fSavePolicy != null ) fSavePolicy . preSave ( info . fCopy ) ; try { subMonitor = getSubProgressMonitor ( monitor , 50 ) ; fIsAboutToSave = true ; info . fCopy . commitWorkingCopy ( overwrite , subMonitor ) ; } catch ( CoreException x ) { fireElementStateChangeFailed ( element ) ; throw x ; } catch ( RuntimeException x ) { fireElementStateChangeFailed ( element ) ; throw x ; } finally { fIsAboutToSave = false ; subMonitor . done ( ) ; } if ( info . fModel instanceof AbstractMarkerAnnotationModel ) { AbstractMarkerAnnotationModel model = ( AbstractMarkerAnnotationModel ) info . fModel ; model . updateMarkers ( document ) ; } if ( fSavePolicy != null ) { IRubyScript unit = fSavePolicy . postSave ( info . fCopy ) ; if ( unit != null && info . fModel instanceof AbstractMarkerAnnotationModel ) { IResource r = unit . getResource ( ) ; IMarker [ ] markers = r . findMarkers ( IMarker . MARKER , true , IResource . DEPTH_ZERO ) ; if ( markers != null && markers . length > 0 ) { AbstractMarkerAnnotationModel model = ( AbstractMarkerAnnotationModel ) info . fModel ; for ( int i = 0 ; i < markers . length ; i ++ ) model . updateMarker ( document , markers [ i ] , null ) ; } } } } finally { monitor . done ( ) ; } } private IProgressMonitor getSubProgressMonitor ( IProgressMonitor monitor , int ticks ) { if ( monitor != null ) return new SubProgressMonitor ( monitor , ticks , SubProgressMonitor . PREPEND_MAIN_LABEL_TO_SUBTASK ) ; return new NullProgressMonitor ( ) ; } public IRubyScript getWorkingCopy ( | |
509 | <s> package test . modelgen . table . model ; import java . io . DataInput ; import java . io . DataOutput ; import java . io . IOException ; import javax . annotation . Generated ; import org . apache . hadoop . io . Text ; import org . apache . hadoop . io . Writable ; import com . asakusafw . runtime . value . DateTime ; import com . asakusafw . runtime . value . DateTimeOption ; import com . asakusafw . runtime . value . LongOption ; import com . asakusafw . runtime . value . StringOption ; import com . asakusafw . vocabulary . model . DataModel ; import com . asakusafw . vocabulary . model . Property ; import com . asakusafw . vocabulary . model . TableModel ; @ Generated ( "" ) @ DataModel @ TableModel ( name = "" , columns = { "JOBFLOW_SID" , "BATCH_ID" , "JOBFLOW_ID" , "TARGET_NAME" , "EXECUTION_ID" , "" } , primary = { "JOBFLOW_SID" } ) @ SuppressWarnings ( "deprecation" ) public class RunningJobflows implements Writable { @ Property ( name = "JOBFLOW_SID" ) private LongOption jobflowSid = new LongOption ( ) ; @ Property ( name = "BATCH_ID" ) private StringOption batchId = new StringOption ( ) ; @ Property ( name = "JOBFLOW_ID" ) private StringOption jobflowId = new StringOption ( ) ; @ Property ( name = "TARGET_NAME" ) private StringOption targetName = new StringOption ( ) ; @ Property ( name = "EXECUTION_ID" ) private StringOption executionId = new StringOption ( ) ; @ Property ( name = "" ) private DateTimeOption expectedCompletionDatetime = new DateTimeOption ( ) ; public long getJobflowSid ( ) { return this . jobflowSid . get ( ) ; } public void setJobflowSid ( long jobflowSid ) { this . jobflowSid . modify ( jobflowSid ) ; } public LongOption getJobflowSidOption ( ) { return this . jobflowSid ; } public void setJobflowSidOption ( LongOption jobflowSid ) { this . jobflowSid . copyFrom ( jobflowSid ) ; } public Text getBatchId ( ) { return this . batchId . get ( ) ; } public void setBatchId ( Text batchId ) { this . batchId . modify ( batchId ) ; } public String getBatchIdAsString ( ) { return this . batchId . getAsString ( ) ; } public void setBatchIdAsString ( String batchId ) { this . batchId . modify ( batchId ) ; } public StringOption getBatchIdOption ( ) { return this . batchId ; } public void setBatchIdOption ( StringOption batchId ) { this . batchId . copyFrom ( batchId ) ; } public Text getJobflowId ( ) { return this . jobflowId . get ( ) ; } public void setJobflowId ( Text jobflowId ) { this . jobflowId . modify ( jobflowId ) ; } public String getJobflowIdAsString ( ) { return this . jobflowId . getAsString ( ) ; } public void setJobflowIdAsString ( String jobflowId ) { this . jobflowId . modify ( jobflowId ) ; } public StringOption getJobflowIdOption ( ) { return this . jobflowId ; } public void setJobflowIdOption ( StringOption jobflowId ) { this . jobflowId . copyFrom ( jobflowId ) ; } public Text getTargetName ( ) { return this . targetName . get ( ) ; } public void setTargetName ( Text targetName ) { this . targetName . modify ( targetName ) ; } public String getTargetNameAsString ( ) { return this . targetName . getAsString ( ) ; } public void setTargetNameAsString ( String targetName ) { this . targetName . modify ( targetName ) ; } public StringOption getTargetNameOption ( ) { return this . targetName ; } public void setTargetNameOption ( StringOption targetName ) { this . targetName . copyFrom ( targetName ) ; } public Text getExecutionId ( ) { return this . executionId . get ( ) ; } public void setExecutionId ( Text executionId ) { this . executionId . modify ( executionId ) ; } public String getExecutionIdAsString ( ) { return this . executionId . getAsString ( ) ; } public void setExecutionIdAsString ( String executionId ) { this . executionId . modify ( executionId ) ; } public StringOption getExecutionIdOption ( ) { return this . executionId ; } public void setExecutionIdOption ( StringOption executionId ) { this . executionId . copyFrom ( executionId ) ; } public DateTime getExpectedCompletionDatetime ( ) { return this . expectedCompletionDatetime . get ( ) ; } public void setExpectedCompletionDatetime ( DateTime expectedCompletionDatetime ) { this . expectedCompletionDatetime . modify ( expectedCompletionDatetime ) ; } public DateTimeOption getExpectedCompletionDatetimeOption ( ) { return this . expectedCompletionDatetime ; } public void setExpectedCompletionDatetimeOption ( DateTimeOption expectedCompletionDatetime ) { this . expectedCompletionDatetime . copyFrom ( expectedCompletionDatetime ) ; } public void copyFrom ( RunningJobflows source ) { this . jobflowSid . copyFrom ( source . jobflowSid ) ; this . batchId . copyFrom ( source . batchId ) ; this . jobflowId . copyFrom ( source . jobflowId ) ; this . targetName . copyFrom ( source . targetName ) ; this . executionId . copyFrom ( source . executionId ) ; this . expectedCompletionDatetime . copyFrom ( source . expectedCompletionDatetime ) ; } @ Override public void write ( DataOutput out ) throws IOException { jobflowSid . write ( out ) ; batchId . write ( out ) ; jobflowId . write ( out ) ; targetName . write ( out ) ; executionId . write ( out ) ; expectedCompletionDatetime . write ( out ) ; } @ Override public void readFields ( DataInput in ) throws IOException { jobflowSid . readFields ( in ) ; batchId . readFields ( in ) ; jobflowId . readFields ( in ) ; targetName . readFields ( in ) ; executionId . readFields ( in ) ; expectedCompletionDatetime . readFields ( in ) ; } @ Override public int hashCode ( ) { int prime = 31 ; int result = 1 ; result = prime * result + jobflowSid . hashCode ( ) ; result = prime * result + batchId . hashCode ( ) ; result = prime * result + jobflowId . hashCode ( ) ; result = prime * result + targetName . hashCode ( ) ; result = prime * result + executionId . hashCode ( ) ; result = prime * result | |
510 | <s> package com . asakusafw . vocabulary . operator ; import java . lang . annotation . Documented ; import java . lang . annotation . ElementType ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; import com . asakusafw . vocabulary . model . Key ; @ Target ( ElementType . METHOD ) @ Retention ( RetentionPolicy . RUNTIME | |
511 | <s> package net . sf . sveditor . core . tests ; import java . io . InputStream ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . Map . Entry ; import net . sf . sveditor . core . db . index . ISVDBFileSystemChangeListener ; import net . sf . sveditor . core . db . index . ISVDBFileSystemProvider ; public class SaveMarkersFileSystemProvider implements ISVDBFileSystemProvider { private ISVDBFileSystemProvider fFSProvider ; private Map < String , List < String > > fMarkersMap ; public SaveMarkersFileSystemProvider ( ISVDBFileSystemProvider fs_provider ) { fFSProvider = fs_provider ; fMarkersMap = new HashMap < String , List < String > > ( ) ; } public List < String > getMarkers ( ) { List < String > ret = new ArrayList < String > ( ) ; | |
512 | <s> package org . oddjob . designer . elements . schedule ; import junit . framework . TestCase ; import org . apache . log4j . Logger ; import org . oddjob . Helper ; import org . oddjob . OddjobDescriptorFactory ; import org . oddjob . arooa . ArooaDescriptor ; import org . oddjob . arooa . ArooaParseException ; import org . oddjob . arooa . ArooaType ; import org . oddjob . arooa . design . DesignInstance ; import org . oddjob . arooa . design . DesignParser ; import org . oddjob . arooa . design . view . ViewMainHelper ; import org . oddjob . arooa . standard . StandardArooaSession ; import org . oddjob . arooa . xml . XMLConfiguration ; import org . oddjob . schedules . schedules . CountSchedule ; import org . oddjob . schedules . schedules . IntervalSchedule ; public class CountScheduleDETest extends TestCase { private static final Logger logger = Logger . getLogger ( CountScheduleDETest . class ) ; public void setUp ( ) { logger . debug ( "" + getName ( ) + "" ) ; } DesignInstance design ; public void testCreate ( ) throws ArooaParseException { String xml = "" + "" + "" + "" + "" + "" ; ArooaDescriptor descriptor = new OddjobDescriptorFactory ( ) . createDescriptor ( getClass ( ) . getClassLoader ( ) ) ; DesignParser parser = new DesignParser ( new StandardArooaSession ( descriptor ) ) ; parser . setArooaType ( ArooaType . VALUE ) ; parser . parse ( new XMLConfiguration ( "TEST" , xml ) ) ; design = parser . getDesign ( ) ; assertEquals ( CountScheduleDesign . class , design . getClass ( ) ) ; CountSchedule test = | |
513 | <s> package org . oddjob . jmx . server ; import org . oddjob . jmx . RemoteOperation ; public class MBeanOperation extends RemoteOperation < Object > { private final String actionName ; private final String [ ] signature ; public MBeanOperation ( String actionName , String [ | |
514 | <s> package org . rubypeople . rdt . internal . codeassist ; import java . util . List ; import org . jruby . ast . ClassNode ; import org . jruby . ast . CommentNode ; import org . jruby . ast . MethodDefNode ; import org . jruby . ast . ModuleNode ; import org . jruby . ast . Node ; import org . jruby . parser . RubyParserResult ; import org . rubypeople . rdt . core . IRubyScript ; import org . rubypeople . rdt . core . RubyCore ; import org . rubypeople . rdt . core . RubyModelException ; import org . rubypeople . rdt . internal . core . RubyScript ; import org . rubypeople . rdt . internal . core . parser . RubyParser ; import org . rubypeople . rdt . internal . ti . util . ClosestSpanningNodeLocator ; import org . rubypeople . rdt . internal . ti . util . INodeAcceptor ; public class CompletionContext { private IRubyScript script ; private int offset ; private boolean isMethodInvokation = false ; private String correctedSource ; private String partialPrefix ; private String fullPrefix ; private int replaceStart ; private boolean isAfterDoubleSemiColon = false ; private Node fRootNode ; private List < CommentNode > fCommentNodes ; private boolean inComment ; public CompletionContext ( IRubyScript script , int offset ) throws RubyModelException { this . script = script ; if ( offset < 0 ) offset = 0 ; this . offset = offset ; replaceStart = offset + 1 ; try { run ( ) ; } catch ( RuntimeException e ) { RubyCore . log ( e ) ; } } private void run ( ) throws RubyModelException { StringBuffer source = new StringBuffer ( script . getSource ( ) ) ; if ( offset >= source . length ( ) ) { offset = source . length ( ) - 1 ; replaceStart = offset + 1 ; } StringBuffer tmpPrefix = new StringBuffer ( ) ; boolean setOffset = false ; for ( int i = offset ; i >= 0 ; i -- ) { char curChar = source . charAt ( i ) ; if ( offset == i ) { switch ( curChar ) { case '@' : if ( ( ( i - 1 ) >= 0 ) && ( source . charAt ( i - 1 ) == '@' ) ) { source . deleteCharAt ( i ) ; source . deleteCharAt ( i - 1 ) ; tmpPrefix . append ( "@" ) ; i -- ; } else source . deleteCharAt ( i ) ; break ; case '.' : case '$' : case ',' : source . deleteCharAt ( i ) ; break ; case ':' : if ( i > 0 ) { char previous = source . charAt ( i - 1 ) ; if ( previous == ':' ) { isAfterDoubleSemiColon = true ; source . deleteCharAt ( i ) ; source . deleteCharAt ( i - 1 ) ; tmpPrefix . insert ( 0 , "::" ) ; partialPrefix = "" ; i -- ; continue ; } } break ; } } if ( curChar == '.' ) { isMethodInvokation = true ; if ( partialPrefix == null ) this . partialPrefix = tmpPrefix . toString ( ) ; if ( offset - 1 == i ) { offset = i ; } else { offset = i - 1 ; } setOffset = true ; } else if ( curChar == ':' ) { if ( i > 0 ) { char previous = source . charAt ( i - 1 ) ; if ( previous == ':' ) { isAfterDoubleSemiColon = true ; if ( partialPrefix == null ) partialPrefix = tmpPrefix . toString ( ) ; tmpPrefix . insert ( 0 , ":" ) ; i -- ; } } } if ( Character . isWhitespace ( curChar ) || curChar == ',' || curChar == '(' || curChar == '[' || curChar == '{' ) { if ( ! setOffset ) { offset = i + 1 ; setOffset = true ; } break ; } tmpPrefix . insert ( 0 , curChar ) ; } this . fullPrefix = tmpPrefix . toString ( ) ; if ( partialPrefix == null ) partialPrefix = fullPrefix ; if ( partialPrefix != null ) replaceStart -= partialPrefix . length ( ) ; this . correctedSource = source . toString ( ) ; Node selected = ClosestSpanningNodeLocator . Instance ( ) . findClosestSpanner ( getRootNode ( ) , this . offset , new INodeAcceptor ( ) { public boolean doesAccept ( Node node ) { return true ; } } ) ; if ( selected == null ) { if ( fCommentNodes != null ) { for ( CommentNode comment : fCommentNodes ) { if ( ClosestSpanningNodeLocator . nodeSpansOffset ( comment , this . offset ) ) { inComment = true ; break ; } } } } } public boolean isExplicitMethodInvokation ( ) { return isMethodInvokation ; } public boolean isMethodInvokationOrLocal ( ) { return ! isExplicitMethodInvokation ( ) && ( emptyPrefix ( ) || ( getPartialPrefix ( ) . length ( ) > 0 && Character . isLowerCase ( getPartialPrefix ( ) . charAt ( 0 ) ) ) ) ; } public boolean isConstant ( ) { return getPartialPrefix ( ) != null && getPartialPrefix ( ) . length ( ) > 0 && Character . isUpperCase ( getPartialPrefix ( ) . charAt ( 0 ) ) ; } public int getReplaceStart ( ) { return replaceStart ; } public String getCorrectedSource ( ) { return correctedSource ; } public boolean isBroken ( ) { try { return ! getCorrectedSource ( ) . equals ( script . getSource | |
515 | <s> package org . oddjob . state ; import junit . framework . TestCase ; public class StructuralStateConverterTest extends TestCase { public void testConvert ( ) { ParentStateConverter test = new ParentStateConverter ( ) ; assertEquals ( ParentState . READY , test . toStructuralState ( JobState . READY ) ) ; assertEquals ( ParentState . ACTIVE , test . toStructuralState ( JobState | |
516 | <s> package net . sf . sveditor . core . db . refs ; import java . util . ArrayList ; import java . util . List ; import net . sf . sveditor . core . db . ISVDBItemBase ; import net . sf . sveditor . core . db . SVDBFile ; import net . sf . sveditor . core . db . SVDBLocation ; public class SVDBRefFinder extends AbstractSVDBFileRefFinder { private SVDBRefType fRefType ; private String fRefName ; private List < SVDBRefItem > fRefList ; public SVDBRefFinder ( SVDBRefType ref_type , String ref_name ) { fRefList = new ArrayList < SVDBRefItem > ( ) ; fRefType = ref_type ; fRefName = ref_name ; } public List < SVDBRefItem > find_refs ( SVDBFile file | |
517 | <s> package test . modelgen . table . model ; import java . io . DataInput ; import java . io . DataOutput ; import java . io . IOException ; import javax . annotation . Generated ; import org . apache . hadoop . io . Text ; import org . apache . hadoop . io . Writable ; import com . asakusafw . runtime . value . DateTime ; import com . asakusafw . runtime . value . DateTimeOption ; import com . asakusafw . runtime . value . IntOption ; import com . asakusafw . runtime . value . LongOption ; import com . asakusafw . runtime . value . StringOption ; import com . asakusafw . vocabulary . model . DataModel ; import com . asakusafw . vocabulary . model . Property ; import com . asakusafw . vocabulary . model . TableModel ; @ Generated ( "" ) @ DataModel @ TableModel ( name = "" , columns = { "TEMP_SID" , "SID" , "VERSION_NO" , "TEXTDATA2" , "INTDATA2" , "DATEDATA2" , "RGST_DATE" , "UPDT_DATE" , "" } , primary = { "TEMP_SID" } ) @ SuppressWarnings ( "deprecation" ) public class TempImportTarget2 implements Writable { @ Property ( name = "TEMP_SID" ) private LongOption tempSid = new LongOption ( ) ; @ Property ( name = "SID" ) private LongOption sid = new LongOption ( ) ; @ Property ( name = "VERSION_NO" ) private LongOption versionNo = new LongOption ( ) ; @ Property ( name = "TEXTDATA2" ) private StringOption textdata2 = new StringOption ( ) ; @ Property ( name = "INTDATA2" ) private IntOption intdata2 = new IntOption ( ) ; @ Property ( name = "DATEDATA2" ) private DateTimeOption datedata2 = new DateTimeOption ( ) ; @ Property ( name = "RGST_DATE" ) private DateTimeOption rgstDate = new DateTimeOption ( ) ; @ Property ( name = "UPDT_DATE" ) private DateTimeOption updtDate = new DateTimeOption ( ) ; @ Property ( name = "" ) private StringOption duplicateFlg = new StringOption ( ) ; public long getTempSid ( ) { return this . tempSid . get ( ) ; } public void setTempSid ( long tempSid ) { this . tempSid . modify ( tempSid ) ; } public LongOption getTempSidOption ( ) { return this . tempSid ; } public void setTempSidOption ( LongOption tempSid ) { this . tempSid . copyFrom ( tempSid ) ; } public long getSid ( ) { return this . sid . get ( ) ; } public void setSid ( long sid ) { this . sid . modify ( sid ) ; } public LongOption getSidOption ( ) { | |
518 | <s> package com . asakusafw . compiler . flow . visualizer ; import java . util . UUID ; public interface VisualNode { Kind getKind ( ) ; UUID getId ( ) ; | |
519 | <s> package com . aptana . rdt . internal . ui . preferences ; import org . eclipse . osgi . util . NLS ; public class PreferencesMessages extends NLS { private static final String BUNDLE_NAME = PreferencesMessages . class . getName ( ) ; public static String LicenseConfigurationBlock_company_name_label ; public static String LicenseConfigurationBlock_email_label ; public static String LicenseConfigurationBlock_description ; public static String LicenseConfigurationBlock_license_key_label ; | |
520 | <s> package com . sun . tools . hat . internal . parser ; import java . io . IOException ; import java . io . RandomAccessFile ; class FileReadBuffer implements ReadBuffer { private final RandomAccessFile file ; FileReadBuffer ( RandomAccessFile file ) { this . file = file ; } private void seek ( long pos ) throws IOException { file . getChannel ( ) . position ( pos ) ; } public synchronized void get ( long | |
521 | <s> package org . rubypeople . rdt . internal . ui . preferences ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . runtime . IAdaptable ; import org . eclipse . swt . widgets . Composite ; import org . eclipse . swt . widgets . Control ; import org . eclipse . ui . preferences . IWorkbenchPreferenceContainer ; import org . rubypeople . rdt . internal . ui . RubyPlugin ; public class KeywordPreferencePage extends PropertyAndPreferencePage { public static final String PREF_ID = "" ; public static final String PROP_ID = "" ; private KeywordConfigurationBlock fConfigurationBlock ; public KeywordPreferencePage ( ) { setPreferenceStore ( RubyPlugin . getDefault ( ) . getPreferenceStore ( ) ) ; setDescription ( PreferencesMessages . KeywordPreferencePage_description ) ; setTitle ( PreferencesMessages . KeywordPreferencePage_title ) ; } public void createControl ( Composite parent ) { IWorkbenchPreferenceContainer container = ( IWorkbenchPreferenceContainer ) getContainer ( ) ; fConfigurationBlock = new KeywordConfigurationBlock ( getNewStatusChangedListener ( ) , getProject ( ) , container ) ; super . createControl ( parent ) ; } protected Control createPreferenceContent ( Composite composite ) { return fConfigurationBlock . createContents ( composite ) ; } protected boolean hasProjectSpecificOptions | |
522 | <s> package net . sf . sveditor . core . db . search ; import java . util . regex . Matcher ; import java . util . regex . Pattern ; public class SVDBSearchSpecification { private String fExpr ; private boolean fCaseSensitive ; private boolean fRegExp ; private SVDBSearchType fType ; private SVDBSearchUsage fUsage ; private Pattern fPattern ; public SVDBSearchSpecification ( String expr , boolean case_sensitive , boolean reg_exp , SVDBSearchType type , SVDBSearchUsage usage ) { fExpr = expr ; fCaseSensitive = case_sensitive ; fRegExp = reg_exp ; fType = type ; fUsage = usage ; int flags = 0 ; if ( ! fCaseSensitive ) { flags |= Pattern . CASE_INSENSITIVE ; } if ( ! fRegExp ) { flags |= Pattern . LITERAL ; } fPattern = Pattern . compile ( expr , flags ) ; } public SVDBSearchSpecification ( String expr , boolean case_sensitive , boolean reg_exp ) { this ( expr , case_sensitive , reg_exp , SVDBSearchType . Type , SVDBSearchUsage . All ) ; } public void setSearchType ( SVDBSearchType type ) { fType = type ; } public SVDBSearchType getSearchType ( ) { return | |
523 | <s> package org . rubypeople . rdt . ui . actions ; import org . eclipse . ui . IWorkbenchSite ; import org . eclipse . ui . PlatformUI ; import org . rubypeople . rdt . core . IField ; import org . rubypeople . rdt . core . search . IRubySearchConstants ; import org . rubypeople . rdt . internal . ui . IRubyHelpContextIds ; import org . rubypeople . rdt . internal . ui . RubyPluginImages ; import org . rubypeople . rdt . internal . ui . rubyeditor . RubyEditor ; import org . rubypeople . rdt . internal . ui . search . SearchMessages ; public class FindReadReferencesAction extends FindReferencesAction { public FindReadReferencesAction ( IWorkbenchSite site ) { super ( site ) ; } public FindReadReferencesAction ( RubyEditor editor ) { super ( editor ) ; } Class [ ] getValidTypes ( ) { return new Class [ ] { IField . class } ; } void | |
524 | <s> package com . asakusafw . compiler . flow . mapreduce . parallel ; import java . util . List ; import com . asakusafw . compiler . common . Precondition ; import com . asakusafw . compiler . flow . DataClass ; import com . asakusafw . compiler . flow . DataClass . Property ; public class ResolvedSlot { private Slot source ; private int slotNumber ; private DataClass valueClass ; private List < Property > sortProperties ; public ResolvedSlot ( Slot source , int slotNumber , DataClass valueClass | |
525 | <s> package hudson . jbpm . model ; import hudson . jbpm . ProcessClassLoaderCache ; import hudson . model . Action ; import hudson . model . Hudson ; import java . io . IOException ; import java . lang . reflect . InvocationTargetException ; import javax . servlet . ServletException ; import org . acegisecurity . userdetails . UserDetails ; import org . apache . commons . lang . StringUtils ; import org . jbpm . JbpmConfiguration ; import org . jbpm . JbpmContext ; import org . jbpm . taskmgmt . exe . TaskInstance ; import org . kohsuke . stapler . QueryParameter ; import org . kohsuke . stapler . StaplerRequest ; import org . kohsuke . stapler . StaplerResponse ; public class TaskInstanceWrapper implements Action { private final long taskInstanceId ; private TaskInstance taskInstance ; public TaskInstanceWrapper ( long taskInstanceId ) { this . taskInstanceId = taskInstanceId ; } public TaskInstanceWrapper ( TaskInstance ti ) { this . taskInstance = ti ; taskInstanceId = taskInstance . getId ( ) ; } public long getId ( ) { return taskInstanceId ; } public String getDisplayName ( ) { return null ; } public String getIconFileName ( ) { return null ; } public String getUrlName ( ) { return null ; } public synchronized TaskInstance getTaskInstance ( ) { if ( taskInstance == null ) { JbpmContext context = JbpmConfiguration . getInstance ( ) . getCurrentJbpmContext ( ) ; taskInstance = context . getTaskMgmtSession ( ) . getTaskInstance ( taskInstanceId ) ; } return taskInstance ; } public Object getForm ( ) { TaskInstance ti = getTaskInstance ( ) ; try { ClassLoader processClassLoader = ProcessClassLoaderCache . INSTANCE . getClassLoader ( ti . getProcessInstance ( ) . getProcessDefinition ( ) ) ; String formClass = ( String ) ti . getVariableLocally ( "form" ) ; if ( formClass == null ) { return new Form ( ti ) ; } else { Class < ? > cl = processClassLoader . loadClass ( formClass ) ; return cl . getConstructor ( TaskInstance . class ) . newInstance ( ti ) ; } } catch ( InvocationTargetException e ) { throw new RuntimeException ( e . getCause ( ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } public void doTriggerTransition ( StaplerRequest req , StaplerResponse rsp , @ QueryParameter ( "transition" ) String transition ) throws ServletException , IOException { JbpmContext context = JbpmConfiguration . getInstance ( ) . getCurrentJbpmContext ( ) ; TaskInstance taskInstance = getTaskInstance ( ) ; if ( | |
526 | <s> package com . asakusafw . dmdl . spi ; import com . asakusafw . dmdl | |
527 | <s> package net . sf . sveditor . core ; import java . io . IOException ; import java . io . InputStream ; import java . io . StringReader ; public class StringInputStream extends InputStream { private StringReader fReader ; private int fLastC ; public StringInputStream ( String content ) { fReader | |
528 | <s> package org . oddjob . jmx . server ; import java . util . ArrayList ; import java . util . List ; import org . oddjob . logging . ConsoleArchiver ; import org . oddjob . logging . LogArchiver ; import org . oddjob . logging . LogEvent ; import org . oddjob . logging . LogLevel ; import org . oddjob . logging . LogListener ; public class LogArchiverHelper { static class LL implements LogListener { final List < LogEvent > events = new ArrayList < LogEvent > ( ) ; public void logEvent ( LogEvent logEvent ) { events . add ( logEvent ) ; } } public static LogEvent [ ] retrieveLogEvents ( Object component , LogArchiver archiver , Long last , Integer max ) { if ( archiver == null ) { throw new NullPointerException ( "" ) ; } LL ll = new LL ( ) ; archiver . addLogListener ( ll , component , LogLevel . DEBUG , last . longValue ( ) , max . intValue ( ) ) ; archiver . removeLogListener ( ll , component ) ; return ( LogEvent [ ] ) ll . events . toArray ( new LogEvent [ 0 ] ) ; } public static String consoleId ( Object component , ConsoleArchiver archiver ) { String consoleId = archiver . consoleIdFor ( component ) ; if ( consoleId | |
529 | <s> package com . asakusafw . compiler . flow . processor . flow ; import com . asakusafw . compiler . flow . processor . BranchFlowProcessor ; import com . asakusafw . compiler . flow . processor . operator . MasterBranchFlowFactory ; import com . asakusafw . compiler . flow . processor . operator . MasterBranchFlowFactory . WithParameter ; import com . asakusafw . compiler . flow . testing . external . Ex1MockExporterDescription ; import com . asakusafw . compiler . flow . testing . external . Ex1MockImporterDescription ; import com . asakusafw . compiler . flow . testing . external . Ex2MockImporterDescription ; import com . asakusafw . compiler . flow . testing . model . Ex1 ; import com . asakusafw . compiler . flow . testing . model . | |
530 | <s> package org . rubypeople . rdt . internal . core . util ; import java . util . Map ; import org . eclipse . jface . text . IDocument ; import org . eclipse . jface . text . TextUtilities ; import org . eclipse . text . edits . InsertEdit ; import org . eclipse . text . edits . MultiTextEdit ; import org . eclipse . text . edits . TextEdit ; import org . eclipse . text . edits . TextEditGroup ; import org . jruby . ast . Node ; import org . jruby . lexer . yacc . ISourcePosition ; public class ASTRewrite { private Node ast ; private TextEdit currentEdit ; private String lineDelim ; protected ASTRewrite ( Node ast , IDocument document ) { this . ast = ast ; TextEdit edit = new MultiTextEdit ( ) ; this . lineDelim = TextUtilities . getDefaultLineDelimiter ( document ) ; this . currentEdit = edit ; } public static ASTRewrite create ( Node ast , IDocument document ) { return new ASTRewrite ( ast , document ) ; } public TextEdit rewriteAST ( IDocument document , Map options ) { return currentEdit ; } final void doTextInsert ( int offset , String insertString ) { if ( insertString . | |
531 | <s> package com . asakusafw . compiler . flow . example ; import com . asakusafw . compiler . operator . model . MockHoge ; import com . asakusafw . vocabulary . flow . Export ; import com . asakusafw . vocabulary . flow . FlowDescription ; import com . asakusafw . vocabulary . flow . Import ; import com . asakusafw . vocabulary . flow . In ; import com . asakusafw . vocabulary . flow . JobFlow ; import com . asakusafw . vocabulary . flow . Out ; @ JobFlow ( name = "testing" ) public class WithExportInput extends FlowDescription { private In < MockHoge > in ; private Out < | |
532 | <s> package net . sf . sveditor . core . tests . index ; import java . io . File ; import java . io . InputStream ; import junit . framework . TestCase ; import net . sf . sveditor . core . SVCorePlugin ; import net . sf . sveditor . core . db . SVDBFile ; import net . sf . sveditor . core . db . index . AbstractSVDBIndex ; import net . sf . sveditor . core . db . index . ISVDBIndex ; import net . sf . sveditor . core . db . index . ISVDBItemIterator ; import net . sf . sveditor . core . db . index . SVDBArgFileIndexFactory ; import net . sf . sveditor . core . db . index . SVDBIndexRegistry ; import net . sf . sveditor . core . db . index . SVDBLibPathIndexFactory ; import net . sf . sveditor . core . db . index . SVDBSourceCollectionIndexFactory ; import net . sf . sveditor . core . tests . SVCoreTestsPlugin ; import net . sf . sveditor . core . tests . SaveMarkersFileSystemProvider ; import net . sf . sveditor . core . tests . TestIndexCacheFactory ; import net . sf . sveditor . core . tests . utils . BundleUtils ; import net . sf . sveditor . core . tests . utils . TestUtils ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . runtime . NullProgressMonitor ; public class TestIndexMissingIncludeDefine extends TestCase { private File fTmpDir ; @ Override protected void setUp ( ) throws Exception { super . setUp ( ) ; fTmpDir = TestUtils . createTempDir ( ) ; } @ Override protected void tearDown ( ) throws Exception { super . tearDown ( ) ; SVDBIndexRegistry rgy = SVCorePlugin . getDefault ( ) . getSVDBIndexRegistry ( ) ; rgy . save_state ( ) ; if ( fTmpDir != null ) { TestUtils . delete ( fTmpDir ) ; fTmpDir = null ; } } public void testWSLibMissingIncludeDefine ( ) { SVCorePlugin . getDefault ( ) . enableDebug ( false ) ; BundleUtils utils = new BundleUtils ( SVCoreTestsPlugin . getDefault ( ) . getBundle ( ) ) ; IProject project_dir = TestUtils . createProject ( "project" ) ; utils . copyBundleDirToWS ( "" , project_dir ) ; File db = new File ( fTmpDir , "db" ) ; if ( db . exists ( ) ) { db . delete ( ) ; } SVDBIndexRegistry rgy = SVCorePlugin . getDefault ( ) . getSVDBIndexRegistry ( ) ; rgy . init ( TestIndexCacheFactory . instance ( fTmpDir ) ) ; ISVDBIndex index = rgy . findCreateIndex ( new NullProgressMonitor ( ) , "GENERIC" , "" , SVDBLibPathIndexFactory . TYPE , null ) ; int_TestMissingIncludeDefine ( index , "" , 2 ) ; } public void testWSArgFileMissingIncludeDefine ( ) { BundleUtils utils = new BundleUtils ( SVCoreTestsPlugin . getDefault ( ) . getBundle ( ) ) ; IProject project_dir = TestUtils . createProject ( "project" ) ; utils . copyBundleDirToWS ( "" , project_dir ) ; File db = new File ( fTmpDir , "db" ) ; if ( db . exists ( ) ) { db . delete ( ) ; } SVDBIndexRegistry rgy = SVCorePlugin . getDefault ( ) . getSVDBIndexRegistry ( ) ; rgy . init ( TestIndexCacheFactory . instance ( fTmpDir ) ) ; ISVDBIndex index = rgy . findCreateIndex ( new NullProgressMonitor ( ) , "GENERIC" , "" , SVDBArgFileIndexFactory . TYPE , null ) ; int_TestMissingIncludeDefine ( index , "" , 2 ) ; } public void testWSSourceCollectionMissingIncludeDefine ( ) { BundleUtils utils = new BundleUtils ( SVCoreTestsPlugin . getDefault ( ) . getBundle ( ) ) ; SVCorePlugin . getDefault ( ) . enableDebug ( false ) ; IProject project_dir = TestUtils . createProject ( "" ) ; utils . copyBundleDirToWS ( "" , project_dir ) ; File db = new File ( | |
533 | <s> package de . fuberlin . wiwiss . d2rq . vocab ; import com . hp . hpl . jena . rdf . model . * ; public class ISWC { private static Model m_model = ModelFactory . createDefaultModel ( ) ; public static final String NS = "" ; public static String getURI ( ) { return NS ; } public static final Resource NAMESPACE = m_model . createResource ( NS ) ; public static final Property persons_involved = m_model . createProperty ( "" ) ; public static final Property conference = m_model . createProperty ( "" ) ; public static final Property formal_language = m_model . createProperty ( "" ) ; public static final Property application_domain = m_model . createProperty ( "" ) ; public static final Property algorithm = m_model . createProperty ( "" ) ; public static final Property tool = m_model . createProperty ( "" ) ; public static final Property hasSubtopic = m_model . createProperty ( "" ) ; public static final Property has_affiliate = m_model . createProperty ( "" ) ; public static final Property is_about = m_model . createProperty ( "" ) ; public static final Property funding_by = m_model . createProperty ( "" ) ; public static final Property involved_in_project = m_model . createProperty ( "" ) ; public static final Property application = m_model . createProperty ( "" ) ; public static final Property has_affiliation = m_model . createProperty ( "" ) ; public static final Property topic = m_model . createProperty ( "" ) ; public static final Property author = m_model . createProperty ( "" ) ; public static final Property organizations_involved = m_model . createProperty ( "" ) ; public static final Property research_topics = m_model . createProperty ( "" ) ; public static final Property method = m_model . createProperty ( "" ) ; public static final Property name = m_model . createProperty ( "" ) ; public static final Property phone = m_model . createProperty ( "" ) ; public static final Property country = m_model . createProperty ( "" ) ; public static final Property location = m_model . createProperty ( "" ) ; public static final Property email = m_model . createProperty ( "" ) ; public static final Property eventTitle = m_model . createProperty ( "" ) ; public | |
534 | <s> package com . asakusafw . yaess . jobqueue ; import java . io . IOException ; import java . text . MessageFormat ; import java . util . Collections ; import java . util . HashMap ; import java . util . Map ; import java . util . concurrent . Callable ; import java . util . concurrent . CancellationException ; import java . util . concurrent . ExecutionException ; import java . util . concurrent . ExecutorService ; import java . util . concurrent . Executors ; import java . util . concurrent . Future ; import java . util . concurrent . ThreadFactory ; import java . util . concurrent . TimeUnit ; import java . util . concurrent . TimeoutException ; import java . util . concurrent . atomic . AtomicInteger ; import org . slf4j . Logger ; import org . slf4j . LoggerFactory ; import com . asakusafw . yaess . basic . ExitCodeException ; import com . asakusafw . yaess . core . ExecutionContext ; import com . asakusafw . yaess . core . ExecutionMonitor ; import com . asakusafw . yaess . core . ExecutionScript ; import com . asakusafw . yaess . core . ExecutionScriptHandlerBase ; import com . asakusafw . yaess . core . HadoopScript ; import com . asakusafw . yaess . core . HadoopScriptHandler ; import com . asakusafw . yaess . core . ServiceProfile ; import com . asakusafw . yaess . core . YaessLogger ; import com . asakusafw . yaess . jobqueue . client . JobClient ; import com . asakusafw . yaess . jobqueue . client . JobId ; import com . asakusafw . yaess . jobqueue . client . JobScript ; import com . asakusafw . yaess . jobqueue . client . JobStatus ; public class QueueHadoopScriptHandler extends ExecutionScriptHandlerBase implements HadoopScriptHandler { static final String CLEANUP_STAGE_CLASS = "" ; static final YaessLogger YSLOG = new YaessJobQueueLogger ( QueueHadoopScriptHandler . class ) ; static final Logger LOG = LoggerFactory . getLogger ( QueueHadoopScriptHandler . class ) ; private static final ExecutorService TIMEOUT_THREAD = Executors . newCachedThreadPool ( new ThreadFactory ( ) { private final AtomicInteger counter = new AtomicInteger ( ) ; @ Override public Thread newThread ( Runnable r ) { Thread thread = new Thread ( r , String . format ( "" , counter . incrementAndGet ( ) ) ) ; thread . setDaemon ( true ) ; return thread ; } } ) ; private volatile JobClientProvider clients ; private volatile long timeout ; private volatile long pollingInterval ; @ Override protected void doConfigure ( ServiceProfile < ? > profile , Map < String , String > desiredProperties , Map < String , String > desiredEnvironmentVariables ) throws InterruptedException , IOException { if ( desiredEnvironmentVariables . isEmpty ( ) == false ) { throw new IOException ( MessageFormat . format ( "" , getClass ( ) . getName ( ) , profile . getPrefix ( ) , KEY_ENV_PREFIX , desiredEnvironmentVariables ) ) ; } desiredEnvironmentVariables . put ( ExecutionScript . ENV_ASAKUSA_HOME , "DUMMY" ) ; JobClientProfile p ; try { p = JobClientProfile . convert ( profile ) ; } catch ( IllegalArgumentException e ) { throw new IOException ( MessageFormat . format ( "" , profile . getPrefix ( ) ) , e ) ; } doConfigure ( p ) ; } void doConfigure ( JobClientProfile p ) { this . timeout = p . getTimeout ( ) ; this . pollingInterval = p . getPollingInterval ( ) ; this . clients = new JobClientProvider ( p . getClients ( ) ) ; } @ Override public void execute ( ExecutionMonitor monitor , ExecutionContext context , HadoopScript script ) throws InterruptedException , IOException { run ( monitor , context , script ) ; } @ Override public void cleanUp ( ExecutionMonitor monitor , ExecutionContext context ) throws InterruptedException , IOException { HadoopScript script = new HadoopScript ( context . getPhase ( ) . getSymbol ( ) , Collections . < String > emptySet ( ) , CLEANUP_STAGE_CLASS , Collections . < String , String > emptyMap ( ) , Collections . < String , String > emptyMap ( ) ) ; run ( monitor , context , script ) ; } private void run ( ExecutionMonitor monitor , ExecutionContext context , HadoopScript script ) throws InterruptedException , IOException { assert monitor != null ; assert context != null ; assert script != null ; monitor . open ( 100 ) ; try { monitor . checkCancelled ( ) ; JobInfo info = registerScript ( monitor , context , script ) ; monitor . progressed ( 5 ) ; monitor . checkCancelled ( ) ; submitScript ( context , info ) ; monitor . progressed ( 5 ) ; monitor . checkCancelled ( ) ; YSLOG . info ( "I01005" , info . script . getBatchId ( ) , info . script . getFlowId ( ) , info . script . getPhase ( ) , info . script . getExecutionId ( ) , info . script . getStageId ( ) , info . client , info . id ) ; long start = System . currentTimeMillis ( ) ; try { JobStatus . Kind lastKind = JobStatus . Kind . INITIALIZED ; while ( true ) { JobStatus status = poll ( context , info ) ; JobStatus . Kind currentKind = status . getKind ( ) ; if ( lastKind . compareTo ( currentKind ) < 0 ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "" , new Object [ ] { lastKind , currentKind , info , } ) ; } switch ( currentKind ) { case WAITING : break ; case RUNNING : monitor . progressed ( 10 ) ; break ; case COMPLETED : case ERROR : checkError ( context , info , status ) ; return ; default : throw new AssertionError ( currentKind ) ; } } lastKind = currentKind ; monitor . checkCancelled ( ) ; Thread . sleep ( pollingInterval ) ; } } finally { long end = System . currentTimeMillis ( ) ; YSLOG . info ( "I01006" , info . script . getBatchId ( ) , info . script . getFlowId ( ) , info . script . getPhase ( ) , info . script . getExecutionId ( ) , info . script . getStageId ( ) , info . client , info . id , end - start ) ; } } finally { monitor . close ( ) ; } } private JobInfo registerScript ( ExecutionMonitor monitor , ExecutionContext context , HadoopScript script ) throws InterruptedException , IOException { assert monitor != null ; assert context != null ; assert script != null ; JobScript job = convert ( context , script ) ; for ( int i = 1 , n = clients . count ( ) * 2 ; i | |
535 | <s> package com . asakusafw . dmdl . thundergate . model ; import java . text . MessageFormat ; public class ModelReference { private String simpleName ; public ModelReference ( String simpleName ) { if ( simpleName == null ) { throw new IllegalArgumentException ( "" | |
536 | <s> package net . sf . sveditor . ui . wizards ; import net . sf . sveditor . core . srcgen . NewInterfaceGenerator ; import net . sf . sveditor . ui . SVUiPlugin ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . runtime . IProgressMonitor ; public class NewSVInterfaceWizard extends AbstractNewSVItemFileWizard { public static final String ID = SVUiPlugin . PLUGIN_ID + "" ; public NewSVInterfaceWizard ( ) { super ( ) ; } @ Override protected AbstractNewSVItemFileWizardPage createPage ( ) { return new NewSVInterfaceWizardPage ( ) ; } @ Override protected void generate ( IProgressMonitor monitor , IFile | |
537 | <s> package net . sf . sveditor . core . scanner ; import java . io . File ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . HashSet ; import java . util . List ; import java . util . Map ; import java . util . Set ; import net . sf . sveditor . core . db . ISVDBItemBase ; import net . sf . sveditor . core . db . ISVDBNamedItem ; import net . sf . sveditor . core . db . ISVDBScopeItem ; import net . sf . sveditor . core . db . SVDBFile ; import net . sf . sveditor . core . db . SVDBItemType ; import net . sf . sveditor . core . db . SVDBMacroDef ; import net . sf . sveditor . core . db . index . SVDBFileTree ; import net . sf . sveditor . core . db . index . cache . ISVDBIndexCache ; import net . sf . sveditor . core . log . LogFactory ; import net . sf . sveditor . core . log . LogHandle ; import org . eclipse . core . runtime . NullProgressMonitor ; public class SVFileTreeMacroProvider implements IPreProcMacroProvider { private ISVDBIndexCache fIndexCache ; private Map < String , SVDBMacroDef > fMacroCache ; private Set < String > fMissingIncludes ; private SVDBFileTree fContext ; private boolean fFirstSearch ; private int fLastLineno ; private LogHandle fLog ; private static final boolean fDebugEn = false ; public SVFileTreeMacroProvider ( ISVDBIndexCache cache , SVDBFileTree context , Set < String > missing_includes ) { fLog = LogFactory . getLogHandle ( "" ) ; fContext = context ; fIndexCache = cache ; fMacroCache = new HashMap < String , SVDBMacroDef > ( ) ; if ( missing_includes != null ) { fMissingIncludes = missing_includes ; } else { fMissingIncludes = new HashSet < String > ( ) ; } fFirstSearch = true ; fLastLineno = 0 ; } public void addMacro ( SVDBMacroDef macro ) { if ( fMacroCache . containsKey ( macro . getName ( ) ) ) { fMacroCache . remove ( macro . getName ( ) ) ; } fMacroCache . put ( macro . getName ( ) , macro ) ; } public void setMacro ( String key , String value ) { if ( fMacroCache . containsKey ( key ) ) { fMacroCache . get ( key ) . setDef ( value ) ; } else { fMacroCache . put ( key , new SVDBMacroDef ( key , value ) ) ; } } public SVDBMacroDef findMacro ( String name , int lineno ) { if ( fFirstSearch ) { collectParentFileMacros ( ) ; fFirstSearch = false ; } if ( fLastLineno < lineno ) { collectThisFileMacros ( lineno ) ; fLastLineno = lineno ; } SVDBMacroDef m = fMacroCache . get ( name ) ; return m ; } private void collectParentFileMacros ( ) { List < SVDBFileTree > file_list = new ArrayList < SVDBFileTree > ( ) ; if ( fDebugEn ) { fLog . debug ( "" ) ; } if ( fContext == null ) { return ; } SVDBFileTree ib = fContext ; file_list . add ( ib ) ; while ( ib . getIncludedByFiles ( ) . size ( ) > 0 ) { String ib_s = ib . getIncludedByFiles ( ) . get ( 0 ) ; ib = fIndexCache . getFileTree ( new NullProgressMonitor ( ) , ib_s ) ; file_list . add ( ib ) ; } for ( int i = file_list . size ( ) - 1 ; i > 0 ; i -- ) { SVDBFile this_file = file_list . get ( i ) . getSVDBFile ( ) ; SVDBFile next_file = file_list . get ( i - 1 ) . getSVDBFile ( ) ; if ( fDebugEn ) { fLog . enter ( "" + this_file . getName ( ) + "\" (next " + next_file . getName ( ) + ")" ) ; } if ( this_file != null ) { collectMacroDefs ( file_list . get ( i ) , this_file , next_file ) ; } if ( fDebugEn ) { fLog . leave ( "" + this_file . getName ( ) + "\" (next " + next_file . getName ( ) + ")" ) ; } } } private boolean collectMacroDefs ( SVDBFileTree file , ISVDBScopeItem scope , SVDBFile stop_pt ) { for ( ISVDBItemBase it : scope . getItems ( ) ) { if ( it . getType ( ) == SVDBItemType . MacroDef ) { addMacro ( ( SVDBMacroDef ) it ) ; } else if ( it . getType ( ) == SVDBItemType . Include ) { String leaf = ( ( ISVDBNamedItem ) it ) . getName ( ) ; if ( stop_pt != null && stop_pt . getName ( ) . endsWith ( ( ( ISVDBNamedItem ) it ) . getName | |
538 | <s> package com . asakusafw . compiler . operator ; import java . lang . annotation . Annotation ; import java . util . Arrays ; import java . util . Collections ; import java . util . List ; import javax . lang . model . element . ExecutableElement ; import javax . lang . model . element . VariableElement ; import javax . lang . model . type . TypeKind ; import javax . lang . model . type . TypeMirror ; import javax . lang . model . util . Types ; import com . asakusafw . compiler . common . Precondition ; import com . asakusafw . compiler . operator . OperatorPortDeclaration . Kind ; import com . asakusafw . compiler . operator . OperatorProcessor . Context ; import com . asakusafw . utils . collections . Lists ; import com . asakusafw . utils . java . jsr269 . bridge . Jsr269 ; import com . asakusafw . utils . java . model . syntax . DocElement ; import com . asakusafw . utils . java . model . syntax . Expression ; import com . asakusafw . utils . java . model . syntax . ModelFactory ; import com . asakusafw . utils . java . model . util . ImportBuilder ; import com . asakusafw . utils . java . model . util . Models ; import com . asakusafw . utils . java . model . util . TypeBuilder ; import com . asakusafw . vocabulary . flow . graph . FlowElementAttribute ; import com . asakusafw . vocabulary . flow . graph . OperatorHelper ; import com . asakusafw . vocabulary . flow . graph . ShuffleKey ; public class OperatorMethodDescriptor { private final Class < ? extends Annotation > annotationType ; private final List < DocElement > documentation ; private final String name ; private final List < OperatorPortDeclaration > inputPorts ; private final List < OperatorPortDeclaration > outputPorts ; private final List < OperatorPortDeclaration > parameters ; private final List < Expression > attributes ; public OperatorMethodDescriptor ( Class < ? extends Annotation > annotationType , List < DocElement > documentation , String name , List < OperatorPortDeclaration > inputPorts , List < OperatorPortDeclaration > outputPorts , List < OperatorPortDeclaration > parameters , List < Expression > attributes ) { Precondition . checkMustNotBeNull ( annotationType , "" ) ; Precondition . checkMustNotBeNull ( documentation , "" ) ; Precondition . checkMustNotBeNull ( name , "name" ) ; Precondition . checkMustNotBeNull ( inputPorts , "inputPorts" ) ; Precondition . checkMustNotBeNull ( outputPorts , "outputPorts" ) ; Precondition . checkMustNotBeNull ( parameters , "parameters" ) ; this . annotationType = annotationType ; this . documentation = Lists . freeze ( documentation ) ; this . name = name ; this . inputPorts = Lists . freeze ( inputPorts ) ; this . outputPorts = Lists . freeze ( outputPorts ) ; this . parameters = Lists . freeze ( parameters ) ; this . attributes = Lists . freeze ( attributes ) ; } public Class < ? extends Annotation > getAnnotationType ( ) { return annotationType ; } public List < DocElement > getDocumentation ( ) { return documentation ; } public String getName ( ) { return name ; } public List < OperatorPortDeclaration > getInputPorts ( ) { return inputPorts ; } public List < OperatorPortDeclaration > getOutputPorts ( ) { return outputPorts ; } public List < OperatorPortDeclaration > getParameters ( ) { return parameters ; } public List < Expression > getAttributes ( ) { return attributes ; } public static class Builder { private final Class < ? extends Annotation > annotationType ; private List < DocElement > operatorDescription ; private final String name ; private final List < OperatorPortDeclaration > inputPorts ; private final List < OperatorPortDeclaration > outputPorts ; private final List < OperatorPortDeclaration > parameters ; private final List < Expression > attributes ; private final Context context ; public Builder ( Class | |
539 | <s> package com . asakusafw . vocabulary . operator ; import java . lang . annotation . Documented ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; import com . asakusafw . vocabulary . flow . util . CoreOperatorFactory ; | |
540 | <s> package com . asakusafw . yaess . core . task ; import java . io . IOException ; import com . asakusafw . yaess . core . ExecutionContext ; import com . asakusafw . yaess | |
541 | <s> package de . fuberlin . wiwiss . d2rq . engine ; import java . util . ArrayList ; import java . util . Collection ; import java . util . Collections ; import java . util . Iterator ; import java . util . List ; import com . hp . hpl . jena . graph . Triple ; import de . fuberlin . wiwiss . d2rq . algebra . NodeRelation ; import de . fuberlin . wiwiss . d2rq . algebra . Relation ; import de . fuberlin . wiwiss . d2rq . algebra . TripleRelation ; public class GraphPatternTranslator { private final List < Triple > triplePatterns ; private final Collection < TripleRelation > tripleRelations ; boolean useAllOptimizations ; public GraphPatternTranslator ( List < Triple > triplePatterns , Collection < TripleRelation > tripleRelations , boolean useAllOptimizations ) { this . triplePatterns = triplePatterns ; this . tripleRelations = tripleRelations ; this . useAllOptimizations = useAllOptimizations ; } public List < NodeRelation > translate ( ) { if ( triplePatterns . isEmpty ( ) ) { return Collections . singletonList ( NodeRelation . TRUE ) ; } Iterator < Triple > it = triplePatterns . iterator ( ) ; List < CandidateList > candidateLists = new ArrayList < CandidateList > ( triplePatterns . size ( ) ) ; int index = 1 ; while ( it . hasNext ( ) ) { Triple triplePattern = ( Triple ) it . next ( ) ; CandidateList candidates = new CandidateList ( triplePattern , triplePatterns . size ( ) > 1 , index ) ; if ( candidates . isEmpty ( ) ) { return Collections . < NodeRelation > emptyList ( ) ; } | |
542 | <s> package de . fuberlin . wiwiss . d2rq . mapgen ; import java . util . List ; import junit . framework . TestCase ; import de . fuberlin . wiwiss . d2rq . mapgen . Filter . IdentifierMatcher ; import de . fuberlin . wiwiss . d2rq . mapgen . FilterParser . ParseException ; public class FilterParserTest extends TestCase { public void testEmpty ( ) throws ParseException { assertEquals ( "" , toString ( new FilterParser ( "" ) . parse ( ) ) ) ; } public void testSimple ( ) throws ParseException { assertEquals ( "'foo'" , toString ( new FilterParser ( "foo" ) . parse ( ) ) ) ; } public void testMultipleStrings ( ) throws ParseException { assertEquals ( "'foo'.'bar'" , toString ( new FilterParser ( "foo.bar" ) . parse ( ) ) ) ; } public void testMultipleFilters ( ) throws ParseException { assertEquals ( "'foo','bar'" , toString ( new FilterParser ( "foo,bar" ) . parse ( ) ) ) ; } public void testMultipleFiltersNewline ( ) throws ParseException { assertEquals ( "'foo','bar'" , toString ( new FilterParser ( "foonrbar" ) . parse ( ) ) ) ; } public void testRegex ( ) throws ParseException { assertEquals ( "/foo/0" , toString ( new FilterParser ( "/foo/" ) . parse ( ) ) ) ; } public void testRegexWithFlag ( ) throws ParseException { assertEquals ( "/foo/2" , toString ( new FilterParser ( "/foo/i" ) . parse ( ) ) ) ; } public void testMutlipleRegexes ( ) throws ParseException { assertEquals ( "" , toString ( new FilterParser ( "/foo/./bar/" ) . parse ( ) ) ) ; } public void testMutlipleRegexFilters ( ) throws ParseException { assertEquals ( "" , toString ( new FilterParser ( "/foo/,/bar/" ) . parse ( ) ) ) ; } public void testDotInRegex ( ) throws ParseException { assertEquals ( "/foo.bar/0" , toString ( new FilterParser ( "/foo.bar/" ) . parse ( ) ) ) ; } public void testEscapedDotInRegex ( ) throws ParseException { assertEquals ( "/foo\\.bar/0" , toString ( new FilterParser ( "/foo\\.bar/" ) . parse ( ) ) ) ; } public void testCommaInRegex ( ) throws ParseException { assertEquals ( "/foo,bar/0" , toString ( new FilterParser ( "/foo,bar/" ) . parse ( ) ) ) ; } public void testIncompleteRegex ( ) { try { new FilterParser ( "/foo" ) . parse ( ) ; fail ( "" ) ; } catch ( ParseException ex ) { } } public void testIncompleteRegexNewline ( ) { try { new FilterParser ( "/foonbar/" ) . parse ( ) ; fail ( "" ) ; } catch ( ParseException ex ) { } } public void testComplex ( ) throws ParseException { assertEquals ( "" , toString ( new FilterParser ( "" ) . parse ( ) ) ) ; } public void testParseAsSchemaFilter ( ) throws ParseException { Filter result = new FilterParser ( "" ) . parseSchemaFilter ( ) ; assertTrue ( result . matchesSchema ( "schema1" ) ) ; assertTrue ( result . matchesSchema ( "schema2" ) ) ; assertFalse ( result . matchesSchema ( "schema3" ) ) ; assertFalse ( result . matchesSchema ( null ) ) ; } public void testParseAsSchemaFilterWithRegex ( ) throws ParseException { Filter result = new FilterParser ( "" ) . parseSchemaFilter ( ) ; assertTrue ( result . matchesSchema ( "schema1" ) ) ; assertTrue ( result . matchesSchema ( "SCHEMA2" ) ) ; assertFalse ( result . matchesSchema ( "schema3" ) ) ; assertFalse ( result . matchesSchema ( null ) ) ; } public void testParseAsSchemaFilterFail ( ) { try { new FilterParser ( "schema.table" ) . parseSchemaFilter ( ) ; fail ( "" ) ; } catch ( ParseException ex ) { } } public void testParseAsTableFilter ( ) throws ParseException { Filter result = new FilterParser ( "" ) . parseTableFilter ( false ) ; assertTrue ( result . matchesTable ( "schema" , "table1" ) ) ; assertTrue ( result . matchesTable ( "schema" , "table2" ) ) ; assertTrue ( result . matchesTable ( null , "table3" ) ) ; assertFalse ( result . matchesTable ( "schema" , "table3" ) ) ; assertFalse ( result . matchesTable ( "schema" , "table4" ) ) ; | |
543 | <s> package net . sf . sveditor . core . tests ; import java . io . InputStream ; import java . util . ArrayList ; import java . util . List ; import net . sf . sveditor . core . SVCorePlugin ; import net . sf . sveditor . core . db . ISVDBFileFactory ; import net . sf . sveditor . core . db . ISVDBItemBase ; import net . sf . sveditor . core . db . SVDBFile ; import net . sf . | |
544 | <s> package com . asakusafw . compiler . bulkloader . testing . io ; import java . io . IOException ; import com . asakusafw . compiler . bulkloader . testing . model . MockErrorModel ; import com . asakusafw . runtime . io . ModelInput ; import com . asakusafw . runtime . io . RecordParser ; public final class MockErrorModelInput implements ModelInput < MockErrorModel > { private final RecordParser parser ; public MockErrorModelInput ( RecordParser parser ) { if ( parser == null ) { throw new IllegalArgumentException ( "parser" ) ; } this . parser = parser ; } @ Override public boolean readTo ( MockErrorModel model ) throws IOException { if ( parser . next ( ) == false ) { return false ; } parser . fill ( model . getAOption ( ) ) ; parser . fill | |
545 | <s> package org . rubypeople . rdt . refactoring . core . pullup ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collection ; import org . rubypeople . rdt . refactoring . classnodeprovider . ClassNodeProvider ; import org . rubypeople . rdt . refactoring . documentprovider . DocumentProvider ; import org . rubypeople . rdt . refactoring . editprovider . DeleteEditProvider ; import org . rubypeople . rdt . refactoring . editprovider . EditAndTreeContentProvider ; import org . rubypeople . rdt . refactoring . editprovider . EditProvider ; import org . rubypeople . rdt . refactoring . editprovider . EditProviderGroups ; import org . rubypeople . rdt . refactoring . editprovider . ITreeClass ; import org . rubypeople . rdt . refactoring . nodewrapper . ClassNodeWrapper ; import org . rubypeople . rdt . refactoring . nodewrapper . MethodNodeWrapper ; import org . rubypeople . rdt . refactoring . ui . IItemSelectionReceiver ; import org . rubypeople . rdt . refactoring . ui . IParentProvider ; public class MethodUpPuller extends EditAndTreeContentProvider implements IItemSelectionReceiver { private Object [ ] selectedTreeItems ; private ClassNodeProvider projectClassNodeProvider ; private ClassNodeProvider classNodeProvider ; public MethodUpPuller ( DocumentProvider documentProvider ) { this . projectClassNodeProvider = documentProvider . getProjectClassNodeProvider ( ) ; | |
546 | <s> package com . pogofish . jadt . samples . ast ; import static com . pogofish . jadt . samples . ast . data . Arg . * ; import static com . pogofish . jadt . samples . ast . data . Expression . * ; import static com . pogofish . jadt . samples . ast . data . Function . * ; import static com . pogofish . jadt . samples . ast . data . Statement . * ; import static com . pogofish . jadt . samples . ast . data . Type . * ; import static java . util . Arrays . asList ; import java . util . HashSet ; import java . util . List ; import java . util . Set ; import com . pogofish . jadt . samples . ast . data . * ; public class Usage { public Function sampleFunction ( ) { Function sampleFunction = _Function ( _Int ( ) , "addTwo" , asList ( _Arg ( _Int ( ) , "x" ) , _Arg ( _Int ( ) , "y" ) ) , asList ( _Return ( _Add ( _Variable ( "x" ) , _Variable ( "y" ) ) ) ) ) ; return sampleFunction ; } public Set < Integer > expressionLiterals ( Expression expression ) { return expression . match ( new Expression . MatchBlock < Set < Integer > > ( ) { @ Override public Set < Integer > _case ( Add x ) { final Set < Integer > results = expressionLiterals ( x . left ) ; results . addAll ( expressionLiterals ( x . right ) ) ; return results ; } @ Override public Set < Integer > _case ( Variable x ) { return new HashSet < Integer > ( ) ; } @ Override public Set < Integer > _case ( IntLiteral x | |
547 | <s> package org . rubypeople . rdt . internal . ui . search ; import org . eclipse . jface . viewers . DecoratingLabelProvider ; import org . eclipse . jface . viewers . IColorProvider ; import org . eclipse . jface . viewers . ILabelDecorator ; import org . eclipse . jface . viewers . ILabelProvider ; import org . eclipse . swt . graphics . Color ; public class ColorDecoratingLabelProvider extends DecoratingLabelProvider implements IColorProvider { public ColorDecoratingLabelProvider ( ILabelProvider provider , ILabelDecorator decorator ) { super ( provider , decorator ) ; } | |
548 | <s> package net . sf . sveditor . ui . editor . actions ; import java . util . ResourceBundle ; import net . sf . sveditor . core . scanner . SVCharacter ; import net . sf . sveditor . ui . editor . SVEditor ; import org . eclipse . jface . text . source . ISourceViewer ; import org . eclipse . swt . custom . StyledText ; import org . eclipse . swt . graphics . Point ; import org . eclipse . ui . texteditor . TextEditorAction ; public class SelPrevWordAction extends TextEditorAction { private SVEditor fEditor ; public SelPrevWordAction ( ResourceBundle bundle , String prefix , SVEditor editor ) { super ( bundle , prefix , editor ) ; fEditor = editor ; } @ Override public void run ( ) { ISourceViewer sv = fEditor . sourceViewer ( ) ; StyledText text = fEditor . sourceViewer ( ) . getTextWidget ( ) ; int offset = text . getCaretOffset ( ) ; int start_offset = offset ; if ( text . getSelection ( ) != null ) { Point sel = text . getSelection ( ) ; if ( sel . x == offset ) { start_offset = sel . y ; } else if ( sel . y == offset ) { start_offset = sel . x ; } } String str = text . getText ( ) ; offset -- ; if ( offset < 0 ) { return ; } int ch = str . charAt ( offset ) ; if ( SVCharacter . isSVIdentifierPart ( ch ) ) { while ( offset >= 0 ) { ch = str . charAt ( offset ) ; if ( ! SVCharacter . isSVIdentifierPart ( ch ) ) { | |
549 | <s> package com . asakusafw . runtime . flow . join ; import java . io . IOException ; import java . util . ArrayList ; import java . util . Collections ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; public class VolatileLookUpTable < T > implements LookUpTable < T > { private final Map < LookUpKey , List < T > > entity ; public VolatileLookUpTable ( Map < LookUpKey , List < T > > entity ) { if ( entity == null ) { throw new IllegalArgumentException ( "" ) ; } this . entity = entity ; } @ Override public List < T > get ( LookUpKey key ) { if ( key == null ) { throw new IllegalArgumentException ( "" ) ; } List < T | |
550 | <s> package net . ggtools . grand . ui . event ; import sf . blacksun . util . StopWatch ; public class DispatcherPerformanceMeter { private static final int LOOP = 100000000 ; public static class ManualDispatcher extends DispatcherAdapter implements Dispatcher { ManualDispatcher ( final EventManager manager ) { super ( manager ) ; } public void sendEventToSubscriber ( final Object subscriber , final Object eventData ) | |
551 | <s> package com . mcbans . firestar . mcbans . org . json ; public class JSONException extends Exception { private static final long serialVersionUID = 0 ; private Throwable cause ; public JSONException ( String message ) { super ( message ) ; } public JSONException ( Throwable cause ) { super ( cause . getMessage ( ) ) ; this . cause | |
552 | <s> package org . rubypeople . rdt . internal . ui ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IAdaptable ; import org . eclipse . swt . SWT ; import org . eclipse . swt . events . SelectionAdapter ; import org . eclipse . swt . events . SelectionEvent ; import org . eclipse . swt . layout . GridData ; import org . eclipse . swt . layout . GridLayout ; import org . eclipse . swt . widgets . Composite ; import org . eclipse . swt . widgets . Control ; import org . eclipse . swt . widgets . Label ; import org . eclipse . swt . widgets . TabFolder ; import org . eclipse . swt . widgets . TabItem ; import org . eclipse . ui . IWorkbenchPropertyPage ; import org . eclipse . ui . dialogs . PropertyPage ; import org . rubypeople . rdt . core . RubyCore ; import org . rubypeople . rdt . internal . core . RubyProject ; import org . rubypeople . rdt . internal . ui . util . ExceptionHandler ; public class RubyProjectPropertyPage extends PropertyPage implements IWorkbenchPropertyPage { protected RubyProjectLibraryPage projectsPage ; protected RubyProject workingProject ; public RubyProjectPropertyPage ( ) { } protected Control createContents ( Composite parent ) { noDefaultAndApplyButton ( ) ; workingProject = getRubyProject ( ) ; if ( workingProject == null || ! workingProject . getProject ( ) . isOpen ( ) ) return createClosedProjectPageContents ( parent ) ; return createProjectPageContents ( parent ) ; } protected RubyProject getRubyProject ( ) { IAdaptable selectedElement = getElement ( ) ; if ( selectedElement == null ) return null ; if ( selectedElement instanceof RubyProject ) return ( RubyProject ) selectedElement ; | |
553 | <s> package com . asakusafw . dmdl . windgate . csv . driver ; import com . asakusafw . dmdl . model . AstAttribute ; import com . asakusafw . dmdl . model . BasicTypeKind ; import com . asakusafw . dmdl . semantics . DmdlSemantics ; import com . asakusafw . dmdl . semantics . PropertyDeclaration ; import com . asakusafw . dmdl . spi . PropertyAttributeDriver ; import com . asakusafw . dmdl . util . AttributeUtil ; import com . asakusafw . dmdl . windgate . csv . driver . CsvFieldTrait . Kind ; public class CsvLineNumberDriver extends PropertyAttributeDriver { public static final String TARGET_NAME = "" ; @ Override public String getTargetName ( ) { return TARGET_NAME ; } @ Override public void process ( DmdlSemantics environment , PropertyDeclaration declaration , AstAttribute attribute ) { environment . reportAll ( AttributeUtil . reportInvalidElements ( attribute , attribute . elements ) ) ; CsvFieldDriver . | |
554 | <s> package org . oddjob . designer . elements . schedule ; import junit . framework . TestCase ; import org . apache . log4j . Logger ; import org . oddjob . Helper ; import org . oddjob . OddjobDescriptorFactory ; import org . oddjob . arooa . ArooaDescriptor ; import org . oddjob . arooa . ArooaParseException ; import org . oddjob . arooa . ArooaType ; import org . oddjob . arooa . design . DesignInstance ; import org . oddjob . arooa . design . DesignParser ; import org . oddjob . arooa . design | |
555 | <s> package org . rubypeople . rdt . internal . testunit . launcher ; import org . eclipse . debug . core . ILaunchConfigurationWorkingCopy ; import org . eclipse . debug . ui . AbstractLaunchConfigurationTabGroup ; import org . eclipse . debug . ui . CommonTab ; import org . eclipse . debug . ui . EnvironmentTab ; import org . eclipse . debug . ui . ILaunchConfigurationDialog ; import org . eclipse . debug . ui . ILaunchConfigurationTab ; import org . eclipse . debug . ui . ILaunchConfigurationTabGroup ; import org . rubypeople . rdt . internal . debug . ui . launcher . RubyEnvironmentTab ; import org . rubypeople . rdt . testunit . launcher . TestUnitMainTab ; public class TestUnitTabGroup extends AbstractLaunchConfigurationTabGroup { public void createTabs ( ILaunchConfigurationDialog dialog , String mode ) { ILaunchConfigurationTab [ ] tabs = new ILaunchConfigurationTab [ ] | |
556 | <s> package org . oddjob . jmx ; import java . io . File ; import java . util . Properties ; import junit . framework . TestCase ; import org . apache . log4j . Logger ; import org . oddjob . FailedToStopException ; import org . oddjob . FragmentHelper ; import org . oddjob . Oddjob ; import org . oddjob . OddjobLookup ; import org . oddjob . OurDirs ; import org . oddjob . StateSteps ; import org . oddjob . Stateful ; import org . oddjob . arooa . ArooaParseException ; import org . oddjob . arooa . convert . ArooaConversionException ; import org . oddjob . arooa . reflect . ArooaPropertyException ; import org . oddjob . state . JobState ; import org . oddjob . state . ParentState ; import org . oddjob . state . ServiceState ; public class JMXExamplesTest extends TestCase { private static final Logger logger = Logger . getLogger ( JMXExamplesTest . class ) ; Oddjob serverOddjob ; Oddjob clientOddjob ; @ Override protected void setUp ( ) throws Exception { super . setUp ( ) ; logger . info ( "" + getName ( ) + "" ) ; } @ Override protected void tearDown ( ) throws Exception { super . tearDown ( ) ; if ( clientOddjob != null ) { clientOddjob . destroy ( ) ; } if ( serverOddjob != null ) { serverOddjob . destroy ( ) ; } } public void testSimpleClientServerExample ( ) throws ArooaParseException , FailedToStopException { Properties props = new Properties ( ) ; props . setProperty ( "" , "localhost" ) ; OurDirs dirs = new OurDirs ( ) ; File testDir = dirs . relative ( "" ) ; serverOddjob = new Oddjob ( ) ; serverOddjob . setFile ( new File ( testDir , "" ) ) ; serverOddjob . run ( ) ; assertEquals ( ParentState . ACTIVE , serverOddjob . lastStateEvent ( ) . getState ( ) ) ; FragmentHelper helper = new FragmentHelper ( ) ; helper . setProperties ( props ) ; JMXClientJob client = ( JMXClientJob ) helper . createComponentFromResource ( "" ) ; StateSteps clientSteps = new StateSteps ( client ) ; clientSteps . startCheck ( ServiceState . READY , ServiceState . STARTING , ServiceState . STARTED ) ; client . run ( ) ; clientSteps . checkNow ( ) ; client . stop ( ) ; } public void testClientRunsServerJobExample ( ) throws InterruptedException , ArooaPropertyException , ArooaConversionException { Properties props = new Properties ( ) ; props . setProperty ( "" , "localhost" ) ; OurDirs dirs = new OurDirs ( ) ; File testDir = dirs . relative ( "" ) ; serverOddjob = new Oddjob ( ) ; serverOddjob . setProperties ( props ) ; serverOddjob . setFile ( new File ( testDir , "" ) ) ; serverOddjob . run ( ) ; assertEquals ( ParentState . ACTIVE , serverOddjob . lastStateEvent ( ) . getState ( ) ) ; OddjobLookup serverLookup = new OddjobLookup ( serverOddjob ) ; Stateful serverJob = serverLookup . lookup ( "" , Stateful . class ) ; clientOddjob = new Oddjob ( ) ; clientOddjob . setProperties ( props ) ; clientOddjob . setFile ( new File ( testDir , "" ) ) ; StateSteps steps = new StateSteps ( serverJob ) ; steps . startCheck ( JobState . READY , JobState . EXECUTING , JobState . COMPLETE ) ; clientOddjob . run ( ) ; assertEquals ( ParentState . COMPLETE , clientOddjob . lastStateEvent ( ) . getState ( ) ) ; steps . checkWait ( ) ; } public void testClientTriggersOnServerJobExample ( ) throws InterruptedException , ArooaPropertyException , ArooaConversionException { Properties props = new Properties ( ) ; props . setProperty ( "" , "localhost" ) ; OurDirs dirs = new OurDirs ( ) ; File testDir = dirs . relative ( "" ) ; serverOddjob = new Oddjob | |
557 | <s> package org . rubypeople . rdt . refactoring . core ; import java . util . Collection ; import java . util . | |
558 | <s> package org . rubypeople . rdt . ui . actions ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . IAdaptable ; import org . eclipse . jface . action . IAction ; import org . eclipse . jface . action . IMenuManager ; import org . eclipse . jface . action . MenuManager ; import org . eclipse . jface . viewers . ISelection ; import org . eclipse . jface . viewers . ISelectionProvider ; import org . eclipse . jface . viewers . IStructuredSelection ; import org . eclipse . search . ui . IContextMenuConstants ; import org . eclipse . ui . IActionBars ; import org . eclipse . ui . IViewPart ; import org . eclipse . ui . IWorkbenchSite ; import org . eclipse . ui . actions . ActionGroup ; import org . eclipse . ui . actions . OpenWithMenu ; import org . eclipse . ui . texteditor . AbstractTextEditor ; import org . rubypeople . rdt . internal . ui . actions . ActionMessages ; public class OpenEditorActionGroup extends ActionGroup { private IWorkbenchSite fSite ; private boolean fIsEditorOwner ; private OpenAction fOpen ; public OpenEditorActionGroup ( IViewPart part ) { fSite = part . getSite ( ) ; fOpen = new OpenAction ( fSite ) ; fOpen . setActionDefinitionId ( IRubyEditorActionDefinitionIds . OPEN_EDITOR ) ; initialize ( fSite . getSelectionProvider ( ) ) ; } public OpenEditorActionGroup ( AbstractTextEditor editor ) { fIsEditorOwner = true ; fOpen = new OpenAction ( editor ) ; fOpen . setActionDefinitionId ( IRubyEditorActionDefinitionIds . OPEN_EDITOR ) ; editor . setAction ( "OpenEditor" , fOpen ) ; fSite = editor . getEditorSite ( ) ; initialize ( fSite . getSelectionProvider ( ) ) ; } public IAction getOpenAction ( ) { return fOpen ; } private void initialize ( ISelectionProvider provider ) { ISelection selection = provider . getSelection ( ) ; fOpen . update ( selection ) ; if ( | |
559 | <s> package net . ggtools . grand . ui . launcher ; import java . io . File ; import java . io . FilenameFilter ; import java . net . MalformedURLException ; import java . net . URL ; import java . net . URLClassLoader ; import java . util . ArrayList ; import java . util . Locale ; import org . apache . commons . logging . Log ; import org . apache . commons . logging . LogFactory ; public class Launcher { | |
560 | <s> package com . asakusafw . yaess . core ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . util . HashMap ; import java . util . Map ; import org . junit . Assume ; import org . junit . Test ; public class VariableResolverTest { @ Test public void simple ( ) { Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( "message" , "" ) ; VariableResolver resolver = new VariableResolver ( map ) ; assertThat ( resolver . replace ( "${message}" , true ) , is ( "" ) ) ; } @ Test public void inLine ( ) { Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( "message" , "" ) ; VariableResolver resolver = new VariableResolver ( map ) ; assertThat ( resolver . replace ( "" , true ) , is ( "" ) ) ; } @ Test public void multiple ( ) { Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( "m1" , "Hello1" ) ; map . put ( "m2" , "Hello2" ) ; map . put ( "m3" , "Hello3" ) ; VariableResolver resolver = new VariableResolver ( | |
561 | <s> package com . pogofish . jadt . checker ; import static com . pogofish . jadt . errors . SemanticError . _ConstructorDataTypeConflict ; import static com . pogofish . jadt . errors . SemanticError . _DuplicateArgName ; import static com . pogofish . jadt . errors . SemanticError . _DuplicateConstructor ; import static com . pogofish . jadt . errors . SemanticError . _DuplicateDataType ; import static com . pogofish . jadt . errors . SemanticError . _DuplicateModifier ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . List ; import java . util . Set ; import java . util . logging . Logger ; import com . pogofish . jadt . ast . Arg ; import com . pogofish . jadt . ast . ArgModifier ; import com . pogofish . jadt . ast . Constructor ; import com . pogofish . jadt . ast . DataType ; import com . pogofish . jadt . ast . Doc ; import com . pogofish . jadt . errors . SemanticError ; import com . pogofish . jadt . printer . | |
562 | <s> package com . sun . tools . hat . internal . lang . openjdk6 ; import com . sun . tools . hat . internal . lang . Models ; import com . sun . tools . hat . internal . lang . ScalarModel ; import com . sun . tools . hat . internal . model . JavaObject ; class JavaString extends ScalarModel { private final String value ; private JavaString ( String value ) { this . value = value ; } public static JavaString make | |
563 | <s> package com . asakusafw . runtime . stage . directio ; import static com . asakusafw . runtime . stage . directio . StringTemplate . Format . * ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . IOException ; import java . util . Arrays ; import org . apache . hadoop . io . DataInputBuffer ; import org . apache . hadoop . io . DataOutputBuffer ; import org . apache . hadoop . io . Writable ; import org . junit . Test ; import com . asakusafw . runtime . io . util . WritableRawComparable ; import com . asakusafw . runtime . stage . directio . StringTemplate . Format ; import com . asakusafw . runtime . stage . directio . StringTemplate . FormatSpec ; import com . asakusafw . runtime . value . Date ; import com . asakusafw . runtime . value . DateOption ; import com . asakusafw . runtime . value . DateTime ; import com . asakusafw . runtime . value . DateTimeOption ; public class StringTemplateTest { @ Test public void plain ( ) throws Exception { Mock mock = new Mock ( plain ( "" ) ) ; assertThat ( mock . apply ( ) , is ( "" ) ) ; } @ Test public void placeholder ( ) throws Exception { Mock mock = new Mock ( spec ( NATURAL ) ) ; mock . setMock ( "" ) ; assertThat ( mock . apply ( ) , is ( "" ) ) ; } @ Test public void placeholder_date ( ) throws Exception { Mock mock = new Mock ( spec ( DATE , "yyyy/MM/dd" ) ) ; mock . setMock ( new DateOption ( new Date ( 2012 , 2 , 3 ) ) ) ; assertThat ( mock . apply ( ) , is ( "2012/02/03" ) ) ; } @ Test public void placeholder_date_null ( ) throws Exception { Mock mock = new Mock ( spec ( DATE , "yyyy/MM/dd" ) ) ; mock . setMock ( new DateOption ( ) ) ; mock . apply ( ) ; } @ Test public void placeholder_datetime ( ) throws Exception { Mock mock = new Mock ( spec ( DATETIME , "" ) ) ; mock . setMock ( new DateTimeOption ( new DateTime ( 2012 , 2 , 3 , 4 , 5 , 6 ) ) ) ; assertThat ( mock . apply ( ) , is ( "" ) ) ; } @ Test public void placeholder_datetime_null ( ) throws Exception { Mock mock = new Mock ( spec ( DATETIME , "" ) ) ; mock . setMock ( new DateTimeOption ( ) ) ; mock . apply ( ) ; } @ Test public void mixed ( ) throws Exception { Mock mock = new Mock ( plain ( "left" ) , spec ( NATURAL ) , plain ( "right" ) ) ; mock . setMock ( "" , "replaced" , "" ) ; assertThat ( mock . apply ( ) , is ( "" ) ) ; } @ Test public void serialize | |
564 | <s> package com . asakusafw . modelgen . view . model ; import java . text . MessageFormat ; public class From { public final Name table ; public final String alias ; public final Join join ; public From ( Name table , String alias ) { this ( table , alias , null ) ; } public From ( Name table , String alias , Join join ) { if ( table == null ) { throw new IllegalArgumentException ( "" ) ; } this . table = table ; this . alias = alias ; this . join = join ; } @ Override public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = prime * result + table . hashCode ( ) ; result = prime * result + ( ( join == null ) ? 0 : join . hashCode ( ) ) ; return result ; } @ Override public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } From other = ( From ) obj ; if ( ! table . equals ( other . table ) ) { return false ; } if ( join == null ) { if ( other . join != null ) { | |
565 | <s> package com . asakusafw . bulkloader . exporter ; import static org . junit . Assert . * ; import java . io . File ; import java . sql . Connection ; import java . sql . PreparedStatement ; import java . util . Arrays ; import java . util . LinkedHashMap ; import java . util . List ; import java . util . Map ; import org . junit . After ; import org . junit . AfterClass ; import org . junit . Before ; import org . junit . BeforeClass ; import org . junit . Ignore ; import org . junit . Test ; import com . asakusafw . bulkloader . bean . ExportTargetTableBean ; import com . asakusafw . bulkloader . bean . ExportTempTableBean ; import com . asakusafw . bulkloader . bean . ExporterBean ; import com . asakusafw . bulkloader . bean . ImportTargetTableBean ; import com . asakusafw . bulkloader . common . BulkLoaderInitializer ; import com . asakusafw . bulkloader . common . DBConnection ; import com . asakusafw . bulkloader . exception . BulkLoaderSystemException ; import com . asakusafw . bulkloader . testutil . UnitTestUtil ; import com . asakusafw . testtools . TestUtils ; import com . asakusafw . testtools . inspect . Cause ; public class LockReleaseTest { private static List < String > propertys = Arrays . asList ( new String [ ] { "" } ) ; private static String jobflowId = "JOB_FLOW01" ; private static String executionId = "" ; @ BeforeClass public static void setUpBeforeClass ( ) throws Exception { UnitTestUtil . setUpBeforeClass ( ) ; UnitTestUtil . setUpEnv ( ) ; BulkLoaderInitializer . initDBServer ( jobflowId , executionId , propertys , "target1" ) ; UnitTestUtil . setUpDB ( ) ; } @ AfterClass public static void tearDownAfterClass ( ) throws Exception { UnitTestUtil . tearDownDB ( ) ; UnitTestUtil . tearDownAfterClass ( ) ; } @ Before public void setUp ( ) throws Exception { BulkLoaderInitializer . initDBServer ( jobflowId , executionId , propertys , "target1" ) ; UnitTestUtil . startUp ( ) ; } @ After public void tearDown ( ) throws Exception { UnitTestUtil . tearDown ( ) ; } @ Test public void releaseLockTest01 ( ) throws Exception { File testDataDir = new File ( "" ) ; TestUtils util = new TestUtils ( testDataDir ) ; util . storeToDatabase ( false ) ; String tempTable1 = "" ; String dropSql1 = "" ; String createSql1 = "" ; String tempTable2 = "" ; String dropSql2 = "" ; String createSql2 = "" ; UnitTestUtil . executeUpdate ( dropSql1 ) ; UnitTestUtil . executeUpdate ( createSql1 ) ; UnitTestUtil . executeUpdate ( dropSql2 ) ; UnitTestUtil . executeUpdate ( createSql2 ) ; String dropDup1Sql = "" ; String dropDup2Sql = "" ; StringBuilder dup1Sql = new StringBuilder ( ) ; dup1Sql . append ( "" ) ; dup1Sql . append ( "" ) ; dup1Sql . append ( "" ) ; StringBuilder dup2Sql = new StringBuilder ( ) ; dup2Sql . append ( "" ) ; dup2Sql . append ( "" ) ; dup2Sql . append ( "" ) ; UnitTestUtil . executeUpdate ( dropDup1Sql ) ; UnitTestUtil . executeUpdate ( dropDup2Sql ) ; UnitTestUtil . executeUpdate ( dup1Sql . toString ( ) ) ; UnitTestUtil . executeUpdate ( dup2Sql . toString ( ) ) ; Map < String , ExportTargetTableBean > exportTargetTable = new LinkedHashMap < String , ExportTargetTableBean > ( ) ; ExportTargetTableBean table1 = new ExportTargetTableBean ( ) ; table1 . setExportTempTableName ( tempTable1 ) ; table1 . setDuplicateFlagTableName ( "" ) ; exportTargetTable . put ( "" , table1 ) ; ExportTargetTableBean table2 = new ExportTargetTableBean ( ) ; table2 . setExportTempTableName ( tempTable2 ) ; table2 . setDuplicateFlagTableName ( "" ) ; exportTargetTable . put ( "" , table2 ) ; Map < String , ImportTargetTableBean > importTargetTable = new LinkedHashMap < String , ImportTargetTableBean > ( ) ; ImportTargetTableBean table3 = new ImportTargetTableBean ( ) ; importTargetTable . put ( "" , table3 ) ; ImportTargetTableBean table4 = new ImportTargetTableBean ( ) ; importTargetTable . put ( "" , table4 ) ; ExporterBean bean = new ExporterBean ( ) ; bean . setJobflowSid ( "11" ) ; bean . setExportTargetTable ( exportTargetTable ) ; bean . setImportTargetTable ( importTargetTable ) ; bean . setRetryCount ( 3 ) ; bean . setRetryInterval ( 1 ) ; LockRelease lock = new LockRelease ( ) ; boolean result = lock . releaseLock ( bean , true ) ; assertTrue ( result ) ; util . loadFromDatabase ( ) ; if ( ! util . inspect ( ) ) { for ( Cause cause : util . getCauses ( ) ) { System . out . println ( cause . getMessage ( ) ) ; } fail ( util . getCauseMessage ( ) ) ; } assertFalse ( UnitTestUtil . isExistTable ( tempTable1 ) ) ; assertFalse ( UnitTestUtil . isExistTable ( tempTable2 ) ) ; assertFalse ( UnitTestUtil . isExistTable ( "" ) ) ; assertFalse ( | |
566 | <s> package test . modelgen . table . io ; import java . io . IOException ; import javax . annotation . Generated ; import test . modelgen . table . model . PurchaseTranError ; import com . asakusafw . runtime . io . ModelOutput ; import com . asakusafw . runtime . io . RecordEmitter ; @ Generated ( "" ) @ SuppressWarnings ( "deprecation" ) public final class PurchaseTranErrorModelOutput implements ModelOutput < PurchaseTranError > { private final RecordEmitter emitter ; public PurchaseTranErrorModelOutput ( RecordEmitter emitter ) { if ( emitter == null ) { throw new IllegalArgumentException ( ) ; } this . emitter = emitter ; } @ Override public void write ( PurchaseTranError model ) throws IOException { emitter . emit ( model . getSidOption ( ) ) ; emitter . emit ( model . getVersionNoOption ( ) ) ; emitter . emit ( model . getRgstDatetimeOption ( ) ) ; emitter . emit ( model . getUpdtDatetimeOption ( ) ) ; emitter . emit ( model . getPurchaseNoOption ( ) ) ; emitter . emit ( model . getPurchaseTypeOption ( ) ) ; emitter . emit ( model . getTradeTypeOption ( ) ) ; | |
567 | <s> package com . asakusafw . bulkloader . exporter ; import java . io . File ; import java . util . List ; import com . asakusafw . bulkloader . bean . ExportTargetTableBean ; import com . asakusafw . bulkloader . bean . ExporterBean ; import com . asakusafw . bulkloader . log . Log ; public class ExportFileDelete { static final Log LOG = new Log ( ExportFileDelete . class ) ; public void deleteFile ( ExporterBean bean ) { List < String > list = bean . getExportTargetTableList ( ) ; for ( String tableName : list ) { ExportTargetTableBean targetTable = bean . getExportTargetTable ( tableName ) ; List < File > files = targetTable . getExportFiles ( ) ; for ( File file : files ) { if ( file != null && | |
568 | <s> package com . asakusafw . vocabulary . windgate ; import java . text . MessageFormat ; import java . util . List ; import com . asakusafw . windgate . core . vocabulary . DataModelJdbcSupport ; final class JdbcDescriptionUtil { static void checkCommonConfig ( String descriptionClass , Class < ? > modelType , Class < ? extends DataModelJdbcSupport < ? > > supportClass , String table , List < String > columns ) { if ( isEmpty ( table ) ) { throw new IllegalStateException ( MessageFormat . format ( "" , descriptionClass , "" ) ) ; } if ( columns == null ) { throw new IllegalStateException ( MessageFormat . format ( "" , descriptionClass , "" ) ) ; } if ( columns . isEmpty ( ) ) { throw new IllegalStateException ( MessageFormat . format ( "" , descriptionClass , "" ) ) ; } for ( String column : columns ) { if ( isEmpty ( column ) ) { throw new IllegalStateException ( MessageFormat . format ( "" , descriptionClass , "" ) ) ; } } if ( supportClass == null ) { throw new IllegalStateException ( MessageFormat . format ( "" , descriptionClass , "" ) ) ; } DataModelJdbcSupport < ? > support ; try { support = supportClass . newInstance ( ) ; } catch ( Exception e ) { throw new IllegalStateException ( MessageFormat . format ( "" , descriptionClass , supportClass . getName ( ) ) , e ) ; } if ( support . getSupportedType ( ) | |
569 | <s> package org . springframework . social . google . api . query . impl ; import static org . springframework . util . StringUtils . hasText ; import java . text . Format ; import java . text . SimpleDateFormat ; import java . util . Date ; import org . springframework . social . google . api . query . QueryBuilder ; public abstract class QueryBuilderImpl < Q extends QueryBuilder < ? , T > , T > implements QueryBuilder < Q , T > { private static final Format dateFormatter = new SimpleDateFormat ( "" ) ; protected String feedUrl ; protected int maxResults ; protected QueryBuilderImpl ( ) { } protected | |
570 | <s> package org . rubypeople . rdt . internal . compiler ; import org . rubypeople . rdt . core . compiler . CategorizedProblem ; public interface ISourceElementRequestor { public static class TypeInfo { public int declarationStart ; public boolean isModule = false ; public String name ; public int nameSourceStart ; public int nameSourceEnd ; public String superclass ; public String [ ] modules ; public boolean secondary ; } public static class MethodInfo { public boolean isConstructor = false ; public boolean isClassLevel = false ; public | |
571 | <s> package net . sf . sveditor . core . diagrams ; import net . sf . sveditor . core . db . SVDBModIfcDecl ; import net . sf . sveditor . core . db . SVDBModuleDecl ; import net . sf . sveditor . core . db . index . ISVDBIndex ; public class ModuleDiagModelFactory extends AbstractDiagModelFactory { private SVDBModuleDecl fModuleDecl ; public ModuleDiagModelFactory ( ISVDBIndex index , SVDBModuleDecl moduleDecl ) { super | |
572 | <s> package org . rubypeople . rdt . internal . ui . wizards . buildpaths . newsourcepage ; import java . util . ArrayList ; import java . util . List ; import org . eclipse . jface . action . ActionContributionItem ; import org . eclipse . jface . action . IAction ; import org . eclipse . jface . action . IMenuCreator ; import org . eclipse . swt . widgets . Control ; import org . eclipse . swt . widgets . Menu ; import org . rubypeople . rdt . core . RubyModelException ; public class LoadpathModifierDropDownAction extends LoadpathModifierAction implements IMenuCreator { private Menu fMenu ; protected List fActions ; private int fIndex ; public LoadpathModifierDropDownAction ( LoadpathModifierAction action , String text , String toolTipText ) { super ( action . | |
573 | <s> package org . oddjob . framework ; import java . util . Map ; import junit . framework . TestCase ; import org . apache . commons . beanutils . DynaBean ; import org . oddjob . arooa . ArooaSession ; import org . oddjob . arooa . convert . ArooaConversionException ; import org . oddjob . arooa . reflect . ArooaPropertyException ; import org . oddjob . arooa . standard . StandardArooaSession ; import org . oddjob . describe . UniversalDescriber ; import org . oddjob . state . JobStateHandler ; import org . oddjob . state . StateHandler ; public class BaseWrapperTest extends TestCase { public static class Result { public int getResult ( ) { return 42 ; } } private class MockWrapper extends BaseWrapper { JobStateHandler stateHandler = new JobStateHandler ( this ) ; Object wrapped ; MockWrapper ( Object wrapped ) { this . wrapped = wrapped ; } @ Override protected StateHandler < ? | |
574 | <s> package com . asakusafw . vocabulary . batch ; import com . asakusafw . vocabulary . flow . FlowDescription ; import com . asakusafw . vocabulary | |
575 | <s> package test . modelgen . table . io ; import java . io . IOException ; import javax . annotation . Generated ; import test . modelgen . table . model . ExportTempImportTarget19 ; import com . asakusafw . runtime . io . ModelInput ; import com . asakusafw . runtime . io . RecordParser ; @ Generated ( "" ) @ SuppressWarnings ( "deprecation" ) public final class ExportTempImportTarget19ModelInput implements ModelInput < ExportTempImportTarget19 | |
576 | <s> package com . asakusafw . testdriver . core ; import java . util . Collections ; import java . util . Map ; public interface TestContext { ClassLoader getClassLoader ( ) ; Map < String , String > getEnvironmentVariables ( ) ; Map < String , | |
577 | <s> package com . lmax . disruptor ; import com . lmax . disruptor . support . TestEntry ; import org . jmock . Expectations ; import org . jmock . Mockery ; import org . jmock . integration . junit4 . JMock ; import org . jmock . lib . legacy . ClassImposteriser ; import org . junit . Test ; import org . junit . runner . RunWith ; import java . util . logging . Level ; import java . util . logging . Logger ; @ RunWith ( JMock . class ) public final class IgnoreExceptionHandlerTest { private final Mockery context = new Mockery ( ) ; public IgnoreExceptionHandlerTest ( ) { context . setImposteriser ( ClassImposteriser . | |
578 | <s> package org . rubypeople . rdt . ui . search ; import org . jruby . Ruby ; import org . rubypeople . rdt . core . search . IRubySearchScope ; public class PatternQuerySpecification extends QuerySpecification { private String fPattern ; private int fSearchFor ; private boolean fCaseSensitive ; public PatternQuerySpecification ( String pattern , int searchFor , boolean caseSensitive | |
579 | <s> package org . vaadin . teemu . clara ; import static org . junit . Assert . assertEquals ; import static org . junit . Assert . assertTrue ; import java . io . InputStream ; import java . lang . reflect . Method ; import java . util . Date ; import org . junit . Before ; import org . junit . Test ; import org . vaadin . teemu . clara . binder . Binder ; import org . vaadin . teemu . clara . binder . annotation . DataSource ; import org . vaadin . teemu . clara . binder . annotation . EventHandler ; import org . vaadin . teemu . clara . inflater . LayoutInflater ; import com . vaadin . data . Property ; import com . vaadin . ui . Button ; import com . vaadin . ui . Button . ClickEvent ; import com . vaadin . ui . DateField ; public class BinderTest { private LayoutInflater inflater ; private boolean clickCalled ; @ Before public void setUp ( ) { inflater = new LayoutInflater ( ) ; } private InputStream getXml ( String fileName ) { return getClass ( ) . getClassLoader ( ) . getResourceAsStream ( fileName ) ; } @ EventHandler ( "my-button" ) public void handleButtonClick ( ClickEvent event ) { clickCalled = true ; } @ DataSource ( "my-datefield" ) public Property getDataSource ( ) { Date date = new Date ( 1337337477578L ) ; return new com . vaadin . data . util . ObjectProperty < Date > ( date ) ; } @ Test public void bind_clickListener_clickListenerInvoked ( ) { Button button = ( Button ) inflater . inflate ( getXml ( "" ) ) ; | |
580 | <s> package org . rubypeople . rdt . internal . ui . compare ; import org . eclipse . swt . widgets . Composite ; import org . eclipse . jface . viewers . Viewer ; import org . eclipse . compare . CompareConfiguration ; import | |
581 | <s> package org . oddjob . values . properties ; import junit . framework . TestCase ; import org . oddjob . Helper ; import org . oddjob . OddjobDescriptorFactory ; import org . oddjob . arooa . ArooaDescriptor ; import org . oddjob . arooa . ArooaParseException ; import org . oddjob . arooa . ArooaType ; import org . oddjob . arooa . design . DesignInstance ; import org . oddjob . arooa . design . DesignParser ; import org . oddjob . arooa . design . view . ViewMainHelper ; import org . oddjob . arooa . standard . StandardArooaSession ; import org . oddjob . arooa . xml . XMLConfiguration ; import org . oddjob . values . properties . PropertiesJob ; public class PropertiesJobDesFaTest extends TestCase { DesignInstance design ; public void testCreate ( ) throws ArooaParseException { String xml = "" + "" + "" + "" + " <sets>" + "" + "" + "" + "" + "" + " </sets>" + " <values>" + "" + " </values>" + "" ; ArooaDescriptor descriptor = new OddjobDescriptorFactory ( ) . createDescriptor ( null ) ; DesignParser parser = new DesignParser ( new StandardArooaSession ( descriptor ) ) ; parser . setArooaType ( ArooaType . COMPONENT ) ; parser . parse ( new XMLConfiguration ( "TEST" , xml ) ) ; design = parser . getDesign ( ) ; PropertiesJob test = ( PropertiesJob ) | |
582 | <s> package net . sf . sveditor . core . db ; import java . util . ArrayList ; import java . util . List ; public class SVDBTypeInfoEnum extends SVDBTypeInfo { public List < SVDBTypeInfoEnumerator > fEnumerators ; public SVDBTypeInfoEnum ( ) { this ( "" ) ; } public SVDBTypeInfoEnum ( String typename ) { super ( typename , SVDBItemType . TypeInfoEnum ) ; fEnumerators = new | |
583 | <s> package org . oddjob . scheduling ; import java . util . concurrent . Delayed ; import java . util . concurrent . ExecutionException ; import java . util . concurrent . ScheduledFuture ; import java . util . concurrent . TimeUnit ; import java . util . concurrent . TimeoutException ; public class MockScheduledFuture < T > implements ScheduledFuture < T > { public boolean cancel ( boolean mayInterruptIfRunning ) { throw new RuntimeException ( "" + getClass ( ) ) ; } public T get ( ) throws InterruptedException , ExecutionException { throw new RuntimeException ( "" + getClass ( ) ) ; } public T get ( long timeout , TimeUnit unit ) throws InterruptedException , ExecutionException , TimeoutException { throw | |
584 | <s> package org . rubypeople . rdt . refactoring . core . formatsource ; import java . io . PrintWriter ; import java . io . StringWriter ; import org . rubypeople . rdt . core . formatter . FormatHelper ; import org . rubypeople . rdt . core . formatter . ReWriteVisitor ; import org . rubypeople . rdt . | |
585 | <s> package org . rubypeople . rdt . internal . corext . template . ruby ; import org . eclipse . osgi . util . NLS ; public class RubyTemplateMessages extends NLS { private static final String | |
586 | <s> package com . example . servletjspdemo . domain ; public class Person { private String firstName = "unknown" ; private int yob = 1900 ; public Person ( ) { super ( ) ; } public Person ( String firstName , int yob ) { super ( ) ; this . firstName = firstName ; this . yob = yob ; } public String getFirstName ( ) { return firstName ; } public void setFirstName ( String firstName ) { this . firstName = firstName ; } | |
587 | <s> package com . asakusafw . bulkloader . importer ; import static org . junit . Assert . * ; import java . io . File ; import java . io . FileOutputStream ; import java . io . IOException ; import java . util . Arrays ; import java . util . LinkedHashMap ; import java . util . List ; import java . util . Map ; import org . junit . After ; import org . junit . AfterClass ; import org . junit . Before ; import org . junit . BeforeClass ; import org . junit . Test ; import com . asakusafw . bulkloader . bean . ImportBean ; import com . asakusafw . bulkloader . bean . ImportTargetTableBean ; import com . asakusafw . bulkloader . common . BulkLoaderInitializer ; import com . asakusafw . bulkloader . testutil . UnitTestUtil ; public class ImportFileDeleteTest { private static List < String > propertys = Arrays . asList ( new String [ ] { "" } ) ; private static String jobflowId = "JOB_FLOW01" ; private static String executionId = "" ; @ BeforeClass public static void setUpBeforeClass ( ) throws Exception { UnitTestUtil . setUpBeforeClass ( ) ; UnitTestUtil . setUpEnv ( ) ; BulkLoaderInitializer . initDBServer ( jobflowId , executionId , propertys , "target1" ) ; UnitTestUtil . setUpDB ( ) ; } @ AfterClass public static void tearDownAfterClass ( ) throws Exception { UnitTestUtil . tearDownDB ( ) ; UnitTestUtil . tearDownAfterClass ( ) ; } @ Before public void setUp ( ) throws Exception { BulkLoaderInitializer . initDBServer ( jobflowId , executionId , propertys , "target1" ) ; UnitTestUtil . startUp ( ) ; } @ After public void tearDown ( ) throws Exception { UnitTestUtil . tearDown ( ) ; } @ Test public void deleteFileTest01 ( ) throws Exception { File dumpDir = new File ( "" ) ; File importFile1 = new File ( dumpDir , "" ) ; File importFile2 = new File ( dumpDir , "" ) ; File importFile3 = new File ( dumpDir , "" ) ; importFile1 . createNewFile ( ) ; importFile2 . createNewFile ( ) ; importFile3 . createNewFile ( ) ; Map < String , ImportTargetTableBean > targetTable = new LinkedHashMap < String , ImportTargetTableBean > ( ) ; ImportTargetTableBean tableBean1 = new ImportTargetTableBean ( ) ; tableBean1 . setImportFile ( importFile1 ) ; targetTable . put ( "" , tableBean1 ) ; ImportTargetTableBean tableBean2 = new ImportTargetTableBean ( ) ; tableBean2 . setImportFile ( importFile2 ) ; targetTable . put ( "" , tableBean2 ) ; ImportTargetTableBean tableBean3 = new ImportTargetTableBean ( ) ; tableBean3 . setImportFile ( importFile3 ) ; targetTable . put ( "" , tableBean3 ) ; ImportBean bean = new ImportBean ( ) ; bean . setTargetTable ( targetTable ) ; ImportFileDelete delete = new ImportFileDelete ( ) ; delete . deleteFile ( bean ) ; assertFalse ( importFile1 . exists ( ) ) ; assertFalse ( importFile2 . exists ( ) ) ; assertFalse ( importFile3 . exists ( ) ) ; assertTrue ( dumpDir . exists ( ) ) ; } @ Test public void deleteFileTest02 ( ) throws Exception { File dumpDir = new File ( "" ) ; File importFile1 = new File ( dumpDir , "" ) ; File importFile2 = new File ( dumpDir , "" ) ; File importFile3 = new File ( dumpDir , "" ) ; Map < String , ImportTargetTableBean > targetTable = new LinkedHashMap < String , ImportTargetTableBean > ( ) ; ImportTargetTableBean tableBean1 = new ImportTargetTableBean ( ) ; tableBean1 . setImportFile ( importFile1 ) ; targetTable . put ( "" , tableBean1 ) ; ImportTargetTableBean tableBean2 = new ImportTargetTableBean ( ) ; tableBean2 . setImportFile ( importFile2 ) ; targetTable . put ( "" , tableBean2 ) ; ImportTargetTableBean tableBean3 = new ImportTargetTableBean ( ) ; tableBean3 . setImportFile ( importFile3 ) ; targetTable . put ( "" , tableBean3 ) ; ImportBean bean = new ImportBean ( ) ; bean . setTargetTable ( targetTable ) ; ImportFileDelete delete = new ImportFileDelete ( ) ; delete . deleteFile ( bean ) ; assertFalse ( importFile1 . exists ( ) ) ; assertFalse ( importFile2 . exists ( ) ) ; assertFalse ( importFile3 . exists ( ) ) ; assertTrue ( dumpDir . exists ( ) ) ; } @ Test public void deleteFileTest03 ( ) throws Exception { File importFile1 = null ; | |
588 | <s> package br . com . caelum . vraptor . dash . uristats ; import java . util . Enumeration ; import javax . servlet . ServletResponse ; import javax . servlet . http . HttpServletRequest ; import javax . servlet . http . HttpServletResponse ; import org . apache . log4j . Logger ; import br . com . caelum . vraptor . InterceptionException ; import br . com . caelum . vraptor . core . InterceptorStack ; import br . com . caelum . vraptor . dash . cache . ObservableResponse ; import br . com . caelum . vraptor . http . VRaptorResponse ; import br . com . caelum . vraptor . interceptor . Interceptor ; import br . com . caelum . vraptor . ioc . Container ; import br . com . caelum . vraptor . resource . ResourceMethod ; public class BaseURIStatInterceptor implements Interceptor { private static final Logger LOG = Logger . getLogger ( BaseURIStatInterceptor . class ) ; private final HttpServletRequest request ; private final Container container ; private final HttpServletResponse response ; public BaseURIStatInterceptor ( Container container , HttpServletRequest request , HttpServletResponse response ) { this . container = container ; this . request = request ; this . response = response ; } public boolean accepts ( ResourceMethod arg0 ) { return true ; } public void intercept ( InterceptorStack stack | |
589 | <s> package net . sf . sveditor . core . templates ; import java . io . IOException ; import java . io . InputStream ; import java . net . URL ; import org . osgi . framework . Bundle ; public class PluginInStreamProvider implements ITemplateInStreamProvider { Bundle fBundle ; public PluginInStreamProvider ( Bundle bundle ) { fBundle = bundle ; } public InputStream openStream ( String path ) { URL url = fBundle . getEntry ( path ) ; InputStream in = null ; if ( url != null ) { | |
590 | <s> package org . oddjob ; import java . util . Arrays ; import org . apache . log4j . Logger ; import org . oddjob . images . IconEvent ; import org . oddjob . images . IconListener ; public class IconSteps { private static final Logger logger = Logger . getLogger ( IconSteps . class ) ; private Iconic iconic ; private Listener listener ; private long timeout = 5000L ; public IconSteps ( Iconic iconic ) { if ( iconic == null ) { throw new NullPointerException ( "No Iconic." ) ; } this . iconic = iconic ; } class Listener implements IconListener { private final String [ ] steps ; private int index ; private boolean done ; private String failureMessage ; public Listener ( String [ ] steps ) { this . steps = steps ; } @ Override public void iconEvent ( IconEvent event ) { String position ; if ( failureMessage != null ) { position = "" ; } else { position = "for index [" + index + "]" ; } logger . info ( "" + event . getIconId ( ) + "] " + position + " from [" + event . getSource ( ) + "]" ) ; if ( index >= steps . length ) { failureMessage = "" + event . getIconId ( ) + " (index " + index + ")" ; } else { if ( event . getIconId ( ) == steps [ index ] ) { if ( ++ index == steps . length ) { done = true ; synchronized ( this ) { notifyAll ( ) ; } } } else { done = true ; failureMessage = "Expected " + steps [ index ] + ", was " + event . getIconId ( ) + " (index " + index + ")" ; synchronized ( this ) { notifyAll ( ) ; } } } } } ; public void startCheck ( String ... steps ) { if ( listener != null ) { throw new IllegalStateException ( "" ) ; } if ( steps == null || steps . length == 0 ) { throw new IllegalStateException ( "No steps!" ) ; } this . listener = new Listener ( steps ) ; iconic . addIconListener ( | |
591 | <s> package com . asakusafw . compiler . operator ; import javax . lang . model . type . TypeMirror ; public interface DataModelMirror { Kind getKind ( ) ; boolean isSame ( DataModelMirror other ) ; boolean canInvoke ( DataModelMirror other ) ; boolean canContain ( DataModelMirror other ) ; PropertyMirror findProperty ( String | |
592 | <s> package com . asakusafw . dmdl . semantics ; import java . text . MessageFormat ; import java . util . List ; import java . util . Map ; import com . asakusafw . dmdl . model . AstAttribute ; import com . asakusafw . dmdl . model . AstDescription ; import com . asakusafw . dmdl . model . AstNode ; import com . asakusafw . dmdl . model . AstSimpleName ; import com . asakusafw . utils . collections . Lists ; import com . asakusafw . utils . collections . Maps ; public class PropertyDeclaration implements Declaration { private final AstNode originalAst ; private final ModelSymbol owner ; private final AstSimpleName name ; private final Type type ; private final AstDescription description ; private final List < AstAttribute > attributes ; private final Map < Class < ? extends Trait < ? > > , Trait < ? > > traits ; protected PropertyDeclaration ( ModelSymbol owner , AstNode originalAst , AstSimpleName name , Type type , AstDescription description , List < ? extends AstAttribute > attributes ) { if ( owner == null ) { throw new IllegalArgumentException | |
593 | <s> package de . fuberlin . wiwiss . d2rq . algebra ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashSet ; import java . util . List ; import java . util . Set ; import de . fuberlin . wiwiss . d2rq . expr . Expression ; import de . fuberlin . wiwiss . d2rq . sql . ConnectedDB ; public abstract class Relation implements RelationalOperators { public final static int NO_LIMIT = - 1 ; public static Relation createSimpleRelation ( ConnectedDB database , Attribute [ ] attributes ) { return new RelationImpl ( database , AliasMap . NO_ALIASES , Expression . TRUE , Expression . TRUE , Collections . < Join > emptySet ( ) , new HashSet < ProjectionSpec > ( Arrays . asList ( attributes ) ) , false , Collections . < OrderSpec > emptyList ( ) , - 1 , - 1 ) ; } public static Relation EMPTY = new Relation ( ) { public ConnectedDB database ( ) { return null ; } public AliasMap aliases ( ) { return AliasMap . NO_ALIASES ; } public Set < Join > joinConditions ( ) { return Collections . < Join > emptySet ( ) ; } public Expression condition ( ) { return Expression . FALSE ; } public Expression softCondition ( ) { return Expression . FALSE ; } public Set < ProjectionSpec > projections ( ) { return Collections . < ProjectionSpec > emptySet ( ) ; } public Relation select ( Expression condition ) { return this ; } public Relation renameColumns ( ColumnRenamer renamer ) { return this ; } public Relation project ( Set < ? extends ProjectionSpec > projectionSpecs ) { return this ; } public boolean isUnique ( ) { return true ; } public String toString ( ) { return "" ; } public List < OrderSpec > orderSpecs ( ) { return Collections . emptyList ( ) ; } public int limit ( ) { return Relation . NO_LIMIT ; } public int limitInverse ( ) { return Relation . NO_LIMIT ; } } ; public static Relation TRUE = new Relation ( ) { public ConnectedDB database ( ) { return null ; } public AliasMap aliases ( ) { return AliasMap . NO_ALIASES ; } public Set < Join > joinConditions ( ) { return Collections . < Join > emptySet ( ) ; } public Expression condition ( ) { return Expression . TRUE ; } public Expression softCondition ( ) { return Expression . TRUE ; } public Set < ProjectionSpec > projections ( ) { return Collections . < ProjectionSpec > emptySet ( ) ; } public Relation select ( Expression condition ) { if ( condition . isFalse ( ) ) return Relation . EMPTY ; | |
594 | <s> package com . asakusafw . testdriver . core ; import java . io . IOException ; import com . asakusafw . runtime . io . ModelOutput ; import | |
595 | <s> package test . modelgen . table . io ; import java . io . IOException ; import javax . annotation . Generated ; import test . modelgen . table . model . PurchaseTran ; import com . asakusafw . runtime . io . ModelInput ; import com . asakusafw . runtime . io . RecordParser ; @ Generated ( "" ) @ SuppressWarnings ( "deprecation" ) public final class PurchaseTranModelInput implements ModelInput < PurchaseTran > { private final RecordParser parser ; public PurchaseTranModelInput ( RecordParser parser ) { if ( parser == null ) { throw new IllegalArgumentException ( ) ; } this . parser = parser ; } @ Override public boolean readTo ( PurchaseTran model ) throws IOException { if ( parser . next ( ) == false ) { return false ; } parser . fill ( model . getSidOption ( ) ) ; parser . fill ( model . getVersionNoOption ( ) ) ; parser . fill ( model . getRgstDatetimeOption ( ) ) ; parser . fill ( model . getUpdtDatetimeOption ( ) ) ; parser . fill ( model . getPurchaseNoOption ( ) ) ; parser . fill ( model . getPurchaseTypeOption ( ) ) ; parser . fill ( model . getTradeTypeOption ( ) ) ; parser . fill ( model . getTradeNoOption ( ) ) ; parser . fill ( model . getLineNoOption ( ) ) ; parser . fill ( model . getDeliveryDateOption ( ) ) ; parser . fill ( model . getStoreCodeOption ( ) ) ; parser . fill ( model . getBuyerCodeOption ( ) ) ; parser . fill ( | |
596 | <s> package org . oddjob . tools . includes ; import java . io . ByteArrayInputStream ; import java . io . ByteArrayOutputStream ; import java . io . File ; import java . io . FileInputStream ; import java . io . InputStream ; import org . apache . log4j . Logger ; import org . oddjob . doclet . CustomTagNames ; import org . oddjob . jobs | |
597 | <s> package com . asakusafw . runtime . testing ; import java . io . File ; import java . io . FileOutputStream ; import java . io . IOError ; import java . io . IOException ; import java . io . OutputStream ; import java . io . OutputStreamWriter ; import | |
598 | <s> package com . asakusafw . runtime . io ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . ByteArrayInputStream ; import java . io . ByteArrayOutputStream ; import java . io . InputStream ; import java . util . Collections ; import java . util . LinkedList ; import org . junit . Test ; import com . asakusafw . runtime . io . testing . model . MockModel ; public class TsvIoFactoryTest { @ Test public void input ( ) throws Exception { TsvIoFactory < MockModel > factory = new TsvIoFactory < MockModel > ( MockModel . class ) ; MockModel object = factory . createModelObject ( ) ; InputStream in = new ByteArrayInputStream ( "" . getBytes ( "UTF-8" ) ) ; LinkedList < String > expected = new LinkedList < String > ( ) ; Collections . addAll ( expected , "Hello" , "World" , "TSV" , "INPUT" ) ; ModelInput < MockModel > modelIn = factory . createModelInput ( in ) ; try { while ( modelIn . readTo ( object ) ) { assertThat ( expected . isEmpty ( ) , is ( false | |
599 | <s> package net . sf . sveditor . core . tests . templates ; import junit . |