id
int32
0
3k
input
stringlengths
43
33.8k
gt
stringclasses
1 value
2,500
<s> package com . asakusafw . testdriver . excel . legacy ; import java . text . MessageFormat ; import java . util . Arrays ; import java . util . EnumSet ; import java . util . Set ; import org . apache . poi . ss . usermodel . Cell ; import org . apache . poi . ss . usermodel . Row ; import org . apache . poi . ss . usermodel . Sheet ; import com . asakusafw . testdriver . excel . ExcelRuleExtractor ; import com . asakusafw . testdriver . excel . NullityConditionKind ; import com . asakusafw . testdriver . excel . ValueConditionKind ; import com . asakusafw . testdriver . rule . DataModelCondition ; public class LegacyExcelRuleExtractor implements ExcelRuleExtractor { @ Override public boolean supports ( Sheet sheet ) { if ( sheet == null ) { throw new IllegalArgumentException ( "" ) ; } if ( getStringCell ( sheet , 0 , 0 ) != null ) { return false ; } ConditionSheetItem item = ConditionSheetItem . TABLE_NAME ; String cell = getStringCell ( sheet , item . getRow ( ) , item . getCol ( ) ) ; return cell != null && cell . equals ( item . getName ( ) ) ; } @ Override public Set < DataModelCondition > extractDataModelCondition ( Sheet sheet ) throws FormatException { if ( sheet == null ) { throw new IllegalArgumentException ( "" ) ; } ConditionSheetItem item = ConditionSheetItem . ROW_MATCHING_CONDITION ; String cell = getStringCell ( sheet , item . getRow ( ) , item . getCol ( ) + 1 ) ; if ( cell == null ) { cell = "" ; } RowMatchingCondition condition = RowMatchingCondition . getConditonByJapanseName ( cell ) ; if ( condition == null ) { throw new FormatException ( MessageFormat . format ( "" , ConditionSheetItem . ROW_MATCHING_CONDITION . getName ( ) , cell , Arrays . asList ( RowMatchingCondition . getJapaneseNames ( ) ) ) ) ; } switch ( condition ) { case NONE : return EnumSet . allOf ( DataModelCondition . class ) ; case EXACT : return EnumSet . noneOf ( DataModelCondition . class ) ; case PARTIAL : return EnumSet . of ( DataModelCondition . IGNORE_UNEXPECTED ) ; default : throw new AssertionError ( condition ) ; } } @ Override public int extractPropertyRowStartIndex
2,501
<s> package edsdk ; import com . sun . jna . NativeLong ; import com . sun . jna . Structure ; import edsdk . EdSdkLibrary . __EdsObject ; public class EdsSaveImageSetting extends Structure { public NativeLong JPEGQuality ;
2,502
<s> package org . rubypeople . rdt . internal . testunit . wizards ; import org . eclipse . osgi . util . NLS ; public class WizardMessages extends NLS { private static final String BUNDLE_NAME = "" ;
2,503
<s> package org . oddjob . jmx ; import java . io . IOException ; import java . net . ServerSocket ; import java . net . SocketException ; import java . net . SocketImpl ; public class FailableServerSocket extends ServerSocket {
2,504
<s> package de . fuberlin . wiwiss . d2rq . nodes ; import junit . framework . Test ; import junit
2,505
<s> package net . heraan ; import java . util . ArrayList ; import net . heraan . Game . Play ; import net . heraan . Game . Result ; import net . heraan . Player . Player ; public class Round { public Round ( ) { players = new ArrayList < Player > ( ) ; plays = new ArrayList < Play > ( ) ; } public Round ( ArrayList < Player > players ) { this . set_Players ( players ) ; plays = new ArrayList < Play > ( ) ; } public Round ( ArrayList < Player > players , ArrayList < Play > plays ) { this . set_Plays ( players , plays ) ; } public void set_Play ( Player player , Play play ) { this . plays . add ( play ) ; } public void set_Plays ( ArrayList < Player > players , ArrayList < Play > plays ) { this . players = players ; this . plays = plays ; } public void set_Players ( ArrayList < Player > players ) { this . players = players ; } public void add_Player ( Player player ) { this . players . add ( player ) ; } public void add_Players ( ArrayList < Player > players ) { throw new UnsupportedOperationException ( "" ) ; } public Play get_Play ( Player player ) { if ( ( this . players . get ( 0 ) == player ) ) { return ( this . plays . get ( 0 ) ) ; } else { return ( this . plays . get ( 1 ) ) ; } } public ArrayList < Player > get_Players ( ) { return ( this . players ) ; } public ArrayList < Player > get_HasPlayedList ( ) { throw new UnsupportedOperationException ( "" ) ; } public ArrayList < Player > get_HasNotPlayedList ( ) { throw new UnsupportedOperationException ( "" ) ; } public Result get_PlayerResult ( Player player ) { if ( ( this . is_RoundComplete ( ) == false ) ) { return ( null ) ; } if ( ( this . is_Tie ( ) == true ) ) { return ( Result . TIE ) ; } else if ( ( this . get_Winner ( ) == player ) ) { return ( Result . WIN ) ; } else { return ( Result . LOSE ) ; } } public Player get_Winner ( ) { if ( ( this . is_RoundComplete ( ) == false ) ) { return ( null ) ; } if ( ( this . plays . get ( 0 ) == Play . ROCK ) && ( this . plays . get ( 1 ) == Play . SCISSORS ) ) { return ( this . players . get ( 0 ) ) ; } else if
2,506
<s> package com . sun . tools . hat . internal . parser ; import java . io . * ; import java . util . Date ; import java . util . HashMap ; import java . util . Map ; import static com . sun . tools . hat . internal . model . ArrayTypeCodes . * ; import com . sun . tools . hat . internal . model . * ; public class HprofReader extends Reader { final static int MAGIC_NUMBER = 0x4a415641 ; private final static String [ ] VERSIONS = { "" , "" , "" , } ; private final static int VERSION_JDK12BETA3 = 0 ; private final static int VERSION_JDK12BETA4 = 1 ; private final static int VERSION_JDK6 = 2 ; static final int HPROF_UTF8 = 0x01 ; static final int HPROF_LOAD_CLASS = 0x02 ; static final int HPROF_UNLOAD_CLASS = 0x03 ; static final int HPROF_FRAME = 0x04 ; static final int HPROF_TRACE = 0x05 ; static final int HPROF_ALLOC_SITES = 0x06 ; static final int HPROF_HEAP_SUMMARY = 0x07 ; static final int HPROF_START_THREAD = 0x0a ; static final int HPROF_END_THREAD = 0x0b ; static final int HPROF_HEAP_DUMP = 0x0c ; static final int HPROF_CPU_SAMPLES = 0x0d ; static final int HPROF_CONTROL_SETTINGS = 0x0e ; static final int HPROF_LOCKSTATS_WAIT_TIME = 0x10 ; static final int HPROF_LOCKSTATS_HOLD_TIME = 0x11 ; static final int HPROF_GC_ROOT_UNKNOWN = 0xff ; static final int HPROF_GC_ROOT_JNI_GLOBAL = 0x01 ; static final int HPROF_GC_ROOT_JNI_LOCAL = 0x02 ; static final int HPROF_GC_ROOT_JAVA_FRAME = 0x03 ; static final int HPROF_GC_ROOT_NATIVE_STACK = 0x04 ; static final int HPROF_GC_ROOT_STICKY_CLASS = 0x05 ; static final int HPROF_GC_ROOT_THREAD_BLOCK = 0x06 ; static final int HPROF_GC_ROOT_MONITOR_USED = 0x07 ; static final int HPROF_GC_ROOT_THREAD_OBJ = 0x08 ; static final int HPROF_GC_CLASS_DUMP = 0x20 ; static final int HPROF_GC_INSTANCE_DUMP = 0x21 ; static final int HPROF_GC_OBJ_ARRAY_DUMP = 0x22 ; static final int HPROF_GC_PRIM_ARRAY_DUMP = 0x23 ; static final int HPROF_HEAP_DUMP_SEGMENT = 0x1c ; static final int HPROF_HEAP_DUMP_END = 0x2c ; private final static int T_CLASS = 2 ; private int version ; private final int debugLevel ; private long currPos ; private int dumpsToSkip ; private final boolean callStack ; private int identifierSize ; private final Map < Long , String > names ; private final Map < Integer , ThreadObject > threadObjects ; private final Map < Long , String > classNameFromObjectID ; private final Map < Integer , String > classNameFromSerialNo ; private final Map < Long , StackFrame > stackFrames ; private final Map < Integer , StackTrace > stackTraces ; private final Snapshot snapshot ; public HprofReader ( String fileName , PositionDataInputStream in , int dumpNumber , boolean callStack , int debugLevel ) throws IOException { super ( in ) ; RandomAccessFile file = new RandomAccessFile ( fileName , "r" ) ; this . snapshot = new Snapshot ( MappedReadBuffer . create ( file ) ) ; this . dumpsToSkip = dumpNumber - 1 ; this . callStack = callStack ; this . debugLevel = debugLevel ; names = new HashMap < Long , String > ( ) ; threadObjects = new HashMap < Integer , ThreadObject > ( 43 ) ; classNameFromObjectID = new HashMap < Long , String > ( ) ; if ( callStack ) { stackFrames = new HashMap < Long , StackFrame > ( 43 ) ; stackTraces = new HashMap < Integer , StackTrace > ( 43 ) ; classNameFromSerialNo = new HashMap < Integer , String > ( ) ; } else { stackFrames = null ; stackTraces = null ; classNameFromSerialNo = null ; } } public Snapshot read ( ) throws IOException { currPos = 4 ; version = readVersionHeader ( ) ; identifierSize = in . readInt ( ) ; snapshot . setIdentifierSize ( identifierSize ) ; if ( version >= VERSION_JDK12BETA4 ) { snapshot . setNewStyleArrayClass ( true ) ; } else { snapshot . setNewStyleArrayClass ( false ) ; } currPos += 4 ; if ( identifierSize != 4 && identifierSize != 8 ) { throw new IOException ( "" + identifierSize + "" ) ; } System . out . println ( "" + ( new Date ( in . readLong ( ) ) ) ) ; currPos += 8 ; for ( ; ; ) { int type ; try { type = in . readUnsignedByte ( ) ; } catch ( EOFException ignored ) { break ; } in . readInt ( ) ; long length = in . readInt ( ) & 0xffffffffL ; if ( debugLevel > 0 ) { System . out . println ( "" + type + ", length " + length + "" + toHex ( currPos ) ) ; } if ( length < 0 ) { throw new IOException ( "" + length + " at byte " + toHex ( currPos + 5 ) + " of file." ) ; } currPos += 9 + length ; switch ( type ) { case HPROF_UTF8 : { long id = readID ( ) ; byte [ ] chars = new byte [ ( int ) length - identifierSize ] ; in . readFully ( chars ) ; names . put ( id , new String ( chars , "UTF-8" ) ) ; break ; } case HPROF_LOAD_CLASS : { int serialNo = in . readInt ( ) ; long classID = readID ( ) ; int stackTraceSerialNo = in . readInt ( ) ; long classNameID = readID ( ) ; String nm = getNameFromID ( classNameID ) . replace ( '/' , '.' ) ; classNameFromObjectID . put ( classID , nm ) ; if ( classNameFromSerialNo != null ) { classNameFromSerialNo . put ( serialNo , nm ) ; } break ; } case HPROF_HEAP_DUMP : { if ( dumpsToSkip <= 0 ) { try { readHeapDump ( length , currPos ) ; } catch ( EOFException exp ) { handleEOF ( exp , snapshot ) ; } if ( debugLevel > 0 ) { System . out . println ( "" ) ; } return snapshot ; } else { dumpsToSkip -- ; skipBytes ( length ) ; } break ; } case HPROF_HEAP_DUMP_END : { if ( version >= VERSION_JDK6 ) { if ( dumpsToSkip <= 0 ) { skipBytes ( length ) ; return snapshot ; } else { dumpsToSkip -- ; } } else { warn ( "" + type ) ; } skipBytes ( length ) ; break ; } case HPROF_HEAP_DUMP_SEGMENT : { if ( version >= VERSION_JDK6 ) { if ( dumpsToSkip <= 0 ) { try { readHeapDump ( length , currPos ) ; } catch ( EOFException exp ) { handleEOF ( exp , snapshot ) ; } } else { skipBytes ( length ) ; } } else { warn ( "" + type ) ; skipBytes ( length ) ; } break ; } case HPROF_FRAME : { if ( stackFrames == null ) { skipBytes ( length ) ; } else { long id = readID ( ) ; String methodName = getNameFromID ( readID ( ) ) ; String methodSig = getNameFromID ( readID ( ) ) ; String sourceFile = getNameFromID ( readID ( ) ) ; int classSer = in . readInt ( ) ; String className = classNameFromSerialNo . get ( classSer ) ; int lineNumber = in . readInt ( ) ; if ( lineNumber < StackFrame . LINE_NUMBER_NATIVE ) { warn ( "" + lineNumber ) ; lineNumber = StackFrame . LINE_NUMBER_UNKNOWN ; } stackFrames . put ( id , new StackFrame ( methodName , methodSig , className , sourceFile , lineNumber ) ) ; } break ; } case HPROF_TRACE : { if ( stackTraces == null ) { skipBytes ( length ) ; } else { int serialNo = in . readInt ( ) ; int threadSeq = in . readInt ( ) ; StackFrame [ ] frames = new StackFrame [ in . readInt ( ) ] ; for ( int i = 0 ; i < frames . length ; i ++ ) { long fid = readID ( ) ; frames [ i ] = stackFrames . get ( fid ) ; if ( frames [ i ] == null ) { throw new IOException ( "Stack frame " + toHex ( fid ) + " not found" ) ; } } stackTraces . put ( serialNo , new StackTrace ( frames ) ) ; } break ; } case HPROF_UNLOAD_CLASS : case HPROF_ALLOC_SITES : case HPROF_START_THREAD : case HPROF_END_THREAD : case HPROF_HEAP_SUMMARY : case HPROF_CPU_SAMPLES : case HPROF_CONTROL_SETTINGS : case HPROF_LOCKSTATS_WAIT_TIME : case HPROF_LOCKSTATS_HOLD_TIME : { skipBytes ( length ) ; break ; } default : { skipBytes ( length ) ; warn ( "" + type ) ; } } } return snapshot ; } private void skipBytes ( long length ) throws IOException { in . skipBytes ( ( int ) length ) ; } private int readVersionHeader ( ) throws IOException { int candidatesLeft = VERSIONS . length ; boolean [ ] matched = new boolean [ VERSIONS . length ] ; for ( int i = 0 ; i < candidatesLeft ; i ++ ) { matched [ i ] = true ; } int pos = 0 ; while ( candidatesLeft > 0 ) { char c = ( char ) in . readByte ( ) ; currPos ++ ; for ( int i = 0 ; i < VERSIONS . length ; i ++ ) { if ( matched [ i ] ) { if ( c != VERSIONS [ i ] . charAt ( pos ) ) { matched [ i ] = false ; -- candidatesLeft ; } else if ( pos == VERSIONS [ i ] . length ( ) - 1 ) { return i ; } } } ++ pos ; } throw new IOException ( "" + ( pos + 3 ) ) ; } private void readHeapDump ( long bytesLeft , long posAtEnd ) throws IOException { while ( bytesLeft > 0 ) { int type = in . readUnsignedByte ( ) ; if ( debugLevel > 0 ) { System . out . println ( "" + type + "" + toHex ( posAtEnd - bytesLeft ) ) ; } bytesLeft -- ; switch ( type ) { case HPROF_GC_ROOT_UNKNOWN : { long id = readID ( ) ; bytesLeft -= identifierSize ; snapshot . addRoot ( new Root ( id , 0 , Root . UNKNOWN , "" ) ) ; break ; } case HPROF_GC_ROOT_THREAD_OBJ : { long id = readID ( ) ; int threadSeq = in . readInt ( ) ; int stackSeq = in . readInt ( ) ; bytesLeft -= identifierSize + 8 ; threadObjects . put ( threadSeq , new ThreadObject ( id , stackSeq ) ) ; break ; } case HPROF_GC_ROOT_JNI_GLOBAL : { long id = readID ( ) ; long globalRefId = readID ( ) ; bytesLeft -= 2 * identifierSize ; snapshot . addRoot ( new Root ( id , 0 , Root . NATIVE_STATIC , "" ) ) ; break ; } case HPROF_GC_ROOT_JNI_LOCAL : { long id = readID ( ) ; int threadSeq = in . readInt ( ) ; int depth = in . readInt ( ) ; bytesLeft -= identifierSize + 8 ; ThreadObject to = getThreadObjectFromSequence ( threadSeq ) ; StackTrace st = getStackTraceFromSerial ( to . stackSeq ) ; if ( st != null ) { st = st . traceForDepth ( depth + 1 ) ; } snapshot . addRoot ( new Root ( id , to . threadId , Root . NATIVE_LOCAL , "" , st ) ) ; break ; } case HPROF_GC_ROOT_JAVA_FRAME : { long id = readID ( ) ; int threadSeq = in . readInt ( ) ; int depth = in . readInt ( ) ;
2,507
<s> package org . rubypeople . rdt . internal . debug . ui ; import org . eclipse . ui . IEditorInput ; import org . rubypeople . rdt
2,508
<s> package net . sf . sveditor . core . db . expr ; import net . sf .
2,509
<s> package com . asakusafw . vocabulary . operator ; import java . lang . annotation . Documented ; import java . lang . annotation .
2,510
<s> package org . rubypeople . rdt . internal . core . builder ; import java . util . regex . Matcher ; import java . util . regex . Pattern ; import org . jruby . lexer . yacc . IDESourcePosition ; import org . jruby . lexer . yacc . ISourcePosition ; import org . jruby . lexer . yacc . SyntaxException ; import org . rubypeople . rdt . core . compiler . CategorizedProblem ; import org . rubypeople . rdt . core . compiler . IProblem ; import org . rubypeople . rdt . internal . core . parser . Error ; public class SyntaxExceptionHandler { public static CategorizedProblem handle ( SyntaxException e , String contents ) { String restOfSource = contents . substring ( e . getPosition ( ) . getStartOffset ( ) ) ; if ( restOfSource != null && e . getMessage ( ) . trim ( ) . endsWith ( "" ) && restOfSource . startsWith ( "begin" ) ) { int endIndex = restOfSource . indexOf ( "=end" ) ; if ( endIndex == - 1 ) { endIndex = contents . length ( ) ; } else { endIndex += e . getPosition ( ) . getStartOffset ( ) + 3 ; } ISourcePosition pos = new IDESourcePosition ( e . getPosition ( ) . getFile ( ) , e . getPosition ( ) . getStartLine ( ) , e . getPosition ( ) . getEndLine ( ) , e . getPosition ( ) . getStartOffset ( ) - 1 , endIndex ) ; CategorizedProblem problem = new Error ( pos , "" , IProblem . MultineCommentNotAtFirstColumn ) ; return problem ; } else if ( e . getMessage ( ) . trim ( ) . endsWith ( "" ) ) { Pattern p = Pattern . compile ( "" ) ; Matcher m = p . matcher ( contents ) ; if ( m . find ( ) ) { int startLine = getLineOfOffset ( m . start ( ) , contents ) ; int endLine = getLineOfOffset ( m . end ( ) , contents ) ; ISourcePosition pos = new IDESourcePosition ( e . getPosition ( ) . getFile ( ) , startLine , endLine , m . start ( ) , m . end ( ) ) ; return new Error ( pos , "" , IProblem . Syntax ) ; } } return grabPrecedingPrefixForPosition ( e , contents ) ; }
2,511
<s> package com . asakusafw . testdriver . file ; import java . lang . annotation . Annotation ; import java . util . Collection ; import java . util . Collections ; import org . apache . hadoop . io . Text ; import com . asakusafw . testdriver . core . DataModelDefinition ; import com . asakusafw . testdriver . core . DataModelReflection ; import com . asakusafw . testdriver . core . PropertyName ; import com . asakusafw . testdriver . core . PropertyType ; public class MockTextDefinition implements DataModelDefinition < Text > { static final PropertyName VALUE = PropertyName . newInstance ( "value" ) ; @ Override public Class < Text > getModelClass ( ) { return Text . class ; } @ Override public < A
2,512
<s> package test . modelgen . table . io ; import java . io . IOException ; import javax . annotation . Generated ; import test . modelgen . table . model . CacheFiles ; import com . asakusafw . runtime . io . ModelOutput ; import com .
2,513
<s> package net . sf . sveditor . core . db . stmt ; import net . sf . sveditor . core . db . SVDBItemType ; public class SVDBTimePrecisionStmt extends SVDBStmt { public String fArg1 ; public String fArg2 ; public SVDBTimePrecisionStmt ( ) { super ( SVDBItemType . TimePrecisionStmt ) ; } public String getArg1 ( ) { return fArg1 ; } public void setArg1 ( String arg1 ) { fArg1 = arg1 ; } public String getArg2
2,514
<s> package net . sf . sveditor . core . db . index ; import java . util . Iterator ; import net . sf . sveditor . core . db . ISVDBItemBase ; import net . sf . sveditor . core . db . SVDBItemType ; import org . eclipse . core . runtime . IProgressMonitor ; class SVDBIndexItemItIterator implements ISVDBItemIterator { private Iterator < ISVDBIndexIterator > fIterator ;
2,515
<s> package com . asakusafw . yaess . basic ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . IOException ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . HashSet ; import java . util . List ; import java . util . Map ; import java . util . Set ; import java . util . concurrent . atomic . AtomicInteger ; import org . junit . Test ; import com . asakusafw . yaess . core . ExecutionContext ; import com . asakusafw . yaess . core . ExecutionMonitor ; import com . asakusafw . yaess . core . ExecutionPhase ; import com . asakusafw . yaess . core . Job ; import com . asakusafw . yaess . core . JobScheduler ; import com . asakusafw . yaess . core . PhaseMonitor ; import com . asakusafw . yaess . core . ProfileContext ; import com . asakusafw . yaess . core . ServiceProfile ; public class BasicJobSchedulerTest { private static final ExecutionContext CONTEXT = new ExecutionContext ( "b" , "f" , "e" , ExecutionPhase . MAIN , Collections . < String , String > emptyMap ( ) ) ; @ Test public void simple ( ) throws Exception { Map < String , String > conf = new HashMap < String , String > ( ) ; ServiceProfile < JobScheduler > profile = new ServiceProfile < JobScheduler > ( "testing" , BasicJobScheduler . class , conf , ProfileContext . system ( getClass ( ) . getClassLoader ( ) ) ) ; JobScheduler instance = profile . newInstance ( ) ; List < Mock > jobs = new ArrayList < Mock > ( ) ; jobs . add ( new Mock ( "a" ) ) ; instance . execute ( PhaseMonitor . NULL , CONTEXT , jobs , JobScheduler . STRICT ) ; Set < String > rest = collectRest ( jobs ) ; assertThat ( rest . size ( ) , is ( 0 ) ) ; } @ Test public void multiple ( ) throws Exception { Map < String , String > conf = new HashMap < String , String > ( ) ; ServiceProfile < JobScheduler > profile = new ServiceProfile < JobScheduler > ( "testing" , BasicJobScheduler . class , conf , ProfileContext . system ( getClass ( ) . getClassLoader ( ) ) ) ; JobScheduler instance = profile . newInstance ( ) ; List < Mock > jobs = new ArrayList < Mock > ( ) ; jobs . add ( new Mock ( "a" ) ) ; jobs . add ( new Mock ( "b" ) ) ; jobs . add ( new Mock ( "c" ) ) ; instance . execute ( PhaseMonitor . NULL , CONTEXT , jobs , JobScheduler . STRICT ) ; Set < String > rest = collectRest ( jobs ) ; assertThat ( rest . size ( ) , is ( 0 ) ) ; } @ Test public void dependencies ( ) throws Exception { Map < String , String > conf = new HashMap < String , String > ( ) ; ServiceProfile < JobScheduler > profile = new ServiceProfile < JobScheduler > ( "testing" , BasicJobScheduler . class , conf , ProfileContext . system ( getClass ( ) . getClassLoader ( ) ) ) ; JobScheduler instance = profile . newInstance ( ) ; AtomicInteger group = new AtomicInteger ( ) ; List < Mock > jobs = new ArrayList < Mock > ( ) ; jobs . add ( new Mock ( group , "b" , "a" ) ) ; jobs . add ( new Mock ( group , "d" , "b" , "c" ) ) ; jobs . add ( new Mock ( group , "a" ) ) ; jobs . add ( new Mock ( group , "c" , "a" ) ) ; instance . execute ( PhaseMonitor . NULL , CONTEXT , jobs , JobScheduler . STRICT ) ; Set < String > rest = collectRest ( jobs ) ; assertThat ( rest . size ( ) , is ( 0 ) ) ; assertThat ( ordinary ( jobs , "a" ) , lessThan ( ordinary ( jobs , "b" ) ) ) ; assertThat ( ordinary ( jobs , "a" ) , lessThan ( ordinary ( jobs , "c" ) ) ) ; assertThat ( ordinary ( jobs , "b" ) , lessThan ( ordinary ( jobs , "d" ) ) ) ; assertThat ( ordinary ( jobs , "c" ) , lessThan ( ordinary ( jobs , "d" ) ) ) ; } @ Test public void cyclic ( ) throws Exception { Map < String , String > conf = new HashMap < String , String > ( ) ; ServiceProfile < JobScheduler > profile = new ServiceProfile < JobScheduler > ( "testing" , BasicJobScheduler . class , conf , ProfileContext . system ( getClass ( ) . getClassLoader ( ) ) ) ; JobScheduler instance = profile . newInstance ( ) ; AtomicInteger group = new AtomicInteger ( ) ; List < Mock > jobs = new ArrayList < Mock > ( ) ; jobs . add ( new Mock ( group , "a" ) ) ; jobs . add ( new Mock ( group , "b" , "a" , "d" ) ) ; jobs . add ( new Mock ( group , "c" , "b" ) ) ; jobs . add ( new Mock ( group , "d" , "c" ) ) ; jobs . add ( new Mock ( group , "e" , "d" ) ) ; try { instance . execute ( PhaseMonitor . NULL , CONTEXT , jobs , JobScheduler . STRICT ) ; fail ( ) ; } catch ( IOException e ) { } Set < String > rest = collectRest ( jobs ) ; assertThat ( rest . size ( ) , is ( 4 ) ) ; assertThat ( rest , hasItem ( "b" ) ) ; assertThat ( rest , hasItem ( "c" ) ) ; assertThat ( rest , hasItem ( "d" ) ) ; assertThat ( rest , hasItem ( "e" ) ) ; } @ Test public void fail_job ( ) throws Exception { Map < String , String > conf = new HashMap < String , String > ( ) ; ServiceProfile < JobScheduler > profile = new ServiceProfile < JobScheduler > ( "testing" , BasicJobScheduler . class , conf , ProfileContext . system ( getClass ( ) . getClassLoader ( ) ) ) ; JobScheduler instance = profile . newInstance ( ) ; List < Mock > jobs = new ArrayList
2,516
<s> package org . rubypeople . rdt . refactoring . tests . core . generateaccessors ; public class AccessorSelection { private String className ; private String attributeName ; private boolean readerSelected ; private boolean writerSelected ; public AccessorSelection ( String className , String attributeName , boolean readerSelected , boolean writerSelected ) { this . className = className ; this . attributeName = attributeName ; this .
2,517
<s> package com . aptana . rdt . core . gems ; import java . net . URL ; import java . util . ArrayList ; import java . util . Collection ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . Set ; import org . eclipse . core . runtime . FileLocator ; import org . eclipse . core . runtime . IConfigurationElement ; import org . eclipse . core . runtime . IExtensionPoint ; import org . eclipse . core . runtime . InvalidRegistryObjectException ; import org . eclipse . core . runtime . Path ; import org . eclipse . core . runtime . Platform ; import org . osgi . framework . Bundle ; import org . rubypeople . rdt . launching . RubyRuntime ; import com . aptana . rdt . AptanaRDTPlugin ; public class ContributedGemRegistry { private static Collection < Gem > fContributed ; private ContributedGemRegistry ( ) { } public static Collection < Gem > getContributedGems ( ) { if ( fContributed == null ) { Collection < Gem > gems = new ArrayList < Gem > ( ) ; IExtensionPoint extensionPoint = Platform . getExtensionRegistry ( ) . getExtensionPoint ( AptanaRDTPlugin . PLUGIN_ID , AptanaRDTPlugin . EXTENSION_POINT_GEMS ) ; IConfigurationElement [ ] configs = extensionPoint . getConfigurationElements ( ) ; for ( int i = 0 ; i < configs . length ; i ++ ) { IConfigurationElement element = configs [ i ] ; if ( ! "gem" . equals ( element . getName ( ) ) ) continue ; try { Gem gem = createGem ( element ) ; if ( gem == null ) continue ; gems . add ( gem ) ; } catch ( InvalidRegistryObjectException e ) { AptanaRDTPlugin . log ( e ) ; } } fContributed = gems ; } return fContributed ; } private static Gem createGem ( IConfigurationElement element ) { boolean install = false ; String autoInstall = element . getAttribute ( "auto-install" ) ; if ( autoInstall != null && autoInstall . trim ( ) . length ( ) > 0 ) { install = Boolean . parseBoolean ( autoInstall ) ; } if ( ! install ) return null ; String name = element . getAttribute ( "name" ) ; Gem gem = null ; String path = element . getAttribute ( "path" ) ; if ( path == null || path . trim ( ) . length ( ) == 0 ) { gem = new Gem ( name , getVersion ( element ) , null ) ; } else { gem = createLocalGem ( name , path , element ) ; } String compiles = element . getAttribute ( "compiles" ) ; gem . setCompiles ( Boolean . parseBoolean ( compiles ) ) ; boolean forceUpdate = false ; String forceUpdateRaw = element . getAttribute ( "force-update" ) ; if ( forceUpdateRaw != null && forceUpdateRaw . trim ( ) . length ( ) > 0 ) { forceUpdate = Boolean . parseBoolean ( forceUpdateRaw ) ; } gem . setForceUpdate ( forceUpdate ) ; return gem ; } private static Gem createLocalGem ( String name , String path , IConfigurationElement element ) { Bundle bundle = Platform . getBundle ( element . getContributor ( ) . getName ( ) ) ; URL url = FileLocator . find ( bundle , new Path ( path ) , null ) ; if ( url == null ) { AptanaRDTPlugin . log ( "" + path + " in the " + element . getContributor ( ) . getName ( ) + " plugin" ) ; return null ; } Gem gem = null ; if ( name == null || name . trim ( ) . length ( ) == 0 ) gem = LocalFileGem . create ( url ) ; else { String platform = element . getAttribute ( "platform" ) ; if ( platform == null || platform . trim ( ) . length ( ) == 0 ) platform = Gem . RUBY_PLATFORM ; gem = new LocalFileGem ( url , name , getVersion ( element ) , "" , platform ) ; } IConfigurationElement [ ] dependencies = element . getChildren ( "dependency" ) ; for ( int j = 0 ; j < dependencies . length ; j ++ ) { String dependency = dependencies [ j ] . getAttribute ( "name" ) ; ( ( LocalFileGem ) gem ) . addDependency ( dependency ) ; } return gem ; } private static String getVersion ( IConfigurationElement element ) { String version = element . getAttribute ( "version" ) ; if ( version != null ) return version ; return Gem . ANY_VERSION ; } public static Gem getGem ( String name ) { Collection < Gem > gems = filterByPlatform ( getContributedGems ( ) ) ; for ( Gem gem : gems ) { if ( gem . getName ( ) . equals ( name ) ) { return gem ; } } return null ; } public static Collection < Gem > filterByPlatform ( Collection < Gem > gems ) { Map < String , Gem > map = new HashMap < String , Gem > ( ) ; for ( Gem gem : gems ) { if ( map . containsKey ( gem . getName ( ) ) ) { if ( RubyRuntime . currentVMIsJRuby ( ) && gem . getPlatform ( ) . equals ( Gem . JRUBY_PLATFORM ) ) { map . put ( gem . getName ( ) , gem ) ; } if ( ! RubyRuntime . currentVMIsJRuby ( ) && Platform . getOS ( ) . equals ( Platform . OS_WIN32 ) && gem . getPlatform ( ) . equals ( Gem
2,518
<s> package net . bioclipse . opentox . ui . wizards ; import java . lang . reflect . InvocationTargetException ; import java . util . List ; import net . bioclipse . browser . editors . RichBrowserEditor ; import net . bioclipse . cdk . business . ICDKManager ; import net . bioclipse . cdk . domain . ICDKMolecule ; import net . bioclipse . opentox . Activator ; import net . bioclipse . opentox . business . IOpentoxManager ; import org . apache . log4j . Logger ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . SubProgressMonitor ; import org . eclipse . jface . operation . IRunnableWithProgress ; import org . eclipse . jface . viewers . IStructuredSelection ; import org . eclipse . jface . wizard . Wizard ; import org . eclipse . swt . widgets . Display ; import org . eclipse . ui . IEditorPart ; import org . eclipse . ui . INewWizard ; import org . eclipse . ui . IWorkbench ; import org . eclipse . ui . PartInitException ; import org . eclipse . ui . PlatformUI ; import org . eclipse . ui . internal . part . NullEditorInput ; public class CreateDatasetWizard extends Wizard implements INewWizard { private CreateDatasetPage createDatasetPage ; private static final Logger logger = Logger . getLogger ( CreateDatasetWizard . class ) ; private String license ; private String title ; private String service ; private IFile file ; public String getLicense ( ) { return license ; } public void setLicense ( String license ) { this . license = license ; } public String getTitle ( ) { return title ; } public void setTitle ( String title ) { this . title = title ; } public String getService ( ) { return service ; } public void setService ( String service ) { this . service = service ; } public CreateDatasetWizard ( ) { super ( ) ; setWindowTitle ( "" ) ; setNeedsProgressMonitor ( true ) ; } public CreateDatasetWizard ( IFile file ) { this ( ) ; this . file = file ; } public void init ( IWorkbench workbench , IStructuredSelection selection ) { } public void addPages ( ) { createDatasetPage = new CreateDatasetPage ( file ) ; this . addPage ( createDatasetPage ) ; } @ Override public boolean performFinish ( ) { try { getContainer ( ) . run ( true , true , new IRunnableWithProgress ( ) { public void run ( IProgressMonitor monitor ) { try { IOpentoxManager opentox = Activator . getDefault ( ) . getJavaOpentoxManager ( ) ; ICDKManager cdk = net . bioclipse . cdk . business . Activator . getDefault ( ) . getJavaCDKManager ( ) ; monitor . beginTask ( "" , 10 ) ; monitor . subTask ( "" ) ; monitor . worked ( 1 ) ; List < ICDKMolecule > mols = null ; mols = cdk . loadMolecules ( file , new SubProgressMonitor ( monitor , 7 ) ) ; monitor . subTask ( "" ) ; monitor . worked ( 1 ) ; final String datasetURI = opentox . createDataset ( service , mols ) ; System . out . println ( "" + datasetURI ) ; monitor . subTask ( "" ) ; if ( title != null && title .
2,519
<s> package de . fuberlin . wiwiss . d2rq . server ; import java . io . IOException ; import javax . servlet . ServletException ; import javax . servlet . http . HttpServlet ; import javax . servlet . http . HttpServletRequest ; import javax . servlet . http . HttpServletResponse ; import com . hp . hpl . jena . rdf . model . Model ; import com . hp . hpl . jena . rdf . model . ModelFactory ; import com . hp . hpl . jena . rdf . model . Resource ; import com . hp . hpl . jena . vocabulary . RDFS ; import de . fuberlin . wiwiss . d2rq . ClassMapLister ; public class ClassMapServlet extends HttpServlet { protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { D2RServer server = D2RServer . fromServletContext ( getServletContext ( ) ) ; server . checkMappingFileChanged ( ) ; if ( request . getPathInfo ( ) == null ) { new ModelResponse ( classMapListModel ( ) , request , response ) . serve ( ) ; return ; } String classMapName = request . getPathInfo ( ) . substring ( 1 ) ; Model resourceList = getClassMapLister ( ) . classMapInventory ( classMapName ) ; if ( resourceList == null ) { response . sendError ( 404 , "" + classMapName + "' not found." ) ; return ; } Resource classMap = resourceList . getResource ( server . baseURI ( ) + "all/" + classMapName ) ; Resource directory = resourceList . createResource ( server . baseURI ( ) + "all" ) ; classMap . addProperty ( RDFS . seeAlso , directory ) ; classMap . addProperty ( RDFS . label , "" + classMapName ) ; directory . addProperty ( RDFS . label , "" ) ; server . addDocumentMetadata ( resourceList , classMap ) ; new ModelResponse ( resourceList , request , response ) . serve ( ) ; } private ClassMapLister getClassMapLister ( ) { return D2RServer . retrieveSystemLoader ( getServletContext ( ) ) . getClassMapLister ( ) ; } private Model classMapListModel ( ) {
2,520
<s> package de . fuberlin . wiwiss . d2rq . expr ; import de . fuberlin . wiwiss . d2rq . algebra . ColumnRenamer ; public class Subtract extends BinaryOperator {
2,521
<s> package com . asakusafw . utils . java . internal . model . syntax ; import java . util . List ; import com . asakusafw . utils . java . model . syntax . ArrayCreationExpression ; import com . asakusafw . utils . java . model . syntax . ArrayInitializer ; import com . asakusafw . utils . java . model . syntax . ArrayType ; import com . asakusafw . utils . java . model . syntax . Expression ; import com . asakusafw . utils . java . model . syntax . ModelKind ; import com . asakusafw . utils . java .
2,522
<s> package org . rubypeople . rdt . internal . core . search . indexing ; import org . eclipse . core . runtime . IPath ; import org . rubypeople . rdt . internal . core . search . processing . IJob ; public abstract class IndexRequest implements IJob { protected boolean isCancelled = false ; protected IPath containerPath ; protected IndexManager manager ; public IndexRequest ( IPath containerPath , IndexManager manager ) { this . containerPath = containerPath ; this . manager = manager ; } public boolean belongsTo ( String projectNameOrJarPath ) { return projectNameOrJarPath . equals ( this . containerPath . segment ( 0 ) ) || projectNameOrJarPath . equals ( this . containerPath . toString ( ) ) ; } public void cancel ( ) { this .
2,523
<s> package com . asakusafw . vocabulary . bulkloader ; 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 ; @ Target ( { ElementType . TYPE
2,524
<s> package de . fuberlin . wiwiss . d2rq . sql . types ; import de . fuberlin . wiwiss . d2rq . sql . vendor . Vendor ;
2,525
<s> package org . rubypeople . rdt . internal . ui . wizards . buildpaths ; import java . util . List ; import org . eclipse . core . resources . IContainer ; import org . rubypeople . rdt . internal . ui . RubyPluginImages ; import org . rubypeople . rdt . internal . ui . wizards . NewWizardMessages ; public class AddSourceFolderWizard extends BuildPathWizard { private AddSourceFolderWizardPage fAddFolderPage ; private SetFilterWizardPage fFilterPage ; private final boolean fLinkedMode ; private boolean fAllowConflict ; private final boolean fAllowRemoveProjectFolder ; private final boolean fAllowAddExclusionPatterns ; private final boolean fCanCommitConflict ; private final IContainer fParent ; public AddSourceFolderWizard ( CPListElement [ ] existingEntries , CPListElement newEntry , boolean linkedMode , boolean canCommitConflict , boolean allowConflict , boolean allowRemoveProjectFolder , boolean allowAddExclusionPatterns ) { this ( existingEntries , newEntry , linkedMode , canCommitConflict , allowConflict , allowRemoveProjectFolder , allowAddExclusionPatterns , newEntry . getRubyProject ( ) . getProject ( ) ) ; } public AddSourceFolderWizard ( CPListElement [ ] existingEntries , CPListElement newEntry , boolean linkedMode , boolean canCommitConflict , boolean allowConflict , boolean allowRemoveProjectFolder , boolean allowAddExclusionPatterns , IContainer parent ) { super ( existingEntries , newEntry , getTitel ( newEntry , linkedMode ) , RubyPluginImages . DESC_WIZBAN_NEWSRCFOLDR ) ; fLinkedMode = linkedMode ; fCanCommitConflict = canCommitConflict ; fAllowConflict = allowConflict ; fAllowRemoveProjectFolder = allowRemoveProjectFolder ; fAllowAddExclusionPatterns = allowAddExclusionPatterns ; fParent = parent ; } private static String getTitel ( CPListElement newEntry , boolean linkedMode ) { if ( newEntry . getPath ( ) == null ) { if
2,526
<s> package de . fuberlin . wiwiss . d2rq . assembler ; import com . hp . hpl . jena . assembler . Assembler ; import com . hp . hpl . jena . assembler . Mode ; import com . hp . hpl . jena . assembler . assemblers . AssemblerBase ; import com . hp . hpl . jena . rdf . model . Resource ; import com . hp . hpl . jena . rdf
2,527
<s> package com . asakusafw . utils . java . internal . model . syntax ; import com . asakusafw . utils . java . model . syntax . Expression ; import com . asakusafw . utils . java . model . syntax . IfStatement ; import com . asakusafw . utils . java . model . syntax . ModelKind ; import com . asakusafw . utils . java . model . syntax . Statement ; import com . asakusafw . utils . java . model . syntax . Visitor ; public final class IfStatementImpl extends ModelRoot implements IfStatement { private Expression condition ; private Statement thenStatement ; private Statement elseStatement ; @ Override public Expression getCondition ( ) { return this . condition ; } public void setCondition ( Expression condition ) { Util . notNull ( condition , "condition" ) ; this . condition = condition ; } @ Override public Statement getThenStatement ( ) { return this . thenStatement ; } public void setThenStatement ( Statement thenStatement ) { Util . notNull ( thenStatement , "" ) ; this . thenStatement = thenStatement ; }
2,528
<s> package com . asakusafw . runtime . value ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . ByteArrayInputStream ; import java . io . ByteArrayOutputStream ; import java . io . DataInputStream ; import java . io . DataOutputStream ; import java . io . IOException ; import java . lang . reflect . Method ; import org . apache . hadoop . io . Writable ; public class ValueOptionTestRoot { protected < T extends ValueOption < T > > int compare ( T a , T b ) { int object = a . compareTo ( b ) ; Class < ? > klass = a . getClass ( ) ; try { byte [ ] b1 = toBytes ( a ) ; byte [ ] b2 = toBytes ( b ) ; Method method = klass . getMethod ( "compareBytes" , byte [ ] . class , int . class , int . class , byte [ ] . class , int . class , int . class ) ; int bytes = ( Integer ) method . invoke ( null , b1 , 0 , b1 . length , b2 , 0 , b2 . length ) ; assertThat ( sign ( bytes ) , is ( sign ( object ) ) ) ; } catch ( Exception e ) { throw new AssertionError ( e ) ; } return object ; } private int
2,529
<s> package org . rubypeople . rdt . refactoring . classnodeprovider ; import java . util . ArrayList ; import java . util . Collection ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . Path ; import org . jruby . ast . ArrayNode ; import org . jruby . ast . FCallNode ; import org . jruby . ast . Node ; import org . jruby . ast . StrNode ; import org . rubypeople . rdt . refactoring . core . NodeProvider ; import org . rubypeople . rdt . refactoring . documentprovider . IDocumentProvider ; public class IncludedClassesProvider extends ClassNodeProvider { private String includingFileName ; private ArrayList < IPath > includeFilePaths ; public IncludedClassesProvider ( IDocumentProvider documentProvider ) { super ( documentProvider ) ; this . includingFileName = documentProvider . getActiveFileName ( ) ; prepareIncludedFileNames ( ) ; addIncludedFiles ( ) ; } public String getIncludingFileName ( ) { return includingFileName ; } public String getIncludingFileDocument ( ) { return documentProvider . getActiveFileContent ( ) ; } private void prepareIncludedFileNames ( ) { includeFilePaths = new ArrayList < IPath > ( ) ; Node rootNode = documentProvider . getActiveFileRootNode ( ) ; Collection < FCallNode > loadAndRequireNodes = NodeProvider . getLoadAndRequireNodes ( rootNode ) ; for ( FCallNode fCallNode : loadAndRequireNodes ) { addToIncludeFiles ( fCallNode . getArgsNode ( ) ) ; } } private void addToIncludeFiles ( Node node ) { if ( node instanceof ArrayNode ) { ArrayNode arrayNode = ( ArrayNode ) node ; for ( Object o : arrayNode . childNodes ( ) ) { if ( o instanceof StrNode ) { StrNode strNode = ( StrNode ) o ; appendPath ( strNode . getValue ( ) . toString ( ) ) ; } } } } private void appendPath ( String pathName ) { IPath path = new Path
2,530
<s> package org . rubypeople . rdt . internal . ui . wizards ; import org . eclipse . core . runtime . Platform ; import org . eclipse . jface . dialogs . IPageChangedListener ; import org . eclipse . jface . dialogs . PageChangedEvent ; import org . eclipse . jface . wizard . IWizardPage ; import org . eclipse . jface . wizard . WizardDialog ; import org . eclipse . jface . wizard . WizardPage ; 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 . Button ; import org . eclipse . swt . widgets . Composite ; import org . eclipse . swt . widgets . Group ; class InstallRubyWizardPage extends WizardPage implements IWizardPage , IPageChangedListener { protected IWizardPage fNextPage ; private Button installRubyButton ; private Button useJrubyButton ; private Button browseButton ; protected InstallRubyWizardPage ( ) { super ( "" ) ; setTitle ( NewWizardMessages . InstallRubyWizardPage_TTL ) ; setDescription ( NewWizardMessages . InstallRubyWizardPage_MSG_Description ) ; } public void createControl ( Composite parent ) { Composite main = new Composite ( parent , SWT . NONE ) ; GridLayout layout = new GridLayout ( ) ; layout . marginHeight = 0 ; layout . marginWidth = 0 ; main . setLayout ( layout ) ; main . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; Group group = new Group ( main , SWT . NONE ) ; group . setLayout ( new GridLayout ( 1 , false ) ) ; group . setText ( NewWizardMessages . InstallRubyWizardPage_LBL_Options
2,531
<s> package com . asakusafw . compiler . flow . stage ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . util . List ; import org . junit . Test ; import com . asakusafw . compiler . common . Naming ; import com . asakusafw . compiler . flow . JobflowCompilerTestRoot ; import com . asakusafw . compiler . flow . example . CoGroupStage ; import com . asakusafw . compiler . flow . plan . StageBlock ; import com . asakusafw . compiler . flow . plan . StageGraph ; import com . asakusafw . compiler . flow . stage . ShuffleModel . Segment ; import com . asakusafw . compiler . flow . stage . ShuffleModel . Term ; import com . asakusafw . compiler . flow . testing . model . Ex1 ; import com . asakusafw . compiler . flow . testing . model . Ex2 ; import com . asakusafw . runtime . flow . SegmentedWritable ; import com . asakusafw . utils . java . model . syntax . Name ; import com . asakusafw . vocabulary . flow . FlowDescription ; public class ShuffleKeyEmitterTest extends JobflowCompilerTestRoot { @ Test public void simple ( ) throws Exception { ShuffleModel analyzed = shuffle ( CoGroupStage . class ) ; ShuffleKeyEmitter emitter = new ShuffleKeyEmitter ( environment ) ; Name name = emitter . emit ( analyzed ) ; ClassLoader loader = start ( ) ; SegmentedWritable key = ( SegmentedWritable ) create ( loader , name ) ; List < Segment > segments = analyzed . getSegments ( ) ; assertThat ( segments . size ( ) , is ( 2 ) ) ; Segment seg1 = segments . get ( 0 ) ; Segment seg2 = segments . get ( 1 ) ; assertThat ( seg1 . getTerms ( ) . size ( ) , is ( 2 ) ) ; assertThat ( seg2 . getTerms ( ) . size ( ) , is ( 2 ) ) ; Ex1 ex1 = new Ex1 ( ) ; ex1 . setSid ( 1 ) ; ex1 . setValue ( 100 ) ; ex1 . setStringAsString ( "ex1" ) ; setShuffleKey ( seg1 , key , ex1 ) ; assertThat ( key . getSegmentId ( ) , is ( seg1 . getPortId ( ) ) ) ; Object k1value = getKeyGroupField ( seg1 , "value" , key ) ;
2,532
<s> package org . rubypeople . rdt . internal . ui . preferences . formatter ; import java . io . ByteArrayInputStream ; import java . io . ByteArrayOutputStream ; import java . io . File ; import java . io . FileInputStream ; import java . io . FileOutputStream ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import java . io . UnsupportedEncodingException ; import java . util . ArrayList ; import java . util . Collection ; import java . util . Collections ; import java . util . HashMap ; import java . util . Iterator ; import java . util . List ; import java . util . Map ; import javax . xml . parsers . DocumentBuilder ; import javax . xml . parsers . DocumentBuilderFactory ; import javax . xml . parsers . ParserConfigurationException ; import javax . xml . parsers . SAXParser ; import javax . xml . parsers . SAXParserFactory ; import javax . xml . transform . OutputKeys ; import javax . xml . transform . Transformer ; import javax . xml . transform . TransformerException ; import javax . xml . transform . TransformerFactory ; import javax . xml . transform . dom . DOMSource ; import javax . xml . transform . stream . StreamResult ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . resources . ResourcesPlugin ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . preferences . IEclipsePreferences ; import org . eclipse . core . runtime . preferences . IScopeContext ; import org . osgi . service . prefs . BackingStoreException ; import org . rubypeople . rdt . core . RubyCore ; import org . rubypeople . rdt . internal . ui . RubyPlugin ; import org . rubypeople . rdt . internal . ui . RubyUIException ; import org . rubypeople . rdt . internal . ui . RubyUIStatus ; import org . rubypeople . rdt . internal . ui . preferences . PreferencesAccess ; import org . rubypeople . rdt . internal . ui . preferences . formatter . ProfileManager . CustomProfile ; import org . rubypeople . rdt . internal . ui . preferences . formatter . ProfileManager . Profile ; import org . rubypeople . rdt . ui . RubyUI ; import org . w3c . dom . Document ; import org . w3c . dom . Element ; import org . xml . sax . Attributes ; import org . xml . sax . InputSource ; import org . xml . sax . SAXException ; import org . xml . sax . helpers . DefaultHandler ; public class ProfileStore { private final static class ProfileDefaultHandler extends DefaultHandler { private List fProfiles ; private int fVersion ; private String fName ; private Map fSettings ; public void startElement ( String uri , String localName , String qName , Attributes attributes ) throws SAXException { if ( qName . equals ( XML_NODE_SETTING ) ) { final String key = attributes . getValue ( XML_ATTRIBUTE_ID ) ; final String value = attributes . getValue ( XML_ATTRIBUTE_VALUE ) ; fSettings . put ( key , value ) ; } else if ( qName . equals ( XML_NODE_PROFILE ) ) { fName = attributes . getValue ( XML_ATTRIBUTE_NAME ) ; fSettings = new HashMap ( 200 ) ; } else if ( qName . equals ( XML_NODE_ROOT ) ) { fProfiles = new ArrayList ( ) ; try { fVersion = Integer . parseInt ( attributes . getValue ( XML_ATTRIBUTE_VERSION ) ) ; } catch ( NumberFormatException ex ) { throw new SAXException ( ex ) ; } } } public void endElement ( String uri , String localName , String qName ) { if ( qName . equals ( XML_NODE_PROFILE ) ) { fProfiles . add ( new CustomProfile ( fName , fSettings , fVersion ) ) ; fName = null ; fSettings = null ; } } public List getProfiles ( ) { return fProfiles ; } } private static final String PREF_FORMATTER_PROFILES = "" ; private static final String PREF_FORMATTER_PROFILES_VERSION = "" ; private final static String XML_NODE_ROOT = "profiles" ; private final static String XML_NODE_PROFILE = "profile" ; private final static String XML_NODE_SETTING = "setting" ; private final static String XML_ATTRIBUTE_VERSION = "version" ; private final static String XML_ATTRIBUTE_ID = "id" ; private final static String XML_ATTRIBUTE_NAME = "name" ; private final static String XML_ATTRIBUTE_VALUE = "value" ; private ProfileStore ( ) { } public static List readProfiles ( IScopeContext instanceScope ) throws CoreException { List res = readProfilesFromPreferences ( PREF_FORMATTER_PROFILES , instanceScope ) ; if ( res == null ) { return readOldForCompatibility ( instanceScope ) ; } return res ; } public static void writeProfiles ( Collection profiles , IScopeContext instanceScope ) throws CoreException { ByteArrayOutputStream stream = new ByteArrayOutputStream ( 2000 ) ; try { writeProfilesToStream ( profiles , stream ) ; String val ; try { val = stream . toString ( "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { val = stream . toString ( ) ; } IEclipsePreferences uiPreferences = instanceScope . getNode ( RubyUI . ID_PLUGIN ) ; uiPreferences . put ( PREF_FORMATTER_PROFILES , val ) ; uiPreferences . putInt ( PREF_FORMATTER_PROFILES_VERSION , ProfileVersioner . CURRENT_VERSION ) ; } finally { try { stream . close ( ) ; } catch ( IOException e ) { } } } private static List readProfilesFromPreferences ( String key , IScopeContext instanceScope ) throws CoreException { String string = instanceScope . getNode ( RubyUI . ID_PLUGIN ) . get ( key , null ) ; if ( string != null && string . length ( ) > 0 ) { byte [ ] bytes ; try { bytes = string . getBytes ( "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { bytes = string . getBytes ( ) ; } InputStream is = new ByteArrayInputStream ( bytes ) ; try { List res = readProfilesFromStream ( new InputSource ( is ) ) ; if ( res != null ) { for ( int i = 0 ; i < res . size ( ) ; i ++ ) { ProfileVersioner . updateAndComplete ( ( CustomProfile ) res . get ( i ) ) ; } } return res ; } finally { try { is . close ( ) ; } catch ( IOException e ) { } } } return null ; } private static List readOldForCompatibility ( IScopeContext instanceScope ) { final String STORE_FILE = "" ; File file = RubyPlugin . getDefault ( ) . getStateLocation ( ) . append ( STORE_FILE ) . toFile ( ) ; if ( ! file . exists ( ) ) return null ; try { final FileReader reader = new FileReader ( file ) ; try { List res = readProfilesFromStream ( new InputSource ( reader ) ) ; if ( res != null ) { for ( int i = 0 ; i < res . size ( ) ; i ++ ) { ProfileVersioner . updateAndComplete ( ( CustomProfile ) res . get ( i ) ) ; } writeProfiles ( res , instanceScope ) ; } file . delete ( ) ; return res ; } finally { reader . close ( ) ; } } catch ( CoreException e ) { RubyPlugin . log ( e ) ; } catch ( IOException e ) { RubyPlugin . log ( e ) ; } return null ; } public static List readProfilesFromFile ( File file ) throws CoreException { try { final FileInputStream reader = new FileInputStream ( file ) ; try { return readProfilesFromStream ( new InputSource ( reader ) ) ; } finally { try { reader . close ( ) ; } catch ( IOException e ) { } } } catch ( IOException e ) { throw createException ( e , FormatterMessages . CodingStyleConfigurationBlock_error_reading_xml_message ) ; } } private static List readProfilesFromStream ( InputSource inputSource ) throws CoreException { final ProfileDefaultHandler handler = new ProfileDefaultHandler ( ) ; try { final SAXParserFactory factory = SAXParserFactory . newInstance ( ) ; final SAXParser parser = factory . newSAXParser ( ) ; parser . parse ( inputSource , handler ) ; } catch ( SAXException e ) { throw createException ( e , FormatterMessages . CodingStyleConfigurationBlock_error_reading_xml_message ) ; } catch ( IOException e ) { throw createException ( e , FormatterMessages . CodingStyleConfigurationBlock_error_reading_xml_message ) ; } catch ( ParserConfigurationException e ) { throw createException ( e , FormatterMessages . CodingStyleConfigurationBlock_error_reading_xml_message ) ; } return handler . getProfiles ( ) ; } public static void writeProfilesToFile ( Collection profiles , File file ) throws CoreException { final OutputStream writer ; try { writer = new FileOutputStream ( file ) ; try { writeProfilesToStream ( profiles , writer ) ; } finally { try { writer . close ( ) ; } catch ( IOException e ) { } } } catch ( IOException e ) { throw createException ( e , FormatterMessages . CodingStyleConfigurationBlock_error_serializing_xml_message ) ; } } private static void writeProfilesToStream ( Collection profiles , OutputStream stream ) throws CoreException { try { final DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; final DocumentBuilder builder = factory . newDocumentBuilder ( ) ; final Document document = builder . newDocument ( ) ; final Element rootElement = document . createElement ( XML_NODE_ROOT ) ; rootElement . setAttribute ( XML_ATTRIBUTE_VERSION , Integer . toString ( ProfileVersioner . CURRENT_VERSION ) ) ; document . appendChild ( rootElement ) ; for ( final Iterator iter = profiles . iterator ( ) ; iter . hasNext ( ) ; ) { final Profile profile = ( Profile ) iter . next ( ) ; if ( profile . isProfileToSave ( ) ) { final Element profileElement = createProfileElement ( profile , document ) ; rootElement . appendChild ( profileElement ) ; } } Transformer transformer = TransformerFactory . newInstance ( ) . newTransformer ( ) ; transformer . setOutputProperty ( OutputKeys . METHOD , "xml" ) ; transformer . setOutputProperty ( OutputKeys . ENCODING , "UTF-8" ) ; transformer . setOutputProperty ( OutputKeys . INDENT
2,533
<s> package net . sf . sveditor . core . db . index ; import java . util . ArrayList ; import java . util . List ; import java . util . Set ; import net . sf . sveditor . core . SVCorePlugin ; import net . sf . sveditor . core . SVFileUtils ; import net . sf . sveditor . core . db . index . cache . ISVDBIndexCache ; import net . sf . sveditor . core . fileset . AbstractSVFileMatcher ; import net . sf . sveditor . core . job_mgr . IJob ; import net . sf . sveditor . core . job_mgr . IJobMgr ; import net . sf . sveditor . core . log . LogFactory ; import org . eclipse . core . runtime . IProgressMonitor ; public class SVDBThreadedSourceCollectionIndex extends AbstractThreadedSVDBIndex { private List < AbstractSVFileMatcher > fFileMatcherList ; static { LogFactory . getLogHandle ( "" ) ; } public SVDBThreadedSourceCollectionIndex ( String project , String root , List < AbstractSVFileMatcher > matcher_list , ISVDBFileSystemProvider fs_provider , ISVDBIndexCache cache , SVDBIndexConfig config ) { super ( project , root , fs_provider , cache , config ) ; fFileMatcherList = matcher_list ; } @ Override protected String getLogName ( ) { return "" ; } @ Override protected boolean checkCacheValid ( ) { boolean valid = super . checkCacheValid ( ) ; if ( valid ) { for ( int i = 0 ; i < fFileMatcherList . size ( ) ; i ++ ) { AbstractSVFileMatcher matcher = fFileMatcherList . get ( i ) ; List < String > file_paths = matcher . findIncludedPaths ( ) ; Set < String > cache_files = getCache ( ) . getFileList ( ) ; List < String > tmp_cache_files = new ArrayList < String > ( ) ; tmp_cache_files . addAll ( cache_files ) ; for ( String path : file_paths ) { if ( cache_files . contains ( path ) ) { long fs_timestamp =
2,534
<s> package org . rubypeople . rdt . refactoring . tests ; import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . util . ArrayList ; import java . util . Collection ; import java . util . Properties ; import org . rubypeople . rdt . refactoring . documentprovider . DocumentProvider ; public abstract class FilePropertyData extends DocumentProvider { protected Properties properties ; public FilePropertyData ( String fileName ) throws FileNotFoundException , IOException { if ( TestsPlugin . getFile ( fileName ) != null ) { properties = initProperties ( fileName ) ; } } public static Properties initProperties ( String propertyFileName ) throws FileNotFoundException , IOException { Properties properties = new Properties ( ) ; FileInputStream fileInputStream = null ; try { fileInputStream = new FileInputStream ( TestsPlugin . getFile ( propertyFileName ) ) ; properties . load ( fileInputStream ) ; } finally { if ( fileInputStream != null ) fileInputStream . close ( ) ; } return properties ; } public static boolean getBoolValue ( String value ) { return "true" . equalsIgnoreCase ( value ) || "yes" . equalsIgnoreCase ( value ) ; } public boolean hasProperty ( String propertyName ) { return properties . containsKey ( propertyName ) ; } public String getProperty ( String propertyName ) { return properties . getProperty ( propertyName ) ; } public boolean getBoolProperty ( String propertyName ) { return getBoolValue ( properties . getProperty ( propertyName ) ) ; } public static String [ ] seperateString ( String value ) { return value . split ( ",\\s?" ) ; } public int getIntProperty ( String propertyName ) { if ( hasProperty ( propertyName ) ) { return Integer . parseInt ( properties . getProperty ( propertyName ) ) ; } return 0 ; } public String [ ] getCommaSeparatedStringArray ( String propertyName ) { return seperateString ( properties . getProperty ( propertyName ) ) ; } public int [ ] getCommaSeparatedIntArray ( String propertyName ) { String [ ] strings = properties . getProperty
2,535
<s> package com . asakusafw . modelgen . util ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . util . ArrayList ; import java . util . Collections ; import java . util . HashSet ; import java . util . List ; import java . util . Set ; import org . junit . Test ; import com . asakusafw . modelgen . model . Aggregator ; import com . asakusafw . modelgen . model . ModelDescription ; import com . asakusafw . modelgen . model . ModelProperty ; import com . asakusafw . modelgen . model . PropertyTypeKind ; import com . asakusafw . modelgen . model . Source ; import com . asakusafw . modelgen . model . StringType ; import com . asakusafw . modelgen . model . SummarizedModelDescription ; import com . asakusafw . modelgen . model . TableModelDescription ; public class SummarizedModelBuilderTest { @ Test public void simple ( ) { TableModelDescription desc = new TableModelBuilder ( "A" ) . add ( null , "word" , new StringType ( 255 ) ) . toDescription ( ) ; SummarizedModelDescription model = new SummarizedModelBuilder ( "S" , desc , "a" ) . add ( "word" , Aggregator . IDENT , "a.word" ) . add ( "count" , Aggregator . COUNT , "a.word" ) . groupBy ( "a.word" ) . toDescription ( ) ; assertThat ( model . getReference ( ) . getSimpleName ( ) , is ( "S" ) ) ; assertThat ( model . getGroupBy ( ) , is ( sources ( desc , "word" ) ) ) ; List < ModelProperty > properties = model . getProperties ( ) ; assertThat ( properties . size ( ) , is ( 2 ) ) ; ModelProperty word = properties . get ( 0 ) ; assertThat ( word . getName ( ) , is ( "word" ) ) ; assertThat ( word . getType ( ) . getKind ( ) , is ( PropertyTypeKind . STRING ) ) ; assertThat ( word . getJoined ( ) , is ( nullValue ( ) ) ) ; assertThat ( word . getFrom ( ) , is ( source ( desc , "word" , Aggregator . IDENT ) ) ) ; ModelProperty count = properties . get ( 1 ) ; assertThat ( count . getName ( ) , is ( "count" ) ) ; assertThat ( count . getType ( ) . getKind ( ) , is ( PropertyTypeKind . LONG ) ) ; assertThat ( count . getJoined ( )
2,536
<s> package net . sf . sveditor . ui . editor ; import java . util . ArrayList ; import java . util . Iterator ; import java . util . List ; import net . sf . sveditor . core . db . ISVDBChildItem ; import net . sf . sveditor . core . db . ISVDBChildParent ; import net . sf . sveditor . core . db . ISVDBItemBase ; import net . sf . sveditor . core . db . ISVDBNamedItem ; import net . sf . sveditor . core . db . SVDBFile ; import net . sf . sveditor . core . db . SVDBItem ; import net . sf . sveditor . core . db . SVDBItemType ; import net . sf . sveditor . core . db . SVDBModIfcInst ; import net . sf . sveditor . core . db . index . ISVDBChangeListener ; import net . sf . sveditor . core . db . stmt . SVDBVarDeclStmt ; import net . sf . sveditor . ui . SVDBIconUtils ; import net . sf . sveditor . ui . SVUiPlugin ; import net . sf . sveditor . ui . editor . actions . ToggleCommentAction ; import net . sf . sveditor . ui . pref . SVEditorPrefsConstants ; import net . sf . sveditor . ui . svcp . SVDBDecoratingLabelProvider ; import net . sf . sveditor . ui . svcp . SVDBDefaultContentFilter ; import net . sf . sveditor . ui . svcp . SVTreeContentProvider ; import net . sf . sveditor . ui . svcp . SVTreeLabelProvider ; import org . eclipse . core . runtime . IAdaptable ; import org . eclipse . jface . action . Action ; import org . eclipse . jface . preference . IPreferenceStore ; import org . eclipse . jface . viewers . IElementComparer ; import org . eclipse . jface . viewers . ISelection ; import org . eclipse . jface . viewers . ISelectionChangedListener ; import org . eclipse . jface . viewers . IStructuredSelection ; import org . eclipse . jface . viewers . SelectionChangedEvent ; import org . eclipse . jface . viewers . StructuredSelection ; import org . eclipse . jface . viewers . TreePath ; import org . eclipse . jface . viewers . TreeViewer ; import org . eclipse . jface . viewers . ViewerComparator ; import org . eclipse . swt . widgets . Composite ; import org . eclipse . swt . widgets . Display ; import org . eclipse . ui . part . IPageSite ; import org . eclipse . ui . part . IShowInTarget ; import org . eclipse . ui . part . ShowInContext ; import org . eclipse . ui . views . contentoutline . ContentOutlinePage ; public class SVOutlinePage extends ContentOutlinePage implements IShowInTarget , IAdaptable , Runnable , ISVDBChangeListener { private SVDBFile fSVDBFile ; private SVTreeContentProvider fContentProvider ; private SVEditor fEditor ; private boolean fIgnoreSelectionChange = false ; private ISVDBItemBase fLastSelection ; private Action ToggleAssign ; private Action ToggleAlways ; private Action ToggleDefines ; private Action ToggleInitial ; private Action ToggleGenerate ; private Action ToggleVariables ; private Action ToggleModuleInstances ; private Action ToggleInclude ; private Action ToggleTaskFunction ; private Action ToggleEnumTypedefs ; private Action ToggleAssertionProperties ; private Action ToggleCoverPointGroupCross ; private Action ToggleConstraints ; private Action ToggleSort ; private SVDBDefaultContentFilter DefaultContentFilter ; private ViewerComparator ViewerComapartor ; public SVOutlinePage ( SVEditor editor ) { fEditor = editor ; fContentProvider = new SVTreeContentProvider ( ) ; fSVDBFile = new SVDBFile ( "" ) ; } public void createControl ( Composite parent ) { super . createControl ( parent ) ; fContentProvider = new SVTreeContentProvider ( ) ; DefaultContentFilter = new SVDBDefaultContentFilter ( ) ; ViewerComapartor = new ViewerComparator ( ) ; DefaultContentFilter . HideAlwaysStatements ( SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_OUTLINE_SHOW_ALWAYS_BLOCKS ) ) ; DefaultContentFilter . HideAssignStatements ( SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_OUTLINE_SHOW_ASSIGN_STATEMENTS ) ) ; DefaultContentFilter . HideDefineStatements ( SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_OUTLINE_SHOW_DEFINE_STATEMENTS ) ) ; DefaultContentFilter . HideGenerateBlocks ( SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_OUTLINE_SHOW_GENERATE_BLOCKS ) ) ; DefaultContentFilter . HideIncludeFiles ( SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_OUTLINE_SHOW_INCLUDE_FILES ) ) ; DefaultContentFilter . HideInitialBlocks ( SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_OUTLINE_SHOW_INITIAL_BLOCKS ) ) ; DefaultContentFilter . HideModuleInstances ( SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_OUTLINE_SHOW_MODULE_INSTANCES ) ) ; DefaultContentFilter . HideTaskFunctions ( SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_OUTLINE_SHOW_TASK_FUNCTION_DECLARATIONS ) ) ; DefaultContentFilter . HideVariableDeclarations ( SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_OUTLINE_SHOW_SIGNAL_DECLARATIONS ) ) ; getTreeViewer ( ) . setContentProvider ( fContentProvider ) ; getTreeViewer ( ) . addFilter ( DefaultContentFilter ) ; if ( SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_OUTLINE_SORT ) ) { getTreeViewer ( ) . setComparator ( ViewerComapartor ) ; } else { getTreeViewer ( ) . setComparator ( null ) ; } getTreeViewer ( ) . setLabelProvider ( new SVDBDecoratingLabelProvider ( new SVTreeLabelProvider ( ) ) ) ; getTreeViewer ( ) . setComparer ( new IElementComparer ( ) { public int hashCode ( Object element ) { return element . hashCode ( ) ; } public boolean equals ( Object a , Object b ) { return ( a == b ) ; } } ) ; getTreeViewer ( ) . setInput ( fSVDBFile ) ; getTreeViewer ( ) . addSelectionChangedListener ( fSelectionListener ) ; getTreeViewer ( ) . setAutoExpandLevel ( TreeViewer . ALL_LEVELS ) ; refresh ( ) ; } public void SVDBFileChanged ( SVDBFile file , List < SVDBItem > adds , List < SVDBItem > removes , List < SVDBItem > changes ) { if ( file . getFilePath ( ) . equals ( fEditor . getFilePath ( ) ) ) { if ( getTreeViewer ( ) != null && ! getTreeViewer ( ) . getControl ( ) . isDisposed ( ) ) { Display . getDefault ( ) . asyncExec ( this ) ; } } } public void refresh ( ) { if ( getTreeViewer ( ) != null && ! getTreeViewer ( ) . getControl ( ) . isDisposed ( ) ) { Display . getDefault ( ) . asyncExec ( this ) ; } } public void run ( ) { if ( getTreeViewer ( ) != null && ! getTreeViewer ( ) . getControl ( ) . isDisposed ( ) ) { fSVDBFile = fEditor . getSVDBFile ( ) ; List < ISVDBItemBase > exp_path_list = getExpansionPaths ( ) ; ISelection sel = getTreeViewer ( ) . getSelection ( ) ; getTreeViewer ( ) . setInput ( fSVDBFile ) ; setExpansionPaths ( exp_path_list ) ; setSavedSelection ( sel ) ; } } private List < ISVDBItemBase > getExpansionPaths ( ) { List < ISVDBItemBase > ret = new ArrayList < ISVDBItemBase > ( ) ; for ( TreePath p : getTreeViewer ( ) . getExpandedTreePaths ( ) ) { Object last_seg_o = p . getLastSegment ( ) ; if ( last_seg_o instanceof ISVDBItemBase ) { ret . add ( ( ISVDBItemBase ) last_seg_o ) ; } } return ret ; } private void setExpansionPaths ( List < ISVDBItemBase > exp_paths ) { List < ISVDBItemBase > path = new ArrayList < ISVDBItemBase > ( ) ; List < ISVDBItemBase > target_path = new ArrayList < ISVDBItemBase > ( ) ; List < TreePath > exp_tree_paths = new ArrayList < TreePath > ( ) ; for ( ISVDBItemBase item : exp_paths ) { path . clear ( ) ; target_path . clear ( ) ; buildFullPath ( path , item ) ; lookupPath ( fSVDBFile , path . iterator ( ) , target_path ) ; if ( target_path . size ( ) > 0 ) { exp_tree_paths . add ( new TreePath ( target_path . toArray ( ) ) ) ; } } if ( exp_tree_paths . size ( ) > 0 ) { getTreeViewer ( ) . setExpandedTreePaths ( exp_tree_paths . toArray ( new TreePath [ exp_tree_paths . size ( ) ] ) ) ; } } private void buildFullPath ( List < ISVDBItemBase > path , ISVDBItemBase leaf ) { ISVDBItemBase item_tmp = leaf ; while ( item_tmp != null && item_tmp . getType ( ) != SVDBItemType . File ) { if ( ! ( item_tmp instanceof SVDBVarDeclStmt ) && ! ( item_tmp instanceof SVDBModIfcInst ) ) { path . add ( 0 , item_tmp ) ; } if ( item_tmp instanceof ISVDBChildItem ) { item_tmp = ( ( ISVDBChildItem ) item_tmp ) . getParent ( ) ; } else { item_tmp = null ; } } } private void setSavedSelection ( ISelection sel ) { fIgnoreSelectionChange = true ; if ( ! sel . isEmpty ( ) && sel instanceof IStructuredSelection ) { List < ISVDBItemBase > path = new ArrayList < ISVDBItemBase > ( ) ; IStructuredSelection ss = ( IStructuredSelection ) sel ; List < ISVDBItemBase > new_sel_l = new ArrayList < ISVDBItemBase > ( ) ; List < ISVDBItemBase > target_path = new ArrayList < ISVDBItemBase > ( ) ; for ( Object sel_it : ss . toList ( ) ) { if ( sel_it instanceof ISVDBItemBase ) { path . clear ( ) ; target_path . clear ( ) ; buildFullPath ( path , ( ISVDBItemBase ) sel_it ) ; if ( lookupPath ( fSVDBFile , path . iterator ( ) , target_path ) ) { ISVDBItemBase sel_t = target_path . get ( target_path . size ( ) - 1 ) ; new_sel_l . add ( sel_t ) ; } } } StructuredSelection new_sel = new StructuredSelection ( new_sel_l ) ; getTreeViewer ( ) . setSelection ( new_sel ) ; } } private boolean lookupPath ( ISVDBChildParent scope , Iterator < ISVDBItemBase > path_it , List < ISVDBItemBase > target_path ) { ISVDBItemBase path_item = path_it . next ( ) ; ISVDBItemBase target_item = null ; boolean ret = false ; if ( ! ( path_item instanceof ISVDBNamedItem ) ) { return ret ; } ISVDBNamedItem ni = ( ISVDBNamedItem ) path_item ; for ( ISVDBChildItem ci : scope . getChildren ( ) ) { if ( ci instanceof ISVDBNamedItem ) { ISVDBNamedItem ci_ni = ( ISVDBNamedItem ) ci ; if ( ni . getName ( ) . equals ( ci_ni . getName ( ) ) && ni . getType ( ) == ci_ni . getType ( ) ) { target_item = ci ; break ; } } else if ( ci instanceof SVDBVarDeclStmt || ci instanceof SVDBModIfcInst ) { ISVDBChildParent inst_list = ( ISVDBChildParent ) ci ; for ( ISVDBChildItem ci_inst : inst_list . getChildren ( ) ) { ISVDBNamedItem ci_inst_ni = ( ISVDBNamedItem ) ci_inst ; if ( ni . getName ( ) . equals ( ci_inst_ni . getName ( ) ) && ni . getType ( ) == ci_inst_ni . getType ( ) ) { target_item = ci_inst ; break ; } } if ( target_item != null ) { break ; } } else { } } if ( target_item != null ) { target_path . add ( target_item ) ; } if ( path_it . hasNext ( ) && target_item != null && target_item instanceof ISVDBChildParent ) { ret = lookupPath ( ( ISVDBChildParent ) target_item , path_it , target_path ) ; } else if ( ! path_it . hasNext ( ) && target_item != null ) { ret = true ; } return ret ; } public void dispose ( ) { if ( getTreeViewer ( ) != null ) { getTreeViewer ( ) . removeSelectionChangedListener ( fSelectionListener ) ; } } @ SuppressWarnings ( "rawtypes" ) public Object getAdapter ( Class adapter ) { if ( IShowInTarget . class . equals ( adapter ) ) { return this ; } return null ; } public boolean show ( ShowInContext context ) { return true ; } private ISelectionChangedListener fSelectionListener = new ISelectionChangedListener ( ) { public void selectionChanged ( SelectionChangedEvent event ) { if ( fIgnoreSelectionChange ) { fIgnoreSelectionChange = false ; return ; } removeSelectionChangedListener ( this ) ; if ( event . getSelection ( ) instanceof StructuredSelection ) { StructuredSelection sel = ( StructuredSelection ) event . getSelection ( ) ; if ( sel . getFirstElement ( ) instanceof ISVDBItemBase ) { ISVDBItemBase it = ( ISVDBItemBase ) sel . getFirstElement ( ) ; if ( fLastSelection == null || ! fLastSelection . equals ( it , true ) ) { fEditor . setSelection ( it , false ) ; fLastSelection = it ; } } } addSelectionChangedListener ( this ) ; } } ; public void createActions ( ) { } private class SortAction extends Action { public SortAction ( ) { super ( "sort" , Action . AS_CHECK_BOX ) ; setImageDescriptor ( SVUiPlugin . getImageDescriptor ( "" ) ) ; } public void run ( ) { boolean new_value = true ; if ( SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_OUTLINE_SORT ) ) { new_value = false ; } SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . setValue ( SVEditorPrefsConstants . P_OUTLINE_SORT , new_value ) ; ToggleSort . setChecked ( new_value ) ; if ( new_value ) { getTreeViewer ( ) . setComparator ( ViewerComapartor ) ; } else { getTreeViewer ( ) . setComparator ( null ) ; } refresh ( ) ; } } @ Override public void init ( IPageSite pageSite ) { super . init ( pageSite ) ; ToggleSort = new SortAction ( ) ; pageSite . getActionBars ( ) . getToolBarManager ( ) . add ( ToggleSort ) ; ToggleAssign = new Action ( "Assign" , Action . AS_CHECK_BOX ) { public void run ( ) { ToggleAssign . setChecked ( DefaultContentFilter . ToggleAssignStatements ( ) ) ; SVUiPlugin . getDefault ( ) . getPreferenceStore ( ) . setValue ( SVEditorPrefsConstants . P_OUTLINE_SHOW_ASSIGN_STATEMENTS , ToggleAssign . isChecked ( ) ) ; refresh ( ) ; } } ; ToggleAssign . setImageDescriptor ( SVDBIconUtils . getImageDescriptor ( SVDBItemType . Assign ) ) ; pageSite . getActionBars ( ) . getToolBarManager ( ) . add ( ToggleAssign ) ;
2,537
<s> package de . fuberlin . wiwiss . d2rq . map ; import com . hp . hpl . jena . rdf . model . Property ; import com . hp . hpl . jena . rdf . model . Resource ; import de . fuberlin . wiwiss . d2rq . D2RQException ; import de . fuberlin . wiwiss . d2rq . pp . PrettyPrinter ; public abstract class MapObject { private Resource resource ; public MapObject ( Resource resource ) { this . resource = resource ; } public Resource resource ( ) { return this .
2,538
<s> package com . asakusafw . yaess . core ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . IOException ; import java . util . Properties ; import org . junit . Test ; public class ServiceProfileTest { @ Test public void load ( ) { Properties prop = new Properties ( ) ; prop . setProperty ( "mock1" , MockService . class . getName ( ) ) ; prop . setProperty ( "mock2" , "" ) ; ClassLoader cl = getClass ( ) . getClassLoader ( ) ; ServiceProfile < Service > service = ServiceProfile . load ( prop , "mock1" , Service . class , ProfileContext . system ( cl ) ) ; assertThat ( service . getPrefix ( ) , is ( "mock1" ) ) ; assertThat ( service . getServiceClass ( ) , is ( ( Object ) MockService . class ) ) ; assertThat ( service . getConfiguration ( ) . size ( ) , is ( 0 ) ) ; assertThat ( service . getContext ( ) . getClassLoader ( ) , is ( cl ) ) ; } @ Test public void load_with_config ( ) { Properties prop = new Properties ( ) ; prop . setProperty ( "mock1" , MockService . class . getName ( ) ) ; prop . setProperty ( "mock1.hoge" , "foo" ) ; prop . setProperty ( "mock1.bar.1" , "moga" ) ; prop . setProperty ( "mock2.hoge" , "hoge" ) ; prop . setProperty ( "mock3.bar" , "bar" ) ; ClassLoader cl = getClass ( ) . getClassLoader ( ) ; ServiceProfile < Service > service = ServiceProfile . load ( prop , "mock1" , Service . class , ProfileContext . system ( cl ) ) ; assertThat ( service . getPrefix ( ) , is ( "mock1" ) ) ; assertThat ( service . getConfiguration ( ) . size ( ) , is ( 2 ) ) ; assertThat ( service . getConfiguration ( ) . get ( "hoge" ) , is ( "foo" ) ) ; assertThat ( service . getConfiguration ( ) . get ( "bar.1" ) , is ( "moga" ) ) ; } @ Test ( expected = IllegalArgumentException . class ) public void load_invalid_empty ( ) { Properties prop = new Properties ( ) ; ServiceProfile . load ( prop , "mock1" , Service . class , ProfileContext . system ( getClass ( ) . getClassLoader ( ) ) ) ; } @ Test ( expected = IllegalArgumentException . class ) public void load_invalid_class ( ) { Properties prop = new Properties ( ) ; prop . setProperty ( "mock1" , "__UNKNOWN__" ) ; ServiceProfile . load ( prop , "mock1" , Service . class , ProfileContext . system ( getClass ( ) . getClassLoader ( ) ) ) ; } @ Test ( expected = IllegalArgumentException . class ) public void load_invalid_service ( ) { Properties prop = new Properties ( ) ; prop . setProperty ( "mock1" , String . class . getName ( ) ) ; ServiceProfile . load ( prop , "mock1" , Service . class , ProfileContext . system ( getClass ( ) . getClassLoader ( ) ) ) ; } @ Test ( expected = IllegalArgumentException . class ) public void load_invalid_base ( ) { Properties prop = new Properties ( ) ; prop . setProperty ( "mock1" , MockService . class . getName ( ) ) ; ServiceProfile . load ( prop , "mock1" , CoreProfile . class , ProfileContext . system ( getClass ( ) . getClassLoader ( ) ) ) ; } @ Test public void newInstance ( ) throws Exception { Properties prop = new Properties ( ) ; prop . setProperty ( "mock1" , MockService . class . getName ( ) ) ; prop . setProperty ( "mock1.hoge" , "foo" ) ; prop . setProperty ( "mock1.bar.1" , "moga" ) ; ClassLoader cl = getClass ( ) . getClassLoader ( ) ; ServiceProfile < Service > service = ServiceProfile . load ( prop , "mock1" , Service . class , ProfileContext . system ( cl ) ) ; Service instance = service . newInstance ( ) ; assertThat ( instance , is ( MockService . class ) ) ; MockService mock = ( MockService ) instance ; assertThat ( mock . serviceProfile . getPrefix ( ) , is ( "mock1" ) ) ; assertThat ( mock . serviceProfile . getConfiguration ( ) . size (
2,539
<s> package org . rubypeople . rdt . internal . ui . util ; import java . io . File ; import java . util . regex . Matcher ; import java . util . regex . Pattern ; import org . eclipse . core . resources . IProject ; import org . rubypeople . rdt . core . IRubyProject ; public class StackTraceLine { private static Pattern OPEN_TRACE_LINE_PATTERN = Pattern . compile ( "" ) ; private static Pattern BRACKETED_TRACE_LINE_PATTERN = Pattern . compile ( "" ) ; private static Pattern OPTIONAL_PREFIX = Pattern . compile ( "" ) ; private String fFilename ; private int fLineNumber ; private int length ; private int offset ; public static boolean isTraceLine ( String line ) { Matcher bracketedMatcher = BRACKETED_TRACE_LINE_PATTERN . matcher ( line ) ; Matcher openMatcher = OPEN_TRACE_LINE_PATTERN . matcher ( line ) ; return bracketedMatcher . find ( ) || openMatcher . find ( ) ; } public StackTraceLine ( String traceLine ) { this ( traceLine , ( IProject ) null ) ; } public StackTraceLine ( String traceLine , IRubyProject launchedProject ) { this ( traceLine , launchedProject . getProject ( ) ) ; } public StackTraceLine ( String traceLine , IProject launchedProject ) { int prefix = 0 ; Matcher matcher = OPTIONAL_PREFIX . matcher ( traceLine ) ; if ( matcher . find ( ) ) { traceLine = traceLine . substring ( matcher . group ( 0 ) . length ( ) ) ; prefix = matcher . group ( 0 ) . length ( ) ; } matcher = BRACKETED_TRACE_LINE_PATTERN . matcher ( traceLine ) ; if ( ! matcher . find ( ) ) { matcher = OPEN_TRACE_LINE_PATTERN .
2,540
<s> package net . sf . sveditor . core . db ; import java . util . ArrayList ; import java . util . List ; public class SVDBClassDecl extends SVDBScopeItem { public List < SVDBModIfcClassParam > fParams ; public SVDBTypeInfoClassType fClassType ; public SVDBTypeInfoClassType fSuperClass ; public SVDBClassDecl ( ) { this ( "" ) ; } public SVDBClassDecl ( String name ) { super ( name , SVDBItemType . ClassDecl ) ; } public List < SVDBModIfcClassParam > getParameters ( ) { return fParams ; } public void addParameters ( List < SVDBModIfcClassParam > params ) { if ( fParams == null ) { fParams = new ArrayList < SVDBModIfcClassParam > ( ) ; } fParams . addAll ( params ) ; } public SVDBTypeInfoClassType getClassType ( ) { return fClassType ; } public void setClassType ( SVDBTypeInfoClassType cls_type ) { fClassType = cls_type ; } public SVDBTypeInfoClassType getSuperClass ( ) { return fSuperClass ; } public void setSuperClass ( SVDBTypeInfoClassType super_class ) { fSuperClass = super_class ; } public SVDBClassDecl duplicate ( ) { return ( SVDBClassDecl ) SVDBItemUtils . duplicate ( this ) ; }
2,541
<s> package org . oddjob . monitor . actions ; import java . net . URL ; import org . oddjob . arooa . ArooaSession ; public class ResourceActionProvider implements ActionProvider { public static final String ACTION_FILE = "" ; private final ArooaSession session ; public ResourceActionProvider ( ArooaSession session ) { this . session =
2,542
<s> package org . rubypeople . rdt . refactoring . tests . core . splitlocal ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . util . Collection ; import junit . framework . TestCase ; import org . jruby . ast . DAsgnNode ; import org . jruby . ast . DVarNode ; import org . jruby . ast . LocalAsgnNode ; import org . jruby . ast . LocalVarNode ; import org . rubypeople . rdt . refactoring . core . renamelocal . SingleLocalVariableEdit ; import org . rubypeople . rdt . refactoring . core . splitlocal . LocalVarFinder ; import org . rubypeople . rdt . refactoring . core . splitlocal . LocalVarUsage ; import org . rubypeople . rdt . refactoring . core . splitlocal . SplittedVariableRenamer ; import org . rubypeople . rdt . refactoring . tests . FileTestData ; public class TC_SplittedVariableRenamer extends TestCase { private SingleLocalVariableEdit [ ] getEdits ( String name , int pos ) throws FileNotFoundException , IOException { LocalVarFinder finder = new LocalVarFinder ( ) ; Collection < LocalVarUsage > variables = finder . findLocalUsages ( new FileTestData ( name , "" , "" ) , pos ) ; SplittedVariableRenamer variableRenamer = new SplittedVariableRenamer ( finder . getScopeNode ( ) ) ; return variableRenamer . rename ( variables ) . toArray ( new SingleLocalVariableEdit [ 0 ] ) ; } public void testRename_1 ( ) throws FileNotFoundException , IOException { SingleLocalVariableEdit [ ] edits = getEdits ( "" , 0 ) ;
2,543
<s> package org . rubypeople . rdt . debug . core . tests ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . io . PipedInputStream ; import java . io . PipedOutputStream ; import java . io . PrintWriter ; import java . util . HashMap ; import junit . framework . TestCase ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . resources . ResourcesPlugin ; import org . eclipse . core . runtime . CoreException ; import org . rubypeople . rdt . debug . core . RdtDebugModel ; import org . rubypeople . rdt . debug . core . model . IRubyExceptionBreakpoint ; import org . rubypeople . rdt . internal . debug . core . RubyDebuggerProxy ; import org . xmlpull . v1 . XmlPullParser ; import org . xmlpull . v1 . XmlPullParserFactory ; public class FTC_DebuggerProxyTest extends TestCase { private PrintWriter writer ; private RubyDebuggerProxy proxy ; private TestRubyDebugTarget target ; private BufferedReader proxyOutputReader ; public FTC_DebuggerProxyTest ( String name ) { super ( name ) ; } protected PrintWriter getPrintWriter ( ) { return writer ; } public RubyDebuggerProxy getProxy ( ) { return proxy ; } public TestRubyDebugTarget getTarget ( ) { return target ; } public void writeToDebuggerProxy ( String text ) throws Exception { getPrintWriter ( ) . println ( text ) ; getPrintWriter ( ) . flush ( ) ; } public String getLineFromDebuggerProxy ( ) throws IOException { return proxyOutputReader . readLine ( ) ; } public void setUp ( ) throws Exception { target = new TestRubyDebugTarget ( ) ; proxy = new RubyDebuggerProxy ( target , false ) ; PipedInputStream pipedInputStream = new PipedInputStream ( ) ; PipedOutputStream pipedOutputStream = new PipedOutputStream ( pipedInputStream ) ; XmlPullParserFactory factory = XmlPullParserFactory . newInstance ( "" , null ) ; XmlPullParser xpp = factory . newPullParser ( ) ; PipedOutputStream outputStream = new PipedOutputStream ( ) ; PipedInputStream inputStream = new PipedInputStream ( outputStream ) ; xpp . setInput ( new InputStreamReader ( inputStream ) ) ; proxy . startRubyLoop ( ) ; writer = new PrintWriter ( new OutputStreamWriter ( outputStream ) ) ; proxyOutputReader = new BufferedReader ( new InputStreamReader ( pipedInputStream ) ) ; } public void testMultipleBreakpoints ( ) throws Exception { writeToDebuggerProxy ( "" ) ; Thread . sleep ( 2000
2,544
<s> package com . asakusafw . testdriver . bulkloader ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . IOException ; import java . math . BigDecimal ; import java . sql . Connection ; import java . util . Arrays ; import java . util . Calendar ; import java . util . Collections ; import java . util . Comparator ; import java . util . LinkedList ; import org . junit . Rule ; import org . junit . Test ; import com . asakusafw . testdriver . core . DataModelDefinition ; import com . asakusafw . testdriver . core . DataModelReflection ; import com . asakusafw . testdriver . core . DataModelSource ; import com . asakusafw . testdriver . model . SimpleDataModelDefinition ; public class TableSourceTest { static final DataModelDefinition < Simple > SIMPLE = new SimpleDataModelDefinition < Simple > ( Simple . class ) ; @ Rule public H2Resource h2 = new H2Resource ( "config" ) { @ Override protected void before ( ) throws Exception { executeFile ( "" ) ; } } ; @ Test public void empty ( ) throws Exception { TableSource < Simple > source = new TableSource < Simple > ( info ( "NUMBER" , "TEXT" ) , h2 . open ( ) ) ; try { assertThat ( next ( source ) , is ( nullValue ( ) ) ) ; } finally { source . close ( ) ; } } @ Test public void single ( ) throws Exception { Simple s1 = new Simple ( ) ; s1 . number = 100 ; s1 . text = "" ; insert ( s1 ) ; TableSource < Simple > source = new TableSource < Simple > ( info ( "NUMBER" , "TEXT" ) , h2 . open ( ) ) ; try { assertThat ( next ( source ) , is ( s1 ) ) ; assertThat ( next ( source ) , is ( nullValue ( ) ) ) ; } finally { source . close ( ) ; } } @ Test public void multiple ( ) throws Exception { Simple s1 = new Simple ( ) ; s1 . number = 100 ; s1 . text = "aaa" ; insert ( s1 ) ; Simple s2 = new Simple ( ) ; s2 . number = 200 ; s2 . text = "bbb" ; insert ( s2 ) ; Simple s3 = new Simple ( ) ; s3 . number = 300 ; s3 . text = "ccc" ; insert ( s3 ) ; TableSource < Simple > source = new TableSource < Simple > ( info ( "NUMBER" , "TEXT" ) , h2 . open ( ) ) ; try { LinkedList < Simple > results = new LinkedList < Simple > ( ) ; results . addLast ( next ( source ) ) ; assertThat ( results . getLast ( ) , not ( nullValue ( ) ) ) ; results . addLast ( next ( source ) ) ; assertThat ( results . getLast ( ) , not ( nullValue ( ) ) ) ; results . addLast ( next ( source ) ) ; assertThat ( results . getLast ( ) , not ( nullValue ( ) ) ) ; assertThat ( next ( source ) , is ( nullValue ( ) ) ) ; Collections . sort ( results , new Comparator < Simple > ( ) { @ Override public int compare ( Simple o1 , Simple o2 ) { return o1 . number . compareTo ( o2 . number ) ; } } ) ; assertThat ( results , is ( Arrays . asList ( s1 , s2 , s3 ) ) ) ; } finally { source . close ( ) ; } } @ Test public void allTypes ( ) throws Exception { Simple simple = new Simple ( ) ; simple . number = 100 ; simple . text = "aaa" ; simple . booleanValue = true ; simple . byteValue = 2 ; simple . shortValue = 3 ; simple . longValue = 4L ; simple . floatValue = 1.5f ; simple . doubleValue = 2.5d ; simple . bigDecimalValue = new BigDecimal ( "3.14" ) ; simple . dateValue = Calendar . getInstance ( ) ; simple . dateValue . clear ( ) ; simple . dateValue . set ( 2011 , 2 , 31 ) ; simple . timeValue = Calendar . getInstance ( ) ; simple . timeValue . clear ( ) ; simple . timeValue . set ( Calendar . HOUR_OF_DAY , 13 ) ; simple . timeValue . set ( Calendar . MINUTE , 14 ) ; simple . timeValue . set ( Calendar . SECOND , 15 ) ; simple . datetimeValue = Calendar . getInstance ( ) ; simple . datetimeValue . clear ( ) ; simple . datetimeValue . set ( 2000 , 0 , 2 , 3 , 4 , 5 ) ; insert ( simple ) ; TableSource < Simple > source = new TableSource < Simple >
2,545
<s> package com . asakusafw . compiler . yaess . testing . model ; import java . io . DataInput ; import java . io . DataOutput ; import java . io . IOException ; import org . apache . hadoop . io . Writable ; import com . asakusafw . compiler . yaess . testing . io . DummyInput ; import com . asakusafw . compiler . yaess . testing . io . DummyOutput ; 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 ; @ DataModelKind ( "DMDL" ) @ ModelInputLocation ( DummyInput . class ) @ ModelOutputLocation ( DummyOutput . class ) public class Dummy implements DataModel < Dummy > , Writable { private final IntOption value = new IntOption ( ) ; @ Override @ SuppressWarnings ( "deprecation" ) public void reset ( ) { this . value . setNull ( ) ; } @ Override @ SuppressWarnings ( "deprecation" ) public void copyFrom ( Dummy other ) { this . value . copyFrom ( other . value ) ; } public int getValue ( ) { return this . value . get ( ) ; } @ SuppressWarnings ( "deprecation" ) public void setValue ( int value0 ) { this . value . modify ( value0 ) ; } public IntOption getValueOption ( ) { return this . value ; } @ SuppressWarnings ( "deprecation" ) public void setValueOption ( IntOption option ) { this . value . copyFrom ( option ) ; } @ Override public String toString ( ) { StringBuilder result = new StringBuilder ( ) ; result . append
2,546
<s> package org . springframework . social . google . api . impl ; import static java . util . Collections . singletonList ; import static org . codehaus . jackson . map . DeserializationConfig . Feature . FAIL_ON_UNKNOWN_PROPERTIES ; import static org . codehaus . jackson . map . SerializationConfig . Feature . WRITE_DATES_AS_TIMESTAMPS ; import static org . codehaus . jackson . map . annotate . JsonSerialize . Inclusion . NON_NULL ; import static org . springframework . http . MediaType . APPLICATION_ATOM_XML ; import static org . springframework . util . ReflectionUtils . findMethod ; import static org . springframework . util . ReflectionUtils . invokeMethod ; import java . lang . reflect . Method ; import java . util . ArrayList ; import java . util . List ; import javax . xml . transform . Source ; import org . codehaus . jackson . map . ObjectMapper ; import org . springframework . http . converter . ByteArrayHttpMessageConverter ; import org . springframework . http . converter . HttpMessageConverter ; import org . springframework . http . converter . json . MappingJacksonHttpMessageConverter ; import org . springframework . http . converter .
2,547
<s> package de . fuberlin . wiwiss . d2rq . map ; import org . apache . commons . logging . Log ; import org . apache . commons . logging . LogFactory ; import com . hp . hpl . jena . rdf . model . Property ; import com . hp . hpl . jena . rdf . model . Resource ; import de . fuberlin . wiwiss . d2rq . D2RQException ; import de . fuberlin . wiwiss . d2rq . algebra . Attribute ; import de . fuberlin . wiwiss . d2rq . algebra . ProjectionSpec ; import de . fuberlin . wiwiss . d2rq . algebra . Relation ; import de . fuberlin . wiwiss . d2rq . parser . RelationBuilder ; import de . fuberlin . wiwiss . d2rq . sql . SQL ; import de . fuberlin . wiwiss . d2rq . values . ConstantValueMaker ; import de . fuberlin . wiwiss . d2rq . values . Pattern ; import de . fuberlin . wiwiss . d2rq . values . ValueMaker ; import de . fuberlin . wiwiss . d2rq . vocab . D2RQ ; public class DownloadMap extends ResourceMap { private final static Log log = LogFactory . getLog ( DownloadMap . class ) ; private ClassMap belongsToClassMap = null ;
2,548
<s> package org . oddjob . input ; import org . oddjob . arooa . design . screem . FileSelectionOptions ; public interface InputMedium { public void prompt ( String prompt , String defaultValue ) ; public void password ( String prompt ) ; public
2,549
<s> package com . asakusafw . testdriver . core ; public class TesterDriver < T > implements TestRule { private final ModelTester < ? super T > verifier ; private final DataModelDefinition < ? extends T > definition ; public TesterDriver ( ModelTester < ? super T > verifier , DataModelDefinition < ? extends T > definition ) { if ( verifier == null ) {
2,550
<s> package com . asakusafw . utils . java . internal . model . syntax ; import java . util . ArrayList ; import java . util . Collection ; import java . util . Collections ; import java . util . List ; final class Util { private Util ( ) { return ; } static void notNull ( Object reference , String name ) { if ( reference == null ) { throw new IllegalArgumentException ( name + "" ) ; } } static void notContainNull ( Iterable < ? > references , String name ) { for ( Object
2,551
<s> package org . rubypeople . rdt . refactoring . core . generateaccessors ; import org . eclipse . osgi . util . NLS ; public class Messages extends NLS { private static final String BUNDLE_NAME = "" ; public static String AccessorsGenerator_Reader ; public static String AccessorsGenerator_Writer ; public static String GenerateAccessorsRefactoring_Name ; static { NLS
2,552
<s> package com . asakusafw . testdriver . excel ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . IOException ; import java . io . InputStream ; import java . util . EnumSet ; import org . apache . poi . hssf . usermodel . HSSFWorkbook ; import org . apache . poi . ss . usermodel . Sheet ; import org . apache . poi . ss . usermodel . Workbook ; import org . junit . Test ; import com . asakusafw . testdriver . rule . DataModelCondition ; public class DefaultExcelRuleExtractorTest { @ Test public void supports ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "simple.xls" ) ; assertThat ( extractor . supports ( sheet ) , is ( true ) ) ; } @ Test public void supports_not ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "" ) ; assertThat ( extractor . supports ( sheet ) , is ( false ) ) ; } @ Test public void supports_invalid_version ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "" ) ; assertThat ( extractor . supports ( sheet ) , is ( false ) ) ; } @ Test public void extractDataModelCondition_strict ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "" ) ; assertThat ( extractor . extractDataModelCondition ( sheet ) , is ( ( Object ) EnumSet . noneOf ( DataModelCondition . class ) ) ) ; } @ Test public void extractDataModelCondition_expect ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "" ) ; assertThat ( extractor . extractDataModelCondition ( sheet ) , is ( ( Object ) EnumSet . of ( DataModelCondition . IGNORE_UNEXPECTED ) ) ) ; } @ Test public void extractDataModelCondition_actual ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "" ) ; assertThat ( extractor . extractDataModelCondition ( sheet ) , is ( ( Object ) EnumSet . of ( DataModelCondition . IGNORE_ABSENT ) ) ) ; } @ Test public void extractDataModelCondition_intersect ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "" ) ; assertThat ( extractor . extractDataModelCondition ( sheet ) , is ( ( Object ) EnumSet . of ( DataModelCondition . IGNORE_UNEXPECTED , DataModelCondition . IGNORE_ABSENT ) ) ) ; } @ Test public void extractDataModelCondition_skip ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "" ) ; assertThat ( extractor . extractDataModelCondition ( sheet ) , is ( ( Object ) EnumSet . allOf ( DataModelCondition . class ) ) ) ; } @ Test public void extractPropertyRowStartIndex ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "simple.xls" ) ; assertThat ( extractor . extractPropertyRowStartIndex ( sheet ) , is ( 3 ) ) ; } @ Test public void extractName ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "name.xls" ) ; assertThat ( extractor . extractName ( sheet . getRow ( 3 ) ) , is ( "value" ) ) ; assertThat ( extractor . extractName ( sheet . getRow ( 4 ) ) , is ( "a" ) ) ; assertThat ( extractor . extractName ( sheet . getRow ( 5 ) ) , is ( "" ) ) ; } @ Test public void extractName_empty ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "name.xls" ) ; assertThat ( extractor . extractName ( sheet . getRow ( 6 ) ) , is ( nullValue ( ) ) ) ; } @ Test public void extractName_blank ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "name.xls" ) ; assertThat ( extractor . extractName ( sheet . getRow ( 7 ) ) , is ( nullValue ( ) ) ) ; } @ Test public void extractValueCondition ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "value.xls" ) ; assertThat ( extractor . extractValueCondition ( sheet . getRow ( 3 ) ) , is ( ValueConditionKind . ANY ) ) ; assertThat ( extractor . extractValueCondition ( sheet . getRow ( 4 ) ) , is ( ValueConditionKind . KEY ) ) ; assertThat ( extractor . extractValueCondition ( sheet . getRow ( 5 ) ) , is ( ValueConditionKind . EQUAL ) ) ; assertThat ( extractor . extractValueCondition ( sheet . getRow ( 6 ) ) , is ( ValueConditionKind . CONTAIN ) ) ; assertThat ( extractor . extractValueCondition ( sheet . getRow ( 7 ) ) , is ( ValueConditionKind . TODAY ) ) ; assertThat ( extractor . extractValueCondition ( sheet . getRow ( 8 ) ) , is ( ValueConditionKind . NOW ) ) ; } @ Test public void extractNullityCondition ( ) throws Exception { ExcelRuleExtractor extractor = new DefaultExcelRuleExtractor ( ) ; Sheet sheet = sheet ( "nullity.xls" ) ; assertThat ( extractor . extractNullityCondition (
2,553
<s> package com . asakusafw . utils . java . parser . javadoc ; import java . util . MissingResourceException ; import java . util
2,554
<s> package com . asakusafw . dmdl . source ; import java . io . File ; import java . io . FileInputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . Reader ; import java . net . URI ; import java . nio . charset . Charset ; import java . util . Iterator ; import java . util . List ; import java . util . NoSuchElementException ; import com . asakusafw . utils . collections . Lists ; public class DmdlSourceFile implements DmdlSourceRepository { private final List < File > files ; private final Charset encoding ; public DmdlSourceFile ( List < File > sourceFiles , Charset encoding ) { if ( sourceFiles == null ) { throw new IllegalArgumentException ( "" ) ; } if ( encoding == null ) { throw new IllegalArgumentException ( "" ) ; } this . files = Lists . freeze ( sourceFiles ) ; this . encoding = encoding ; } @ Override public Cursor createCursor ( ) throws IOException { return new FileListCursor ( files . iterator ( ) , encoding ) ; } static class FileListCursor implements Cursor { private final Iterator < File > rest ; private final Charset encoding ; private File current ; FileListCursor ( Iterator < File > iterator , Charset encoding ) { assert iterator != null ; assert encoding != null ; this . current = null ; this . rest = iterator ; this . encoding = encoding ; } @ Override public boolean next ( ) throws IOException { if ( rest . hasNext ( ) ) { current = rest . next ( ) ; return true ; } else { current = null ; return false ; } } @ Override public URI getIdentifier ( ) { if ( current == null ) { throw new NoSuchElementException ( ) ; } return current
2,555
<s> package net . sf . sveditor . core . tests . content_assist ; import java . util . ArrayList ; import java . util . List ; import net . sf . sveditor . core . SVCorePlugin ; import net . sf . sveditor . core . StringInputStream ; import net . sf . sveditor . core . content_assist . SVCompletionProposal ; import net . sf . sveditor . core . db . ISVDBFileFactory ; import net . sf . sveditor . core . db . ISVDBItemBase ; import net . sf . sveditor . core . db . SVDBFile ; import net . sf . sveditor . core . db . SVDBItem ; import net . sf . sveditor . core . db . SVDBMarker ; import net . sf . sveditor . core . log . LogFactory ; import net . sf . sveditor . core . log . LogHandle ; import net . sf . sveditor . core . scanutils . StringBIDITextScanner ; import net . sf . sveditor . core . tests . FileIndexIterator ; import net . sf . sveditor . core . tests . TextTagPosUtils ; import junit . framework . Test ; import junit . framework . TestCase ; import junit . framework . TestSuite ; public class ContentAssistTests extends TestCase { public static Test suite ( ) { TestSuite suite = new TestSuite ( "" ) ; suite . addTest ( new TestSuite ( TestArrayContentAssist . class ) ) ; suite . addTest ( new TestSuite ( TestContentAssistBasics . class ) ) ; suite . addTest ( new TestSuite ( TestContentAssistBehavioralBlock . class ) ) ; suite . addTest ( new TestSuite ( TestContentAssistBuiltins . class ) ) ; suite . addTest ( new TestSuite (
2,556
<s> package com . asakusafw . compiler . directio . testing . io ; import java . io . IOException ; import com . asakusafw . compiler . directio . testing . model . Line ; import com . asakusafw . runtime . io . ModelInput ; import com . asakusafw . runtime . io . RecordParser ; public final class LineInput implements ModelInput < Line > { private final RecordParser parser ; public LineInput ( RecordParser parser ) { if ( parser == null ) { throw new IllegalArgumentException ( "parser" ) ; } this . parser = parser ; } @ Override public boolean readTo ( Line model ) throws IOException { if ( parser . next ( ) == false ) { return false ; } parser . fill ( model . getValueOption ( ) ) ; parser . fill (
2,557
<s> package $ { package } . jobflow ; import $ { package } . modelgen . dmdl .
2,558
<s> package org . rubypeople . rdt . core ; import org
2,559
<s> package com . aptana . rdt . ui ; import org . eclipse . ui . plugin . AbstractUIPlugin ; import org . osgi . framework . BundleContext ; import org . rubypeople . rdt . core . RubyModelException ; import com . aptana . rdt . internal . ui . GemAutoInstallDialogJob ; public class AptanaRDTUIPlugin extends AbstractUIPlugin { public static final String PLUGIN_ID = "" ;
2,560
<s> package org . oddjob . values . properties ; import java . io . IOException ; import java . io . InputStream ; import java . io . ObjectInputStream ; import java . io . ObjectOutputStream ; import java . util . Map ; import java . util . Properties ; import java . util . Set ; import java . util . TreeMap ; import java . util . TreeSet ; import org . oddjob . Describeable ; import org . oddjob . arooa . ArooaSession ; import org . oddjob . arooa . convert . ArooaConversionException ; import org . oddjob . arooa . parsing . ArooaContext ; import org . oddjob . arooa . runtime . PropertyLookup ; import org . oddjob . arooa . runtime . PropertySource ; public class PropertiesJob extends PropertiesJobBase implements Describeable { private static final long serialVersionUID = 2011033000L ; private transient PropertiesBase delegate ; private transient ArooaSession session ; private transient PropertyLookup lookup ; private String environment ; private boolean override ; public PropertiesJob ( ) { completeConstruction ( ) ; } private void completeConstruction ( ) { delegate = new PropertiesBase ( ) ; } @ Override public void setArooaContext ( ArooaContext context ) { super . setArooaContext ( context ) ; delegate . setArooaContext ( context ) ; session = ( ( PropertiesConfigurationSession ) context . getSession ( ) ) . getOriginal ( ) ; }
2,561
<s> package com . asakusafw . compiler . operator . flow ; import java . io . IOException ; import java . text . MessageFormat ; import java . util . Collections ; import java . util . List ; import javax . lang . model . element . PackageElement ; import javax . tools . Diagnostic ; import org . slf4j . Logger ; import org . slf4j . LoggerFactory ; import com . asakusafw . compiler . common . Precondition ; import com . asakusafw . compiler . operator . OperatorCompilingEnvironment ; import com . asakusafw . utils . java . jsr269 . bridge . Jsr269 ; import com . asakusafw . utils . java . model . syntax . Comment ; import com . asakusafw . utils . java . model . syntax . CompilationUnit ; import com . asakusafw . utils . java . model . syntax . ImportDeclaration ; import com . asakusafw . utils . java . model . syntax . ModelFactory ; import com . asakusafw . utils . java . model . syntax . PackageDeclaration ; import com . asakusafw . utils . java . model . syntax . TypeDeclaration ; import com . asakusafw . utils . java . model . util . ImportBuilder ; import com . asakusafw . utils . java . model . util . ImportBuilder . Strategy ; public class FlowClassEmitter { static final Logger LOG = LoggerFactory . getLogger ( FlowClassEmitter . class ) ; private final OperatorCompilingEnvironment environment ; public FlowClassEmitter ( OperatorCompilingEnvironment environment ) { Precondition . checkMustNotBeNull ( environment , "environment" ) ; this . environment = environment ; } public void emit ( FlowPartClass aClass ) { assert aClass != null ; ModelFactory f = environment . getFactory ( ) ; PackageDeclaration packageDecl = getPackage ( f , aClass ) ; ImportBuilder imports = getImportBuilder ( f , packageDecl ) ; FlowFactoryClassGenerator generator = new FlowFactoryClassGenerator ( environment , f , imports , aClass ) ; TypeDeclaration type = generator . generate ( ) ; List < ImportDeclaration > decls = imports . toImportDeclarations ( ) ; try { emit ( f , packageDecl , decls ,
2,562
<s> package br . com . caelum . vraptor . dash . statement ; import java . util . ArrayList ; import java . util . List ; import java . util . StringTokenizer ; import javax . persistence . Entity ; import javax . persistence . GeneratedValue ; import javax . persistence . Id ; import javax . persistence . Lob ; import javax . persistence . Table ; import org . hibernate . annotations . GenericGenerator ; @ Entity ( name = "" ) @ Table ( name = "" ) public class Statement { @ Id @ GeneratedValue ( generator = "" ) @ GenericGenerator ( name = "" , strategy = "uuid" ) private String id ; private String name ; @ Lob private String hql ; private String password ; public String getId ( ) { return id ; } public void setId ( String id ) { this . id = id ; } public String getName ( ) { return name ; } public void setName ( String name ) { this . name = name ; } public String getPassword ( ) { return password ; } public void setPassword ( String password ) { this . password = password ; } @ Deprecated protected Statement ( ) { } public Statement ( String name , String hql ) { this . name = name ; this . hql = hql ; } public String getHql ( ) { return hql ; } public String getEscapedHql ( ) { String escapedHql
2,563
<s> package com . asakusafw . runtime . directio . util ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . ByteArrayInputStream ; import java . io . ByteArrayOutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . nio . charset . Charset ; import java . util . Arrays ; import java . util . Random ; import org . apache . hadoop . io . InputBuffer ; import org . junit . Test ; public class DelimiterRangeInputStreamTest { @ Test public void readByte_nodelim ( ) throws Exception { InputStream origin = bytes ( "" ) ; InputStream testee = new DelimiterRangeInputStream ( origin , '|' , 100 , false ) ; assertThat ( readBytes ( testee ) , is ( "" ) ) ; } @ Test public void readByte_enough ( ) throws Exception { InputStream origin = bytes ( "" ) ; InputStream testee = new DelimiterRangeInputStream ( origin , '|' , 100 , false ) ; assertThat ( readBytes ( testee ) , is ( "" ) ) ; } @ Test public void readByte_delimited ( ) throws Exception { InputStream origin = bytes ( "" ) ; InputStream testee = new DelimiterRangeInputStream ( origin , '|' , 1 , false ) ; assertThat ( readBytes ( testee ) , is ( "Hello|" ) ) ; } @ Test public void readByte_just_not_delimited ( ) throws Exception { InputStream origin = bytes ( "" ) ; InputStream testee = new DelimiterRangeInputStream ( origin , '|' , 5 , false ) ; assertThat ( readBytes ( testee ) , is ( "Hello|" ) ) ; } @ Test public void readByte_just_delimited ( ) throws Exception { InputStream origin = bytes ( "" ) ; InputStream testee = new DelimiterRangeInputStream ( origin , '|' , 6 , false ) ; assertThat ( readBytes ( testee ) , is ( "Hello|World|" ) ) ; } @ Test public void readByte_skip ( ) throws Exception { InputStream origin = bytes ( "" ) ; InputStream testee = new DelimiterRangeInputStream ( origin , '|' , 100 , true ) ; assertThat ( readBytes ( testee ) , is ( "World|!" ) ) ; } @ Test public void readByte_skip_too_small ( ) throws Exception { InputStream origin = bytes ( "" ) ; InputStream testee = new DelimiterRangeInputStream ( origin , '|' , 5 , true ) ; assertThat ( readBytes ( testee ) , is ( "" ) ) ; } @ Test public void readByte_skip_small ( ) throws Exception { InputStream origin = bytes ( "" ) ; InputStream testee = new DelimiterRangeInputStream ( origin , '|' , 6 , true ) ; assertThat ( readBytes ( testee ) , is ( "World|" ) ) ; } @ Test public void readByte_skip_nodelim ( ) throws Exception { InputStream origin = bytes ( "" ) ; InputStream testee = new DelimiterRangeInputStream ( origin , '|' , 100 , true ) ; assertThat ( readBytes ( testee ) , is ( "" ) ) ; } @ Test public void readByte_skip_nodelim_small ( ) throws Exception { InputStream origin = bytes ( "" ) ; InputStream testee = new DelimiterRangeInputStream ( origin , '|' , 1 , true ) ; assertThat ( readBytes ( testee ) , is ( "" ) ) ; } @ Test public void readByte_random ( ) throws Exception { byte [ ] bytes = "ABC|D|EF" . getBytes ( Charset . forName ( "ASCII" ) ) ; InputBuffer buffer = new InputBuffer ( ) ; buffer . reset ( bytes , bytes . length ) ; Random random = new Random ( 12345 ) ; for ( int i = 0 ; i < 100000 ; i ++ ) { int [ ] bounds = new int [ 5 ] ; for ( int j = 0 ; j < bounds . length ; j ++ ) { bounds [ j ] = random . nextInt ( bytes . length + 1 ) ; } Arrays . sort ( bounds ) ; StringBuilder buf = new StringBuilder ( ) ; int start = 0 ; for ( int j = 0 ; j < bounds . length ; j ++ ) { int end = bounds [ j ] ; copy ( buffer , buf , start , end ) ; start
2,564
<s> package net . sf . sveditor . core . db ; public class SVDBDocComment extends SVDBItem { public String fRawComment ; public SVDBDocComment ( ) { super (
2,565
<s> package org . oddjob . persist ; import java . io . File ; import org . apache . log4j . Logger ; import org . oddjob . arooa . deploy . annotations . ArooaAttribute ; import org . oddjob . arooa . life . ComponentPersistException ; import org . oddjob . arooa . registry . Path ; public class FilePersister extends PersisterBase { private static final Logger logger = Logger . getLogger ( FilePersister . class ) ; private File directory ; @ ArooaAttribute public void setDir ( File dir ) { this . directory = dir ; } public File getDir ( ) { return this . directory ; } protected void persist ( Path path , String id , Object o ) throws ComponentPersistException { new SerializeWithFile ( ) . toFile ( directoryFor ( path ) , id , o ) ; } protected void remove ( Path path , String id ) throws ComponentPersistException { new SerializeWithFile ( ) . remove ( directoryFor ( path ) , id ) ; } protected Object restore ( Path path , String id , ClassLoader classLoader ) throws ComponentPersistException { return new SerializeWithFile ( ) . fromFile ( directoryFor ( path ) , id , classLoader ) ; } @ Override protected String [ ] list ( Path path ) throws ComponentPersistException { return new SerializeWithFile ( ) . list ( directoryFor ( path ) ) ; } @ Override protected void clear ( Path path ) { new SerializeWithFile ( ) . clear ( new File ( directory , path . toString ( ) ) ) ; } File directoryFor ( Path path ) throws ComponentPersistException { if ( directory == null && ( path == null || path . size ( ) == 0 ) ) {
2,566
<s> package org . rubypeople . rdt . internal . core . hierarchy ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . List ; import java . util . Map ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . IStatus ; import org . rubypeople . rdt . core . IOpenable ; import org . rubypeople . rdt . core . IType ; import org . rubypeople . rdt . core . RubyCore ; import org . rubypeople . rdt . core . RubyModelException ; import org . rubypeople . rdt . internal . codeassist . RubyElementRequestor ; import org . rubypeople . rdt . internal . core . LogicalType ; public class HierarchyResolver { private static final int RECURSE_DEPTH_BAILOUT = 50 ; private boolean superTypesOnly ; private HierarchyBuilder builder ; private HashSet < String > visitedTypes ; public HierarchyResolver ( Map options , HierarchyBuilder builder ) { this . builder = builder ; } public void resolve ( IOpenable [ ] openables , HashSet < String > localTypes , IProgressMonitor monitor ) { try { int openablesLength = openables . length ; IType focus = this . builder . getType ( ) ; for ( int i = 0 ; i < openablesLength ; i ++ ) { IOpenable openable = openables [ i ] ; if ( openable instanceof org . rubypeople . rdt . core . IRubyScript ) { org . rubypeople . rdt . core . IRubyScript
2,567
<s> package com . asakusafw . windgate . core . vocabulary ; public enum JdbcProcess implements ConfigurationItem { JDBC_SUPPORT ( "jdbcSupport" , "" ) , TABLE ( "table" , "" ) , COLUMNS ( "columns" , "" ) , CONDITION ( "condition" , "" ) , OPERATION ( "operation" , "" ) , ; private final String key ; private final String description ; private JdbcProcess ( String key , String description ) { assert key != null ; assert description != null ; this . key = key ; this . description = description ; } @ Override public
2,568
<s> package org . springframework . samples . petclinic . validation ; import org . springframework . samples . petclinic . Visit ; import org . springframework . util . StringUtils ; import org . springframework . validation . Errors ; public class VisitValidator { public void validate ( Visit visit , Errors errors ) {
2,569
<s> package com . asakusafw . compiler . flow . processor . operator ; import java . util . Arrays ; import java . util . List ; import javax . annotation . Generated ; import com . asakusafw . compiler . flow . testing . model . Ex1 ; import com . asakusafw . compiler . flow . testing . model . Ex2 ; import com . asakusafw . vocabulary . flow . Operator ; import com . asakusafw . vocabulary . flow . Source ; import com . asakusafw . vocabulary . flow . graph . FlowBoundary ; import com . asakusafw . vocabulary . flow . graph . FlowElementResolver ; import com . asakusafw . vocabulary . flow . graph . OperatorDescription ; import com . asakusafw . vocabulary . flow . graph . OperatorHelper ; import com . asakusafw . vocabulary . flow . graph . ShuffleKey ; import com . asakusafw . vocabulary . operator . MasterJoinUpdate ; @ Generated ( "" ) public class MasterJoinUpdateFlowFactory { public static final class Simple implements Operator { public final Source < Ex1 > updated ; public final Source < Ex1 > missed ; Simple ( Source < Ex2 > master , Source < Ex1 > model ) { OperatorDescription . Builder builder = new OperatorDescription . Builder ( MasterJoinUpdate . class ) ; builder . declare ( MasterJoinUpdateFlow . class , MasterJoinUpdateFlowImpl . class , "simple" ) ; builder . declareParameter ( Ex2 . class ) ; builder . declareParameter ( Ex1 . class ) ; builder . addInput ( "master" , Ex2 . class , new ShuffleKey ( Arrays . asList ( new String [ ] { "string" } ) , Arrays . asList ( new ShuffleKey . Order [ ] { } ) ) ) ; builder . addInput ( "model" , Ex1 . class , new ShuffleKey ( Arrays . asList ( new String [ ] { "string" } ) , Arrays . asList ( new ShuffleKey . Order [ ] { } ) ) ) ; builder . addOutput ( "updated" , Ex1 . class ) ; builder . addOutput ( "missed" , Ex1 . class ) ; builder . addAttribute ( FlowBoundary . SHUFFLE ) ; FlowElementResolver resolver = builder . toResolver ( ) ; resolver . resolveInput ( "master" , master ) ; resolver . resolveInput ( "model" , model ) ; this . updated = resolver . resolveOutput ( "updated" ) ; this . missed = resolver . resolveOutput ( "missed" ) ; } } public MasterJoinUpdateFlowFactory . Simple simple ( Source < Ex2 > master , Source < Ex1 > model ) {
2,570
<s> package org . rubypeople . rdt . internal . ui . search ; import java . util . Collection ; import java . util . List ; import org . eclipse . jface . text . IDocument ; import org . eclipse . jface . text . Position ; import org . jruby . ast . Node ; import org . rubypeople . rdt . core . IRubyElement ; public interface IOccurrencesFinder { public String initialize ( Node root , int offset , int length ) ; public List < Position > perform (
2,571
<s> package org . oddjob . jmx . server ; import javax . management . MBeanException ; import javax . management . MBeanInfo ; import javax . management . ReflectionException ; import org . oddjob . jmx . client . ClientHandlerResolver ; public interface ServerInterfaceManager { public ClientHandlerResolver < ? > [ ] allClientInfo ( ) ; public MBeanInfo getMBeanInfo ( ) ; public Object invoke
2,572
<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 . WeeklySchedule ; import org . oddjob . schedules . units . DayOfWeek ; public class WeeklyScheduleDETest extends TestCase { private static final Logger logger = Logger . getLogger ( WeeklyScheduleDETest . class ) ; public void setUp ( ) { logger . debug ( "" + getName ( ) + "" ) ; }
2,573
<s> package org . vaadin . teemu . clara . inflater ; @ SuppressWarnings ( "serial" ) public class LayoutInflaterException extends RuntimeException { public LayoutInflaterException ( String message ) { super ( message ) ; } public LayoutInflaterException ( String message , Throwable e ) {
2,574
<s> package org . rubypeople . rdt . internal . debug . core . model ; import org . eclipse . debug . core . DebugException ; import org . eclipse . debug . core . model . IVariable ; import org . rubypeople . rdt . debug . core . model . IRubyValue ; public class RubyValue extends RubyDebugElement implements IRubyValue { private String valueString ; private String referenceTypeName ; private boolean hasChildren ; private RubyVariable owner ; private RubyVariable [ ] variables ; public RubyValue ( RubyVariable owner ) { this ( owner , "nil" , null , false ) ; } public RubyValue ( RubyVariable owner , String valueString , String type , boolean hasChildren ) { super ( owner . getDebugTarget ( ) ) ; this . valueString = valueString ; if ( type != null && type . equals ( "String" ) ) { this . valueString = '"' + this . valueString + '"' ; } else if ( this .
2,575
<s> package org . rubypeople . rdt . internal . compiler . parser ; public abstract class ScannerHelper { public final static int MAX_OBVIOUS = 128 ; public final static int [ ] OBVIOUS_IDENT_CHAR_NATURES = new int [ MAX_OBVIOUS ] ; public final static int C_JLS_SPACE = 0x100 ; public final static int C_SPECIAL = 0x80 ; public final static int C_IDENT_START = 0x40 ; public final static int C_UPPER_LETTER = 0x20 ; public final static int C_LOWER_LETTER = 0x10 ; public final static int C_IDENT_PART = 0x8 ; public final static int C_DIGIT = 0x4 ; public final static int C_SEPARATOR = 0x2 ; public final static int C_SPACE = 0x1 ; static { OBVIOUS_IDENT_CHAR_NATURES [ 0 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 1 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 2 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 3 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 4 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 5 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 6 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 7 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 8 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 14 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 15 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 16 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 17 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 18 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 19 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 20 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 21 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 22 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 23 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 24 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 25 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 26 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 27 ] = C_IDENT_PART ; OBVIOUS_IDENT_CHAR_NATURES [ 127 ] = C_IDENT_PART ; for ( int i = '0' ; i <= '9' ; i ++ ) OBVIOUS_IDENT_CHAR_NATURES [ i ] = C_DIGIT | C_IDENT_PART ; for ( int i = 'a' ; i <= 'z' ; i ++ ) OBVIOUS_IDENT_CHAR_NATURES [ i ] = C_LOWER_LETTER | C_IDENT_PART | C_IDENT_START ; for ( int i = 'A' ; i <= 'Z' ; i ++ ) OBVIOUS_IDENT_CHAR_NATURES [ i ] = C_UPPER_LETTER | C_IDENT_PART | C_IDENT_START ; OBVIOUS_IDENT_CHAR_NATURES [ '_' ] = C_SPECIAL | C_IDENT_PART | C_IDENT_START ; OBVIOUS_IDENT_CHAR_NATURES [ '$' ] = C_SPECIAL | C_IDENT_PART | C_IDENT_START ;
2,576
<s> package org . rubypeople . rdt . refactoring . tests . core . mergewithexternalclassparts . conditionchecks ; import junit . framework . Test ; import org . rubypeople . rdt . refactoring . tests . FileTestSuite ; public class TS_MergetWitExternalChecks extends FileTestSuite
2,577
<s> package com . asakusafw . compiler . flow . mapreduce . copy ; import java . io . IOException ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import org . apache . hadoop . io . NullWritable ; import org . slf4j . Logger ; import org . slf4j . LoggerFactory ; import com . asakusafw . compiler . common . Naming ; import com . asakusafw . compiler . common . Precondition ; import com . asakusafw . compiler . flow . ExternalIoDescriptionProcessor . SourceInfo ; import com . asakusafw . compiler . flow . FlowCompilingEnvironment ; import com . asakusafw . compiler . flow . Location ; import com . asakusafw . compiler . flow . jobflow . CompiledStage ; import com . asakusafw . compiler . flow . stage . CompiledType ; import com . asakusafw . runtime . stage . AbstractStageClient ; import com . asakusafw . runtime . stage . BaseStageClient ; import com . asakusafw . runtime . stage . StageInput ; import com . asakusafw . runtime . stage . StageOutput ; import com . asakusafw . utils . collections . Lists ; import com . asakusafw . utils . java . model . syntax . Comment ; import com . asakusafw . utils . java . model . syntax . CompilationUnit ; import com . asakusafw . utils . java . model . syntax . Expression ; import com . asakusafw . utils . java . model . syntax . FormalParameterDeclaration ; import com . asakusafw . utils . java . model . syntax . Javadoc ; import com . asakusafw . utils . java . model . syntax . MethodDeclaration ; import com . asakusafw . utils . java . model . syntax . ModelFactory ; import com . asakusafw . utils . java . model . syntax . Name ; import com . asakusafw . utils . java . model . syntax . QualifiedName ; import com . asakusafw . utils . java . model . syntax . SimpleName ; import com . asakusafw . utils . java . model . syntax . Statement ; import com . asakusafw . utils . java . model . syntax . Type ; import com . asakusafw . utils . java . model . syntax . TypeBodyDeclaration ; import com . asakusafw . utils . java . model . syntax . TypeDeclaration ; import com . asakusafw . utils . java . model . syntax . TypeParameterDeclaration ; import com . asakusafw . utils . java . model . util . AttributeBuilder ; import com . asakusafw . utils . java . model . util . ExpressionBuilder ; import com . asakusafw . utils . java . model . util . ImportBuilder ; import com . asakusafw . utils . java . model . util . JavadocBuilder ; import com . asakusafw . utils . java . model . util . Models ; import com . asakusafw . utils . java . model . util . TypeBuilder ; public class CopierClientEmitter { static final Logger LOG = LoggerFactory . getLogger ( CopierClientEmitter . class ) ; private final FlowCompilingEnvironment environment ; public CopierClientEmitter ( FlowCompilingEnvironment environment ) { Precondition . checkMustNotBeNull ( environment , "environment" ) ; this . environment = environment ; } public CompiledStage emitPrologue ( String moduleId , List < CopyDescription > slots , Location outputDirectory ) throws IOException { return emit ( moduleId , slots , outputDirectory , true ) ; } public CompiledStage emitEpilogue ( String moduleId , List < CopyDescription > slots , Location outputDirectory ) throws IOException { return emit ( moduleId , slots , outputDirectory , false ) ; } private CompiledStage emit ( String moduleId , List < CopyDescription > slots , Location outputDirectory , boolean prologue ) throws IOException { Precondition . checkMustNotBeNull ( moduleId , "moduleId" ) ; Precondition . checkMustNotBeNull ( slots , "slots" ) ; Precondition . checkMustNotBeNull ( outputDirectory , "" ) ; LOG . debug ( "" , moduleId , prologue ? "prologue" : "epilogue" ) ; Engine engine = new Engine ( environment , moduleId , slots , outputDirectory , prologue ) ; CompilationUnit source = engine . generate ( ) ; environment . emit ( source ) ; Name packageName = source . getPackageDeclaration ( ) . getName ( ) ; SimpleName simpleName = source . getTypeDeclarations ( ) . get ( 0 ) . getName ( ) ; QualifiedName name = environment . getModelFactory ( ) . newQualifiedName ( packageName , simpleName ) ; LOG . debug ( "" , moduleId , name ) ; return new CompiledStage ( name , prologue ? Naming . getPrologueName ( moduleId ) : Naming . getEpilogueName ( moduleId ) ) ; } private static class Engine { private static final char PATH_SEPARATOR = '/' ; private final FlowCompilingEnvironment environment ; private final String moduleId ; private final List < CopyDescription > slots ; private final Location outputDirectory ; private final ModelFactory factory ; private final ImportBuilder importer ; private final boolean prologue ; Engine ( FlowCompilingEnvironment environment , String moduleId , List < CopyDescription > slots , Location outputDirectory , boolean prologue ) { assert environment != null ; assert moduleId != null ; assert slots != null ; this . environment = environment ; this . moduleId = moduleId ; this . slots = slots ; this . outputDirectory = outputDirectory ; this . prologue = prologue ; this . factory = environment . getModelFactory ( ) ; Name packageName = prologue ? environment . getProloguePackageName ( moduleId ) : environment . getEpiloguePackageName ( moduleId ) ; this . importer = new ImportBuilder ( factory , factory . newPackageDeclaration ( packageName ) , ImportBuilder . Strategy . TOP_LEVEL ) ; } public CompilationUnit generate ( ) throws IOException { TypeDeclaration type = createType ( ) ; return factory . newCompilationUnit ( importer . getPackageDeclaration ( ) , importer . toImportDeclarations ( ) , Collections . singletonList ( type ) , Collections . < Comment > emptyList ( ) ) ; } private TypeDeclaration createType ( ) throws IOException { SimpleName name = factory . newSimpleName ( Naming . getClientClass ( ) ) ; importer . resolvePackageMember ( name ) ; List < TypeBodyDeclaration > members = Lists . create ( ) ; members . addAll ( createIdMethods ( ) ) ; members . add ( createStageOutputPath ( ) ) ; members . add ( createStageInputsMethod ( ) ) ; members . add ( createStageOutputsMethod ( ) ) ; return factory . newClassDeclaration ( createJavadoc ( ) , new AttributeBuilder ( factory ) . Public ( ) . Final ( ) . toAttributes ( ) , name , Collections . < TypeParameterDeclaration > emptyList ( ) , t ( AbstractStageClient . class ) , Collections . < Type > emptyList ( ) , members ) ; } private List < MethodDeclaration > createIdMethods ( ) { List < MethodDeclaration > results = Lists . create ( ) ; results . add ( createValueMethod ( BaseStageClient . METHOD_BATCH_ID , t ( String . class ) , Models . toLiteral ( factory , environment . getBatchId ( ) ) ) ) ; results . add ( createValueMethod ( BaseStageClient . METHOD_FLOW_ID , t ( String . class ) , Models . toLiteral ( factory , environment . getFlowId ( ) ) ) ) ; results . add ( createValueMethod ( BaseStageClient . METHOD_STAGE_ID , t ( String . class ) , Models . toLiteral ( factory , prologue ? Naming . getPrologueName ( moduleId ) : Naming . getEpilogueName ( moduleId ) ) ) ) ; return results ; } private MethodDeclaration createStageOutputPath ( ) { return createValueMethod ( AbstractStageClient . METHOD_STAGE_OUTPUT_PATH , t ( String . class ) , Models . toLiteral ( factory , outputDirectory . toPath ( PATH_SEPARATOR ) ) ) ; } private MethodDeclaration createStageInputsMethod ( ) throws IOException { SimpleName list = factory . newSimpleName ( "results" ) ; SimpleName attributes = factory . newSimpleName ( "attributes" ) ; List < Statement > statements = Lists . create ( ) ; statements . add ( new TypeBuilder ( factory , t ( ArrayList . class , t ( StageInput . class ) ) ) . newObject ( ) . toLocalVariableDeclaration ( t ( List . class , t ( StageInput . class ) ) , list ) ) ; statements . add ( new ExpressionBuilder ( factory , Models . toNullLiteral ( factory ) ) . toLocalVariableDeclaration ( t ( Map . class , t ( String . class ) , t ( String . class ) ) , attributes ) ) ; for ( CopyDescription slot : slots ) { SourceInfo info = slot . getInput ( ) ; Type mapperType = generateMapper ( slot ) ; Type formatClass = t ( info . getFormat ( ) ) ; statements . add ( new ExpressionBuilder ( factory , attributes ) . assignFrom ( new TypeBuilder ( factory , t ( HashMap . class , t ( String . class ) , t ( String . class ) ) ) . newObject ( ) . toExpression ( ) ) . toStatement ( ) ) ; for ( Map . Entry < String , String > entry : info . getAttributes ( ) . entrySet ( ) ) { statements . add ( new ExpressionBuilder ( factory , attributes ) . method ( "put" , Models . toLiteral ( factory ,
2,578
<s> package com . asakusafw . compiler . directio . testing . io ; import java . io . IOException ; import com . asakusafw . compiler . directio . testing . model . Line1 ; import com . asakusafw . runtime . io . ModelInput ; import com . asakusafw . runtime . io . RecordParser ; public final class Line1Input implements ModelInput < Line1 > { private final RecordParser parser ; public Line1Input ( RecordParser parser ) { if ( parser == null ) { throw new IllegalArgumentException ( "parser" ) ; } this . parser = parser ; } @ Override public boolean readTo ( Line1 model ) throws IOException { if ( parser . next ( ) == false ) { return false ; } parser . fill ( model . getValueOption ( ) ) ; parser . fill ( model . getFirstOption ( ) ) ;
2,579
<s> package org . springframework . social . google . api . tasks ; public interface TaskOperations { TaskListsPage getTaskLists ( ) ; TaskList getTaskList ( String id ) ; TaskList saveTaskList (
2,580
<s> package net . sf . sveditor . core . db . index . cache ; import java . io . File ;
2,581
<s> package net . sf . sveditor . core . db . index ; import java . io . ByteArrayInputStream ; import java . io . ByteArrayOutputStream ; import java . io . IOException ; import java . io . InputStream ; public class InputStreamCopier { private InputStream fIn ; private ByteArrayOutputStream fOut ; public InputStreamCopier ( InputStream
2,582
<s> package com . asakusafw . runtime . io ; import java . io . Closeable ; import java . io . IOException ; import com . asakusafw . runtime . value . BooleanOption ; import com . asakusafw . runtime . value . ByteOption ; import com . asakusafw . runtime . value . DateOption ; import com . asakusafw . runtime . value . DateTimeOption ; import com . asakusafw . runtime . value . DecimalOption ; import com . asakusafw . runtime . value . DoubleOption ; import com . asakusafw . runtime . value . FloatOption ; import com . asakusafw . runtime . value . IntOption ; import com . asakusafw . runtime . value . LongOption ; import com . asakusafw . runtime . value . ShortOption ; import com . asakusafw . runtime . value . StringOption ; import com . asakusafw . runtime . value . ValueOption ; public interface RecordParser extends Closeable { boolean next ( ) throws
2,583
<s> package org . rubypeople . rdt . internal . ui ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . runtime . CoreException ; import org . rubypeople . rdt . core . IRubyElement ; import org . rubypeople . rdt . core . IRubyProject ; import org . rubypeople . rdt . core . IRubyScript ; import org . rubypeople . rdt . core . tests . ModifyingResourceTest ; import org . rubypeople . rdt . internal . core . RubyProject ; import org . rubypeople . rdt . internal . core . RubyScript ; public class TC_ResourceAdapterFactory extends ModifyingResourceTest { private static final String PROJECT_NAME = "adapterTest" ; private ResourceAdapterFactory factory ; private IProject project ; public TC_ResourceAdapterFactory ( String name ) { super ( name ) ; } protected void setUp ( ) throws Exception { super . setUp ( ) ; this . project = createProject ( PROJECT_NAME ) ; factory = new ResourceAdapterFactory ( ) ; } @ Override protected void tearDown ( ) throws Exception { super . tearDown ( ) ; deleteProject ( PROJECT_NAME ) ; } public void testGetAdapterForRBFile ( ) throws CoreException { IFile file = createFile ( PROJECT_NAME + "/mustBeA.rb" , "" ) ; assertEquals ( RubyScript . class , factory . getAdapter ( file , IRubyElement . class ) . getClass ( ) ) ; assertTrue ( factory . getAdapter ( file , IRubyElement . class ) instanceof IRubyScript ) ; } public void testGetAdapterForRBWFile ( ) throws CoreException { IFile file = createFile ( PROJECT_NAME + "/mustBeA.rbw" , "" ) ; assertEquals ( RubyScript
2,584
<s> package test . modelgen . table . io ; import java . io . IOException ; import javax . annotation . Generated ; import test . modelgen . table . model . ExportTempImportTarget13 ; import com . asakusafw . runtime . io . ModelInput ; import com . asakusafw . runtime . io . RecordParser ; @ Generated ( "" ) @ SuppressWarnings ( "deprecation" ) public final class ExportTempImportTarget13ModelInput implements ModelInput < ExportTempImportTarget13 > { private final RecordParser parser ; public ExportTempImportTarget13ModelInput ( RecordParser parser ) { if ( parser == null ) { throw new IllegalArgumentException ( ) ; } this . parser = parser ; } @ Override public boolean readTo ( ExportTempImportTarget13 model ) throws IOException { if ( parser . next ( ) == false ) { return false ; } parser . fill ( model . getVersionNoOption ( ) ) ; parser . fill ( model . getTempSidOption ( ) ) ; parser . fill ( model . getSidOption ( ) ) ; parser . fill ( model . getUpdtDateOption ( )
2,585
<s> package com . asakusafw . testdriver . core ; import
2,586
<s> package test . modelgen . table . io ; import java . io . IOException ; import javax . annotation . Generated ; import test . modelgen . table . model . JobflowInstanceLock ; import com . asakusafw . runtime
2,587
<s> package com . asakusafw . compiler . operator . model ; import java . io . DataInput ; import java . io . DataOutput ; import java . io . IOException ; import org . apache . hadoop . io . Writable ; import com . asakusafw . compiler . operator . io . MockSummarizedInput ; import com . asakusafw . compiler . operator . io . MockSummarizedOutput ; 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 . LongOption ; import com . asakusafw . vocabulary . model . Key ; import com . asakusafw . vocabulary . model . Summarized ; @ DataModelKind ( "DMDL" ) @ ModelInputLocation ( MockSummarizedInput . class ) @ ModelOutputLocation ( MockSummarizedOutput . class ) @ Summarized ( term = @ Summarized . Term ( source = MockHoge . class , foldings = { @ Summarized . Folding ( aggregator = Summarized . Aggregator . ANY , source = "value" , destination = "key" ) , @ Summarized . Folding ( aggregator = Summarized . Aggregator . COUNT , source = "value" , destination = "count" ) } , shuffle = @ Key ( group = { "value" } ) ) )
2,588
<s> package org . rubypeople . rdt . internal . debug . ui . display ; import org . eclipse . core . runtime . PlatformObject ; import org . eclipse . debug . core . DebugEvent ; import org . eclipse . debug . core . DebugException ; import org . eclipse . debug . core . DebugPlugin ; import org . eclipse . debug . core . IDebugEventSetListener ; import org . eclipse . debug . core . ILaunch ; import org . eclipse . debug . core . model . IDebugElement ; import org . eclipse . debug . core . model . IDebugTarget ; import org . eclipse . debug . core . model . IErrorReportingExpression ; import org . eclipse . debug . core . model . IExpression ; import org . eclipse . debug . core . model . IValue ; import org . rubypeople . rdt . debug . core . model . IEvaluationResult ; public class RubyInspectExpression extends PlatformObject implements IErrorReportingExpression , IDebugEventSetListener { private IValue fValue ; private String fExpression ; private IEvaluationResult fResult ; public RubyInspectExpression ( String expression , IValue value ) { fValue = value ; fExpression = expression ; DebugPlugin . getDefault ( ) . addDebugEventListener ( this ) ; } public RubyInspectExpression ( IEvaluationResult result ) { this ( result . getSnippet ( ) , result . getValue ( ) ) ; fResult = result ; } public String getExpressionText ( ) { return fExpression ; } public IValue getValue ( ) { return fValue ; } public IDebugTarget getDebugTarget ( ) { IValue value = getValue ( ) ; if ( value != null ) { return getValue ( ) . getDebugTarget ( ) ; } if ( fResult != null ) { return fResult . getThread ( ) . getDebugTarget ( ) ; } return null ; } public String getModelIdentifier ( ) { return getDebugTarget ( ) . getModelIdentifier ( ) ; } public ILaunch getLaunch ( ) { return getDebugTarget ( ) . getLaunch ( ) ; } public void handleDebugEvents ( DebugEvent [ ] events ) { for ( int i = 0 ; i < events . length ; i ++ ) { DebugEvent event = events [ i ] ; switch ( event . getKind ( ) ) { case DebugEvent . TERMINATE : if ( event . getSource ( ) . equals ( getDebugTarget ( ) ) ) { DebugPlugin . getDefault ( ) . getExpressionManager ( ) . removeExpression ( this ) ; } break ; case DebugEvent . SUSPEND : if ( event . getDetail ( ) != DebugEvent . EVALUATION_IMPLICIT ) { if ( event . getSource ( ) instanceof IDebugElement ) { IDebugElement source = ( IDebugElement ) event . getSource ( ) ; if ( source . getDebugTarget ( ) . equals ( getDebugTarget ( ) ) )
2,589
<s> package com . asakusafw . compiler . fileio . 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 . fileio . io . ExSummarized2Input ; import com . asakusafw . compiler . fileio . io . ExSummarized2Output ; 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 . LongOption ; import com . asakusafw . runtime . value . StringOption ; import com . asakusafw . vocabulary . model . Key ; import com . asakusafw . vocabulary . model . Summarized ; @ DataModelKind ( "DMDL" ) @ ModelInputLocation ( ExSummarized2Input . class ) @ ModelOutputLocation ( ExSummarized2Output . class ) @ Summarized ( term = @ Summarized . Term ( source = Ex1 . class , foldings = { @ Summarized . Folding ( aggregator = Summarized . Aggregator . ANY , source = "string" , destination = "key" ) , @ Summarized . Folding ( aggregator = Summarized . Aggregator . SUM , source = "value" , destination = "value" ) , @ Summarized . Folding ( aggregator = Summarized . Aggregator . COUNT , source = "sid" , destination = "count" ) } , shuffle = @ Key ( group = { "string" } ) ) ) public class ExSummarized2 implements DataModel < ExSummarized2 > , Writable { private final StringOption key = new StringOption ( ) ; private final LongOption value = new LongOption ( ) ; private final LongOption count = new LongOption ( ) ; @ Override @ SuppressWarnings ( "deprecation" ) public void reset ( ) { this . key . setNull ( ) ; this . value . setNull ( ) ; this . count . setNull ( ) ; } @ Override @ SuppressWarnings ( "deprecation" ) public void copyFrom ( ExSummarized2 other ) { this . key . copyFrom ( other . key ) ; this . value . copyFrom ( other . value ) ; this . count . copyFrom ( other . count ) ; } public Text getKey ( ) { return this . key . get ( ) ; } @ SuppressWarnings ( "deprecation" ) public void setKey ( Text value0 ) { this . key . modify ( value0 ) ; } public StringOption getKeyOption ( ) { return this . key ; } @ SuppressWarnings ( "deprecation" ) public void setKeyOption ( StringOption option ) { this . key . copyFrom ( option ) ; } public long getValue ( ) { return this . value . get ( ) ; } @ SuppressWarnings ( "deprecation" ) public void setValue ( long value0 ) { this . value . modify ( value0 ) ; } public LongOption getValueOption ( ) { return this . value ; } @ SuppressWarnings ( "deprecation" ) public void setValueOption ( LongOption option ) { this . value . copyFrom ( option ) ; } public long getCount ( ) { return this . count . get ( ) ; } @ SuppressWarnings ( "deprecation" ) public void setCount ( long value0 ) { this . count . modify ( value0 ) ; } public LongOption getCountOption ( ) { return this . count ; } @ SuppressWarnings ( "deprecation" ) public void setCountOption ( LongOption option ) { this . count . copyFrom ( option ) ; } @ Override public String toString ( ) { StringBuilder result = new StringBuilder ( ) ; result . append ( "{" ) ; result . append ( "" ) ; result . append ( ", key=" ) ; result . append ( this . key ) ; result . append ( ", value=" ) ; result . append ( this . value ) ; result . append ( ", count=" ) ; result . append ( this . count ) ; result . append ( "}" ) ; return result . toString ( ) ; } @ Override public int hashCode ( ) { int prime = 31 ; int result = 1 ; result = prime * result + key . hashCode ( ) ; result = prime * result + value . hashCode ( ) ; result = prime * result + count . hashCode ( ) ; return result ; } @ Override public boolean equals ( Object obj ) { if ( this ==
2,590
<s> package org . rubypeople . rdt . internal . ui . rdocexport ; import java . io . BufferedReader ; import java . io . File ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . Iterator ; import java . util . List ; import java . util . Set ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . Platform ; import org . eclipse . jface . dialogs . ErrorDialog ; import org . eclipse . jface . dialogs . MessageDialog ; import org . rubypeople . rdt . internal . ui . RubyPlugin ; import org . rubypeople . rdt . internal . ui . RubyUIMessages ; import org . rubypeople . rdt . internal . ui . dialogs . StatusInfo ; import org . rubypeople . rdt . launching . RubyRuntime ; public class RDocUtility { static { String generateRdocOption = Platform . getDebugOption ( RubyPlugin . PLUGIN_ID + "" ) ; RDocUtility . setDebugging ( generateRdocOption == null ? false : generateRdocOption . equalsIgnoreCase ( "true" ) ) ; } private static Set < RdocListener > listeners = new HashSet < RdocListener > ( ) ; private static boolean isDebug = false ; public static void addRdocListener ( RdocListener listener ) { listeners . add ( listener ) ; } public static void removeRdocListener ( RdocListener listener ) { listeners . remove ( listener ) ; } public static void setDebugging ( boolean isDebug ) { RDocUtility . isDebug = isDebug ; } public static void generateDocumentation ( IResource resource ) { RubyInvoker invoker = new RubyInvoker ( resource ) ; invoker . invoke ( ) ; notifyListeners ( ) ; } private static class RubyInvoker { private IResource resource ; private RubyInvoker ( IResource resource ) { this . resource = resource ; findParentProject ( resource ) ; } private void findParentProject ( IResource resource ) { IResource project = resource ; while ( ! isProject ( project ) ) { project = project . getParent ( ) ; if ( project == null ) break ; } if ( project != null && isProject ( project ) ) this . resource = project ; } private boolean isProject ( IResource resource ) { return ( resource instanceof IProject ) ; } private void log ( String message ) { if ( RDocUtility . isDebug ) { System . out . println ( message ) ; } } public final void invoke ( ) { log ( "" + resource . getName ( ) ) ; File file = RubyRuntime . getRDoc ( ) ; if ( file == null || ! file . exists ( ) || ! file . isFile ( ) ) { MessageDialog . openError ( RubyPlugin . getActiveWorkbenchShell ( ) , RubyUIMessages . RDocPathErrorTitle , RubyUIMessages . RDocPathError ) ; return ; } List < String > args = new ArrayList < String > ( ) ; args . add ( file . getAbsolutePath ( ) ) ; args . add ( "-r" ) ; args . add ( resource . getLocation ( ) . toOSString ( ) ) ; String [ ] argArray = ( String [ ] ) args . toArray ( new String [ args . size ( ) ] ) ; try { Process process = Runtime . getRuntime ( ) . exec ( argArray ) ; if ( process != null ) { handleOutput ( process , args ) ; } } catch ( IOException e ) { RubyPlugin . log ( e ) ; log ( e . getMessage ( ) ) ; ErrorDialog . openError ( RubyPlugin . getActiveWorkbenchShell ( ) , RubyUIMessages . ErrorRunningRdocTitle , e . getMessage ( ) , new StatusInfo ( StatusInfo . ERROR , e . getMessage ( ) ) ) ; } }
2,591
<s> package org . rubypeople . rdt . internal . ui . search ; import org . eclipse . search . ui . text . AbstractTextSearchViewPage ; import org . eclipse . swt . graphics . Image ; import org . rubypeople . rdt . internal . ui . RubyPluginImages ; class OccurrencesSearchLabelProvider extends TextSearchLabelProvider { public OccurrencesSearchLabelProvider ( AbstractTextSearchViewPage page ) { super ( page ) ; } protected String doGetText ( Object element ) { RubyElementLine jel = ( RubyElementLine ) element ; return jel . getLineContents ( ) . replace ( '\t' , ' ' ) ; } public Image getImage ( Object element ) { if ( element instanceof OccurrencesGroupKey ) { OccurrencesGroupKey group = ( OccurrencesGroupKey ) element ; if ( group .
2,592
<s> package org . oddjob . jmx . handlers ; import java . lang . reflect . Method ; import javax . management . MBeanAttributeInfo ; import javax . management . MBeanNotificationInfo ; import javax . management . MBeanOperationInfo ; import org . oddjob . jmx . client . ClientHandlerResolver ; import org . oddjob . jmx . client . VanillaHandlerResolver ; import org . oddjob . jmx . server . JMXOperation ; import org . oddjob . jmx . server . JMXOperationFactory ; import org . oddjob . jmx . server . ServerAllOperationsHandler ; import org . oddjob . jmx . server . ServerInterfaceHandler ; import org . oddjob . jmx . server . ServerInterfaceHandlerFactory ; import org . oddjob . jmx . server . ServerSideToolkit ; public class VanillaServerHandlerFactory < T > implements ServerInterfaceHandlerFactory < T , T > { private final Class < T > cl ; private final MBeanOperationInfo [ ] opInfo ; public VanillaServerHandlerFactory ( Class < T > cl ) { this . cl = cl ; Method [ ] ms = cl . getMethods ( ) ; opInfo = new MBeanOperationInfo [ ms . length ] ; for ( int i = 0 ; i < opInfo . length ; ++ i ) { Method m = ms [ i ] ; JMXOperation < ? > op = new JMXOperationFactory ( cl ) . operationFor ( m , MBeanOperationInfo . UNKNOWN ) ; opInfo [ i ] =
2,593
<s> package com . asakusafw . yaess . basic ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . File ; import java . io . FileOutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . Scanner ; import java . util . Set ; import java . util . TreeSet ; import org . junit . Assume ; import org . junit . Rule ; import org . junit . rules . TemporaryFolder ; import org . slf4j . Logger ; import org . slf4j . LoggerFactory ; import com . asakusafw . yaess . core . ExecutionContext ; import com . asakusafw . yaess . core . ExecutionMonitor ; import com . asakusafw . yaess . core . ExecutionPhase ; import com . asakusafw . yaess . core . ExecutionScript ; import com . asakusafw . yaess . core . ExecutionScriptHandler ; public class BasicScriptHandlerTestRoot { static final Logger LOG = LoggerFactory . getLogger ( BasicScriptHandlerTestRoot . class ) ; @ Rule public final TemporaryFolder folder = new TemporaryFolder ( ) ; protected < T extends ExecutionScript > void execute ( T script , ExecutionScriptHandler < T > handler ) { ExecutionContext context = new ExecutionContext ( "b" , "f" , "e" , ExecutionPhase . MAIN , map ( ) ) ; execute ( context , script , handler ) ; } protected < T extends ExecutionScript > void execute ( ExecutionContext context , T script , ExecutionScriptHandler < T > handler ) { try { handler . execute ( ExecutionMonitor . NULL , context , script ) ; } catch ( InterruptedException e ) { throw new AssertionError ( e ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; Assume . assumeNoException ( e ) ; } } protected List < String > getOutput ( File copier ) throws IOException { File output = new File ( copier . getParentFile ( ) , copier . getName ( ) + ".out" ) ; List < String > results = new ArrayList < String > ( ) ; Scanner scanner = new Scanner ( output ) ; while ( scanner . hasNextLine ( ) ) { results . add ( scanner . nextLine ( ) ) ; }
2,594
<s> package com . asakusafw . runtime . stage ; import java . text . MessageFormat ; import com . asakusafw . runtime . util . VariableTable ; public final class StageConstants { public static final String PROP_USER = "" ; public static final String PROP_EXECUTION_ID = "" ; public static final String PROP_BATCH_ID = "" ; public static final String PROP_FLOW_ID = "" ; public static final String PROP_ASAKUSA_BATCH_ARGS = "" ; public static final String VAR_USER = "user" ; public static final String VAR_EXECUTION_ID = "execution_id" ; public static final String VAR_BATCH_ID = "batch_id" ; public static final String VAR_FLOW_ID
2,595
<s> package com . asakusafw . testdriver ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . File ; import java . net . URL ; import java . net . URLClassLoader ; import org . junit . Assume ; import org . junit . Ignore ; import org . junit . Rule ; import org . junit . Test ; import com . asakusafw . runtime . configuration . FrameworkDeployer ; import com . asakusafw . testdriver . testing . flowpart . SimpleFlowPart ; import com . asakusafw . testdriver . testing . model . Simple ; import com . asakusafw . vocabulary . external . ImporterDescription . DataSize ; import com . asakusafw . vocabulary . flow . In ; import com . asakusafw . vocabulary . flow . Out ; public class FlowPartTesterTest { @ Rule public FrameworkDeployer framework = new FrameworkDeployer ( ) ; @ Test public void simple ( ) { FlowPartTester tester = new FlowPartTester ( getClass ( ) ) ; tester . setFrameworkHomePath ( framework . getHome ( ) ) ; In < Simple > in = tester . input ( "in" , Simple . class ) . prepare ( "" ) ; Out < Simple > out = tester . output ( "out" , Simple . class ) . verify ( "" , new IdentityVerifier ( ) ) ; tester . runTest ( new SimpleFlowPart ( in , out ) ) ; } @ Test public void dumpActual_path ( ) { File target = new File ( "" ) ; target . delete ( ) ; FlowPartTester tester = new FlowPartTester ( getClass ( ) ) ; tester . setFrameworkHomePath ( framework . getHome ( ) ) ; In < Simple > in = tester . input ( "in" , Simple . class ) . prepare ( "" ) ; Out < Simple > out = tester . output ( "out" , Simple . class ) . verify ( "" , new IdentityVerifier ( ) ) . dumpActual ( target . getPath ( ) ) ; tester . runTest ( new SimpleFlowPart ( in , out ) ) ; assertThat ( target . exists ( ) , is ( true ) ) ; } @ Test public void dumpActual_noverify ( ) { File target = new File ( "" ) ; target . delete ( ) ; FlowPartTester tester = new FlowPartTester ( getClass ( ) ) ; tester . setFrameworkHomePath ( framework . getHome ( ) ) ; In < Simple > in = tester . input ( "in" , Simple . class ) . prepare ( "" ) ; Out < Simple > out = tester . output ( "out" , Simple . class ) . dumpActual ( target . getPath ( ) ) ; tester . runTest ( new SimpleFlowPart ( in , out ) ) ; assertThat ( target . exists ( ) , is ( true ) ) ; } @ Test public void dumpActual_uri ( ) { File target = new File ( "" ) ; target . delete ( ) ; FlowPartTester tester = new FlowPartTester ( getClass
2,596
<s> package net . sf . sveditor . core . scanutils ; import net . sf . sveditor . core . scanner . SVCharacter ; public abstract class AbstractTextScanner implements ITextScanner { protected StringBuilder fTmpBuffer ; protected StringBuilder fCaptureBuffer ; protected boolean fCaptureEnabled ; protected int fLineno ; protected int fLinepos ; protected int fLastCh ; protected boolean fScanFwd ; public AbstractTextScanner ( ) { fTmpBuffer = new StringBuilder ( ) ; fCaptureBuffer = new StringBuilder ( ) ; fCaptureEnabled = false ; fScanFwd = true ; fLastCh = - 1 ; fLineno = 1 ; fLinepos = 0 ; } public void init ( ) { fCaptureEnabled = false ; } public boolean getScanFwd ( ) { return fScanFwd ; } public void setScanFwd ( boolean scanFwd ) { fScanFwd = scanFwd ; } public int skipWhite ( int ch ) { while ( Character . isWhitespace ( ch ) || ch == '\\' ) { int tmp = get_ch ( ) ; if ( ch == '\\' && ( tmp != '\r' && tmp != '\n' ) ) { unget_ch ( tmp ) ; return ch ; } ch = tmp ; } return ch ; } public String readIdentifier ( int ci ) { fTmpBuffer . setLength ( 0 ) ; if ( fScanFwd ) { if ( ! SVCharacter . isSVIdentifierStart ( ci ) ) { unget_ch ( ci ) ; return null ; } boolean in_ref = false ; int last_ci = ci ; fTmpBuffer . append ( ( char ) ci ) ; while ( ( ci = get_ch ( ) ) != - 1 && ( SVCharacter . isSVIdentifierPart ( ci ) || ci == ':' || ( last_ci == '$' && ci == '{' ) || ( in_ref && ci == '}' ) ) ) { if ( ci == ':' ) { int c2 = get_ch ( ) ; if ( c2 == ':' ) { fTmpBuffer . append ( "::" ) ; } else { unget_ch ( c2 ) ; break ; } } else { fTmpBuffer . append ( ( char ) ci ) ; } in_ref |= ( ci == '{' && last_ci == '$' ) ; in_ref &= ! ( in_ref &&
2,597
<s> package org . rubypeople . rdt . internal . launching ; import org . eclipse . core . expressions . PropertyTester ; import org . eclipse . core . resources . IContainer ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IAdaptable ; import org . eclipse . core . runtime . NullProgressMonitor ; import org . rubypeople . rdt . core . IMember ; import org . rubypeople . rdt . core . IMethod ; import org . rubypeople . rdt . core . IRubyElement ; import org . rubypeople . rdt . core . IRubyScript ; import org . rubypeople . rdt . core . IType ; import org . rubypeople . rdt . core . RubyModelException ; public class RubyLaunchableTester extends PropertyTester { private static final String PROPERTY_HAS_METHOD = "hasMethod" ; private static final String PROPERTY_EXTENDS_CLASS = "extendsClass" ; private static final String PROPERTY_IS_CONTAINER = "isContainer" ; private static final String PROPERTY_PROJECT_NATURE = "" ; public boolean test ( Object receiver , String property , Object [ ] args , Object expectedValue ) { if ( PROPERTY_IS_CONTAINER . equals ( property ) ) { if ( receiver instanceof IAdaptable ) { IResource resource = ( IResource ) ( ( IAdaptable ) receiver ) . getAdapter ( IResource . class ) ; if ( resource != null ) { return resource instanceof IContainer ; } } return false ; } if ( PROPERTY_PROJECT_NATURE . equals ( property ) ) { if ( receiver instanceof IAdaptable ) { IResource resource = ( IResource ) ( ( IAdaptable ) receiver ) . getAdapter ( IResource . class ) ; if ( resource != null ) { return hasProjectNature ( resource , ( String ) args [ 0 ] ) ; } } } IRubyElement element = null ; if
2,598
<s> package com . asakusafw . compiler . testing ; import java . io . File ; import java . util . List ; import java . util . Map ; import com . asakusafw . compiler . common . Precondition ; import com . asakusafw . compiler . flow . ExternalIoCommandProvider ; import com . asakusafw . compiler . flow . jobflow . JobflowModel ; import com . asakusafw . compiler . flow . jobflow . JobflowModel . Export ; import com . asakusafw . compiler . flow . jobflow . JobflowModel . Import ; import com . asakusafw . utils . collections . Maps ; import com . asakusafw . vocabulary . external . ExporterDescription ; import com . asakusafw . vocabulary . external . ImporterDescription ; public class JobflowInfo { private final File packageFile ; private final File sourceArchive ; private final List < StageInfo > stages ; private final JobflowModel jobflow ; public JobflowInfo ( JobflowModel jobflow , File packageArchive , File sourceArchive , List < StageInfo > stages ) { Precondition . checkMustNotBeNull ( jobflow , "jobflow" ) ; Precondition . checkMustNotBeNull ( packageArchive , "" ) ; Precondition . checkMustNotBeNull ( sourceArchive , "" ) ; Precondition . checkMustNotBeNull ( stages , "stages" ) ; this . jobflow = jobflow ; this . packageFile = packageArchive ; this . sourceArchive = sourceArchive ; this . stages = stages ; } public ImporterDescription findImporter ( String inputId ) { if ( inputId == null ) { throw new IllegalArgumentException ( "" ) ; }
2,599
<s> package org . oddjob . designer . elements . schedule ; import org . oddjob . arooa . design . DesignFactory ; import org . oddjob . arooa . design . DesignInstance ; import org . oddjob . arooa . design . DesignProperty ; import org . oddjob . arooa . design . SimpleTextAttribute ; import org . oddjob . arooa . design . screem . BorderedGroup ; import org . oddjob . arooa . design . screem . FieldGroup ; import org . oddjob . arooa . design . screem . FieldSelection ; import org . oddjob . arooa . design . screem . Form ; import org . oddjob . arooa . design . screem . StandardForm ; import org . oddjob . arooa . parsing . ArooaContext ; import org . oddjob . arooa . parsing . ArooaElement ; public class DayOfWeekScheduleDE implements DesignFactory { public DesignInstance createDesign ( ArooaElement element , ArooaContext parentContext ) { return new DayOfWeekScheduleDesign ( element , parentContext ) ; } } class DayOfWeekScheduleDesign extends ParentSchedule { private final SimpleTextAttribute on ; private final SimpleTextAttribute from ;