id
int32 0
3k
| input
stringlengths 43
33.8k
| gt
stringclasses 1
value |
---|---|---|
2,800 | <s> package com . asakusafw . compiler . flow . plan ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . util . ArrayList ; import java . util . Arrays ; import org . junit . Test ; import com . asakusafw . compiler . flow . FlowGraphGenerator ; import com . asakusafw . vocabulary . flow . graph . FlowBoundary ; import com . asakusafw . vocabulary . flow . graph . FlowElement ; import com . asakusafw . vocabulary . flow . graph . FlowElementInput ; import com . asakusafw . vocabulary . flow . graph . FlowElementOutput ; import com . asakusafw . vocabulary . flow . graph . ObservationCount ; public class FlowBlockTest { @ Test public void isEmpty ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in" ) ; gen . defineOperator ( "op" , "in" , "out" ) ; gen . defineOutput ( "out" ) ; gen . connect ( "in" , "op" ) . connect ( "op" , "out" ) ; FlowBlock block = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( ) ) , gen . getAsSet ( "op" ) ) ; assertThat ( block . isEmpty ( ) , is ( true ) ) ; } @ Test public void isEmpty_input ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in" ) ; gen . defineOperator ( "op" , "in" , "out" ) ; gen . defineOutput ( "out" ) ; gen . connect ( "in" , "op" ) . connect ( "op" , "out" ) ; FlowBlock block = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( ) ) , gen . getAsSet ( "op" ) ) ; assertThat ( block . isEmpty ( ) , is ( false ) ) ; } @ Test public void isEmpty_output ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in" ) ; gen . defineOperator ( "op" , "in" , "out" ) ; gen . defineOutput ( "out" ) ; gen . connect ( "in" , "op" ) . connect ( "op" , "out" ) ; FlowBlock block = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op" ) ) , gen . getAsSet ( "op" ) ) ; assertThat ( block . isEmpty ( ) , is ( false ) ) ; } @ Test public void isReduceBlock_true ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in" ) ; gen . defineOperator ( "op" , "in" , "out" , FlowBoundary . SHUFFLE ) ; gen . defineOutput ( "out" ) ; gen . connect ( "in" , "op" ) . connect ( "op" , "out" ) ; FlowBlock block = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op" ) ) , gen . getAsSet ( "op" ) ) ; assertThat ( block . isReduceBlock ( ) , is ( true ) ) ; } @ Test public void isReduceBlock_false ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in" ) ; gen . defineOperator ( "op" , "in" , "out" ) ; gen . defineOutput ( "out" ) ; gen . connect ( "in" , "op" ) . connect ( "op" , "out" ) ; FlowBlock block = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op" ) ) , gen . getAsSet ( "op" ) ) ; assertThat ( block . isReduceBlock ( ) , is ( false ) ) ; } @ Test public void detach_1 ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in" ) ; gen . defineOperator ( "op" , "in" , "out" ) ; gen . defineOutput ( "out" ) ; gen . connect ( "in" , "op" ) . connect ( "op" , "out" ) ; FlowBlock block = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op" ) ) , gen . getAsSet ( "op" ) ) ; block . detach ( ) ; assertThat ( block . getElements ( ) . size ( ) , is ( 1 ) ) ; assertThat ( block . getBlockInputs ( ) . size ( ) , is ( 1 ) ) ; assertThat ( block . getBlockOutputs ( ) . size ( ) , is ( 1 ) ) ; FlowElement op = block . getElements ( ) . iterator ( ) . next ( ) ; FlowBlock . Input input = block . getBlockInputs ( ) . get ( 0 ) ; FlowBlock . Output output = block . getBlockOutputs ( ) . get ( 0 ) ; assertThat ( op , not ( sameInstance ( gen . get ( "op" ) ) ) ) ; assertThat ( input . getElementPort ( ) , not ( sameInstance ( gen . input ( "op" ) ) ) ) ; assertThat ( output . getElementPort ( ) , not ( sameInstance ( gen . output ( "op" ) ) ) ) ; assertThat ( input . getElementPort ( ) . getOwner ( ) , is ( op ) ) ; assertThat ( output . getElementPort ( ) . getOwner ( ) , is ( op ) ) ; assertThat ( input . getConnections ( ) . isEmpty ( ) , is ( true ) ) ; assertThat ( output . getConnections ( ) . isEmpty ( ) , is ( true ) ) ; } @ Test public void detach_2 ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in" ) ; gen . defineOperator ( "op1" , "in" , "out" ) ; gen . defineOperator ( "op2" , "in" , "out" ) ; gen . defineOutput ( "out" ) ; gen . connect ( "in" , "op1" ) . connect ( "op1" , "op2" ) . connect ( "op2" , "out" ) ; FlowBlock block = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op1" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op2" ) ) , gen . getAsSet ( "op1" , "op2" ) ) ; block . detach ( ) ; assertThat ( block . getElements ( ) . size ( ) , is ( 2 ) ) ; assertThat ( block . getBlockInputs ( ) . size ( ) , is ( 1 ) ) ; assertThat ( block . getBlockOutputs ( ) . size ( ) , is ( 1 ) ) ; FlowBlock . Input input = block . getBlockInputs ( ) . get ( 0 ) ; FlowBlock . Output output = block . getBlockOutputs ( ) . get ( 0 ) ; assertThat ( input . getElementPort ( ) , not ( sameInstance ( gen . input ( "op1" ) ) ) ) ; assertThat ( output . getElementPort ( ) , not ( sameInstance ( gen . output ( "op2" ) ) ) ) ; FlowElement op1 = input . getElementPort ( ) . getOwner ( ) ; FlowElement op2 = output . getElementPort ( ) . getOwner ( ) ; assertThat ( op1 . getInputPorts ( ) . get ( 0 ) . getConnected ( ) . size ( ) , is ( 0 ) ) ; assertThat ( op1 . getOutputPorts ( ) . get ( 0 ) . getConnected ( ) . size ( ) , is ( 1 ) ) ; assertThat ( op2 . getInputPorts ( ) . get ( 0 ) . getConnected ( ) . size ( ) , is ( 1 ) ) ; assertThat ( op2 . getOutputPorts ( ) . get ( 0 ) . getConnected ( ) . size ( ) , is ( 0 ) ) ; assertThat ( op1 . getOutputPorts ( ) . get ( 0 ) . getConnected ( ) , is ( op2 . getInputPorts ( ) . get ( 0 ) . getConnected ( ) ) ) ; } @ Test public void connect ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in" ) ; gen . defineOperator ( "op1" , "in" , "out" ) ; gen . defineOperator ( "op2" , "in" , "out" ) ; gen . defineOutput ( "out" ) ; gen . connect ( "in" , "op1" ) . connect ( "op1" , "op2" ) . connect ( "op2" , "out" ) ; FlowBlock b1 = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op1" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op1" ) ) , gen . getAsSet ( "op1" ) ) ; FlowBlock b2 = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op2" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op2" ) ) , gen . getAsSet ( "op2" ) ) ; FlowBlock . connect ( b1 . getBlockOutputs ( ) . get ( 0 ) , b2 . getBlockInputs ( ) . get ( 0 ) ) ; b1 . detach ( ) ; b2 . detach ( ) ; assertThat ( b1 . getBlockInputs ( ) . get ( 0 ) . getConnections ( ) . size ( ) , is ( 0 ) ) ; assertThat ( b2 . getBlockInputs ( ) . get ( 0 ) . getConnections ( ) . size ( ) , is ( 1 ) ) ; assertThat ( b1 . getBlockOutputs ( ) . get ( 0 ) . getConnections ( ) . size ( ) , is ( 1 ) ) ; assertThat ( b2 . getBlockOutputs ( ) . get ( 0 ) . getConnections ( ) . size ( ) , is ( 0 ) ) ; assertThat ( b1 . getBlockOutputs ( ) . get ( 0 ) . getConnections ( ) . get ( 0 ) . getUpstream ( ) , is ( b1 . getBlockOutputs ( ) . get ( 0 ) ) ) ; assertThat ( b1 . getBlockOutputs ( ) . get ( 0 ) . getConnections ( ) . get ( 0 ) . getDownstream ( ) , is ( b2 . getBlockInputs ( ) . get ( 0 ) ) ) ; assertThat ( b2 . getBlockInputs ( ) . get ( 0 ) . getConnections ( ) . get ( 0 ) . getDownstream ( ) , is ( b2 . getBlockInputs ( ) . get ( 0 ) ) ) ; assertThat ( b2 . getBlockInputs ( ) . get ( 0 ) . getConnections ( ) . get ( 0 ) . getUpstream ( ) , is ( b1 . getBlockOutputs ( ) . get ( 0 ) ) ) ; } @ Test public void isSucceedingReduceBlock_true ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in" ) ; gen . defineOperator ( "op1" , "in" , "out" ) ; gen . defineOperator ( "op2" , "in" , "out" , FlowBoundary . SHUFFLE ) ; gen . defineOutput ( "out" ) ; gen . connect ( "in" , "op1" ) . connect ( "op1" , "op2" ) . connect ( "op2" , "out" ) ; FlowBlock b1 = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op1" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op1" ) ) , gen . getAsSet ( "op1" ) ) ; FlowBlock b2 = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op2" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op2" ) ) , gen . getAsSet ( "op2" ) ) ; FlowBlock . connect ( b1 . getBlockOutputs ( ) . get ( 0 ) , b2 . getBlockInputs ( ) . get ( 0 ) ) ; b1 . detach ( ) ; b2 . detach ( ) ; assertThat ( b1 . isSucceedingReduceBlock ( ) , is ( true ) ) ; } @ Test public void isSucceedingReduceBlock_false ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in" ) ; gen . defineOperator ( "op1" , "in" , "out" ) ; gen . defineOperator ( "op2" , "in" , "out" ) ; gen . defineOutput ( "out" ) ; gen . connect ( "in" , "op1" ) . connect ( "op1" , "op2" ) . connect ( "op2" , "out" ) ; FlowBlock b1 = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op1" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op1" ) ) , gen . getAsSet ( "op1" ) ) ; FlowBlock b2 = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op2" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op2" ) ) , gen . getAsSet ( "op2" ) ) ; FlowBlock . connect ( b1 . getBlockOutputs ( ) . get ( 0 ) , b2 . getBlockInputs ( ) . get ( 0 ) ) ; b1 . detach ( ) ; b2 . detach ( ) ; assertThat ( b1 . isSucceedingReduceBlock ( ) , is ( false ) ) ; } @ Test public void isSucceedingReduceBlock_empty ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in" ) ; gen . defineOperator ( "op1" , "in" , "out" ) ; gen . defineOperator ( "op2" , "in" , "out" , FlowBoundary . SHUFFLE ) ; gen . defineOutput ( "out" ) ; gen . connect ( "in" , "op1" ) . connect ( "op1" , "op2" ) . connect ( "op2" , "out" ) ; FlowBlock b1 = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op1" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op1" ) ) , gen . getAsSet ( "op1" ) ) ; FlowBlock b2 = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( "op2" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( "op2" ) ) , gen . getAsSet ( "op2" ) ) ; b1 . detach ( ) ; b2 . detach ( ) ; assertThat ( b1 . isSucceedingReduceBlock ( ) , is ( false ) ) ; } @ Test public void compaction_deadIn ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in1" ) ; gen . defineInput ( "in2" ) ; gen . defineOperator ( "op1" , "in1 in2" , "out1 out2" ) ; gen . defineOutput ( "out1" ) ; gen . defineOutput ( "out2" ) ; gen . connect ( "in1" , "op1.in1" ) . connect ( "op1.out1" , "out1" ) ; gen . connect ( "in2" , "op1.in2" ) . connect ( "op1.out2" , "out2" ) ; FlowBlock bin = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( ) ) , Arrays . asList ( gen . output ( "in1" ) , gen . output ( "in2" ) ) , gen . getAsSet ( "in1" , "in2" ) ) ; FlowBlock b1 = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , Arrays . asList ( gen . input ( "op1.in1" ) , gen . input ( "op1.in2" ) ) , Arrays . asList ( gen . output ( "op1.out1" ) , gen . output ( "op1.out2" ) ) , gen . getAsSet ( "op1" ) ) ; FlowBlock bout = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , Arrays . asList ( gen . input ( "out1" ) , gen . input ( "out2" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( ) ) , gen . getAsSet ( "out1" , "out2" ) ) ; FlowBlock . connect ( bin . getBlockOutputs ( ) . get ( 0 ) , b1 . getBlockInputs ( ) . get ( 0 ) ) ; FlowBlock . connect ( b1 . getBlockOutputs ( ) . get ( 0 ) , bout . getBlockInputs ( ) . get ( 0 ) ) ; FlowBlock . connect ( b1 . getBlockOutputs ( ) . get ( 1 ) , bout . getBlockInputs ( ) . get ( 1 ) ) ; bin . detach ( ) ; b1 . detach ( ) ; bout . detach ( ) ; assertThat ( b1 . compaction ( ) , is ( true ) ) ; assertThat ( b1 . getBlockInputs ( ) . size ( ) , is ( 1 ) ) ; assertThat ( b1 . getBlockOutputs ( ) . size ( ) , is ( 2 ) ) ; assertThat ( b1 . getElements ( ) . size ( ) , is ( 1 ) ) ; assertThat ( b1 . getBlockInputs ( ) . get ( 0 ) . getElementPort ( ) . getDescription ( ) . getName ( ) , is ( "in1" ) ) ; } @ Test public void compaction_deadOut ( ) { FlowGraphGenerator gen = new FlowGraphGenerator ( ) ; gen . defineInput ( "in1" ) ; gen . defineInput ( "in2" ) ; gen . defineOperator ( "op1" , "in1 in2" , "out1 out2" ) ; gen . defineOutput ( "out1" ) ; gen . defineOutput ( "out2" ) ; gen . connect ( "in1" , "op1.in1" ) . connect ( "op1.out1" , "out1" ) ; gen . connect ( "in2" , "op1.in2" ) . connect ( "op1.out2" , "out2" ) ; FlowBlock bin = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , new ArrayList < FlowElementInput > ( gen . inputs ( ) ) , Arrays . asList ( gen . output ( "in1" ) , gen . output ( "in2" ) ) , gen . getAsSet ( "in1" , "in2" ) ) ; FlowBlock b1 = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , Arrays . asList ( gen . input ( "op1.in1" ) , gen . input ( "op1.in2" ) ) , Arrays . asList ( gen . output ( "op1.out1" ) , gen . output ( "op1.out2" ) ) , gen . getAsSet ( "op1" ) ) ; FlowBlock bout = FlowBlock . fromPorts ( 0 , gen . toGraph ( ) , Arrays . asList ( gen . input ( "out1" ) , gen . input ( "out2" ) ) , new ArrayList < FlowElementOutput > ( gen . outputs ( ) ) , gen . getAsSet ( "out1" , "out2" ) ) ; FlowBlock . connect ( bin . getBlockOutputs ( ) . get ( 0 ) , b1 . getBlockInputs ( ) . get ( 0 ) ) ; FlowBlock . connect ( bin . getBlockOutputs ( ) . get ( 1 ) , b1 . getBlockInputs ( ) . get ( 1 ) ) ; FlowBlock . connect ( b1 . getBlockOutputs ( ) . get ( 0 ) , bout . getBlockInputs ( ) . get ( 0 ) ) ; bin . detach ( ) ; b1 . detach ( ) ; bout . detach ( ) ; assertThat ( b1 | |
2,801 | <s> package de . fuberlin . wiwiss . d2rq . vocab ; import java . lang . reflect . Field ; import java . lang . reflect . Modifier ; import java . util . Collection ; import java . util . HashSet ; import java . util . Set ; import com . hp . hpl . jena . rdf . model . Model ; import com . hp . hpl . jena . rdf . model . Property ; import com . hp . hpl . jena . rdf . model . RDFNode ; import com . hp . hpl . jena . rdf . model . Resource ; import com . hp . hpl . jena . rdf . model . Statement ; import com . hp . hpl . jena . rdf . model . StmtIterator ; import com . hp . hpl . jena . vocabulary . RDF ; import de . fuberlin . wiwiss . d2rq . D2RQException ; import de . fuberlin . wiwiss . d2rq . pp . PrettyPrinter ; public class VocabularySummarizer { private final Class < ? extends Object > vocabularyJavaClass ; private final String namespace ; private final Set < Property > properties ; private final Set < Resource > classes ; public VocabularySummarizer ( Class < ? extends Object > vocabularyJavaClass ) { this . vocabularyJavaClass = vocabularyJavaClass ; namespace = findNamespace ( ) ; properties = findAllProperties ( ) ; classes = findAllClasses ( ) ; } public Set < Property > getAllProperties ( ) { return properties ; } private Set < Property > findAllProperties ( ) { Set < Property > results = new HashSet < Property > ( ) ; for ( int i = | |
2,802 | <s> package org . rubypeople . rdt . internal . ui . viewsupport ; import java . util . ArrayList ; import org . eclipse . jface . viewers . CheckStateChangedEvent ; import org . eclipse . jface . viewers . CheckboxTreeViewer ; import org . eclipse . jface . viewers . ICheckStateListener ; import org . eclipse . jface . viewers . ITreeViewerListener ; import org . eclipse . jface . viewers . TreeExpansionEvent ; import org . eclipse . swt . widgets . Composite ; import org . eclipse . swt . widgets . Item ; import org . eclipse . swt . widgets . Tree ; import org . eclipse . swt . widgets . TreeItem ; import org . eclipse . swt . widgets . Widget ; public class ContainerCheckedTreeViewer extends CheckboxTreeViewer { public ContainerCheckedTreeViewer ( Composite parent ) { super ( parent ) ; initViewer ( ) ; } public ContainerCheckedTreeViewer ( Composite parent , int style ) { super ( parent , style ) ; initViewer ( ) ; } public ContainerCheckedTreeViewer ( Tree tree ) { super ( tree ) ; initViewer ( ) ; } private void initViewer ( ) { setUseHashlookup ( true ) ; addCheckStateListener ( new ICheckStateListener ( ) { public void checkStateChanged ( CheckStateChangedEvent event ) { doCheckStateChanged ( event . getElement ( ) ) ; } } ) ; addTreeListener ( new ITreeViewerListener ( ) { public void treeCollapsed ( TreeExpansionEvent event ) { } public void treeExpanded ( TreeExpansionEvent event ) { Widget item = findItem ( event . getElement ( ) ) ; if ( item instanceof TreeItem ) { initializeItem ( ( TreeItem ) item ) ; } } } ) ; } protected void doCheckStateChanged ( Object element ) { Widget item = findItem ( element ) ; if ( item instanceof TreeItem ) { TreeItem treeItem = ( TreeItem ) item ; treeItem . setGrayed ( false ) ; updateChildrenItems ( treeItem ) ; updateParentItems ( treeItem . getParentItem ( ) ) ; } } private void initializeItem ( TreeItem item ) { if ( item . getChecked ( ) && ! item . getGrayed ( ) ) { updateChildrenItems ( item ) ; } } private void updateChildrenItems ( TreeItem parent ) { Item [ ] children = getChildren ( parent ) ; boolean state = parent . | |
2,803 | <s> package org . springframework . social . google . api . plus . person ; import org . springframework . social . google . api . query . ApiQueryBuilder ; import org . springframework . social | |
2,804 | <s> import java . io . BufferedReader ; import java . io . File ; import java . io . FileNotFoundException ; import java . io . FileReader ; import java . io . IOException ; import java . io . PrintWriter ; public class DataDirectory { public static String VERSION = "4.0.5" ; public static String CAPTURE_PATH ; public static boolean MULTI_SNIPPET ; public static String PASTEBIN_TITLE ; public static String PASTEBIN_TYPE ; public static String PASTEBIN_FORMAT ; public static String PASTEBIN_EXPIRATION ; public static int PASTEBIN_PRIVACY ; public static boolean PASTEBIN_GUEST ; public static String PASTEBIN_USERNAME ; public static String PASTEBIN_PASSWORD ; public static String dirPath = System . getProperty ( "user.home" ) + "" ; public static String dirDataPath = System . getProperty ( "user.home" ) + "" ; public static String defaultCapturePath = System . getProperty ( "user.home" ) + "" ; File directory ; File defaultCap ; public DataDirectory ( ) { directory = new File ( dirDataPath ) ; defaultCap = new File ( defaultCapturePath ) ; if ( ! directory . exists ( ) ) { System . out . println ( "" ) ; createDirectories ( ) ; } else { System . out . println ( "" ) ; if ( isCurrentVersion ( ) ) { System . out . println ( "" ) ; File pref = new File ( dirDataPath + "" ) ; if ( pref . exists ( ) ) loadPreferences ( ) ; else createPrefFile ( ) ; } else { System . out . println ( "" ) ; recreateDirectories ( ) ; } } } private boolean isCurrentVersion ( ) { if ( new File ( dirDataPath + "version.txt" ) . exists ( ) ) { try { BufferedReader reader = new BufferedReader ( new FileReader ( dirDataPath + "version.txt" ) ) ; String line ; while ( ( line = reader . readLine ( ) ) != null ) if ( line . equals ( VERSION ) ) return true ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return false ; } private void recreateDirectories ( ) { deleteDirectory ( new File ( dirPath ) ) ; createDirectories ( ) ; } private void deleteDirectory ( File file ) { if ( file . isDirectory ( ) ) { if ( file . list ( ) . length == 0 ) { file . delete ( ) ; System . out . println ( "" + file . getAbsolutePath ( ) ) ; } else { String files [ ] = file . list ( ) ; for ( String temp : files ) { File fileDelete = new File ( file , temp ) ; deleteDirectory ( | |
2,805 | <s> package org . rubypeople . rdt . refactoring . core . splitlocal ; import org . jruby . ast . AssignableNode ; public class LocalVarUsage { private int fromPosition ; private int toPosition ; private AssignableNode node ; private String name ; private String newName = "" ; public int getFromPosition ( ) { return fromPosition ; } public void setFromPosition ( int from ) { this . fromPosition = from ; } public String getName ( ) { return name ; } public void setName ( String name ) { this . name = name ; } public AssignableNode getNode ( ) { return node ; } public void setNode ( AssignableNode node ) { this . node = node ; } public int getToPosition ( | |
2,806 | <s> package com . asakusafw . dmdl . model ; import java . util . List ; import com . asakusafw . dmdl . Region ; import com . asakusafw . utils . collections . Lists ; public class AstGrouping extends AbstractAstNode { private final Region region ; public final List < AstSimpleName > properties ; public AstGrouping ( Region region , List < AstSimpleName > properties ) { if ( properties == null ) { throw new IllegalArgumentException ( "" ) ; } this . region = region ; this . properties = Lists . freeze ( properties ) ; } @ Override public Region getRegion ( ) { return region ; } @ Override public < C , R > R accept ( C context , AstNode | |
2,807 | <s> package org . rubypeople . rdt . refactoring . core . renamelocal ; import java . util . Observable ; import org . eclipse . swt . widgets . Event ; import org . eclipse . swt . widgets . List ; import org . eclipse . swt . widgets . Text ; import org . rubypeople . rdt . refactoring . ui . IErrorMessageGenerator ; import org . rubypeople . rdt . refactoring . ui . IErrorMessageReceiver ; import org . rubypeople . rdt . refactoring . util . NameValidator ; public class VariableNameProvider extends Observable implements IErrorMessageGenerator { private String selected = "" ; private String name = "" ; private IErrorMessageReceiver errorReceiver ; public VariableNameProvider ( String selected ) { this . selected = selected ; this . name = selected ; } public String getSelected ( ) { return selected ; } public String getName ( ) { return name ; } public void handleEvent ( Event event ) { if ( event . widget instanceof List ) { selected = ( ( List ) event . widget ) . getSelection ( ) [ 0 ] ; } else if ( event . | |
2,808 | <s> package org . oddjob . state ; import java . util . Date ; public class OrderedStateChanger < S extends State > implements StateChanger < S > { private final StateChanger < S > stateChanger ; private final StateLock stateLock ; public OrderedStateChanger ( StateChanger < S > stateChanger , StateLock stateLock ) { this . stateChanger = stateChanger ; this . stateLock = stateLock ; } public void setStateException ( final Throwable t , final Date date ) { runLocked ( new Runnable ( ) { public void run ( ) { stateChanger . setStateException ( t , date ) ; } } ) ; } public void setStateException ( final Throwable t ) { runLocked ( new Runnable ( ) { public void run ( ) { stateChanger . setStateException ( t ) ; } } ) ; } public void setState ( final S state , final Date date ) { runLocked ( new Runnable ( ) { public void run ( ) { stateChanger . setState ( state , date ) ; } } ) ; } public void | |
2,809 | <s> package org . rubypeople . rdt . internal . testunit . ui ; import org . eclipse . swt . custom . CTabFolder ; import org . eclipse . swt . dnd . Clipboard ; public abstract class TestRunTab { public abstract void createTabControl ( CTabFolder tabFolder , Clipboard clipboard , TestUnitView runner ) ; | |
2,810 | <s> package net . sf . sveditor . ui . views . objects ; import net . sf . sveditor . core . SVCorePlugin ; import net . sf . sveditor . core . db . SVDBItemType ; import net . sf . sveditor . core . objects . ObjectsTreeNode ; import net . sf . sveditor . ui . SVDBIconUtils ; import net . sf . sveditor . ui . SVEditorUtil ; import org . eclipse . jface . action . Action ; import org . eclipse . jface . action . IToolBarManager ; import org . eclipse . jface . viewers . DoubleClickEvent ; import org . eclipse . jface . viewers . IDoubleClickListener ; import org . eclipse . jface . viewers . IStructuredSelection ; import org . eclipse . jface . viewers . TreeViewer ; import org . eclipse . jface . viewers . ViewerComparator ; import org . eclipse . swt . SWT ; import org . eclipse . swt . events . SelectionEvent ; import org . eclipse . swt . events . SelectionListener ; import org . eclipse . swt . layout . GridData ; import org . eclipse . swt . layout . GridLayout ; import org . eclipse . swt . widgets . Composite ; import org . eclipse . ui . ISharedImages ; import org . eclipse . ui . IViewSite ; import org . eclipse . ui . PartInitException ; import org . eclipse . ui . PlatformUI ; import org . eclipse . ui . dialogs . FilteredTree ; import org . eclipse . ui . dialogs . PatternFilter ; import org . eclipse . ui . part . ViewPart ; public class SVObjectsView extends ViewPart implements SelectionListener { private FilteredTree fObjectTree ; private TreeViewer fTreeViewer ; private PatternFilter fPatternFilter ; private ObjectsViewContentProvider fContentProvider ; @ Override public void createPartControl ( Composite parent ) { GridLayout gl ; gl = new GridLayout ( ) ; gl . marginHeight = 0 ; gl . marginWidth = 0 ; Composite class_c = new Composite ( parent , SWT . NONE ) ; class_c . setLayout ( gl ) ; class_c . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; fPatternFilter = new PatternFilter ( ) ; fObjectTree = new FilteredTree ( class_c , SWT . H_SCROLL | SWT . V_SCROLL , fPatternFilter , true ) ; fTreeViewer = fObjectTree . getViewer ( ) ; fTreeViewer . getControl ( ) . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; fTreeViewer . setContentProvider ( fContentProvider = new ObjectsViewContentProvider ( ) ) ; fTreeViewer . setLabelProvider ( | |
2,811 | <s> package net . sf . sveditor . core . templates ; import java . io . File ; import java . io . FileOutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; public class TemplateFSFileCreator implements ITemplateFileCreator { private File fRoot ; public TemplateFSFileCreator ( File root ) { fRoot = root ; } public void createFile ( String path , InputStream content ) { File file = new File ( fRoot , path ) ; byte tmp [ ] = new byte [ 16384 ] ; int len ; if ( ! file . getParentFile ( ) . exists ( ) ) { file . getParentFile ( ) . mkdirs ( ) ; } try { FileOutputStream fos = new FileOutputStream ( file ) ; while ( ( len = content . read ( tmp , 0 , tmp . length ) ) > 0 ) { fos . write ( tmp , 0 , len ) ; } fos . close ( ) ; } | |
2,812 | <s> package org . rubypeople . rdt . ui ; 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 . Label ; import org . eclipse . ui . IViewPart ; import org . eclipse . ui . IWorkbenchPage ; import org . eclipse . ui . IWorkbenchWindow ; import org . eclipse . ui . PartInitException ; import org . eclipse . ui . PlatformUI ; import org . eclipse . ui . part . ViewPart ; import org . rubypeople | |
2,813 | <s> package org . oddjob . monitor . actions ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; public class AccumulatingActionProvider implements ActionProvider { private List < ActionProvider > providers = new ArrayList < ActionProvider > ( ) ; public void addProvider ( ActionProvider provider ) { providers . add ( provider ) ; } public ExplorerAction | |
2,814 | <s> package com . facebook . android ; import android . app . Dialog ; import android . app . ProgressDialog ; import android . content . Context ; import android . content . Intent ; import android . graphics . Bitmap ; import android . graphics . Color ; import android . graphics . drawable . Drawable ; import android . net . Uri ; import android . os . Bundle ; import android . util . Log ; import android . view . View ; import android . view . ViewGroup ; import android . view . ViewGroup . LayoutParams ; import android . view . Window ; import android . webkit . WebView ; import android . webkit . WebViewClient ; import android . widget . FrameLayout ; import android . widget . ImageView ; import android . widget . LinearLayout ; import com . facebook . android . Facebook . DialogListener ; public class FbDialog extends Dialog { static final int FB_BLUE = 0xFF6D84B4 ; static final float [ ] DIMENSIONS_DIFF_LANDSCAPE = { 20 , 60 } ; static final float [ ] DIMENSIONS_DIFF_PORTRAIT = { 40 , 60 } ; static final FrameLayout . LayoutParams FILL = new FrameLayout . LayoutParams ( ViewGroup . LayoutParams . FILL_PARENT , ViewGroup . LayoutParams . FILL_PARENT ) ; static final int MARGIN = 4 ; static final int PADDING = 2 ; static final String DISPLAY_STRING = "touch" ; static final String FB_ICON = "icon.png" ; private String mUrl ; private DialogListener mListener ; private ProgressDialog mSpinner ; private ImageView mCrossImage ; private WebView mWebView ; private FrameLayout mContent ; public FbDialog ( Context context , String url , DialogListener listener ) { super ( context , android . R . style . Theme_Translucent_NoTitleBar ) ; mUrl = url ; mListener = listener ; } @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; mSpinner = new ProgressDialog ( getContext ( ) ) ; mSpinner . requestWindowFeature ( Window . FEATURE_NO_TITLE ) ; mSpinner . setMessage ( "Loading..." ) ; requestWindowFeature ( Window . FEATURE_NO_TITLE ) ; mContent = new FrameLayout ( getContext ( ) ) ; createCrossImage ( ) ; int crossWidth = mCrossImage . getDrawable ( ) . getIntrinsicWidth ( ) ; setUpWebView ( crossWidth / 2 ) ; mContent . addView ( mCrossImage , new LayoutParams ( LayoutParams . WRAP_CONTENT , LayoutParams . WRAP_CONTENT ) ) ; addContentView ( mContent , new LayoutParams ( LayoutParams . FILL_PARENT , LayoutParams . FILL_PARENT ) ) ; } private void createCrossImage ( ) { mCrossImage = new ImageView ( getContext ( ) ) ; mCrossImage . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { mListener . onCancel ( ) ; FbDialog . this . dismiss ( ) ; } } ) ; Drawable crossDrawable = getContext ( ) . getResources ( ) . getDrawable ( R . drawable . close ) ; mCrossImage . setImageDrawable ( crossDrawable ) ; mCrossImage . setVisibility ( View . INVISIBLE ) ; } private void setUpWebView ( int margin ) { LinearLayout webViewContainer = new LinearLayout ( getContext ( ) ) ; mWebView = new WebView ( getContext ( ) ) ; mWebView . setVerticalScrollBarEnabled ( false ) ; mWebView . setHorizontalScrollBarEnabled ( false ) ; mWebView . setWebViewClient ( new FbDialog . FbWebViewClient ( ) ) ; mWebView . getSettings ( ) . setJavaScriptEnabled ( true ) ; mWebView . loadUrl ( mUrl ) ; mWebView . setLayoutParams ( FILL ) ; mWebView . setVisibility ( View . INVISIBLE ) ; webViewContainer . setPadding ( margin , margin , margin , margin ) ; webViewContainer . addView ( mWebView ) ; mContent . addView ( webViewContainer ) ; } private class FbWebViewClient extends WebViewClient { @ Override public boolean shouldOverrideUrlLoading ( WebView view , String url ) { Log . d ( "" , "" + url ) ; if ( | |
2,815 | <s> package org . oddjob . jmx . handlers ; import javax . management . MBeanAttributeInfo ; import javax . management . MBeanException ; import javax . management . MBeanNotificationInfo ; import javax . management . MBeanOperationInfo ; import javax . management . ReflectionException ; import org . apache . commons . beanutils . DynaBean ; import org . apache . commons . beanutils . DynaClass ; import org . apache . commons . beanutils . PropertyUtils ; import org . oddjob . framework . WrapDynaClass ; import org . oddjob . jmx . RemoteOperation ; import org . oddjob . jmx . client . ClientHandlerResolver ; import org . oddjob . jmx . client . HandlerVersion ; import org . oddjob . jmx . client . VanillaHandlerResolver ; import org . oddjob . jmx . server . JMXOperationPlus ; import org . oddjob . jmx . server . ServerInterfaceHandler ; import org . oddjob . jmx . server . ServerInterfaceHandlerFactory ; import org . oddjob . jmx . server . ServerSideToolkit ; public class DynaBeanHandlerFactory implements ServerInterfaceHandlerFactory < Object , DynaBean > { public static final HandlerVersion VERSION = new HandlerVersion ( 1 , 0 ) ; private static final JMXOperationPlus < Boolean > CONTAINS = new JMXOperationPlus < Boolean > ( "contains" , "" , Boolean . TYPE , MBeanOperationInfo . INFO ) . addParam ( "property" , String . class , "" ) . addParam ( "key" , String . class , "The key." ) ; private static final JMXOperationPlus < Object > GET_SIMPLE = new JMXOperationPlus < Object > ( "get" , "" , Object . class , MBeanOperationInfo . INFO ) . addParam ( "property" , String . class , "" ) ; private static final JMXOperationPlus < Object > GET_INDEXED = new JMXOperationPlus < Object > ( "get" , "" , Object . class , MBeanOperationInfo . INFO ) . addParam ( "property" , String . class , "" ) . addParam ( "index" , Integer . TYPE , "The index." ) ; private static final JMXOperationPlus < Object > GET_MAPPED = new JMXOperationPlus < Object > ( "get" , "" , Object . class , MBeanOperationInfo . INFO ) . addParam ( "property" , String . class , "" ) . addParam ( "key" , String . class , "The key." ) ; private static final JMXOperationPlus < DynaClass > GET_DYNACLASS = new JMXOperationPlus < DynaClass > ( "getDynaClass" , "" , DynaClass . class , MBeanOperationInfo . INFO ) ; private static final JMXOperationPlus < Void > REMOVE = new JMXOperationPlus < Void > ( "remove" , "" , Void . TYPE , MBeanOperationInfo . ACTION ) . addParam ( "property" , String . class , "" ) . addParam ( "key" , String . class , "The key." ) ; private static final JMXOperationPlus < Void > SET_SIMPLE = new JMXOperationPlus < Void > ( "set" , "" , Void . TYPE , MBeanOperationInfo . ACTION ) . addParam ( "property" , String . class , "" ) . addParam ( "value " , Object . class , "The value." ) ; private static final JMXOperationPlus < Void > SET_INDEXED = new JMXOperationPlus < Void > ( "set" , "" , Void . TYPE , MBeanOperationInfo . ACTION ) . addParam ( "property" , String . class , "" ) . addParam ( "index" , Integer . TYPE , "The index." ) . addParam ( "value " , Object . class , "The value." ) ; private static final JMXOperationPlus < Void > SET_MAPPED = new JMXOperationPlus < Void > ( "set" , "" , Void . TYPE , MBeanOperationInfo . ACTION ) . addParam ( "property" , String . class , "" ) . addParam ( "key" , String . class , "The key." ) . addParam ( "value " , Object . class , "The value." ) ; public Class < Object > interfaceClass ( ) { return Object . class ; } public MBeanAttributeInfo [ ] getMBeanAttributeInfo ( ) { return new MBeanAttributeInfo [ 0 ] ; } public MBeanOperationInfo [ ] getMBeanOperationInfo ( ) { return new MBeanOperationInfo [ ] { CONTAINS . getOpInfo ( ) , GET_SIMPLE . getOpInfo ( ) , GET_INDEXED . getOpInfo ( ) , SET_MAPPED . getOpInfo ( ) , GET_DYNACLASS . getOpInfo ( ) , REMOVE . getOpInfo ( ) , SET_SIMPLE . getOpInfo ( ) , SET_INDEXED . getOpInfo ( ) , SET_MAPPED . getOpInfo ( ) , } ; } public MBeanNotificationInfo [ ] getMBeanNotificationInfo ( ) { return new MBeanNotificationInfo [ 0 ] ; } public ServerInterfaceHandler createServerHandler ( Object target , ServerSideToolkit serverSideToolkit ) { return new DynaBeanServerHandler ( target ) ; } public ClientHandlerResolver < DynaBean > clientHandlerFactory ( ) { return new VanillaHandlerResolver < DynaBean > ( DynaBean . class . getName ( ) ) ; } class DynaBeanServerHandler implements ServerInterfaceHandler { private final Object bean ; DynaBeanServerHandler ( Object bean ) { this . bean = bean ; } public Object invoke ( RemoteOperation < ? > operation , Object [ ] params ) throws MBeanException , ReflectionException { if ( CONTAINS . equals ( operation ) ) { try { return Boolean . valueOf ( ! ( PropertyUtils . getMappedProperty ( bean , ( String ) params [ 0 ] , ( String ) params [ 1 ] ) == null ) ) ; } catch ( Exception e ) { throw new MBeanException ( e ) ; } } else if ( GET_SIMPLE . equals ( operation ) ) { String property = ( String | |
2,816 | <s> package org . rubypeople . rdt . refactoring . tests . core . generateaccessors ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collection ; import org . rubypeople . rdt . refactoring . core . generateaccessors . AccessorsGenerator ; import org . rubypeople . rdt . refactoring . core . generateaccessors . GeneratedAccessor ; import org . rubypeople . rdt . refactoring . documentprovider . DocumentProvider ; import org . rubypeople . rdt . refactoring . documentprovider . StringDocumentProvider ; import org . rubypeople . rdt . refactoring . tests . TreeProviderTester ; public class TC_AccessorsGeneratorTreeTest extends TreeProviderTester { private final static String TEST_DOCUMENT_SIMPLE = "" + "class Xn" + "" + " def a(a)n" + " @a = an" + " @b = an" + " endn" + "end" ; private final static String TEST_DOCUMENT_WITH_SIMPLE_ACCESSOR = "class Xn" + "" + " def a(a)n" + " @a = an" + " endn" + "end" ; private final static String TEST_DOCUMENT_WITH_METHOD_ACCESSOR = "class Xn" + " def a(a)n" + " @a = an" + " endn" + " def an" + " @an" + " endn" + " def a=(a)n" + " @a=an" + " endn" + "end" ; private final static String TEST_DOCUMENT_WITH_SIMPLE_WRITER = "class Xn" + "" + " def a(a)n" + " @a = an" + " endn" + "end" ; private final static String TEST_DOCUMENT_WITH_METHOD_READER = "class Xn" + " def a(a)n" + " @a = an" + " endn" + " def an" + " @an" + " endn" + "end" ; public void testSimpleDocument ( ) { DocumentProvider docProvider = new StringDocumentProvider ( "" , TEST_DOCUMENT_SIMPLE ) ; AccessorsGenerator provider = new AccessorsGenerator ( docProvider , GeneratedAccessor . TYPE_SIMPLE_ACCESSOR ) ; addContentWithBothAccessors ( | |
2,817 | <s> package com . asakusafw . testtools . inspect ; import org . apache . hadoop . io . Writable ; import com . asakusafw . runtime . value . ValueOption ; import com . asakusafw . testtools . ColumnInfo ; public class Cause { public enum Type { NOT_STRING_COLUMN ( "" ) , CONDITION_NOW_ON_INVALID_COLUMN ( "" ) , CONDITION_TODAY_ON_INVALID_COLUMN ( "" ) , CONDITION_PARTIAL_ON_INVALID_COLUMN ( "" ) , NOT_IN_TESTING_TIME ( "" ) , NOT_IN_TEST_DAY ( "" ) , NULL_NOT_ALLOWD ( "NULL-UNK-" ) , NO_EXPECT_RECORD ( "" ) , NO_ACTUAL_RECORD ( "" ) | |
2,818 | <s> package org . oddjob . sql ; import java . io . IOException ; import java . util . List ; import junit . framework . TestCase ; import org . oddjob . arooa . standard . StandardArooaSession ; import org . oddjob . beanbus . BeanTrap ; import org . oddjob . beanbus . BusException ; import org . oddjob . io . BufferType ; import org . oddjob . sql . SQLJob . DelimiterType ; public class SQLScriptParserTest extends TestCase { public void testNoDelimiter ( ) throws IOException , BusException { BeanTrap < String > results = new BeanTrap < String > ( ) ; ScriptParser test = new ScriptParser ( ) ; BufferType buffer = new BufferType ( ) ; buffer . setText ( "SIMPLE TEXT" ) ; buffer . configured ( ) ; test . setInput ( buffer . toInputStream ( ) ) ; test . setTo ( results ) ; test . go ( ) ; List < String > stmts = results . toValue ( ) ; assertEquals ( 1 , stmts . size ( ) ) ; assertEquals ( "SIMPLE TEXT" , stmts . get ( 0 ) ) ; } public void testOneEmptyLine ( ) throws IOException , BusException { BeanTrap < String > results = new BeanTrap < String > ( ) ; ScriptParser test = new ScriptParser ( ) ; BufferType buffer = new BufferType ( ) ; buffer . setText ( "" ) ; buffer . configured ( ) ; test . setInput ( buffer . toInputStream ( ) ) ; test . setTo ( results ) ; test . go ( ) ; List < String > stmts = results . toValue ( ) ; assertEquals ( 2 , stmts . size ( ) ) ; assertEquals ( "LINE ONE" , stmts . get ( 0 ) ) ; assertEquals ( "LINE TWO" , stmts . get ( 1 ) ) ; } public void testLotsOfEmptyLines ( ) throws IOException , BusException { BeanTrap < String > results = new BeanTrap < String > ( ) ; ScriptParser test = new ScriptParser ( ) ; BufferType buffer = new BufferType ( ) ; buffer . setText ( "" ) ; buffer . configured ( ) ; test . setInput ( buffer . toInputStream ( ) ) ; test . setTo ( results ) ; test . go ( ) ; List < String > stmts = results . toValue ( ) ; assertEquals ( 2 , stmts . size ( ) ) ; assertEquals ( "LINE ONE" , stmts . get ( 0 ) ) ; assertEquals ( "LINE TWO" , stmts . get ( 1 ) ) ; } public void testWindowsLines ( ) throws IOException , BusException { BeanTrap < String > results = new BeanTrap < String > ( ) ; ScriptParser test = new ScriptParser ( ) ; BufferType buffer = new BufferType ( ) ; buffer . setText ( "" ) ; buffer . configured ( ) ; test . setInput ( buffer . toInputStream ( ) ) ; test . setTo ( results ) ; test . go ( ) ; List < String > stmts = results . toValue ( ) ; assertEquals ( 2 , stmts . size ( ) ) ; assertEquals ( "LINE ONE" , stmts . get ( 0 ) ) ; assertEquals ( "LINE TWO" | |
2,819 | <s> package org . oddjob . framework ; import java . util . concurrent . atomic . AtomicInteger ; public class ExecutionWatcher { private final Runnable action ; private final AtomicInteger added = new AtomicInteger ( ) ; private final AtomicInteger executed = new AtomicInteger ( ) ; private boolean started ; public | |
2,820 | <s> package org . oddjob . jmx ; import java . io . ByteArrayInputStream ; import java . io . ByteArrayOutputStream ; import java . io . IOException ; import java . io . ObjectInputStream ; import java . io . ObjectOutputStream ; import java . util . HashMap ; import java . util . Map ; import junit . framework . TestCase ; import org . apache . commons . beanutils . DynaProperty ; import org . oddjob . framework . WrapDynaClass ; public class WrapDynaClassTest extends TestCase { public class Bean { public String getFruit ( ) { return "apples" ; } } | |
2,821 | <s> package net . sf . sveditor . core . tests . content_assist ; import java . util . ArrayList ; import java . util . List ; import junit . framework . TestCase ; 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 ; public class TestContentAssistEnum extends TestCase { public void testContentAssistEnumeratorAssign ( ) { String testname = "" ; LogHandle log = LogFactory . getLogHandle ( testname ) ; String doc1 | |
2,822 | <s> package net . sf . sveditor . core . db ; import java . util . ArrayList ; import java . util . List ; import net . sf . sveditor . core . db . | |
2,823 | <s> package gettingstarted ; import static edsdk . EdSdkLibrary . kEdsPropID_Av ; import static edsdk . EdSdkLibrary . kEdsPropID_BatteryLevel ; import static edsdk . EdSdkLibrary . kEdsPropID_ISOSpeed ; import static edsdk . EdSdkLibrary . kEdsPropID_Tv ; import static edsdk . utils . CanonConstants . Av_7_1 ; import static edsdk . utils . CanonConstants . ISO_800 ; import static edsdk . utils . CanonConstants . Tv_1by100 ; import java . awt . GridBagConstraints ; import java . awt . GridBagLayout ; import java . awt . Insets ; import java . awt . event . ActionEvent ; import java . awt . event . ActionListener ; import java . io . File ; import java . lang . reflect . Field ; import java . text . SimpleDateFormat ; import java . util . Date ; import java . util . LinkedList ; import java . util . concurrent . Callable ; import javax . swing . BorderFactory ; import javax . swing . JComboBox ; import javax . swing . JFrame ; import javax . swing . JLabel ; import javax . swing . JPanel ; import edsdk . utils . CanonCamera ; import edsdk . utils . CanonConstants ; import edsdk . utils . commands . ShootTask ; public class E05_Timelapse { public static void main ( String [ ] args ) throws InterruptedException { CanonCamera camera = new CanonCamera ( ) ; camera . openSession ( ) ; camera . setProperty ( kEdsPropID_Av , Av_7_1 ) ; camera . setProperty ( kEdsPropID_Tv , Tv_1by100 ) ; camera . setProperty ( kEdsPropID_ISOSpeed , ISO_800 ) ; createUI ( camera ) ; while ( true ) { System . out . println ( "" ) ; System . out . println ( "" + camera . getProperty ( kEdsPropID_BatteryLevel ) ) ; camera . execute ( new ShootTask ( filename ( ) ) ) ; try { Thread . sleep ( 15000 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } } public static File filename ( ) { return new File ( "images\\" + new SimpleDateFormat ( "" ) . format ( new Date ( ) ) + ".jpg" ) ; } private static void createUI ( final CanonCamera camera ) { JFrame frame = new JFrame ( ) ; JPanel content = new JPanel ( new GridBagLayout ( ) ) ; content . setBorder ( BorderFactory . createEmptyBorder ( 10 , 10 , 10 , 10 ) ) ; GridBagConstraints gbc = new | |
2,824 | <s> package com . asakusafw . testdriver . bulkloader ; import java . math . BigDecimal ; import java . util . Calendar ; import com . asakusafw . testdriver . model . SimpleDataModelDefinition ; import com . asakusafw . vocabulary . bulkloader . ColumnOrder ; import com . asakusafw . vocabulary . bulkloader . OriginalName ; import com . asakusafw . vocabulary . bulkloader . PrimaryKey ; @ PrimaryKey ( "number" ) @ OriginalName ( "SIMPLE" ) @ ColumnOrder ( { "NUMBER" , "TEXT" , "C_BOOL" , "C_BYTE" , "C_SHORT" , "C_LONG" , "C_FLOAT" , "C_DOUBLE" , "C_DECIMAL" , "C_DATE" , "C_TIME" , "C_DATETIME" } ) public class Simple { @ OriginalName ( "NUMBER" ) public Integer number ; @ OriginalName ( "TEXT" ) public String text ; @ OriginalName ( "C_BOOL" ) public Boolean booleanValue ; @ OriginalName ( "C_BYTE" ) public Byte byteValue ; @ OriginalName ( "C_SHORT" ) public Short shortValue ; @ OriginalName ( "C_LONG" ) public Long longValue ; @ OriginalName ( "C_FLOAT" ) public Float floatValue ; @ OriginalName ( "C_DOUBLE" ) public Double doubleValue ; @ OriginalName ( "C_DECIMAL" ) public BigDecimal bigDecimalValue ; @ OriginalName ( "C_DATE" ) public Calendar dateValue ; @ OriginalName ( "C_TIME" ) public Calendar timeValue ; @ OriginalName ( "C_DATETIME" ) public Calendar datetimeValue ; public Integer inferOriginalName ; @ Override public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = prime * result + ( ( bigDecimalValue == null ) ? 0 : bigDecimalValue . hashCode ( ) ) ; result = prime * result + ( ( booleanValue == null ) ? 0 : booleanValue . hashCode ( ) ) ; result = prime * result + ( ( byteValue == null ) ? 0 : byteValue . hashCode ( ) ) ; result = prime * result + ( ( dateValue == null ) ? 0 : dateValue . hashCode ( ) ) ; result = prime * result + ( ( datetimeValue == null ) ? 0 : datetimeValue . hashCode ( ) ) ; result = prime * result + ( ( doubleValue == null ) ? 0 : doubleValue . hashCode ( ) ) ; result = prime * result + ( ( floatValue == null ) ? 0 : floatValue . hashCode ( ) ) ; result = prime * result + ( ( inferOriginalName == null ) ? 0 : inferOriginalName . hashCode ( ) ) ; result = prime * result + ( ( longValue == null ) ? 0 : longValue . hashCode ( ) ) ; result = prime * result + ( ( number == null ) ? 0 : number . hashCode ( ) ) ; result = prime * result + ( ( shortValue == null ) ? 0 : shortValue . hashCode ( ) ) ; result = prime * result + ( ( text == null ) ? 0 : text . hashCode ( ) ) ; result = prime * result + ( ( timeValue == null ) ? 0 : timeValue . hashCode ( ) ) ; return result ; } @ Override public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } Simple other = ( Simple ) obj ; if ( bigDecimalValue == null ) { if ( other . bigDecimalValue != null ) { return false ; } } else if ( ! bigDecimalValue . equals ( other . bigDecimalValue ) ) { return false ; } if ( booleanValue == null ) { if ( other . booleanValue != null ) { return false ; } } else if ( ! booleanValue . equals ( other . booleanValue ) ) { return false ; } if ( byteValue == null ) { if ( other . byteValue != null ) { return false ; } } else if ( ! byteValue . equals ( other . byteValue ) ) { return false ; } if ( dateValue == null ) { if ( other . dateValue != null ) { return false ; } } else if ( ! dateValue . equals ( other . dateValue ) ) { return false ; } if ( datetimeValue == null ) { if ( other . datetimeValue != null ) { return false ; } } else if ( ! datetimeValue . equals ( other . datetimeValue ) ) { return false ; } if ( doubleValue == null ) { if ( other . doubleValue != null ) { return false ; } } else if ( ! doubleValue . equals ( other . doubleValue ) ) { return false ; } if ( floatValue == null ) { if ( other . floatValue != null ) { return false ; } } else if ( ! floatValue . equals ( other . floatValue ) ) { return false ; } if ( inferOriginalName == null ) { if ( other . inferOriginalName != null ) { | |
2,825 | <s> package org . rubypeople . rdt . internal . testunit . ui ; import java . net . MalformedURLException ; import java . net . URL ; import java . util . AbstractSet ; import java . util . HashSet ; import java . util . MissingResourceException ; import java . util . ResourceBundle ; import java . util . Set ; import org . eclipse . core . resources . IWorkspace ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . Platform ; import org . eclipse . core . runtime . Status ; import org . eclipse . debug . core . DebugPlugin ; import org . eclipse . debug . core . ILaunch ; import org . eclipse . debug . core . ILaunchConfiguration ; import org . eclipse . debug . core . ILaunchListener ; import org . eclipse . debug . core . ILaunchManager ; import org . eclipse . jface . resource . ImageDescriptor ; import org . eclipse . swt . widgets . Display ; import org . eclipse . swt . widgets . Shell ; import org . eclipse . ui . IWorkbench ; import org . eclipse . ui . IWorkbenchPage ; import org . eclipse . ui . IWorkbenchPart ; import org . eclipse . ui . IWorkbenchWindow ; import org . eclipse . ui . PartInitException ; import org . eclipse . ui . plugin . AbstractUIPlugin ; import org . osgi . framework . BundleContext ; import org . rubypeople . rdt . core . IRubyElement ; import org . rubypeople . rdt . core . IType ; import org . rubypeople . rdt . core . RubyCore ; import org . rubypeople . rdt . testunit . ITestRunListener ; import org . rubypeople . rdt . testunit . launcher . TestUnitLaunchConfigurationDelegate ; public class TestunitPlugin extends AbstractUIPlugin implements ILaunchListener { public static final String PLUGIN_ID = "" ; public static final String TESTUNIT_PORT_ATTR = "" ; private static TestunitPlugin plugin ; private ResourceBundle resourceBundle ; private AbstractSet < ILaunch > fTrackedLaunches = new HashSet < ILaunch > ( 20 ) ; private Set < ITestRunListener > fTestRunListeners = new HashSet < ITestRunListener > ( ) ; private static URL fgIconBaseURL ; public TestunitPlugin ( ) { super ( ) ; String pathSuffix = "icons/full/" ; try { fgIconBaseURL = new URL ( Platform . getBundle ( PLUGIN_ID ) . getEntry ( "/" ) , pathSuffix ) ; } catch ( MalformedURLException e ) { } try { resourceBundle = ResourceBundle . getBundle ( "" ) ; } catch ( MissingResourceException x ) { resourceBundle = null ; } } public static URL makeIconFileURL ( String name ) throws MalformedURLException { if ( TestunitPlugin . fgIconBaseURL == null ) throw new MalformedURLException ( ) ; return new URL ( TestunitPlugin . fgIconBaseURL , name ) ; } public static ImageDescriptor getImageDescriptor ( String relativePath ) { try { return ImageDescriptor . createFromURL ( makeIconFileURL ( relativePath ) ) ; } catch ( MalformedURLException e ) { return ImageDescriptor . getMissingImageDescriptor ( ) ; } } public void start ( BundleContext context ) throws Exception { plugin = this ; super . start ( context ) ; ILaunchManager launchManager = DebugPlugin . getDefault ( ) . getLaunchManager ( ) ; launchManager . addLaunchListener ( this ) ; } public void stop ( BundleContext context ) throws Exception { super . stop ( context ) ; } public static TestunitPlugin getDefault ( ) { return plugin ; } public static String getResourceString ( String key ) { ResourceBundle bundle = TestunitPlugin . getDefault ( ) . getResourceBundle ( ) ; try { return ( bundle != null ) ? bundle . getString ( key ) : key ; } catch ( MissingResourceException e ) { return key ; } } public ResourceBundle getResourceBundle ( ) { return resourceBundle ; } public static String getPluginId ( ) { return PLUGIN_ID ; } public static void log ( Throwable e ) { log ( new Status ( IStatus . ERROR , getPluginId ( ) , IStatus . ERROR , "Error" , e ) ) ; } public static void log ( IStatus status ) { getDefault ( ) . getLog ( ) . log ( status ) ; } public static Shell getActiveWorkbenchShell ( ) { IWorkbenchWindow workBenchWindow = getActiveWorkbenchWindow ( ) ; if ( workBenchWindow == null ) return null ; return workBenchWindow . getShell ( ) ; } public static IWorkbenchWindow getActiveWorkbenchWindow ( ) { if ( plugin == null ) return null ; IWorkbench workBench = plugin . getWorkbench ( ) ; if ( workBench == null ) return null ; return workBench . getActiveWorkbenchWindow ( ) ; } public static IWorkspace getWorkspace ( ) { return RubyCore . getWorkspace ( ) ; } public static Display getDisplay ( ) { Display display = Display . getCurrent ( ) ; if ( display == null ) { display = Display . getDefault ( ) ; } return display ; } public static IWorkbenchPage getActivePage ( ) | |
2,826 | <s> package org . rubypeople . rdt . internal . ui . actions ; import org . eclipse . core . resources . IResource ; import org . eclipse . jface . action . IMenuManager ; import org . eclipse . jface . action . MenuManager ; import org . eclipse . jface . viewers . ISelection ; import org . eclipse . jface . viewers . IStructuredSelection ; import org . eclipse . ui . IWorkbenchSite ; import org . eclipse . ui . actions . ActionGroup ; import | |
2,827 | <s> package com . asakusafw . utils . java . parser . javadoc ; import static com . asakusafw . utils . java . internal . parser . javadoc . ir . IrDocElementKind . * ; import static org . junit . Assert . * ; import java . io . ByteArrayOutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . text . MessageFormat ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; import org . junit . Assert ; import com . asakusafw . utils . java . internal . model . util . JavaEscape ; import com . asakusafw . utils . java . internal . parser . javadoc . ir . IrDocBlock ; import com . asakusafw . utils . java . internal . parser . javadoc . ir . IrDocElement ; import com . asakusafw . utils . java . internal . parser . javadoc . ir . IrDocElementKind ; import com . asakusafw . utils . java . internal . parser . javadoc . ir . IrDocFragment ; import com . asakusafw . utils . java . internal . parser . javadoc . ir . IrDocText ; import com . asakusafw . utils . java . internal . parser . javadoc . ir . JavadocToken ; public class JavadocTestRoot { public static String load ( String name ) { InputStream in = JavadocTestRoot . class . getResourceAsStream ( name ) ; Assert . assertNotNull ( name , in ) ; try { ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; byte [ ] buf = | |
2,828 | <s> package com . asakusafw . testdriver . core ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . math . BigDecimal ; import java . util . GregorianCalendar ; import org . junit . Test ; public class DifferenceTest { @ Test public void string ( ) { | |
2,829 | <s> package org . rubypeople . rdt . internal . ui . filters ; import java . text . Collator ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . List ; import java . util . Set ; import org . eclipse . core . runtime . IConfigurationElement ; import org . eclipse . core . runtime . IExtensionRegistry ; import org . eclipse . core . runtime . ISafeRunnable ; import org . eclipse . core . runtime . Platform ; import org . eclipse . jface . util . Assert ; import org . eclipse . jface . util . SafeRunnable ; import org . eclipse . jface . viewers . ViewerFilter ; import org . eclipse . ui . IPluginContribution ; import org . eclipse . ui . activities . WorkbenchActivityHelper ; import org . rubypeople . rdt . internal . corext . util . Messages ; import org . rubypeople . rdt . ui . RubyUI ; public class FilterDescriptor implements Comparable , IPluginContribution { private static String PATTERN_FILTER_ID_PREFIX = "" ; private static final String EXTENSION_POINT_NAME = "" ; private static final String FILTER_TAG = "filter" ; private static final String PATTERN_ATTRIBUTE = "pattern" ; private static final String ID_ATTRIBUTE = "id" ; private static final String VIEW_ID_ATTRIBUTE = "viewId" ; private static final String TARGET_ID_ATTRIBUTE = "targetId" ; private static final String CLASS_ATTRIBUTE = "class" ; private static final String NAME_ATTRIBUTE = "name" ; private static final String ENABLED_ATTRIBUTE = "enabled" ; private static final String DESCRIPTION_ATTRIBUTE = "description" ; private static final String SELECTED_ATTRIBUTE = "selected" ; private static FilterDescriptor [ ] fgFilterDescriptors ; private IConfigurationElement fElement ; public static FilterDescriptor [ ] getFilterDescriptors ( ) { if ( fgFilterDescriptors == null ) { IExtensionRegistry registry = Platform . getExtensionRegistry ( ) ; IConfigurationElement [ ] elements = registry . getConfigurationElementsFor ( RubyUI . ID_PLUGIN , EXTENSION_POINT_NAME ) ; fgFilterDescriptors = createFilterDescriptors ( elements ) ; } return fgFilterDescriptors ; } public static FilterDescriptor [ ] getFilterDescriptors ( String targetId ) { FilterDescriptor [ ] filterDescs = FilterDescriptor . getFilterDescriptors ( ) ; List result = new ArrayList ( filterDescs . length ) ; for ( int i = 0 ; i < filterDescs . length ; i ++ ) { String tid = filterDescs [ i ] . getTargetId ( ) ; if ( WorkbenchActivityHelper . filterItem ( filterDescs [ i ] ) ) continue ; if ( tid == null || | |
2,830 | <s> package org . rubypeople . rdt . internal . core ; import java . util . ArrayList ; import java . util . Iterator ; import java . util . LinkedList ; import java . util . List ; import org . jruby . ast . AliasNode ; import org . jruby . ast . ArgsNode ; import org . jruby . ast . ArgumentNode ; import org . jruby . ast . ArrayNode ; import org . jruby . ast . AssignableNode ; import org . jruby . ast . CallNode ; import org . jruby . ast . ClassNode ; import org . jruby . ast . ClassVarAsgnNode ; import org . jruby . ast . ClassVarDeclNode ; import org . jruby . ast . ClassVarNode ; import org . jruby . ast . Colon2Node ; import org . jruby . ast . ConstDeclNode ; import org . jruby . ast . ConstNode ; import org . jruby . ast . DAsgnNode ; import org . jruby . ast . DStrNode ; import org . jruby . ast . DefnNode ; import org . jruby . ast . DefsNode ; import org . jruby . ast . FCallNode ; import org . jruby . ast . GlobalAsgnNode ; import org . jruby . ast . GlobalVarNode ; import org . jruby . ast . InstAsgnNode ; import org . jruby . ast . InstVarNode ; import org . jruby . ast . IterNode ; import org . jruby . ast . ListNode ; import org . jruby . ast . LocalAsgnNode ; import org . jruby . ast . LocalVarNode ; import org . jruby . ast . ModuleNode ; import org . jruby . ast . Node ; import org . jruby . ast . RootNode ; import org . jruby . ast . SClassNode ; import org . jruby . ast . SelfNode ; import org . jruby . ast . SplatNode ; import org . jruby . ast . StrNode ; import org . jruby . ast . VCallNode ; import org . jruby . ast . YieldNode ; import org . jruby . runtime . Visibility ; import org . rubypeople . rdt . core . IMethod ; import org . rubypeople . rdt . internal . compiler . ISourceElementRequestor ; import org . rubypeople . rdt . internal . compiler . ISourceElementRequestor . FieldInfo ; import org . rubypeople . rdt . internal . compiler . ISourceElementRequestor . MethodInfo ; import org . rubypeople . rdt . internal . compiler . ISourceElementRequestor . TypeInfo ; import org . rubypeople . rdt . internal . core . parser . InOrderVisitor ; import org . rubypeople . rdt . internal . core . parser . RubyParser ; import org . rubypeople . rdt . internal . core . util . ASTUtil ; public class SourceElementParser extends InOrderVisitor { private static final String MODULE_FUNCTION = "" ; private static final String PROTECTED = "protected" ; private static final String PRIVATE = "private" ; private static final String PUBLIC = "public" ; private static final String INCLUDE = "include" ; private static final String LOAD = "load" ; private static final String REQUIRE = "require" ; private static final String ALIAS = "alias :" ; private static final String MODULE = "Module" ; private static final String CONSTRUCTOR_NAME = "initialize" ; private static final String OBJECT = "Object" ; private List < Visibility > visibilities = new ArrayList < Visibility > ( ) ; private boolean inSingletonClass ; public ISourceElementRequestor requestor ; private boolean inModuleFunction ; private char [ ] source ; private String typeName ; public SourceElementParser ( ISourceElementRequestor requestor ) { super ( ) ; this . requestor = requestor ; } public Object visitClassNode ( ClassNode iVisited ) { pushVisibility ( Visibility . PUBLIC ) ; TypeInfo typeInfo = new TypeInfo ( ) ; typeInfo . name = ASTUtil . getFullyQualifiedName ( iVisited . getCPath ( ) ) ; typeInfo . declarationStart = iVisited . getPosition ( ) . getStartOffset ( ) ; typeInfo . nameSourceStart = iVisited . getCPath ( ) . getPosition ( ) . getStartOffset ( ) ; typeInfo . nameSourceEnd = iVisited . getCPath ( ) . getPosition ( ) . getEndOffset ( ) - 1 ; if ( ! typeInfo . name . equals ( OBJECT ) ) { String superClass = ASTUtil . getSuperClassName ( iVisited . getSuperNode ( ) ) ; typeInfo . superclass = superClass ; } typeInfo . isModule = false ; typeInfo . modules = new String [ 0 ] ; typeInfo . secondary = false ; typeName = typeInfo . name ; requestor . enterType ( typeInfo ) ; Object ins = super . visitClassNode ( iVisited ) ; popVisibility ( ) ; requestor . exitType ( iVisited . getPosition ( ) . getEndOffset ( ) - 2 ) ; return ins ; } @ Override public Object visitConstNode ( ConstNode iVisited ) { requestor . acceptTypeReference ( iVisited . getName ( ) , iVisited . getPosition ( ) . getStartOffset ( ) , iVisited . getPosition ( ) . getEndOffset ( ) ) ; return super . visitConstNode ( iVisited ) ; } @ Override public Object visitModuleNode ( ModuleNode iVisited ) { pushVisibility ( Visibility . PUBLIC ) ; TypeInfo typeInfo = new TypeInfo ( ) ; typeInfo . name = ASTUtil . getFullyQualifiedName ( iVisited . getCPath ( ) ) ; typeInfo . declarationStart = iVisited . getPosition ( ) . getStartOffset ( ) ; typeInfo . nameSourceStart = iVisited . getCPath ( ) . getPosition ( ) . getStartOffset ( ) ; typeInfo . nameSourceEnd = iVisited . getCPath ( ) . getPosition ( ) . getEndOffset ( ) - 1 ; typeInfo . superclass = MODULE ; typeInfo . isModule = true ; typeInfo . modules = new String [ 0 ] ; typeInfo . secondary = false ; typeName = typeInfo . name ; requestor . enterType ( typeInfo ) ; Object ins = super . visitModuleNode ( iVisited ) ; popVisibility ( ) ; requestor . exitType ( iVisited . getPosition ( ) . getEndOffset ( ) - 2 ) ; inModuleFunction = false ; return ins ; } @ Override public Object visitDefnNode ( DefnNode iVisited ) { Visibility visibility = getCurrentVisibility ( ) ; MethodInfo methodInfo = new MethodInfo ( ) ; methodInfo . declarationStart = iVisited . getPosition ( ) . getStartOffset ( ) ; methodInfo . name = iVisited . getName ( ) ; methodInfo . nameSourceStart = iVisited . getNameNode ( ) . getPosition ( ) . getStartOffset ( ) ; methodInfo . nameSourceEnd = iVisited . getNameNode ( ) . getPosition ( ) . getEndOffset ( ) - 1 ; if ( methodInfo . name . equals ( CONSTRUCTOR_NAME ) ) { visibility = Visibility . PROTECTED ; methodInfo . isConstructor = true ; } else { methodInfo . isConstructor = false ; } methodInfo . isClassLevel = inSingletonClass || inModuleFunction ; methodInfo . visibility = convertVisibility ( visibility ) ; methodInfo . parameterNames = ASTUtil . getArgs ( iVisited . getArgsNode ( ) , iVisited . getScope ( ) ) ; if ( methodInfo . isConstructor ) { requestor . enterConstructor ( methodInfo ) ; } else { requestor . enterMethod ( methodInfo ) ; } Object ins = super . visitDefnNode ( iVisited ) ; int end = iVisited . getPosition ( ) . getEndOffset ( ) - 2 ; if ( methodInfo . isConstructor ) { requestor . exitConstructor ( end ) ; } else { requestor . exitMethod ( end ) ; } return ins ; } @ Override public Object visitArgsNode ( ArgsNode iVisited ) { ListNode list = iVisited . getArgs ( ) ; if ( list != null ) { for ( int i = 0 ; i < list . size ( ) ; i ++ ) { Node arg = list . get ( i ) ; FieldInfo field = new FieldInfo ( ) ; field . declarationStart = arg . getPosition ( ) . getStartOffset ( ) ; field . nameSourceStart = arg . getPosition ( ) . getStartOffset ( ) ; String name = ASTUtil . getNameReflectively ( arg ) ; field . nameSourceEnd = arg . getPosition ( ) . getStartOffset ( ) + name . length ( ) - 1 ; field . name = name ; requestor . enterField ( field ) ; requestor . exitField ( arg . getPosition ( ) . getEndOffset ( ) - 1 ) ; } } ArgumentNode arg = iVisited . getRestArgNode ( ) ; if ( arg != null ) { FieldInfo field = new FieldInfo ( ) ; field . declarationStart = arg . getPosition ( ) . getStartOffset ( ) + 1 ; field . nameSourceStart = arg . getPosition ( ) . getStartOffset ( ) + 1 ; String name = ASTUtil . getNameReflectively | |
2,831 | <s> package com . asakusafw . dmdl . directio . csv . driver ; import java . text . SimpleDateFormat ; import com . asakusafw . dmdl . model . AstNode ; import com . asakusafw . dmdl . semantics . Trait ; import com . asakusafw . runtime . io . csv . CsvConfiguration ; import com . asakusafw . runtime . value . Date ; import com . asakusafw . runtime . value . DateTime ; public class CsvFormatTrait implements Trait < CsvFormatTrait > { private final AstNode originalAst ; private final Configuration configuration ; public CsvFormatTrait ( AstNode originalAst , Configuration configuration ) { | |
2,832 | <s> package com . asakusafw . runtime . flow ; public class BufferException extends RuntimeException | |
2,833 | <s> package org . rubypeople . rdt . refactoring . core . extractmethod ; public class ExtractedArgument { private String originalArgName ; private String newInExtractedMethodArgName ; private String oldInExtractedMethodArgName ; private int index ; public ExtractedArgument ( int id , | |
2,834 | <s> package com . asakusafw . compiler . flow . processor . operator ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . util . List ; import com . asakusafw . compiler . flow . processor . CoGroupFlowProcessor ; import com . asakusafw . compiler . flow . testing . model . Ex1 ; import com . asakusafw . compiler . flow . testing . model . Ex2 ; import com . asakusafw . runtime . core . Result ; import com . asakusafw . vocabulary . flow . processor . InputBuffer ; import com . asakusafw . vocabulary . model . Key ; import com . asakusafw . vocabulary . operator . CoGroup ; public abstract class CoGroupFlow { @ CoGroup public void op1 ( @ Key ( group = "string" ) List < Ex1 > a1 , Result < Ex1 > r1 ) { withParameter ( a1 , r1 , 0 ) ; } @ CoGroup ( inputBuffer = InputBuffer . ESCAPE ) public void swap ( @ Key ( group = "string" ) List < Ex1 > a1 , Result < Ex1 > r1 ) { withParameter ( a1 , r1 , 0 ) ; } @ CoGroup public void sorted ( @ Key ( group = "string" , order = "value desc" ) List < Ex1 > a1 , Result < Ex1 > r1 ) { int current = a1 . get ( 0 ) . getValue ( ) ; for ( Ex1 e : a1 ) { assertThat ( current , lessThanOrEqualTo ( e . getValue ( ) ) ) ; current = e . getValue ( ) ; } } @ CoGroup public void op2 ( @ Key ( group = "string" ) List < Ex1 > a1 , @ Key ( group = "string" ) List < Ex2 > a2 , Result < Ex1 > r1 , Result < Ex2 > r2 ) { String string = "" ; int value1 = 0 ; int value2 = 0 ; for ( Ex1 e : a1 ) { value1 += e . getValue ( ) ; string = e . getStringAsString ( ) ; } for ( Ex2 e : a2 ) { value2 += e . getValue ( ) ; string = e . getStringAsString ( ) ; } Ex1 re1 = new Ex1 ( ) ; Ex2 re2 = new Ex2 ( ) ; re1 . setValue ( value2 ) ; re2 . setValue ( value1 ) ; re1 . setStringAsString ( string ) ; re2 . setStringAsString ( string | |
2,835 | <s> package com . asakusafw . yaess . jsch ; import java . io . IOException ; import java . text . MessageFormat ; import com . asakusafw . yaess . basic . ProcessExecutor ; import com . asakusafw . yaess . basic . ProcessHadoopScriptHandler ; import com . asakusafw . yaess . core . ExecutionContext ; import com . asakusafw . yaess . core . HadoopScript ; import com . asakusafw . yaess . core . HadoopScriptHandler ; import com . asakusafw . yaess . core . ServiceProfile ; import com . jcraft . jsch . JSchException ; public class SshHadoopScriptHandler extends ProcessHadoopScriptHandler { private volatile JschProcessExecutor executor ; @ Override protected void configureExtension ( ServiceProfile < ? > profile ) throws InterruptedException , IOException { try { this . executor = JschProcessExecutor . extract ( profile . getPrefix ( ) , profile . getConfiguration ( ) , profile . getContext ( ) . getContextParameters ( ) ) ; } catch | |
2,836 | <s> package net . sf . sveditor . core . tests . index . persistence ; import java . io . ByteArrayInputStream ; import java . io . ByteArrayOutputStream ; import java . io . DataInputStream ; import java . io . DataOutputStream ; import java . io . IOException ; import java . util . ArrayList ; import junit . framework . TestCase ; import net . sf . sveditor . core . db . SVDBItemType ; import net . sf . sveditor . core . db . index . SVDBBaseIndexCacheData ; import net . sf . sveditor . core . db . index . SVDBDeclCacheItem ; import net . sf . sveditor . core . db . persistence . DBFormatException ; import net . sf . sveditor . core . db . persistence . DBWriteException ; import net . sf . sveditor . core . db . persistence . IDBReader ; import net . sf . sveditor . core . db . persistence . IDBWriter ; import net . sf . sveditor . core . db . persistence . SVDBPersistenceRW ; public class TestIndexCacheDataPersistence extends TestCase { private void dump_load ( SVDBBaseIndexCacheData data , SVDBBaseIndexCacheData data_n ) throws DBFormatException , DBWriteException , IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; IDBWriter writer = new SVDBPersistenceRW ( ) ; IDBReader reader = new SVDBPersistenceRW ( ) ; writer . init ( dos ) ; writer . writeObject ( data . getClass ( ) , data ) ; dos . flush ( ) ; DataInputStream dis = new DataInputStream ( new ByteArrayInputStream ( bos . toByteArray ( ) ) ) ; reader . init ( dis ) ; reader . readObject ( null , data_n . getClass ( ) , data_n ) ; } public void testBasics ( ) throws DBFormatException , | |
2,837 | <s> package org . oddjob . framework ; import org . oddjob . arooa . beanutils . DynaArooaClass ; import org . oddjob . arooa . reflect . BeanOverview ; import org . oddjob . arooa . reflect . PropertyAccessor ; public class WrapDynaArooaClass extends DynaArooaClass { public WrapDynaArooaClass ( WrapDynaClass dynaClass , Class < ? | |
2,838 | <s> package $ { package } . util ; import java . io . IOException ; import java . util . ArrayList ; import java . util . Collections ; import java . util . List ; import com . asakusafw . testdriver . core . DataModelDefinition ; import com . asakusafw . testdriver . core . DataModelReflection ; import com . asakusafw . testdriver . core . DataModelSource ; import com . asakusafw . testdriver . core . Difference ; import com . asakusafw . testdriver . core . PropertyName ; import com . asakusafw . testdriver . core . Verifier ; import com . asakusafw . testdriver . core . VerifierFactory ; import com . asakusafw . testdriver . core . VerifyContext ; public class CountVerifier implements Verifier { private final long expected ; public CountVerifier ( long expected ) { this . expected = expected ; } public static VerifierFactory factory ( final long expected ) { return new VerifierFactory ( ) { @ Override public < T > Verifier createVerifier ( DataModelDefinition < T > definition , VerifyContext context ) { return new | |
2,839 | <s> package com . asakusafw . testdriver . rule ; import java . text . MessageFormat ; import java . util . ArrayList ; import java . util . LinkedHashMap ; import java . util . List ; import java . util . Map ; import java . util . Set ; import com . asakusafw . testdriver . core . DataModelReflection ; import com . asakusafw . testdriver . core . PropertyName ; import com . asakusafw . testdriver . core . VerifyRule ; public class VerifyRuleInterpretor implements VerifyRule { private final List < PropertyName > keys ; private final Set < DataModelCondition > modelConditions ; private final List < ? extends PropertyCondition < ? > > propertyConditions ; public VerifyRuleInterpretor ( List < PropertyName > keys , Set < DataModelCondition > modelConditions , List < ? extends PropertyCondition < ? > > propertyConditions ) { if ( keys == null ) { throw new IllegalArgumentException ( "" ) ; } if ( modelConditions == null ) { throw new IllegalArgumentException ( "" ) ; } if ( propertyConditions == null ) { throw new IllegalArgumentException ( "" ) ; } this . keys = keys ; this . modelConditions = modelConditions ; this . propertyConditions = propertyConditions ; } @ Override public Map < PropertyName , Object > getKey ( DataModelReflection target ) { Map < PropertyName , Object > results = new LinkedHashMap < | |
2,840 | <s> package org . rubypeople . rdt . internal . ui ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . IAdaptable ; import org . eclipse . ui . views . tasklist . ITaskListResourceAdapter ; import org . rubypeople . rdt . core . IRubyScript ; import org . rubypeople . rdt . core . IRubyElement ; import org . rubypeople . rdt . internal . corext . util . RubyModelUtil ; public class RubyTaskListAdapter implements ITaskListResourceAdapter { public IResource getAffectedResource ( IAdaptable element ) { IRubyElement ruby = ( IRubyElement ) element ; IResource resource = ruby . getResource ( ) ; | |
2,841 | <s> package com . asakusafw . compiler . directio ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . util . Arrays ; import java . util . List ; import org . junit . Test ; import com . asakusafw . compiler . directio . OutputPattern . CompiledOrder ; import com . asakusafw . compiler . directio . OutputPattern . CompiledResourcePattern ; import com . asakusafw . compiler . directio . OutputPattern . SourceKind ; import com . asakusafw . compiler . flow . DataClass ; import com . asakusafw . runtime . stage . directio . StringTemplate . Format ; public class OutputPatternTest { final DataClass dataClass = new MockDataClass ( MockData . class ) ; @ Test public void resource_plain ( ) { List < CompiledResourcePattern > pattern = OutputPattern . compileResourcePattern ( "hello" , dataClass ) ; assertThat ( pattern . size ( ) , is ( 1 ) ) ; assertThat ( pattern . get ( 0 ) . getFormat ( ) , is ( Format . PLAIN ) ) ; assertThat ( pattern . get ( 0 ) . getArgument ( ) , is ( "hello" ) ) ; } @ Test public void resource_placeholder ( ) { List < CompiledResourcePattern > pattern = OutputPattern . compileResourcePattern ( "{intValue}" , dataClass ) ; assertThat ( pattern . size ( ) , is ( 1 ) ) ; assertThat ( pattern . get ( 0 ) . getTarget ( ) . getName ( ) , is ( "intValue" ) ) ; assertThat ( pattern . get ( 0 ) . getFormat ( ) , is ( Format . NATURAL ) ) ; } @ Test public void resource_placeholder_date ( ) { List < CompiledResourcePattern > pattern = OutputPattern . compileResourcePattern ( "" , dataClass ) ; assertThat ( pattern . size ( ) , is ( 1 ) ) ; assertThat ( pattern . get ( 0 ) . getTarget ( ) . getName ( ) , is ( "dateValue" ) ) ; assertThat ( pattern . get ( 0 ) . getFormat ( ) , is ( Format . DATE ) ) ; assertThat ( pattern . get ( 0 ) . getArgument ( ) , is ( "yyyy/MM" ) ) ; } @ Test public void resource_placeholder_datetime ( ) { List < CompiledResourcePattern > pattern = OutputPattern . compileResourcePattern ( "" , dataClass ) ; assertThat ( pattern . size ( ) , is ( 1 ) ) ; assertThat ( pattern . get ( 0 ) . getTarget ( ) . getName ( ) , is ( "" ) ) ; assertThat ( pattern . get ( 0 ) . getFormat ( ) , is ( Format . DATETIME ) ) ; assertThat ( pattern . get ( 0 ) . getArgument ( ) , is ( "yyyy/MM_ss" ) ) ; } @ Test public void resource_placeholder_mixed ( ) { List < CompiledResourcePattern > pattern = OutputPattern . compileResourcePattern ( "" , dataClass ) ; assertThat ( pattern . size ( ) , is ( 3 ) ) ; assertThat ( pattern . get ( 0 ) . getFormat ( ) , is ( Format . PLAIN ) ) ; assertThat ( pattern . get ( 0 ) . getArgument ( ) , is ( "left" ) ) ; assertThat ( pattern . get ( 1 ) . getTarget ( ) . getName ( ) , is ( "intValue" ) ) ; assertThat ( pattern . get ( 1 ) . getFormat ( ) , is ( Format . NATURAL ) ) ; assertThat ( pattern . get ( 2 ) . getFormat ( ) , is ( Format . PLAIN ) ) ; assertThat ( pattern . get ( 2 ) . getArgument ( ) , is ( "right" ) ) ; } @ Test public void resource_randomNumber ( ) { List < CompiledResourcePattern > pattern = OutputPattern . compileResourcePattern ( "[0..10]" , dataClass ) ; assertThat ( pattern . size ( ) , is ( 1 ) ) ; assertThat ( pattern . get ( 0 ) . getRandomNumber ( ) . getLowerBound ( ) , is ( 0 ) ) ; assertThat ( pattern . get ( 0 ) . getRandomNumber ( ) . getUpperBound ( ) , is ( 10 ) ) ; assertThat ( pattern . get ( 0 ) . getFormat ( ) , is ( Format . NATURAL ) ) ; } @ Test public void resource_wildcard ( ) { List < CompiledResourcePattern > pattern = OutputPattern . compileResourcePattern ( "*" , dataClass ) ; assertThat ( pattern . size ( ) , is ( 1 ) ) ; assertThat ( pattern . get ( 0 ) . getKind ( ) , is ( SourceKind . ENVIRONMENT ) ) ; } @ Test public void resource_variable ( ) { List < CompiledResourcePattern > pattern = OutputPattern . compileResourcePattern ( "${date}" , dataClass ) ; assertThat ( pattern . size ( ) , is ( 1 ) ) ; assertThat ( pattern . get ( 0 ) . getFormat ( ) , is ( Format . PLAIN ) ) ; assertThat ( pattern . get ( 0 ) . getArgument ( ) , is ( "${date}" ) ) ; } @ Test public void resource_variable_mixed ( ) { List < CompiledResourcePattern > pattern = OutputPattern . compileResourcePattern ( "" , dataClass ) ; assertThat ( pattern . size ( ) , is ( 1 ) ) ; assertThat ( pattern . get ( 0 ) . getFormat ( ) , is ( Format . PLAIN ) ) ; assertThat ( pattern . get ( 0 ) . getArgument ( ) , is ( "" ) ) ; } @ Test public void resource_complex ( ) { List < CompiledResourcePattern > pattern = OutputPattern . compileResourcePattern ( "" , dataClass ) ; assertThat ( pattern . size ( ) , is ( 8 ) ) ; assertThat ( pattern . get ( 0 ) . getTarget ( ) . getName ( ) , is ( "stringValue" ) ) ; assertThat ( pattern . get ( 0 ) . getFormat ( ) , is ( Format . NATURAL ) ) ; assertThat ( pattern . get ( 1 ) . getKind ( ) , is ( SourceKind . NOTHING ) ) ; assertThat ( pattern . get ( 1 ) . getArgument ( ) , is ( "" ) ) ; assertThat ( pattern . get ( 2 ) . getTarget ( ) . getName ( ) , is ( "dateValue" ) ) ; assertThat ( pattern . get ( 2 ) . getFormat ( ) , is ( Format . DATE ) ) ; assertThat ( pattern . get ( 2 ) . getArgument ( ) , is ( "yyyy-MM-dd" ) ) ; assertThat ( pattern . get ( 3 ) . getKind ( ) , is ( SourceKind . NOTHING ) ) ; assertThat ( pattern . get ( 3 ) . getArgument ( ) , is ( "-" ) ) ; assertThat ( pattern . get ( 4 ) . getRandomNumber ( ) . getLowerBound ( ) , is ( 10 ) ) ; assertThat ( pattern . get ( 4 ) . getRandomNumber ( ) . getUpperBound ( ) , is ( 99 ) ) ; assertThat ( pattern . get ( 5 ) . getFormat ( ) , is ( Format . PLAIN ) ) ; assertThat ( pattern . get ( 5 ) . getArgument ( ) , is ( "-" ) ) ; assertThat ( pattern . get ( 6 ) . getKind ( ) , is ( SourceKind . ENVIRONMENT ) ) ; assertThat ( pattern . get ( 7 ) . getKind ( ) , is ( SourceKind . NOTHING ) ) ; assertThat ( pattern . get ( 7 ) . getArgument ( ) , is ( ".csv" ) ) ; } @ Test ( expected = IllegalArgumentException . class ) public void resource_unknown_property ( ) { OutputPattern . compileResourcePattern ( "{UNKNWON}" , dataClass ) ; } | |
2,842 | <s> package org . oddjob . images ; import java . io . Serializable ; import java . util . | |
2,843 | <s> package com . asakusafw . runtime . io ; import java . io . Closeable ; import java . io . Flushable ; 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 RecordEmitter extends Flushable , Closeable { void endRecord ( ) throws IOException ; void emit ( BooleanOption option ) throws IOException ; void emit | |
2,844 | <s> package com . asakusafw . dmdl . java . emitter ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import org . apache . hadoop . io . Text ; import org . junit . Test ; import com . asakusafw . dmdl . java . GeneratorTesterRoot ; import com . asakusafw . dmdl . java . emitter . driver . ProjectionDriver ; public class ProjectiveModelEmitterTest extends GeneratorTesterRoot { @ Test public void projection ( ) { emitDrivers . add ( new ProjectionDriver ( ) ) ; ModelLoader loader = generate ( ) ; Class < ? > projection = loader . modelType ( "Projection" ) ; ModelWrapper object = loader . newModel ( "Record" ) ; assertThat ( object . unwrap ( ) , instanceOf ( projection ) ) ; object . setInterfaceType ( projection ) ; object . set ( "hoge" , 100 ) ; assertThat ( object . | |
2,845 | <s> package com . fredbrunel . android . twitter ; import oauth . signpost . OAuth ; import oauth . signpost . exception . OAuthCommunicationException ; import oauth . signpost . exception . OAuthExpectationFailedException ; import oauth . signpost . exception . OAuthMessageSignerException ; import oauth . signpost . exception . OAuthNotAuthorizedException ; import android . net . Uri ; public class TwitterAuth implements AuthConstants { private String accessKey = "" ; private String accessSecret = "" ; public TwitterAuth ( Uri uri ) { String verifier = uri . getQueryParameter ( OAuth . OAUTH_VERIFIER ) ; try { provider . retrieveAccessToken ( consumer , verifier ) ; accessKey = consumer . getToken | |
2,846 | <s> package net . sf . sveditor . core . db . search ; import java . util . ArrayList ; import java . util . List ; import net . sf . sveditor . core . db . ISVDBItemBase ; import net . sf . sveditor . core . db . SVDBItemType ; import net . sf . sveditor . core . db . index . ISVDBIndexIterator ; import net . sf . sveditor . core . db . index . SVDBDeclCacheItem ; import net . sf . sveditor . core . log . LogFactory ; import net . sf . sveditor . core . log . LogHandle ; import org . eclipse . core . runtime . NullProgressMonitor ; public class SVDBFindByName { private ISVDBIndexIterator fIndexIterator ; private ISVDBFindNameMatcher fMatcher ; private LogHandle fLog ; public SVDBFindByName ( ISVDBIndexIterator index_it ) { this ( index_it , SVDBFindDefaultNameMatcher . getDefault ( ) ) ; } public SVDBFindByName ( ISVDBIndexIterator index_it , ISVDBFindNameMatcher matcher ) { fIndexIterator = index_it ; fMatcher = matcher ; fLog = LogFactory . getLogHandle ( "" ) ; } | |
2,847 | <s> package com . asakusafw . dmdl . java . emitter ; import java . io . IOException ; import java . util . Arrays ; import java . util . Collections ; import java . util . List ; import com . asakusafw . dmdl . java . Configuration ; import com . asakusafw . dmdl . java . spi . JavaDataModelDriver ; import com . asakusafw . dmdl . semantics . DmdlSemantics ; import com . asakusafw . dmdl . semantics . ModelDeclaration ; import com . asakusafw . dmdl . semantics . PropertyDeclaration ; import com . asakusafw . utils . collections . Lists ; import com . asakusafw . utils . java . model . syntax . Attribute ; import com . asakusafw . utils . java . model . syntax . FormalParameterDeclaration ; import com . asakusafw . utils . java . model . syntax . MethodDeclaration ; import com . asakusafw . utils . java . model . syntax . ModelFactory ; import com . asakusafw . utils . java . model . syntax . SimpleName ; import com . asakusafw . utils . java . model . syntax . Type ; import com . asakusafw . utils . java . model . syntax . TypeBodyDeclaration ; import com . asakusafw . utils . java . model . syntax . TypeParameterDeclaration ; import com . asakusafw . utils . java . model . util . AttributeBuilder ; import com . asakusafw . utils . java . model . util . JavadocBuilder ; public class ProjectiveModelEmitter { private final ModelDeclaration model ; private final EmitContext context ; private final JavaDataModelDriver driver ; private final ModelFactory f ; public ProjectiveModelEmitter ( DmdlSemantics semantics , Configuration config , ModelDeclaration model , JavaDataModelDriver driver ) { if ( semantics == null ) { throw new IllegalArgumentException ( "" ) ; } if ( config == null ) { throw new IllegalArgumentException ( "" ) ; } if ( model == null ) { throw | |
2,848 | <s> package de . fuberlin . wiwiss . d2rq . map ; import java . lang . reflect . Constructor ; import java . util . ArrayList ; import java . util . Collection ; import java . util . HashMap ; import java . util . Map ; import com . hp . hpl . jena . rdf . model . Resource ; import de . fuberlin . wiwiss . d2rq . D2RQException ; import de . fuberlin . wiwiss . d2rq . csv . TranslationTableParser ; import de . fuberlin . wiwiss . d2rq . values . Translator ; import de . fuberlin . wiwiss . d2rq . vocab . D2RQ ; public class TranslationTable extends MapObject { private Collection < Translation > translations = new ArrayList < Translation > ( ) ; private String javaClass = null ; private String href = null ; public TranslationTable ( Resource resource ) { super ( resource ) ; } public int size ( ) { return this . translations . size ( ) ; } public void addTranslation ( String dbValue , String rdfValue ) { assertArgumentNotNull ( dbValue , D2RQ . databaseValue , D2RQException . TRANSLATION_MISSING_DBVALUE ) ; assertArgumentNotNull ( rdfValue , D2RQ . rdfValue , D2RQException . TRANSLATION_MISSING_RDFVALUE ) ; this . translations . add ( new Translation ( dbValue , rdfValue ) ) ; } public void setJavaClass ( String className ) { assertNotYetDefined ( this . javaClass , D2RQ . javaClass , D2RQException . TRANSLATIONTABLE_DUPLICATE_JAVACLASS ) ; this . javaClass = className ; } public void setHref ( String href ) { assertNotYetDefined ( this . href , D2RQ . href , D2RQException . TRANSLATIONTABLE_DUPLICATE_HREF ) ; this . href = href ; } public Translator translator ( ) { validate ( ) ; if ( this . javaClass != null ) { return instantiateJavaClass ( ) ; } if ( this . href != null ) { return new TableTranslator ( new TranslationTableParser ( href ) . parseTranslations ( ) ) ; } return new TableTranslator ( this . translations ) ; } public void validate ( ) throws D2RQException { if ( ! this . translations . isEmpty ( ) && this . javaClass != null ) { throw new D2RQException ( "" + this , D2RQException . TRANSLATIONTABLE_TRANSLATION_AND_JAVACLASS ) ; } if ( ! this . translations . isEmpty ( ) && this . href != null ) { throw new D2RQException ( "" + this , D2RQException . TRANSLATIONTABLE_TRANSLATION_AND_HREF ) ; } if ( this . href != null && this . javaClass != null ) { throw new D2RQException ( "" + this , D2RQException . TRANSLATIONTABLE_HREF_AND_JAVACLASS ) ; } } public String toString ( ) { return "" + super . toString ( ) ; } private Translator instantiateJavaClass ( ) { try { Class < ? > translatorClass = Class . forName ( this . javaClass ) ; if ( ! checkTranslatorClassImplementation ( translatorClass ) ) { throw new D2RQException ( "" + this . javaClass + "" + Translator . class . getName ( ) ) ; } if ( hasConstructorWithArg ( translatorClass ) ) { return invokeConstructorWithArg ( translatorClass , resource ( ) ) ; } if ( hasConstructorWithoutArg ( translatorClass ) ) { return invokeConstructorWithoutArg ( translatorClass ) ; } throw new D2RQException ( "" + this . javaClass ) ; } catch ( ClassNotFoundException e ) { throw new D2RQException ( "" + this . javaClass ) ; } } private boolean checkTranslatorClassImplementation ( Class < ? > translatorClass ) { if ( implementsTranslator ( translatorClass ) ) { return true ; } if ( translatorClass . getSuperclass ( ) == null ) { return false ; } return this . checkTranslatorClassImplementation ( translatorClass . getSuperclass ( ) ) ; } private boolean implementsTranslator ( Class < ? > aClass ) { for ( int i = 0 ; i < aClass . getInterfaces ( ) . length ; i ++ ) { if ( aClass . getInterfaces ( ) [ i ] . equals ( Translator . class ) ) { return true ; } } return false ; } private boolean hasConstructorWithArg ( Class < ? > aClass ) { try { aClass . getConstructor ( new Class [ ] { Resource . class } ) ; return true ; } catch ( NoSuchMethodException nsmex ) { return false ; } } private Translator invokeConstructorWithArg ( Class < ? > aClass , Resource r ) { try { Constructor < ? > c = aClass . getConstructor ( new Class [ ] { | |
2,849 | <s> package test . modelgen . table . io ; import java . io . IOException ; import javax . annotation . Generated ; import test . modelgen . table . model . ExportTempImportTarget19 ; import com . asakusafw . runtime . io . ModelOutput ; import com . asakusafw . runtime . io . RecordEmitter ; @ Generated ( "" ) @ SuppressWarnings ( "deprecation" ) public final class ExportTempImportTarget19ModelOutput implements ModelOutput < ExportTempImportTarget19 > { private final RecordEmitter emitter ; public ExportTempImportTarget19ModelOutput ( RecordEmitter emitter ) { if ( emitter == null ) { throw new IllegalArgumentException ( ) ; } this . emitter = emitter ; } @ Override public void write ( ExportTempImportTarget19 model ) throws IOException { emitter . emit ( model . getTempSidOption ( ) ) ; emitter . emit ( model . getSidOption ( ) ) ; emitter . emit ( model . getVersionNoOption ( ) ) ; emitter . emit ( model . getRgstDateOption ( ) ) ; emitter . emit ( model . getUpdtDateOption ( ) ) ; emitter | |
2,850 | <s> package com . aptana . rdt . core . gems ; import java . util . ArrayList ; import java . util . List ; import java . util . StringTokenizer ; public class Gem implements Comparable < Gem > { private String name ; private String version ; private String description ; private String platform ; private boolean compiles = false ; private boolean forceUpdates ; public static final String RUBY_PLATFORM = "ruby" ; public static final String MSWIN32_PLATFORM = "mswin32" ; public static final String JRUBY_PLATFORM = "java" ; public static final String ANY_VERSION = "" ; public Gem ( String name , String version , String description ) { this ( name , version , description , RUBY_PLATFORM ) ; } public Gem ( String name , String version , String description , String platform ) { if ( name == null ) throw new IllegalArgumentException ( "" ) ; if ( version == null ) throw new IllegalArgumentException ( "" ) ; if ( version . indexOf ( "," ) != - 1 ) { if ( ! ( this instanceof LogicalGem ) ) throw new IllegalArgumentException ( "" ) ; } if ( platform == null ) throw new IllegalArgumentException ( "" ) ; this . name = name ; this . version = version ; this . description = description ; this . platform = platform ; } public String getName ( ) { return name ; } public String getVersion ( ) { return version ; } public Version getVersionObject ( ) { return new Version ( version ) ; } public String getDescription ( ) { return description ; } public String getPlatform ( ) { return platform ; } public boolean equals ( Object arg0 ) { if ( ! ( arg0 instanceof Gem ) ) return false ; Gem other = ( Gem ) arg0 ; return getName ( ) . equals ( other . getName ( ) ) && getVersion ( ) . equals ( other . getVersion ( ) ) && getPlatform ( ) . equals ( other . getPlatform ( ) ) ; } public int hashCode ( ) { return ( getName ( ) . hashCode ( ) * 100 ) + getVersion ( ) . hashCode ( ) ; } public int compareTo ( Gem other ) { return toString ( ) . compareTo ( other . toString ( ) ) ; } public String toString ( ) { return getName ( ) . toLowerCase ( ) + " " + getVersion ( ) + " " + getPlatform ( ) ; } public boolean hasMultipleVersions ( ) { return version != null && version | |
2,851 | <s> package com . asakusafw . compiler . flow . example ; import com . asakusafw . compiler . operator . model . MockHoge ; import com . asakusafw . vocabulary . flow . Export ; import com . asakusafw . vocabulary . flow . FlowDescription ; import com . asakusafw . vocabulary . flow . Import ; import com . asakusafw . vocabulary . flow . In ; import com . asakusafw . vocabulary . flow . JobFlow ; import com . asakusafw . vocabulary . flow . Out ; @ JobFlow ( name = "testing" | |
2,852 | <s> package org . springframework . social . google . api . impl ; import java . io . IOException ; import org . codehaus . jackson . JsonParser ; import org . codehaus . jackson . JsonProcessingException ; import org . codehaus . jackson . map . DeserializationContext ; import org . codehaus . jackson . map . JsonDeserializer ; public abstract class ApiEnumDeserializer < T extends Enum < ? > > extends JsonDeserializer < T > { private final Class < T > type ; public ApiEnumDeserializer ( Class < T > type ) { this . type = type ; } @ Override public T deserialize ( JsonParser jp , DeserializationContext ctxt ) throws IOException , JsonProcessingException { String camelCase = jp . getText ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < camelCase . length ( ) ; i ++ ) { char c = camelCase . charAt | |
2,853 | <s> package org . rubypeople . rdt . internal . ui . callhierarchy ; import org . eclipse . jface . action . Action ; import org . eclipse . ui . IWorkingSet ; import org . eclipse . ui . PlatformUI ; import org . rubypeople . rdt . core . RubyModelException ; import org . rubypeople . rdt . internal . ui . IRubyHelpContextIds ; import org . rubypeople . rdt . internal . ui . RubyPlugin ; import org . rubypeople . rdt . internal . ui . search . RubySearchScopeFactory ; import org . rubypeople . rdt . internal . ui . util . ExceptionHandler ; class SelectWorkingSetAction extends Action { private final SearchScopeActionGroup fGroup ; public SelectWorkingSetAction ( SearchScopeActionGroup group ) { super ( CallHierarchyMessages . SearchScopeActionGroup_workingset_select_text ) ; this . fGroup = group ; setToolTipText ( CallHierarchyMessages . SearchScopeActionGroup_workingset_select_tooltip ) ; PlatformUI . | |
2,854 | <s> package org . rubypeople . rdt . internal . debug . ui ; import java . io . File ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . resources . IProject ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . Path ; import org . eclipse . debug . core . ILaunchConfiguration ; import org . eclipse . debug . core . model . IPersistableSourceLocator ; import org . eclipse . debug . core . model . IStackFrame ; import org . eclipse . debug . ui . ISourcePresentation ; import org . eclipse . ui . IEditorDescriptor ; import org . eclipse . ui . IEditorInput ; import org . eclipse . ui . PartInitException ; import org . eclipse . ui . ide . IDE ; import org . eclipse . ui . part . FileEditorInput ; import org . rubypeople . rdt . debug . core . RdtDebugCorePlugin ; import org . rubypeople . rdt . debug . core . model . IRubyStackFrame ; import org . rubypeople . rdt . internal . ui . rubyeditor . ExternalRubyFileEditorInput ; import org . rubypeople . rdt . launching . IRubyLaunchConfigurationConstants ; import org . rubypeople . rdt . ui . RubyUI ; public class RubySourceLocator implements IPersistableSourceLocator , ISourcePresentation { private String absoluteWorkingDirectory ; private String projectName ; public RubySourceLocator ( ) { } public String getAbsoluteWorkingDirectory ( ) { return absoluteWorkingDirectory ; } public String getMemento ( ) throws CoreException { return null ; } public void initializeFromMemento ( String memento ) throws CoreException { } public void initializeDefaults ( ILaunchConfiguration configuration ) throws CoreException { this . absoluteWorkingDirectory = configuration . getAttribute ( IRubyLaunchConfigurationConstants . ATTR_WORKING_DIRECTORY , "" ) ; this . projectName = configuration . getAttribute ( IRubyLaunchConfigurationConstants . ATTR_PROJECT_NAME , "" ) ; } public Object getSourceElement ( IStackFrame stackFrame ) { return this . getSourceElement ( ( ( IRubyStackFrame ) stackFrame ) . getFileName ( ) ) ; } public Object getSourceElement ( String pFilename ) { return new SourceElement ( pFilename , this ) ; } public String getEditorId ( IEditorInput input , Object element ) { SourceElement sourceElement = ( SourceElement ) element ; try { IEditorDescriptor desc = IDE . getEditorDescriptor ( sourceElement . getFilename ( ) ) ; return desc . getId ( ) ; } catch ( PartInitException e ) { } return sourceElement . isExternal ( ) ? RubyUI . ID_EXTERNAL_EDITOR : RubyUI . ID_RUBY_EDITOR ; } public IEditorInput getEditorInput ( Object element ) { SourceElement sourceElement = ( SourceElement ) element ; if ( ! sourceElement . isExternal ( ) ) { return new FileEditorInput ( sourceElement . getWorkspaceFile ( ) ) ; } File filesystemFile = new File ( sourceElement . getFilename ( ) ) ; if ( filesystemFile . exists ( ) ) { return new ExternalRubyFileEditorInput ( filesystemFile ) ; } RdtDebugCorePlugin . log ( IStatus . INFO , RdtDebugUiMessages . getFormattedString ( RdtDebugUiMessages . RdtDebugUiPlugin_couldNotOpenFile , sourceElement . getFilename ( ) ) ) ; return null ; } public class SourceElement { private String filename ; private IFile workspaceFile ; private RubySourceLocator sourceLocator ; public SourceElement ( String aFilename , RubySourceLocator pSourceLocator ) { filename = aFilename ; this . sourceLocator = pSourceLocator ; init ( ) ; } private void init ( ) { setFileName ( ) ; grabWorkspaceFile ( ) ; } private void setFileName ( ) { if ( filename == null ) return ; if ( filename . startsWith ( "./" ) ) { filename = filename . substring ( 2 ) ; } if ( sourceLocator . getAbsoluteWorkingDirectory ( ) != null && sourceLocator . getAbsoluteWorkingDirectory ( ) . trim ( ) . length ( ) > 0 ) { String relativeToWorkingDir = sourceLocator . getAbsoluteWorkingDirectory ( ) + "/" + filename ; File file = new File ( relativeToWorkingDir ) ; if ( file . exists ( ) && ! file . isDirectory ( ) ) { filename = relativeToWorkingDir ; return ; } } if ( projectName != null && projectName . trim ( ) . length ( ) > 0 ) { IProject project = getProject ( ) ; String relativeToProject = project . getLocation ( ) . toOSString ( ) + filename . substring ( 1 ) ; File file = new File ( relativeToProject ) ; if ( file . exists ( ) && ! file . | |
2,855 | <s> package net . sf . sveditor . core . db ; import net . sf . sveditor . core . db . attr . SVDBDoNotSaveAttr ; public class SVDBItemBase implements ISVDBItemBase { @ SVDBDoNotSaveAttr public SVDBItemType fType ; public SVDBLocation fLocation ; public SVDBItemBase ( SVDBItemType type ) { fType = type ; fLocation = null ; } public SVDBItemType getType ( ) { return fType ; } public void setType ( SVDBItemType type ) { fType = type ; } public SVDBLocation getLocation ( ) { return fLocation ; } public void setLocation ( SVDBLocation location ) { fLocation = location ; } public ISVDBItemBase duplicate ( ) { return SVDBItemUtils . duplicate ( this ) ; } public void init ( | |
2,856 | <s> package net . sf . sveditor . core . tests ; import java . io . FileInputStream ; import java . io . IOException ; import java . io . InputStream ; import net . sf . sveditor . core . SVCorePlugin ; import net . sf . sveditor . core . db . index . ISVDBIndex ; import net . sf . sveditor . core . db . index . SVDBFileTree ; import net . sf . sveditor . core . db . index . SVDBIndexRegistry ; import net . sf . sveditor . core . db . index . SVDBSourceCollectionIndexFactory ; import net . sf . sveditor . core . log . LogFactory ; import net . sf . sveditor . core . log . LogHandle ; import net . sf . sveditor . core . preproc | |
2,857 | <s> package net . sf . sveditor . core . db . index ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import net . sf . sveditor . core . db . refs . SVDBRefCacheEntry ; public class SVDBBaseIndexCacheData { public String fVersion ; public String fBaseLocation ; public List < String > fIncludePathList ; public List < String > fMissingIncludeFiles ; public Map < String , String > fGlobalDefines ; public Map < String , String > fDefineMap ; public Map < String , List < SVDBDeclCacheItem > > fDeclCacheMap ; public Map < String , List < SVDBDeclCacheItem > > fPackageCacheMap ; public Map < String , SVDBRefCacheEntry > fReferenceCacheMap ; public SVDBBaseIndexCacheData ( String base ) { fBaseLocation = base ; fIncludePathList = new ArrayList < String > ( ) ; fMissingIncludeFiles = new ArrayList < String > ( ) ; fGlobalDefines = new HashMap < String , String > ( ) ; fDefineMap = new HashMap < String , String > ( ) ; fDeclCacheMap = new HashMap < String , List < SVDBDeclCacheItem > > ( ) ; fPackageCacheMap = new HashMap < String , List < SVDBDeclCacheItem > > ( ) ; fReferenceCacheMap = new HashMap < String , SVDBRefCacheEntry > ( ) ; } public String getVersion ( ) { return fVersion ; } public void setVersion ( String version ) { fVersion = version ; } public String getBaseLocation ( ) { return fBaseLocation ; } public void addMissingIncludeFile ( String path ) { if ( ! fMissingIncludeFiles . contains ( path ) ) { fMissingIncludeFiles . add ( path ) ; } } public void clearMissingIncludeFiles ( ) { fMissingIncludeFiles . clear ( ) ; } public List < String > getMissingIncludeFiles ( ) { return fMissingIncludeFiles ; } public void setGlobalDefine ( String key , String val ) { if ( fGlobalDefines . containsKey ( key ) ) { fGlobalDefines . remove ( key ) ; } fGlobalDefines . put ( key , val ) ; } public Map < String , String > getGlobalDefines ( ) { return fGlobalDefines ; } public void clearGlobalDefines ( ) { fGlobalDefines . clear ( ) ; } public void clearDefines ( ) { fDefineMap . clear ( ) ; fDefineMap . putAll ( fGlobalDefines ) ; } public void addDefine ( String key , String val ) { if ( fDefineMap . containsKey ( key ) ) { fDefineMap . remove ( key ) ; } fDefineMap . put ( key , val ) ; } public | |
2,858 | <s> package org . rubypeople . rdt . refactoring . core ; import java . util . ArrayList ; import java . util . Collection ; import org . jruby . ast . AttrAssignNode ; import org . jruby . ast . BlockNode ; import org . jruby . ast . CallNode ; import org . jruby . ast . ClassNode ; import org . jruby . ast . ClassVarAsgnNode ; import org . jruby . ast . ClassVarNode ; import org . jruby . ast . DAsgnNode ; import org . jruby . ast . DVarNode ; import org . jruby . ast . GlobalAsgnNode ; import org . jruby . ast . GlobalVarNode ; import org . jruby . ast . InstAsgnNode ; import org . jruby . ast . InstVarNode ; import org . jruby . ast . IterNode ; import org . jruby . ast . LocalAsgnNode ; import org . jruby . ast . LocalVarNode ; import org . jruby . ast . MethodDefNode ; import org . jruby . ast . ModuleNode ; import org . jruby . ast . NewlineNode ; import org . jruby . ast . NilImplicitNode ; import org . jruby . ast . Node ; import org . jruby . ast . RootNode ; import org . jruby . ast . types . INameNode ; import org . jruby . lexer . yacc . ISourcePosition ; import org . rubypeople . rdt . refactoring . exception . NoClassNodeException ; import org . rubypeople . rdt . refactoring . nodewrapper . AttrAccessorNodeWrapper ; import org . rubypeople . rdt . refactoring . nodewrapper . ClassNodeWrapper ; import org . rubypeople . rdt . refactoring . nodewrapper . INodeWrapper ; import org . rubypeople . rdt . refactoring . nodewrapper . PartialClassNodeWrapper ; import org . rubypeople . rdt . refactoring . util . NodeUtil ; public class SelectionNodeProvider { public static Node getEnclosingScope ( Node rootNode , Node from ) { return getEnclosingScope ( rootNode , from . getPosition ( ) . getStartOffset ( ) ) ; } public static Node getEnclosingScope ( Node rootNode , int where ) { return SelectionNodeProvider . getSelectedNodeOfType ( rootNode , where , MethodDefNode . class , ClassNode . class , RootNode . class , IterNode . class ) ; } public static Node getSelectedNodes ( Node rootNode , IRefactoringContext selection ) { Node enclosingNode = getEnclosingNode ( rootNode , selection , Node . class ) ; if ( enclosingNode == null ) return null ; BlockNode enclosingBlockNode = ( BlockNode ) getEnclosingNode ( rootNode , selection , BlockNode . class ) ; if ( enclosingBlockNode == null ) { return enclosingNode ; } Collection < Node > blockChildren = NodeProvider . getChildren ( enclosingBlockNode ) ; Node beginNode = getSelectedNodeOfType ( enclosingBlockNode , selection . getStartOffset ( ) , Node . class ) ; Node beginBlockChildNode = getEnclosingNode ( beginNode , blockChildren ) ; Node endNode = getSelectedNodeOfType ( enclosingBlockNode , selection . getEndOffset ( ) , Node . class ) ; Node endBlockChildNode = getEnclosingNode ( endNode , blockChildren ) ; Collection < Node > selectedNodes = getNodesFromTo ( beginBlockChildNode , endBlockChildNode , blockChildren ) ; if ( isNodeContainedInNode ( selectedNodes . toArray ( new Node [ selectedNodes . size ( ) ] ) [ 0 ] , enclosingNode ) ) { BlockNode blockAroundSelected = NodeFactory . createBlockNode ( selectedNodes . toArray ( new Node [ 0 ] ) ) ; blockAroundSelected . setPosition ( NodeFactory . unionPositions ( NodeProvider . unwrap ( beginBlockChildNode ) . getPosition ( ) , NodeProvider . unwrap ( endBlockChildNode ) . getPosition ( ) ) ) ; return blockAroundSelected ; } else if ( beginNode . equals ( endNode ) ) { return beginNode ; } return enclosingNode ; } public static boolean isNodeContainedInNode ( Node containedNode , Node containingNode ) { return ( nodeContainsPosition ( containingNode , containedNode . getPosition ( ) . getStartOffset ( ) ) && nodeContainsPosition ( containingNode , containedNode . getPosition ( ) . getEndOffset ( ) ) ) ; } private static Collection < Node > getNodesFromTo ( Node beginNode , Node endNode , Collection < Node > allNodes ) { Collection < Node > affectedNodes = new ArrayList < Node > ( ) ; boolean between = false ; for ( Node aktNode : allNodes ) { if ( aktNode . equals ( beginNode ) ) between = true ; if ( between ) { affectedNodes . add ( aktNode ) ; } if ( aktNode . equals ( endNode ) ) between = false ; } return affectedNodes ; } private static Node getEnclosingNode ( Node enclosedNode , Collection < Node > possibleEnclosingNodes ) { for ( Node aktNode : possibleEnclosingNodes ) { if ( nodeEnclosesNode ( aktNode , enclosedNode ) ) return aktNode ; } return null ; } public static boolean nodeEnclosesNode ( Node enclosingNode , Node enclosedNode ) { ISourcePosition enclosingPos = enclosingNode . getPosition ( ) ; ISourcePosition enclosedPos = enclosedNode . getPosition ( ) ; return ( enclosingPos . getStartOffset ( ) <= enclosedPos . getStartOffset ( ) && enclosingPos . getEndOffset ( ) >= enclosedPos . getEndOffset ( ) ) ; } public static Node getEnclosingNode ( Node rootNode , IRefactoringContext selection , Class ... classes ) { Collection < Node > enclosingNodes = getEnclosingNodes ( rootNode , selection , classes ) ; Node lastNode = null ; Node secondLastNode = null ; Node thirdLastNode = null ; for ( Node aktNode : enclosingNodes ) { thirdLastNode = secondLastNode ; secondLastNode = lastNode ; lastNode = aktNode ; } if ( thirdLastNode != null && sameStartPosAndIsVariableNode ( thirdLastNode , lastNode ) && hasSamePosAndIsSelfAsignment ( secondLastNode , thirdLastNode ) ) { return thirdLastNode ; } if ( secondLastNode != null && hasSamePosAndIsSelfAsignment ( lastNode , secondLastNode ) ) { return secondLastNode ; } return lastNode ; } private static boolean sameStartPosAndIsVariableNode ( Node firstNode , Node secondNode ) { Class [ ] classes = { LocalAsgnNode . class , LocalVarNode . class , DAsgnNode . class , DVarNode . class , InstAsgnNode . class , InstVarNode . class , ClassVarAsgnNode . class , ClassVarNode . class , GlobalAsgnNode . class , GlobalVarNode . class } ; boolean sameStart = firstNode . getPosition ( ) . getStartOffset ( ) == secondNode . getPosition ( ) . getStartOffset ( ) ; boolean isFirstNodeVarNode = NodeUtil . nodeAssignableFrom ( firstNode , classes ) ; boolean isSecondNodeVarNode = NodeUtil . nodeAssignableFrom ( secondNode , classes ) ; return sameStart && isFirstNodeVarNode && isSecondNodeVarNode ; } private static boolean hasSamePosAndIsSelfAsignment ( Node probablyCallNode , Node probablyAsgnNode ) { boolean sameStart = probablyCallNode . getPosition ( ) . getStartOffset ( ) == probablyAsgnNode . getPosition ( ) . getStartOffset ( ) ; boolean sameEnd = probablyCallNode . getPosition ( ) . getEndOffset ( ) == probablyAsgnNode . getPosition ( ) . getEndOffset ( ) ; boolean isAsgnNode = NodeUtil . nodeAssignableFrom ( probablyAsgnNode , LocalAsgnNode . class , DAsgnNode . class , InstAsgnNode . class , ClassVarAsgnNode . class ) ; boolean isCallNode = NodeUtil . nodeAssignableFrom ( probablyCallNode , CallNode . class , AttrAssignNode . class ) ; return sameStart && sameEnd && isCallNode && isAsgnNode ; } public static Collection < Node > getEnclosingNodes ( Node rootNode , IRefactoringContext selection , Class ... classes ) { Collection < Node > allNodes = NodeProvider . getAllNodes ( rootNode ) ; Collection < Node > enclosingStartNodes = getSelectedNodesOfType ( allNodes , selection . getStartOffset ( ) , classes ) ; Collection < Node > enclosingNodes = new ArrayList < Node > ( ) ; for ( Node aktNode : enclosingStartNodes ) { if ( nodeContainsPosition ( aktNode , selection . getEndOffset ( ) ) ) { enclosingNodes . add ( aktNode ) ; } else { break ; } } return enclosingNodes ; } public static Node getSelectedNodeOfType ( Node baseNode , int position , Class ... klasses ) { return getSelectedNodeOfType ( NodeProvider . getAllNodes ( baseNode ) , position , klasses ) ; } public static Node getSelectedNodeOfType ( Collection < ? extends Node > nodes , int position , Class ... klasses ) { return returnLast ( getSelectedNodesOfType ( nodes , position , klasses ) ) ; } private static Node returnLast ( Collection < Node > candidates ) { if ( candidates . size ( ) <= 0 ) return null ; Node candidate = candidates . toArray ( new Node [ candidates . size ( ) ] ) [ 0 ] ; for ( Node node : candidates ) { if ( node . getPosition ( ) . getEndOffset ( ) <= candidate . getPosition ( ) . getEndOffset ( ) ) { | |
2,859 | <s> package com . aptana . rdt . ui . gems ; import java . util . Collections ; import java . util . Set ; import java . util . TreeSet ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . jobs . Job ; import org . eclipse . jface . action . ActionContributionItem ; import org . eclipse . jface . action . IContributionItem ; import org . eclipse . jface . action . IMenuListener ; import org . eclipse . jface . action . IMenuManager ; import org . eclipse . jface . action . MenuManager ; import org . eclipse . jface . action . Separator ; import org . eclipse . jface . dialogs . MessageDialog ; import org . eclipse . jface . viewers . TableViewer ; import org . eclipse . swt . SWT ; import org . eclipse . swt . events . KeyEvent ; import org . eclipse . swt . events . KeyListener ; import org . eclipse . swt . layout . GridData ; import org . eclipse . swt . layout . GridLayout ; import org . eclipse . swt . widgets . Composite ; import org . eclipse . swt . widgets . Display ; import org . eclipse . swt . widgets . Menu ; import org . eclipse . swt . widgets . Table ; import org . eclipse . swt . widgets . TableColumn ; import org . eclipse . swt . widgets . TableItem ; import org . eclipse . ui . IActionBars ; import org . eclipse . ui . IWorkbenchActionConstants ; import org . eclipse . ui . part . ViewPart ; import org . rubypeople . rdt . internal . ui . util . CollectionContentProvider ; import org . rubypeople . rdt . ui . TableViewerSorter ; import com . aptana . rdt . AptanaRDTPlugin ; import com . aptana . rdt . core . gems . Gem ; import com . aptana . rdt . core . gems . GemListener ; import com . aptana . rdt . core . gems . IGemManager ; public class GemsView extends ViewPart implements GemListener { private TableViewer gemViewer ; private GemManagerSelectionAction gemManagerSelectionAction ; private IGemManager gemManager ; @ Override public void createPartControl ( Composite parent ) { parent . setLayout ( new GridLayout ( ) ) ; gemViewer = new TableViewer ( parent , SWT . SINGLE | SWT . FULL_SELECTION ) ; final Table gemTable = gemViewer . getTable ( ) ; gemTable . setHeaderVisible ( true ) ; gemTable . setLinesVisible ( true ) ; gemTable . setLayoutData ( new GridData ( GridData . FILL_BOTH ) ) ; gemTable . addKeyListener ( new KeyListener ( ) { public void keyReleased ( KeyEvent e ) { } public void keyPressed ( KeyEvent e ) { if ( e . keyCode == SWT . DEL ) { TableItem item = gemTable . getItem ( gemTable . getSelectionIndex ( ) ) ; final Gem gem = ( Gem ) item . getData ( ) ; if ( MessageDialog . openConfirm ( gemTable . getShell ( ) , null , GemsMessages . bind ( GemsMessages . RemoveGemDialog_msg , gem . getName ( ) ) ) ) { Job job = null ; if ( gem . hasMultipleVersions ( ) ) { | |
2,860 | <s> package com . asakusafw . dmdl . thundergate . model ; import java . util . Set ; import com . asakusafw . utils . collections . Sets ; public class Source { private Aggregator aggregator ; private ModelReference declaring ; private String name ; private PropertyType type ; private Set < Attribute > attributes ; public Source ( Aggregator aggregator , ModelReference declaring , String name , PropertyType type , Set < Attribute > attributes ) { this . aggregator = aggregator ; this . declaring = declaring ; this . name = name ; this . type = type ; this . attributes = Sets . freeze ( attributes ) ; } public Aggregator getAggregator ( ) { return aggregator ; } public ModelReference getDeclaring ( ) { return declaring ; } public String getName ( ) { return name ; } public PropertyType getType ( ) { return type ; } public Set < Attribute > getAttributes ( ) { return attributes ; } @ Override public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = prime * result + aggregator . hashCode ( ) ; result = prime * result + attributes . hashCode ( ) ; result = prime * result + declaring . hashCode ( ) ; result = prime * result + name . hashCode ( ) ; result = prime * result + type . hashCode ( ) ; return result ; } @ Override public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return | |
2,861 | <s> package com . loiane . model ; public class Tag { private int id ; private String value ; public int getId ( ) { return id ; } public void setId ( int id ) { this . id = id ; } public String getValue ( ) { return value ; } public void setValue ( String value ) { this . value = value ; } public String toString ( ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( "Tag: id = | |
2,862 | <s> package com . pogofish . jadt . samples . ast . data ; import java . util . List ; public final class Function { public static final Function _Function ( Type returnType , String name , List < Arg > args , List < Statement > statements ) { return new Function ( returnType , name , args , statements ) ; } public final Type returnType ; public final String name ; public List < Arg > args ; public final List < Statement > statements ; public Function ( Type returnType , String name , List < Arg > args , List < Statement > statements ) { this . returnType = returnType ; this . name = name ; this . args = args ; this . statements = statements ; } @ Override public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = prime * result + ( ( returnType == null ) ? 0 : returnType . hashCode ( ) ) ; result = prime * result + ( ( name == null ) ? 0 : name . hashCode ( ) ) ; result = prime * result + ( ( args == null ) ? 0 : args . hashCode ( ) ) ; result = prime * result + ( ( statements == null ) ? 0 : statements . hashCode ( ) ) ; return result ; } @ Override public boolean equals ( Object obj ) { if ( this == obj ) return true ; if ( obj == null ) return false ; if ( getClass ( ) != obj . getClass ( ) ) return false ; Function other = ( Function ) obj ; if ( returnType == null ) { if ( other . returnType != null ) return false ; } else if ( ! returnType . equals ( other . returnType ) ) return false ; if ( name == null ) { if ( other . name != null ) return false ; } else if ( ! name . equals ( other . name ) ) return false ; | |
2,863 | <s> package org . rubypeople . rdt . internal . ui ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . Preferences ; import org . eclipse . core . runtime . Status ; import org . eclipse . jface . wizard . WizardDialog ; import org . eclipse . ui . IWorkbench ; import org . eclipse . ui . PlatformUI ; import org . eclipse . ui . progress . UIJob ; import org . rubypeople . rdt . internal . launching . LaunchingPlugin ; import org . rubypeople . rdt . internal . ui . wizards . InstallStandardRubyWizard ; import org . rubypeople . rdt . launching . IRubyLaunchConfigurationConstants ; import org . rubypeople . rdt . launching . IVMInstall ; import org . rubypeople . rdt . launching . RubyRuntime ; public class RubyInstalledDetector extends UIJob { private static boolean fgFinished ; public RubyInstalledDetector ( ) { super ( "" ) ; } private boolean usingIncludedJRuby ( ) { Preferences store = LaunchingPlugin . getDefault ( ) . getPluginPreferences ( ) ; if ( store == null ) return false ; return store . getBoolean ( LaunchingPlugin . USING_INCLUDED_JRUBY ) ; } private boolean rubyInstalled ( ) { return | |
2,864 | <s> package org . rubypeople . rdt . internal . core . index ; import org . rubypeople . rdt . internal . compiler . util . HashtableOfObject ; import org . rubypeople . rdt . internal . compiler . util . SimpleSet ; import org . rubypeople . rdt . internal . core . util . CharOperation ; public class EntryResult { private char [ ] word ; private HashtableOfObject [ ] documentTables ; private SimpleSet documentNames ; public EntryResult ( char [ ] word , HashtableOfObject table ) { this . word = word ; if ( table != null ) this . documentTables = new HashtableOfObject [ ] { table } ; } public void addDocumentName ( String documentName ) { if ( this . documentNames == null ) this . documentNames = new SimpleSet ( 3 ) ; this . documentNames . add ( documentName ) ; } public void addDocumentTable ( HashtableOfObject table ) { if ( this . documentTables != null ) { int length = this | |
2,865 | <s> package com . asakusafw . vocabulary . flow . graph ; import java . util . HashMap ; import java . util . Map ; import java . util . NoSuchElementException ; import com . asakusafw . vocabulary . flow . Source ; public class FlowElementResolver { private final FlowElement element ; private final Map < String , FlowElementInput > inputPorts ; private final Map < String , FlowElementOutput > outputPorts ; public FlowElementResolver ( FlowElement element ) { if ( element == null ) { throw new IllegalArgumentException ( "" ) ; } this . element = element ; this . inputPorts = new HashMap < String , FlowElementInput > ( ) ; this . outputPorts = new HashMap < String , FlowElementOutput > ( ) ; for ( FlowElementInput input : element . getInputPorts ( ) ) { inputPorts . put ( input . getDescription ( ) . getName ( ) , input ) ; } for ( FlowElementOutput | |
2,866 | <s> package net . sf . sveditor . ui . pref ; import net . sf . sveditor . ui . SVUiPlugin ; import org . eclipse . jface . preference . BooleanFieldEditor ; import org . eclipse | |
2,867 | <s> package org . oddjob . jmx . server ; import java . util . ArrayList ; import java . util . List ; import javax . management . JMException ; import javax . management . MBeanServer ; import javax . management . MBeanServerFactory ; import javax . management . Notification ; import javax . management . NotificationListener ; import javax . management . ObjectName ; import junit . framework . TestCase ; import org . apache . commons . beanutils . DynaClass ; import org . apache . commons . beanutils . DynaProperty ; import org . apache . log4j . Level ; import org . apache . log4j . Logger ; import org . oddjob . Helper ; import org . oddjob . MockStateful ; import org . oddjob . Structural ; import org . oddjob . arooa . ArooaSession ; import org . oddjob . arooa . registry . MockBeanRegistry ; import org . oddjob . arooa . registry . ServerId ; import org . oddjob . arooa . standard . StandardArooaSession ; import org . oddjob . jmx . SharedConstants ; import org . oddjob . jmx . handlers . StatefulHandlerFactory ; import org . oddjob . jmx . handlers . StructuralHandlerFactory ; import org . oddjob . logging . LogEnabled ; import org . oddjob . logging . LogEvent ; import org . oddjob . state . JobState ; import org . oddjob . state . StateEvent ; import org . oddjob . state . StateListener ; import org . oddjob . structural . StructuralEvent ; import org . oddjob . structural . StructuralListener ; import org . oddjob . util . MockThreadManager ; public class OddjobMBeanTest extends TestCase { private static final Logger logger = Logger . getLogger ( OddjobMBeanTest . class ) ; private ServerModel sm ; private int unique ; private class OurHierarchicalRegistry extends MockBeanRegistry { @ Override public String getIdFor ( Object component ) { assertNotNull ( component ) ; return "x" + unique ++ ; } } public void setUp ( ) { logger . debug ( "" + getName ( ) + "" ) ; ServerInterfaceManagerFactoryImpl imf = new ServerInterfaceManagerFactoryImpl ( ) ; imf . addServerHandlerFactories ( new ResourceFactoryProvider ( new StandardArooaSession ( ) ) . getHandlerFactories ( ) ) ; sm = new ServerModelImpl ( new ServerId ( "//test" ) , new MockThreadManager ( ) , imf ) ; } private class OurServerSession extends MockServerSession { ArooaSession session = new StandardArooaSession ( ) ; @ Override public ObjectName nameFor ( Object object ) { return OddjobMBeanFactory . objectName ( 0 ) ; } @ Override public ArooaSession getArooaSession ( ) { return session ; } } public void testRegister ( ) throws Exception { Runnable myJob = new Runnable ( ) { public void run ( ) { } } ; ServerContext serverContext = new ServerContextImpl ( myJob , sm , new OurHierarchicalRegistry ( ) ) ; OddjobMBean ojmb = new OddjobMBean ( myJob , new OurServerSession ( ) , serverContext ) ; ObjectName on = new ObjectName ( "" ) ; MBeanServer mbs = MBeanServerFactory . createMBeanServer ( ) ; mbs . registerMBean ( ojmb , on ) ; assertTrue ( mbs . isRegistered ( on ) ) ; mbs . unregisterMBean ( on ) ; } public void testNotifyState ( ) throws Exception { class MyStateful extends MockStateful { StateListener jsl ; public void addStateListener ( StateListener listener ) { jsl = listener ; listener . jobStateChange ( new StateEvent ( this , JobState . READY , null ) ) ; } public void removeStateListener ( StateListener listener ) { } public void foo ( ) { jsl . jobStateChange ( new StateEvent ( this , JobState . COMPLETE , null ) ) ; } } ; MyStateful myJob = new MyStateful ( ) ; MyNotLis myNotLis = new MyNotLis ( ) ; ServerContext serverContext = new ServerContextImpl ( myJob , sm , new OurHierarchicalRegistry ( ) ) ; OddjobMBean ojmb = new OddjobMBean ( myJob , new OurServerSession ( ) , serverContext ) ; ObjectName on = OddjobMBeanFactory . objectName ( 0 ) ; MBeanServer mbs = MBeanServerFactory . createMBeanServer ( ) ; mbs . registerMBean ( ojmb , on ) ; mbs . addNotificationListener ( on , myNotLis , null , null ) ; assertEquals ( "number" , 0 , myNotLis . getNum ( ) ) ; myJob . foo ( ) ; assertEquals ( "number" , 1 , myNotLis . getNum ( ) ) ; assertEquals ( "source" , on , myNotLis . getNotification ( 0 ) . | |
2,868 | <s> package $ { package } . jobflow ; import $ { package } . modelgen . table . model . CategorySummary ; import $ { package } . modelgen . table . model . ErrorRecord ; import $ { package } . modelgen . table . model . ItemInfo ; import $ { package } . modelgen . table . model . SalesDetail ; import $ { package } . modelgen . table . model . StoreInfo ; import $ { package } . operator . CategorySummaryOperatorFactory ; import $ { package } . operator . CategorySummaryOperatorFactory . CheckStore ; import $ { package } . operator . CategorySummaryOperatorFactory . JoinItemInfo ; import $ { package } . operator . CategorySummaryOperatorFactory . SetErrorMessage ; import $ { package } . operator . CategorySummaryOperatorFactory . SummarizeByCategory ; import com . asakusafw . vocabulary . flow . Export ; import com . asakusafw . vocabulary . flow . FlowDescription ; import com . asakusafw . vocabulary . flow . Import ; import com . asakusafw . vocabulary . flow . In ; import com . asakusafw . vocabulary . flow . JobFlow ; import com . asakusafw . vocabulary . flow . Out ; import com . asakusafw . vocabulary . flow . util . CoreOperatorFactory ; import com . asakusafw . vocabulary . flow . util . CoreOperatorFactory . Extend ; @ JobFlow ( name = "byCategory" ) public class CategorySummaryJob extends FlowDescription { final In < SalesDetail > salesDetail ; final In < StoreInfo > storeInfo ; final In < ItemInfo > itemInfo ; final Out < CategorySummary > categorySummary ; final Out < ErrorRecord > errorRecord ; public CategorySummaryJob ( @ Import ( name = "salesDetail" , description = SalesDetailFromJdbc . class ) In < SalesDetail > salesDetail , @ Import ( name = "storeInfo" , description = StoreInfoFromJdbc . class ) In < StoreInfo > storeInfo , @ Import ( name = "itemInfo" , description = ItemInfoFromJdbc . class ) In < ItemInfo > itemInfo , @ Export ( name = "" , description = CategorySummaryToJdbc . class ) Out < CategorySummary > categorySummary , @ Export ( name = "errorRecord" , description = | |
2,869 | <s> package com . asakusafw . bulkloader . importer ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . ByteArrayInputStream ; import java . io . File ; import java . io . FileOutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import java . util . Arrays ; import java . util . LinkedHashMap ; import java . util . List ; import java . util . Map ; import java . util . Properties ; import org . junit . After ; import org . junit . AfterClass ; import org . junit . Before ; import org . junit . BeforeClass ; import org . junit . Rule ; import org . junit . Test ; import org . junit . rules . TemporaryFolder ; import com . asakusafw . bulkloader . bean . ImportBean ; import com . asakusafw . bulkloader . bean . ImportTargetTableBean ; import com . asakusafw . bulkloader . common . BulkLoaderInitializer ; import com . asakusafw . bulkloader . common . ConfigurationLoader ; import com . asakusafw . bulkloader . common . Constants ; import com . asakusafw . bulkloader . common . FileCompType ; import com . asakusafw . bulkloader . testutil . UnitTestUtil ; import com . asakusafw . bulkloader . transfer . FileList ; import com . asakusafw . bulkloader . transfer . FileListProvider ; import com . asakusafw . bulkloader . transfer . StreamFileListProvider ; @ SuppressWarnings ( "deprecation" ) public class ImportFileSendTest { private static List < String > properties = Arrays . asList ( new String [ ] { "" } ) ; private static String testTargetName = "target1" ; private static String testBatchId = "batch01" ; private static String testJobflowId = "JOB_FLOW01" ; | |
2,870 | <s> package com . asakusafw . compiler . fileio . flow ; import com . asakusafw . compiler . fileio . model . Ex1 ; import com . asakusafw . vocabulary . external . FileExporterDescription ; public class RootOutputExporterDesc extends FileExporterDescription { @ Override public Class < ? > getModelType ( ) { return Ex1 . class ; } | |
2,871 | <s> package com . asakusafw . utils . collections ; import java . io . IOException ; import java . io . ObjectInputStream ; import java . io . ObjectOutputStream ; import java . io . Serializable ; import java . util . ArrayList ; import java . util . Collection ; import java . util . Iterator ; import java . util . List ; import java . util . ListIterator ; import java . util . NoSuchElementException ; public class SingleLinkedList < E > implements Iterable < E > , Serializable { private static final long serialVersionUID = 1L ; private transient Node < E > head ; public SingleLinkedList ( ) { head = null ; } public SingleLinkedList ( List < ? extends E > list ) { if ( list == null ) { throw new IllegalArgumentException ( "" ) ; } head = restoreFromList ( list ) ; } public SingleLinkedList ( Iterable < ? extends E > iterable ) { if ( iterable == null ) { throw new IllegalArgumentException ( "" ) ; } head = restoreFromList ( Lists . from ( iterable ) ) ; } private SingleLinkedList ( Node < E > head ) { this . head = head ; } public boolean isEmpty ( ) { return head == null ; } public int size ( ) { int size = 0 ; for ( Node < E > node = head ; node != null ; node = node . next ) { size ++ ; } return size ; } public SingleLinkedList < E > concat ( E element ) { Node < E > next = new Node < E > ( element , head ) ; return new SingleLinkedList < E > ( next ) ; } public E first ( ) { if ( isEmpty ( ) ) { throw new NoSuchElementException ( ) ; } return head . value ; } public SingleLinkedList < E > rest ( ) { if ( isEmpty ( ) ) { throw new NoSuchElementException ( ) ; } return new SingleLinkedList < E > ( head . next ) ; } public E get ( int index ) { if ( index < 0 ) { throw new IndexOutOfBoundsException ( ) ; } Node < E > node = head ; for ( int i = 0 ; i < index && node != null ; i ++ ) { node = node . next ; } if ( node == null ) { throw new IndexOutOfBoundsException ( ) ; } return node . value ; } @ Override public Iterator < E > iterator ( ) { return new NodeIterator < E > ( head ) ; } public < C extends Collection < ? super E > > C fill ( C target ) { if ( target == null ) { throw new IllegalArgumentException ( "" ) ; } for ( Node < E > node = head ; node != null ; node = node . next ) { target . add ( node . value ) ; } return target ; } @ Override public int hashCode ( ) { final int prime = 31 ; int result = 1 ; for ( Node < E > node = head ; node != null ; node = node . next ) { result = prime * result + ( node . value == null ? 0 : node . value . hashCode ( ) ) ; } return result ; } @ Override public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } SingleLinkedList < ? > other = ( SingleLinkedList < ? > ) obj ; Node | |
2,872 | <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 . rubypeople . rdt . refactoring . core . splitlocal . LocalVarFinder ; import org . rubypeople . rdt . refactoring . core . splitlocal . LocalVarUsage ; import org . rubypeople . rdt . refactoring . tests . FileTestData ; public class TC_LocalVarFinder extends TestCase { private Collection < LocalVarUsage > find ( String name , int pos ) throws FileNotFoundException , IOException { LocalVarFinder finder = new LocalVarFinder ( ) ; Collection < LocalVarUsage > variables = finder . findLocalUsages ( new FileTestData ( name , "" , "" ) , pos ) ; return variables ; } public void testFindLocalUsages_1 ( ) throws FileNotFoundException , IOException { Collection < LocalVarUsage > variables = find ( "" , 0 ) ; assertNotNull ( variables ) ; assertEquals ( 1 , variables . size ( ) ) ; LocalVarUsage found = ( LocalVarUsage ) variables . toArray ( ) [ 0 ] ; assertNotNull ( found . getNode ( ) ) ; assertEquals ( "a" , found . getName ( ) ) ; assertEquals ( 0 , found . getFromPosition ( ) ) ; assertEquals ( 12 , found . getToPosition ( ) ) ; } public void testFindLocalUsages_2 ( ) throws FileNotFoundException , IOException { Collection < LocalVarUsage > variables = find ( "" , 0 ) ; assertNotNull ( variables ) ; assertEquals ( 2 , variables . size ( ) ) ; LocalVarUsage found = ( LocalVarUsage ) variables . toArray ( ) [ 0 ] ; assertNotNull ( found . getNode ( ) ) ; assertEquals ( "a" , found . getName ( ) ) ; assertEquals ( 0 , found . getFromPosition ( ) ) ; assertEquals ( 12 , found . getToPosition ( ) ) ; found = ( LocalVarUsage ) variables . toArray ( ) [ 1 ] ; assertNotNull ( found . getNode ( ) ) ; assertEquals ( "a" , found . getName ( ) ) ; assertEquals ( 13 , found . getFromPosition ( ) ) ; assertEquals ( 25 , found . getToPosition ( ) ) ; } public void testFindLocalUsages_3 ( ) throws FileNotFoundException , IOException { Collection < LocalVarUsage > variables = find ( "" , 0 ) ; assertNotNull ( variables ) ; assertEquals ( 2 , variables . size ( ) ) ; LocalVarUsage found = ( LocalVarUsage ) variables . toArray ( ) [ 0 ] ; assertNotNull ( found . getNode ( ) ) ; assertEquals ( "a" , found . getName ( ) ) ; assertEquals ( 0 , found . getFromPosition ( ) ) ; assertEquals ( 25 , found . getToPosition ( ) ) ; found = ( LocalVarUsage ) variables . toArray ( ) [ 1 ] ; assertNotNull ( found . getNode ( ) ) ; assertEquals ( "a" , found . getName ( ) ) ; assertEquals ( 26 , found . getFromPosition ( ) ) ; assertEquals ( 38 , found . getToPosition ( ) ) ; } public void testFindLocalUsages_4 ( ) throws FileNotFoundException , IOException { Collection < LocalVarUsage > variables = find ( "" , 14 ) ; assertNotNull ( variables ) ; assertEquals ( 1 , variables . size ( ) ) ; LocalVarUsage found = ( LocalVarUsage ) variables . toArray ( ) [ 0 ] ; assertNotNull ( found . getNode ( ) ) ; assertEquals ( "a" , found . getName ( ) ) ; assertEquals ( 14 , found . getFromPosition ( ) ) ; assertEquals ( 84 , found . getToPosition ( ) ) ; } public void testFindLocalUsages_5 ( ) throws FileNotFoundException , IOException { Collection < LocalVarUsage > variables = find ( "" , 14 ) ; assertNotNull ( variables ) ; assertEquals ( 1 , variables . size ( ) ) ; LocalVarUsage found = ( LocalVarUsage ) variables . toArray ( ) [ 0 ] ; assertNotNull ( found . getNode ( ) ) ; assertEquals ( "i" , found . getName ( ) ) ; assertEquals ( 14 , found . getFromPosition ( ) ) ; assertEquals ( 32 , found . getToPosition ( ) ) ; } public void testFindLocalUsages_6 ( ) throws FileNotFoundException , IOException { Collection < LocalVarUsage > variables = find ( "" , 14 ) ; assertNotNull ( variables ) ; assertEquals ( 2 , variables . size ( ) ) ; } public void testFindLocalUsages_7 ( ) throws FileNotFoundException , IOException { Collection < LocalVarUsage > variables = find ( "" , 14 ) ; assertNotNull ( variables ) ; | |
2,873 | <s> package org . oddjob . swing ; import java . util . Date ; import org . oddjob . Oddjob ; import org . oddjob . OddjobDescriptorFactory ; import org . oddjob . OddjobLookup ; import org . oddjob . Resetable ; import org . oddjob . arooa . ArooaParseException ; import org . oddjob . arooa . convert . ArooaConversionException ; import org . oddjob . arooa . reflect . ArooaPropertyException ; import org . oddjob . arooa . standard . StandardArooaSession ; import org . oddjob . arooa . xml . XMLConfiguration ; import org . oddjob . persist . MapPersister ; public class ConfigureBeanMain { public static class MyBean { private String name ; private Date dateOfBirth ; private double height ; public String getName ( ) { return name ; } public void setName ( String name ) { this . name = name ; } public Date getDateOfBirth ( ) { return dateOfBirth ; } public void setDateOfBirth ( Date dateOfBirth ) { this . dateOfBirth = dateOfBirth ; } public double getHeight ( ) { return height ; } public void setHeight ( double height ) { this . height = height ; } } public void simpleBeanOnly ( ) { ConfigureBeanJob job = new ConfigureBeanJob ( ) ; MyBean bean = new MyBean ( ) ; job . setBean ( bean ) ; job . setArooaSession ( new StandardArooaSession ( new OddjobDescriptorFactory ( ) . createDescriptor ( getClass ( ) . getClassLoader ( ) ) ) ) ; job . run ( ) ; System . out . println ( bean . getName ( ) ) ; System . out . println ( bean . getDateOfBirth ( ) ) ; System . out . println ( bean . getHeight ( ) ) ; } public void simpleInOddjob ( ) throws ArooaPropertyException , ArooaConversionException { String inner = "" + " <job>" + "" + "" + " <bean>" + "" + " </bean>" + " </class>" + " </job>" + "</oddjob>" ; String outer = "" + " <job>" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + | |
2,874 | <s> package com . asakusafw . utils . java . internal . parser . javadoc . ir ; import java . text . MessageFormat ; public class IrDocMethodParameter extends AbstractIrDocElement { private static final long serialVersionUID = 1L ; private IrDocType type ; private boolean variableArity ; private IrDocSimpleName name ; @ Override public IrDocElementKind getKind ( ) { return IrDocElementKind . METHOD_PARAMETER ; } public IrDocType getType ( ) { return this . type ; } public void setType ( IrDocType type ) { if ( type == null ) { throw new IllegalArgumentException ( "type" ) ; } this . type = type ; } public boolean isVariableArity ( ) { return this . variableArity ; } public void setVariableArity ( boolean variableArity ) { this . variableArity = variableArity ; } public IrDocSimpleName getName ( ) { return this . name ; } public void setName ( IrDocSimpleName name ) { this . name = name ; } @ Override public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = prime * result + ( ( name == null ) ? 0 : name . hashCode ( ) ) ; result = prime * result + ( ( type == null ) ? 0 : type . hashCode ( ) ) ; result = prime * result + ( variableArity ? 1231 : 1237 ) ; return result ; } @ Override public boolean equals ( Object obj ) { if ( this == obj ) { return true ; } if ( obj == null ) { return false ; } if ( getClass ( ) != obj . getClass ( ) ) { return false ; } final IrDocMethodParameter other = ( IrDocMethodParameter ) obj ; if ( name == null ) { if ( other . name != null ) { return false ; } } else if ( ! name . equals ( other . name ) ) { return false ; } if ( type == null ) { if ( other . type != null ) { return false ; } } else if ( ! type . equals ( other . type ) ) { return false ; } if ( variableArity != other . variableArity ) { return false ; } return true ; } @ Override public | |
2,875 | <s> package com . example . servletjspdemo . web ; import java . io . IOException ; import java . io . PrintWriter ; import javax . servlet . ServletException ; import javax . servlet . annotation . WebServlet ; import javax . servlet . | |
2,876 | <s> package org . rubypeople . rdt . internal . ui . filters ; import org . eclipse . jface . viewers . Viewer ; import org . eclipse . jface . viewers . ViewerFilter ; import org . | |
2,877 | <s> package org . oddjob . designer . components ; import java . io . File ; import junit . framework . TestCase ; import org . apache . log4j . Logger ; import org . oddjob . Helper ; import org . oddjob . Oddjob ; import org . oddjob . OddjobDescriptorFactory ; import org . oddjob . OddjobInheritance ; import org . oddjob . OurDirs ; 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 ; public class OddjobDCTest extends TestCase { private static final Logger logger = Logger . getLogger ( OddjobDCTest . class ) ; public void setUp ( ) { logger . debug ( "" + getName ( ) + "" ) ; } DesignInstance design ; public void testCreate ( ) throws ArooaParseException { OurDirs dirs = new OurDirs ( ) ; File testFile = dirs . relative ( "" ) ; String xml = "" + testFile . getPath ( ) + "" + "" + "" + " <values>" + "" + " </values>" + "" + "" + "" + "" + " <files>" + "" + " </files>" | |
2,878 | <s> package org . rubypeople . rdt . core ; import java . util . EventObject ; public class BufferChangedEvent extends EventObject { private int length ; private int offset ; private String text ; private static final long serialVersionUID = 655379473891745999L ; public BufferChangedEvent ( IBuffer buffer , int offset , int length , String text ) { super ( buffer ) ; this . offset = offset ; this . length = length ; this . text = text ; } public IBuffer getBuffer ( ) { return ( IBuffer ) | |
2,879 | <s> package com . asakusafw . compiler . flow . processor ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . IOException ; import java . util . Comparator ; import java . util . List ; import org . junit . Rule ; import org . junit . Test ; import com . asakusafw . compiler . flow . processor . flow . MasterBranchFlowSelection ; import com . asakusafw . compiler . flow . processor . flow . MasterBranchFlowSelectionWithParameter0 ; import com . asakusafw . compiler . flow . processor . flow . MasterBranchFlowSelectionWithParameter1 ; import com . asakusafw . compiler . flow . processor . flow . MasterBranchFlowSimple ; import com . asakusafw . compiler . flow . processor . flow . MasterBranchFlowWithParameter ; import com . asakusafw . compiler . flow . testing . model . Ex1 ; import com . asakusafw . compiler . flow . testing . model . Ex2 ; import com . asakusafw . compiler . util . tester . CompilerTester ; import com . asakusafw . compiler . util . tester . CompilerTester . TestInput ; import com . asakusafw . compiler . util . tester . CompilerTester . TestOutput ; import com . asakusafw . vocabulary . external . ImporterDescription . DataSize ; public class MasterBranchFlowProcessorTest { @ Rule public CompilerTester tester = new CompilerTester ( ) ; @ Test public void simple ( ) throws Exception { runEq ( DataSize . UNKNOWN ) ; } @ Test public void tiny ( ) throws Exception { runEq ( DataSize . TINY ) ; } private void runEq ( DataSize dataSize ) throws IOException { TestInput < Ex1 > in1 = tester . input ( Ex1 . class , "ex1" ) ; TestInput < Ex2 > in2 = tester . input ( Ex2 . class , "ex2" , dataSize ) ; TestOutput < Ex1 > high = tester . output ( Ex1 . class , "high" ) ; TestOutput < Ex1 > low = tester . output ( Ex1 . class , "low" ) ; TestOutput < Ex1 > stop = tester . output ( Ex1 . class , "stop" ) ; Ex1 ex1 = new Ex1 ( ) ; Ex2 ex2 = new Ex2 ( ) ; ex1 . setStringAsString ( "high" ) ; ex1 . setValue ( 11 ) ; ex2 . setStringAsString ( "high" ) ; ex2 . setValue ( 20 ) ; in1 . add ( ex1 ) ; in2 . add ( ex2 ) ; ex1 . setStringAsString ( "low" ) ; ex1 . setValue ( 50 ) ; ex2 . setStringAsString ( "low" ) ; ex2 . setValue ( - 20 ) ; in1 . add ( ex1 ) ; in2 . add ( ex2 ) ; ex1 . setStringAsString ( "0-stop" ) ; ex1 . setValue ( 10 ) ; ex2 . setStringAsString ( "0-stop" ) ; ex2 . setValue ( - 10 ) ; in1 . add ( ex1 ) ; in2 . add ( ex2 ) ; ex1 . setStringAsString ( "1-missing" ) ; ex1 . setValue ( 1000 ) ; ex2 . setStringAsString ( "2-missing" ) ; ex2 . setValue ( - 1 ) ; in1 . add ( ex1 ) ; in2 . add ( ex2 ) ; assertThat ( tester . runFlow ( new MasterBranchFlowSimple ( in1 . flow ( ) , in2 . flow ( ) , high . flow ( ) , low . flow ( ) , stop . flow ( ) ) ) , is ( true ) ) ; List < Ex1 > highList = high . toList ( ) ; List < Ex1 > lowList = low . toList ( ) ; List < Ex1 > stopList = stop . toList ( new Comparator < Ex1 > ( ) { @ Override public int compare ( Ex1 o1 , Ex1 o2 ) { return o1 . getStringOption ( ) . compareTo ( o2 . getStringOption ( ) ) ; } } ) ; assertThat ( highList . size ( ) , is ( 1 ) ) ; assertThat ( lowList . size ( ) , is ( 1 ) ) ; assertThat ( stopList . size ( ) , is ( 2 ) ) ; assertThat ( highList . get ( 0 ) . getStringAsString ( ) , is ( "high" ) ) ; assertThat ( lowList . get ( 0 ) . getStringAsString ( ) , is ( "low" ) ) ; assertThat ( stopList . get ( 0 ) . getStringAsString ( ) , is ( "0-stop" ) ) ; assertThat ( stopList . get ( 1 ) . getStringAsString ( ) , is ( "1-missing" ) ) ; } @ Test public void withParameter ( ) throws Exception { TestInput < Ex1 > in1 = tester . input ( Ex1 . class , "ex1" ) ; TestInput < Ex2 > in2 = tester . input ( Ex2 . class , "ex2" ) ; TestOutput < Ex1 > high = tester . output ( Ex1 . class , "high" ) ; TestOutput < Ex1 > low = tester . output ( Ex1 . class , "low" ) ; TestOutput < Ex1 > stop = tester . output ( Ex1 . class , "stop" ) ; Ex1 ex1 = new Ex1 ( ) ; Ex2 ex2 = new Ex2 ( ) ; ex1 . setStringAsString ( "high" ) ; ex1 . setValue ( 31 ) ; ex2 . setStringAsString ( "high" ) ; ex2 . setValue ( 20 ) ; in1 . add ( ex1 ) ; in2 . add ( ex2 ) ; ex1 . setStringAsString ( "low" ) ; ex1 . setValue ( 70 ) ; ex2 . setStringAsString ( "low" ) ; ex2 . setValue ( - 20 ) ; in1 . add ( ex1 ) ; in2 . add ( ex2 ) ; ex1 . setStringAsString ( "0-stop" ) ; ex1 . setValue ( 10 ) ; ex2 . setStringAsString ( "0-stop" ) ; ex2 . setValue ( - 10 ) ; in1 . add ( ex1 ) ; in2 . add ( ex2 ) ; ex1 . setStringAsString ( "1-missing" ) ; ex1 . setValue ( 1000 ) ; in1 . add ( ex1 ) ; assertThat ( tester . runFlow ( new MasterBranchFlowWithParameter ( in1 . flow ( ) , in2 . flow ( ) , high . flow ( ) , low . flow ( ) , stop . flow ( ) ) ) , is ( true ) ) ; List < Ex1 > highList = high . toList ( ) ; List < Ex1 > lowList = low . toList ( ) ; List < Ex1 > stopList = stop . toList ( new Comparator < Ex1 > ( ) { @ Override public int compare ( Ex1 o1 , Ex1 o2 ) { return o1 . getStringOption ( ) . compareTo ( o2 . getStringOption ( ) ) ; } } ) ; assertThat ( highList . size ( ) , is ( 1 ) ) ; assertThat ( lowList . size ( ) , is ( 1 ) ) ; assertThat ( stopList . size ( ) , is ( 2 ) ) ; assertThat ( highList . get ( 0 ) . getStringAsString ( ) , is ( "high" ) ) ; assertThat ( lowList . get ( 0 ) . getStringAsString ( ) , is ( "low" ) ) ; assertThat ( stopList . get ( 0 ) . getStringAsString ( ) , is ( "0-stop" ) ) ; assertThat ( stopList . get ( 1 ) . getStringAsString ( ) , is ( "1-missing" ) ) ; } @ Test public void selection ( ) throws Exception { runNoEq ( DataSize . UNKNOWN ) ; } @ Test public void tinySelection ( ) throws Exception { runNoEq ( DataSize . TINY ) ; } private void runNoEq ( DataSize dataSize ) throws IOException { TestInput < Ex1 > in1 = tester . input ( Ex1 . class , "ex1" ) ; TestInput < Ex2 > in2 = tester . input ( Ex2 . class , "ex2" , dataSize ) ; TestOutput < Ex1 > high = tester . output ( Ex1 . class , "high" ) ; TestOutput < Ex1 > low = tester . output ( Ex1 . class , "low" ) ; TestOutput < Ex1 > stop = tester . output ( Ex1 . class , "stop" ) ; Ex1 ex1 = new Ex1 ( ) ; Ex2 ex2 = new Ex2 ( ) ; ex1 . setStringAsString ( "high" ) ; ex1 . setValue ( 20 ) ; in1 . add ( ex1 ) ; ex2 . setStringAsString ( "high" ) ; ex2 . setValue ( 0 ) ; in2 . add ( ex2 ) ; ex2 . setValue ( 10 ) ; in2 . add ( ex2 ) ; ex2 . setValue ( 20 ) ; in2 . add ( ex2 ) ; ex1 . setStringAsString ( "low" ) ; ex1 . setValue ( 10 ) ; in1 . add ( ex1 ) ; ex2 . setStringAsString ( "low" ) ; ex2 . setValue ( - 20 ) ; in2 . add ( ex2 ) ; ex2 . setValue ( 10 ) ; in2 . add ( ex2 ) ; ex2 . setValue ( + 40 ) ; in2 . add ( ex2 ) ; ex1 . setStringAsString ( "0-stop" ) ; ex1 . setValue ( 0 ) ; in1 . add ( ex1 ) ; ex2 . setStringAsString ( "0-stop" ) ; ex2 . setValue ( - 10 ) ; in2 . add ( ex2 ) ; ex2 . setValue ( 0 ) ; in2 . add ( ex2 ) ; ex2 . setValue ( + 10 ) ; in2 . add ( ex2 ) ; ex1 . setStringAsString ( "1-missing" ) ; ex1 . setValue ( 1 ) ; in1 . add ( ex1 ) ; ex2 . setStringAsString ( "1-missing" ) ; ex2 . setValue ( - 1 ) ; in2 . add ( ex2 ) ; ex2 . setValue ( 0 ) ; in2 . add ( ex2 ) ; ex2 . setValue ( 2 ) ; in2 . add ( ex2 ) ; ex2 . setValue ( 10 | |
2,880 | <s> package com . asakusafw . dmdl . model ; import java . util . List ; import com . asakusafw . dmdl . Region ; import com . asakusafw . utils . collections . Lists ; public class AstScript extends AbstractAstNode { private final Region region ; public final List < AstModelDefinition < ? > > models ; public AstScript ( Region region , List < ? extends AstModelDefinition < ? > > models ) { if ( models == null ) { throw new IllegalArgumentException ( | |
2,881 | <s> package br . com . caelum . vraptor . dash . audit ; import static br . com . caelum . vraptor . dash . matchers . IsOfResourceMatcher . isOpenRequestOfResource ; import static org . mockito . Matchers . argThat ; import static org . mockito . Mockito . doThrow ; import static org . mockito . Mockito . inOrder ; import static org . mockito . Mockito . verify ; import static org . mockito . Mockito . when ; import java . lang . reflect . Method ; import org . junit . Before ; import org . junit . Test ; import org . junit . runner . RunWith ; import org . mockito . InOrder ; import org . mockito . Mock ; import org . mockito . runners . MockitoJUnitRunner ; import br . com . caelum . vraptor . InterceptionException ; import br . com . caelum . vraptor . core . InterceptorStack ; import br . com . caelum . vraptor . dash . hibernate . stats . OpenRequest ; import br . com . caelum . vraptor . dash . hibernate . stats . OpenRequestInterceptor ; import br . com . caelum . vraptor . dash . hibernate . stats . OpenRequests ; import br . com . caelum . vraptor . resource . DefaultResourceClass ; import br . com . caelum . vraptor . resource . ResourceClass ; import br . com . caelum . vraptor . resource . ResourceMethod ; @ RunWith ( MockitoJUnitRunner . class ) public class LogRequestTimeInterceptorTest { private OpenRequestInterceptor interceptor ; private @ Mock OpenRequests requests ; private @ Mock InterceptorStack stack ; private @ Mock ResourceMethod resourceMethod ; @ Before public void setUp ( ) throws Exception { configureMockResourceMethod ( ) ; OpenRequest openRequest = new OpenRequest ( resourceMethod ) ; when ( requests . add ( resourceMethod ) ) . thenReturn ( openRequest ) ; interceptor = new OpenRequestInterceptor ( | |
2,882 | <s> package org . rubypeople . rdt . internal . ui . wizards ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . swt . widgets . Shell ; import org . eclipse . ui . INewWizard ; import org . eclipse . ui . PlatformUI ; import org . rubypeople . rdt . internal . ui . IRubyHelpContextIds ; import org . rubypeople . rdt . internal . ui . RubyPlugin ; import org . rubypeople . rdt . internal . ui . RubyPluginImages ; import org . rubypeople . rdt . internal . ui . actions . ActionMessages ; import org . rubypeople . rdt . ui . actions . AbstractOpenWizardAction ; public class OpenNewRubyProjectWizardAction extends AbstractOpenWizardAction { public OpenNewRubyProjectWizardAction ( ) { setText ( ActionMessages . OpenNewRubyProjectWizardAction_text ) ; setDescription ( ActionMessages . OpenNewRubyProjectWizardAction_description | |
2,883 | <s> package com . asakusafw . compiler . flow . processor ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . util . List ; import org . junit . After ; import org . junit . Before ; import org . junit . Test ; import com . asakusafw . compiler . flow . JobflowCompilerTestRoot ; import com . asakusafw . compiler . flow . processor . flow . LoggingFlowSimple ; import com . asakusafw . compiler . flow . processor . flow . LoggingFlowWithParameter ; import com . asakusafw . compiler . flow . stage . StageModel ; import com . asakusafw . compiler . flow . stage . StageModel . Fragment ; import com . asakusafw . compiler . flow . testing . model . Ex1 ; import com . asakusafw . runtime . core . Report ; import com . asakusafw . runtime . core . Result ; import com . asakusafw . runtime . testing . MockResult ; import com . asakusafw . utils . java . model . syntax . Name ; public class LoggingFlowProcessorTest extends JobflowCompilerTestRoot { @ Override @ Before public void setUp ( ) throws Exception { super . setUp ( ) ; Report . setDelegate ( new Report . Default ( ) ) ; } @ Override @ After public void tearDown ( ) throws Exception { Report . setDelegate ( null ) ; super . tearDown ( ) ; } @ Test public void simple ( ) { List < StageModel > stages = compile ( LoggingFlowSimple . class ) ; Fragment fragment = stages . get ( 0 ) . getMapUnits ( ) . get ( 0 ) . getFragments ( ) . get ( 0 ) ; Name name = fragment . getCompiled ( ) | |
2,884 | <s> package org . rubypeople . rdt . internal . ui . text . spelling . engine ; import java . util . Collections ; import java . util . HashSet ; import java . util . Iterator ; import java . util . Set ; import org . eclipse . jface . preference . IPreferenceStore ; public class DefaultSpellChecker implements ISpellChecker { public static final String [ ] URL_PREFIXES = new String [ ] { "http://" , "https://" , "www." , "ftp://" , "ftps://" , "news://" , "mailto://" } ; protected static boolean isDigits ( final String word ) { for ( int index = 0 ; index < word . length ( ) ; index ++ ) { if ( Character . isDigit ( word . charAt ( index ) ) ) return true ; } return false ; } protected static boolean isMixedCase ( final String word , final boolean sentence ) { final int length = word . length ( ) ; boolean upper = Character . isUpperCase ( word . charAt ( 0 ) ) ; if ( sentence && upper && ( length > 1 ) ) upper = Character . isUpperCase ( word . charAt ( 1 ) ) ; if ( upper ) { for ( int index = length - 1 ; index > 0 ; index -- ) { if ( Character . isLowerCase ( word . charAt ( index ) ) ) return true ; } } else { for ( int index = length - 1 ; index > 0 ; index -- ) { if ( Character . isUpperCase ( word . charAt ( index ) ) ) return true ; } } return false ; } protected static boolean isUpperCase ( final String word ) { for ( int index = word . length ( ) - 1 ; index >= 0 ; index -- ) { if ( Character . isLowerCase ( word . charAt ( index ) ) ) return false ; } return true ; } protected static boolean isUrl ( final String word ) { for ( int index = 0 ; index < URL_PREFIXES . length ; index ++ ) { if ( word . | |
2,885 | <s> package com . asakusafw . compiler . operator ; import java . lang . annotation . Annotation ; import java . util . List ; import javax . lang . model . element . AnnotationMirror ; import javax . lang . model . element . ExecutableElement ; import com . asakusafw . compiler . common . NameGenerator ; import com . asakusafw . compiler . common . Precondition ; import com . asakusafw . utils . java . model . syntax . TypeBodyDeclaration ; import com . asakusafw . utils . java . model . util . ImportBuilder ; public interface OperatorProcessor { void initialize ( OperatorCompilingEnvironment env ) ; Class < ? extends Annotation > getTargetAnnotationType ( ) ; AnnotationMirror getOperatorAnnotation ( ExecutableElement element ) ; OperatorMethodDescriptor describe ( Context context ) ; List < ? extends TypeBodyDeclaration > implement ( Context context ) ; class Context { public final OperatorCompilingEnvironment environment ; public final AnnotationMirror annotation ; public final ExecutableElement element ; public final ImportBuilder importer ; public final NameGenerator names ; | |
2,886 | <s> package org . rubypeople . rdt . internal . ui . util ; import org . eclipse . core . resources . IFile ; import org . eclipse . core . resources . IWorkspace ; import org . eclipse . core . resources . IWorkspaceRoot ; import org . eclipse . core . resources . ResourcesPlugin ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . Path ; import org . eclipse . ui . IEditorDescriptor ; import org . eclipse . ui . IEditorInput ; import org . eclipse . ui . IEditorRegistry ; import org . eclipse . ui . IWorkbench ; import org . eclipse . ui . IWorkbenchPage ; import org . eclipse . ui . PartInitException ; import org . eclipse . ui . PlatformUI ; import org . eclipse . ui . part . FileEditorInput ; import org . eclipse . ui . texteditor . ITextEditor ; import org . rubypeople . rdt . internal . ui . RubyPlugin ; import org . rubypeople . rdt . internal . | |
2,887 | <s> package org . oddjob . tools . taglet ; import java . util . Map ; import org . oddjob . doclet . CustomTagNames ; import com . sun . tools . doclets . Taglet ; public class RequiredTaglet extends BaseBlockTaglet { public static void register ( Map < String , Taglet > tagletMap ) { tagletMap . put ( CustomTagNames . REQUIRED_TAG_NAME , new RequiredTaglet ( ) ) ; } @ Override public boolean inField ( ) { return true ; } | |
2,888 | <s> package org . rubypeople . rdt . internal . launching ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IConfigurationElement ; import org . eclipse . debug . core . ILaunchConfiguration ; import org . rubypeople . rdt . core . ILoadpathEntry ; import org . rubypeople . rdt . core . IRubyProject ; import org . rubypeople . rdt . launching . IRuntimeLoadpathEntry ; import org . rubypeople . rdt . launching . IRuntimeLoadpathEntryResolver ; import org . rubypeople . rdt . launching . IRuntimeLoadpathEntryResolver2 ; import org . rubypeople . rdt . launching . IVMInstall ; public class RuntimeLoadpathEntryResolver implements IRuntimeLoadpathEntryResolver2 { private IConfigurationElement fConfigurationElement ; private IRuntimeLoadpathEntryResolver fDelegate ; public RuntimeLoadpathEntryResolver ( IConfigurationElement element ) { fConfigurationElement = element ; } public IRuntimeLoadpathEntry [ ] resolveRuntimeLoadpathEntry ( IRuntimeLoadpathEntry entry , ILaunchConfiguration configuration ) throws CoreException { return getResolver ( ) . resolveRuntimeLoadpathEntry ( entry , configuration ) ; } protected IRuntimeLoadpathEntryResolver getResolver ( ) throws CoreException { if ( fDelegate == null ) { fDelegate = ( IRuntimeLoadpathEntryResolver ) fConfigurationElement . createExecutableExtension ( "class" ) ; } return fDelegate ; } public String getVariableName ( ) { return fConfigurationElement . getAttribute ( "variable" ) ; } public String getContainerId ( ) { return fConfigurationElement . getAttribute ( "container" ) ; } public String getRuntimeLoadpathEntryId ( ) { return fConfigurationElement . getAttribute ( "" ) ; } public IVMInstall resolveVMInstall ( ILoadpathEntry entry ) | |
2,889 | <s> package org . rubypeople . rdt . internal . ui . rubyeditor ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . ISafeRunnable ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . OperationCanceledException ; import org . eclipse . core . runtime . Platform ; import org . eclipse . core . runtime . SafeRunner ; import org . eclipse . core . runtime . Status ; import org . eclipse . jface . text . Assert ; import org . eclipse . ui . IPartListener2 ; import org . eclipse . ui . IWindowListener ; import org . eclipse . ui . IWorkbenchPart ; import org . eclipse . ui . IWorkbenchPartReference ; import org . eclipse . ui . IWorkbenchWindow ; import org . eclipse . ui . PlatformUI ; import org . jruby . ast . Node ; import org . jruby . ast . RootNode ; import org . jruby . lexer . yacc . SyntaxException ; import org . rubypeople . rdt . core . IRubyElement ; import org . rubypeople . rdt . core . IRubyScript ; import org . rubypeople . rdt . core . ISourceReference ; import org . rubypeople . rdt . core . RubyModelException ; import org . rubypeople . rdt . internal . core . parser . RubyParser ; import org . rubypeople . rdt . internal . core . util . ASTUtil ; import org . rubypeople . rdt . internal . ui . RubyPlugin ; import org . rubypeople . rdt . ui . RubyUI ; public final class ASTProvider { public static final class WAIT_FLAG { String fName ; private WAIT_FLAG ( String name ) { fName = name ; } public String toString ( ) { return fName ; } } public static final WAIT_FLAG WAIT_YES = new WAIT_FLAG ( "wait yes" ) ; public static final WAIT_FLAG WAIT_ACTIVE_ONLY = new WAIT_FLAG ( "" ) ; public static final WAIT_FLAG WAIT_NO = new WAIT_FLAG ( "don't wait" ) ; private static final boolean DEBUG = "true" . equalsIgnoreCase ( Platform . getDebugOption ( "" ) ) ; private class ActivationListener implements IPartListener2 , IWindowListener { public void partActivated ( IWorkbenchPartReference ref ) { if ( isRubyEditor ( ref ) && ! isActiveEditor ( ref ) ) activeRubyEditorChanged ( ref . getPart ( true ) ) ; } public void partBroughtToTop ( IWorkbenchPartReference ref ) { if ( isRubyEditor ( ref ) && ! isActiveEditor ( ref ) ) activeRubyEditorChanged ( ref . getPart ( true ) ) ; } public void partClosed ( IWorkbenchPartReference ref ) { if ( isActiveEditor ( ref ) ) { if ( DEBUG ) System . out . println ( getThreadName ( ) + " - " + DEBUG_PREFIX + "" + ref . getTitle ( ) ) ; activeRubyEditorChanged ( null ) ; } } public void partDeactivated ( IWorkbenchPartReference ref ) { } public void partOpened ( IWorkbenchPartReference ref ) { if ( isRubyEditor ( ref ) && ! isActiveEditor ( ref ) ) activeRubyEditorChanged ( ref . getPart ( true ) ) ; } public void partHidden ( IWorkbenchPartReference ref ) { } public void partVisible ( IWorkbenchPartReference ref ) { if ( isRubyEditor ( ref ) && ! isActiveEditor ( ref ) ) activeRubyEditorChanged ( ref . getPart ( true ) ) ; } public void partInputChanged ( IWorkbenchPartReference ref ) { if ( isRubyEditor ( ref ) && isActiveEditor ( ref ) ) activeRubyEditorChanged ( ref . getPart ( true ) ) ; } public void windowActivated ( IWorkbenchWindow window ) { IWorkbenchPartReference ref = window . getPartService ( ) . getActivePartReference ( ) ; if ( isRubyEditor ( ref ) && ! isActiveEditor ( ref ) ) activeRubyEditorChanged ( ref . getPart ( true ) ) ; } public void windowDeactivated ( IWorkbenchWindow window ) { } public void windowClosed ( IWorkbenchWindow window ) { if ( fActiveEditor != null && fActiveEditor . getSite ( ) != null && window == fActiveEditor . getSite ( ) . getWorkbenchWindow ( ) ) { if ( DEBUG ) System . out . println ( getThreadName ( ) + " - " + DEBUG_PREFIX + "" + fActiveEditor . getTitle ( ) ) ; activeRubyEditorChanged ( null ) ; } window . getPartService ( ) . removePartListener ( this ) ; } public void windowOpened ( IWorkbenchWindow window ) { window . getPartService ( ) . addPartListener ( this ) ; } private boolean isActiveEditor ( IWorkbenchPartReference ref ) { return ref != null && isActiveEditor ( ref . getPart ( false ) ) ; } private boolean isActiveEditor ( IWorkbenchPart part ) { return part != null && ( part == fActiveEditor ) ; } private boolean isRubyEditor ( IWorkbenchPartReference ref ) { if ( ref == null ) return false ; String id = ref . getId ( ) ; return RubyUI . ID_RUBY_EDITOR . equals ( id ) || RubyUI . ID_EXTERNAL_EDITOR . equals ( id ) || ref . getPart ( false ) instanceof RubyEditor ; } } public static final boolean SHARED_AST_STATEMENT_RECOVERY = true ; private static final String DEBUG_PREFIX = "" ; private IRubyElement fReconcilingRubyElement ; private IRubyElement fActiveRubyElement ; private RootNode fAST ; private ActivationListener fActivationListener ; private Object fReconcileLock = new Object ( ) ; private Object fWaitLock = new Object ( ) ; private boolean fIsReconciling ; private IWorkbenchPart fActiveEditor ; public static ASTProvider getASTProvider ( ) { return RubyPlugin . getDefault ( ) . getASTProvider ( ) ; } public ASTProvider ( ) { install ( ) ; } void install ( ) { fActivationListener = new ActivationListener ( ) ; PlatformUI . getWorkbench ( ) . addWindowListener ( fActivationListener ) ; IWorkbenchWindow [ ] windows = PlatformUI . getWorkbench ( ) . getWorkbenchWindows ( ) ; for ( int i = 0 , length = windows . length ; i < length ; i ++ ) windows [ i ] . getPartService ( ) . addPartListener ( fActivationListener ) ; } private void activeRubyEditorChanged ( IWorkbenchPart editor ) { IRubyElement rubyElement = null ; if ( editor instanceof RubyEditor ) rubyElement = ( ( RubyEditor ) editor ) . getInputRubyElement ( ) ; synchronized ( this ) { fActiveEditor = editor ; fActiveRubyElement = rubyElement ; cache ( null , rubyElement ) ; } if ( DEBUG ) System . out . println ( getThreadName ( ) + " - " + DEBUG_PREFIX + "" + toString ( rubyElement ) ) ; synchronized ( fReconcileLock ) { if ( fIsReconciling && ( fReconcilingRubyElement == null || ! fReconcilingRubyElement . equals ( rubyElement ) ) ) { fIsReconciling = false ; fReconcilingRubyElement = null ; } else if ( rubyElement == null ) { fIsReconciling = false ; fReconcilingRubyElement = null ; } } } public boolean isCached ( Node ast ) { return ast != null && fAST == ast ; } public boolean isActive ( IRubyScript cu ) { return cu != null && cu . equals ( fActiveRubyElement ) ; } void aboutToBeReconciled ( IRubyElement rubyElement ) { if ( rubyElement == null ) return ; if ( DEBUG ) System . out . println ( getThreadName ( ) + " - " + DEBUG_PREFIX + "" + toString ( rubyElement ) ) ; synchronized ( fReconcileLock ) { fIsReconciling = true ; fReconcilingRubyElement = rubyElement ; } cache ( null , rubyElement ) ; } private synchronized void disposeAST ( ) { if ( fAST == null ) return ; if ( DEBUG ) System . out . println ( getThreadName ( ) + " - " + DEBUG_PREFIX + "" + toString ( fAST ) + " for: " + toString ( fActiveRubyElement ) ) ; fAST = null ; cache ( null , null ) ; } private String toString ( IRubyElement javaElement ) { if ( javaElement == null ) return "null" ; else return javaElement . getElementName ( ) ; } private String toString ( Node ast ) { if ( ast == null ) return "null" ; return ASTUtil . stringRepresentation ( ast ) ; } private synchronized void cache ( RootNode ast , IRubyElement javaElement ) { if ( fActiveRubyElement != null && ! fActiveRubyElement . equals ( javaElement ) ) { if ( DEBUG && javaElement != null ) System . out . println ( getThreadName ( ) + " - " + DEBUG_PREFIX + "" + toString ( javaElement ) ) ; return ; } if ( DEBUG && ( javaElement != null || ast != null ) ) System . out . println ( getThreadName ( ) + " - " + DEBUG_PREFIX + "" + toString ( ast ) + " for: " + toString ( javaElement ) ) ; if ( fAST != null ) disposeAST ( ) ; fAST = ast ; synchronized ( fWaitLock ) { fWaitLock . notifyAll ( ) ; } } public RootNode getAST ( IRubyElement re , WAIT_FLAG waitFlag , IProgressMonitor progressMonitor ) { if ( re == null ) return null ; Assert . isTrue ( re . getElementType ( ) == IRubyElement . SCRIPT ) ; if ( progressMonitor != null && progressMonitor . isCanceled ( ) ) return null ; boolean isActiveElement ; synchronized ( this ) { isActiveElement = re . equals ( fActiveRubyElement ) ; if ( isActiveElement ) { if ( fAST != null ) { if ( DEBUG ) System . out . println ( getThreadName ( ) + " - " + DEBUG_PREFIX + "" + toString ( fAST ) + " for: " + re . getElementName ( ) ) ; return fAST ; } if ( waitFlag == WAIT_NO ) { if ( DEBUG ) System . out . println ( getThreadName ( ) + " - " + DEBUG_PREFIX + "" + re . getElementName ( ) ) ; return null ; } } } if ( isActiveElement && isReconciling ( re ) ) { try { final IRubyElement activeElement = fReconcilingRubyElement ; synchronized ( | |
2,890 | <s> package net . sf . sveditor . core . db . index ; import net . sf . sveditor . core . db . | |
2,891 | <s> package org . oddjob . jobs . structural ; import junit . framework . TestCase ; import org . oddjob . FailedToStopException ; import org . oddjob . Helper ; import org . oddjob . Oddjob ; import org . oddjob . OddjobLookup ; import org . oddjob . arooa . xml . XMLConfiguration ; import org . oddjob . state . JobState ; import org . oddjob . state . ParentState ; import org . oddjob . state . ServiceState ; public class SequentialJobInOddjobTest extends TestCase { public static class OurService { public void start ( ) { } public void stop ( ) { } } public void testException ( ) throws FailedToStopException { String xml = "" + " <job>" + "" + " <jobs>" + "" + OurService . class . getName ( ) + "'/>" + "" + "" + "" + " </jobs>" + "" + " </job>" + "</oddjob>" ; Oddjob | |
2,892 | <s> package com . asakusafw . modelgen . view . model ; public class Name { public final String token ; public Name ( String token ) { if ( token == null ) { throw new IllegalArgumentException ( "" ) ; } this . token = token ; } public Name ( Name qualifier , Name rest ) { if ( qualifier == null ) { throw new IllegalArgumentException | |
2,893 | <s> package org . rubypeople . rdt . testunit . launcher ; import java . io . IOException ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . Path ; import org . eclipse . core . runtime . Status ; import org . eclipse . debug . core . ILaunch ; import org . eclipse . debug . core . ILaunchConfiguration ; import org . eclipse . jface . dialogs . MessageDialog ; import org . eclipse . swt . widgets . Display ; import org . eclipse . swt . widgets . Shell ; import org . rubypeople . rdt . core . IRubyElement ; import org . rubypeople . rdt . core . IRubyProject ; import org . rubypeople . rdt . core . IRubyScript ; import org . rubypeople . rdt . core . IType ; import org . rubypeople . rdt . core . RubyCore ; import org . rubypeople . rdt . core . SocketUtil ; import org . rubypeople . rdt . internal . testunit . ui . TestUnitMessages ; import org . rubypeople . rdt . internal . testunit . ui . TestunitPlugin ; import org . rubypeople . rdt . launching . IRubyLaunchConfigurationConstants ; import org . rubypeople . rdt . launching . RubyLaunchDelegate ; public class TestUnitLaunchConfigurationDelegate extends RubyLaunchDelegate { public static final String TESTTYPE_ATTR = TestunitPlugin . PLUGIN_ID + ".TESTTYPE" ; public static final String TESTNAME_ATTR = TestunitPlugin . PLUGIN_ID + ".TESTNAME" ; public static final String LAUNCH_CONTAINER_ATTR = TestunitPlugin . PLUGIN_ID + ".CONTAINER" ; public static final String ID_TESTUNIT_APPLICATION = "" ; private static final String TEST_RUNNER_FILE = "" ; private static final int TEST_RUNNER_VERSION = 3 ; private int port = - 1 ; @ Override public void launch ( ILaunchConfiguration configuration , String mode , ILaunch launch , IProgressMonitor monitor ) throws CoreException { IType [ ] testTypes = findTestTypes ( configuration , monitor ) ; getTestRunnerPath ( ) ; launch . setAttribute ( TestunitPlugin . TESTUNIT_PORT_ATTR , Integer . toString ( getPort ( ) ) ) ; if ( testTypes != null && testTypes . length > 0 && testTypes [ 0 ] != null ) launch . setAttribute ( TESTTYPE_ATTR , testTypes [ 0 ] . getHandleIdentifier ( ) ) ; super . launch ( configuration , mode , launch , monitor ) ; } protected IType [ ] findTestTypes ( ILaunchConfiguration configuration , IProgressMonitor pm ) throws CoreException { IRubyProject javaProject = getRubyProject ( configuration ) ; if ( ( javaProject == null ) || ! javaProject . exists ( ) ) { informAndAbort ( TestUnitMessages . TestUnitBaseLaunchConfiguration_error_invalidproject , null , IRubyLaunchConfigurationConstants . ERR_NOT_A_RUBY_PROJECT ) ; } String containerHandle = configuration . getAttribute ( LAUNCH_CONTAINER_ATTR , "" ) ; if ( containerHandle . length ( ) > 0 ) { IRubyElement element = RubyCore . create ( containerHandle ) ; if ( element != null ) { if ( element . isType ( IRubyElement . TYPE ) ) { return new IType [ ] { ( IType ) element } ; } IRubyScript script = ( IRubyScript ) element ; if ( script != null ) { IType type = script . findPrimaryType ( ) ; if ( type != null ) return new IType [ ] { type } ; } } } String testTypeName = configuration . getAttribute ( TESTTYPE_ATTR , ( String ) null ) ; if ( testTypeName != null && testTypeName . length ( ) > 0 ) { return new IType [ ] { javaProject . findType ( | |
2,894 | <s> package org . rubypeople . rdt . internal . corext . dom ; import org . eclipse . core . runtime . Assert ; import org . eclipse . jface . text . IRegion ; import org . jruby . ast . Node ; public class Selection { public static final int INTERSECTS = 0 ; public static final int BEFORE = 1 ; public static final int SELECTED = 2 ; public static final int AFTER = 3 ; private int fStart ; private int fLength ; private int fExclusiveEnd ; protected Selection ( ) { } public static Selection createFromStartLength ( int s , int l ) { Assert . isTrue ( s >= 0 && l >= 0 ) ; Selection result = new Selection ( ) ; result . fStart = s ; result . fLength = l ; result . fExclusiveEnd = s + l ; return result ; } public static Selection createFromStartEnd ( int s , int e ) { Assert . isTrue ( s >= 0 && e >= s ) ; Selection result = new Selection ( ) ; result . fStart = s ; result . fLength = e - s + 1 ; result . fExclusiveEnd = result . fStart + result . fLength ; return result ; } public int getOffset ( ) { return fStart ; } public int getLength ( ) { return fLength ; } public int getInclusiveEnd ( ) { return fExclusiveEnd - 1 ; } public int getExclusiveEnd ( ) { return fExclusiveEnd ; } public int getVisitSelectionMode ( Node node ) { int nodeStart = node . getPosition ( ) . getStartOffset ( ) ; int nodeEnd = node . getPosition ( ) . getEndOffset ( ) ; if ( nodeEnd <= fStart ) return BEFORE ; else if ( covers ( node ) ) return SELECTED ; else if ( fExclusiveEnd <= nodeStart ) return AFTER ; return INTERSECTS ; } public int getEndVisitSelectionMode ( Node node ) { int nodeStart = node . getPosition ( ) . getStartOffset ( ) ; int nodeEnd = node . getPosition ( ) . getEndOffset ( ) ; if ( nodeEnd <= fStart ) return BEFORE ; else if ( covers ( node ) ) return SELECTED ; else if ( nodeEnd >= fExclusiveEnd ) return AFTER ; return INTERSECTS ; } public boolean covers ( int position ) { return fStart <= position && position < fStart + fLength ; } public boolean covers ( | |
2,895 | <s> package com . asakusafw . vocabulary . flow . util ; import static com . asakusafw . vocabulary . flow . util . CoreOperatorFactory . * ; import static org . junit . Assert . * ; import java . util . Arrays ; import java . util . HashSet ; import java . util . LinkedList ; import java . util . Set ; import org . hamcrest . Matcher ; import org . hamcrest . Matchers ; import org . junit . Test ; import com . asakusafw . utils . graph . Graph ; import com . asakusafw . utils . graph . Graphs ; import com . asakusafw . vocabulary . flow . Source ; import com . asakusafw . vocabulary . flow . graph . FlowElement ; import com . asakusafw . vocabulary . flow . graph . FlowElementInput ; import com . asakusafw . vocabulary . flow . graph . FlowElementOutput ; import com . asakusafw . vocabulary . flow . graph . PortConnection ; import com . asakusafw . vocabulary . flow . testing . MockIn ; import com . asakusafw . vocabulary . flow . testing . MockOut ; import com . asakusafw . vocabulary . flow . util . CoreOperatorFactory . Checkpoint ; import com . asakusafw . vocabulary . flow . util . CoreOperatorFactory . Empty ; public class CoreOperatorFactoryTest { MockIn < String > in = new MockIn < String > ( String . class , "in" ) ; MockIn < String > in2 = new MockIn < String > ( String . class , "in2" | |
2,896 | <s> package org . springframework . social . google . api . tasks . impl ; import org . codehaus . jackson . map . annotate . JsonCachable ; import org . springframework . social . google . api . impl . ApiEnumDeserializer ; import org . springframework . social . google . api | |
2,897 | <s> package org . rubypeople . rdt . internal . core ; import org . rubypeople . rdt . core . IImportContainer ; import org . rubypeople . rdt . core . IImportDeclaration ; import org . rubypeople . rdt . core . IParent ; import org . rubypeople . rdt . core . IRubyElement ; import org . rubypeople . rdt . core . ISourceRange ; import org . rubypeople . rdt . core . ISourceReference ; import org . rubypeople . rdt . core . RubyModelException ; import org . rubypeople . rdt . core . WorkingCopyOwner ; import org . rubypeople . rdt . internal . core . util . MementoTokenizer ; public class ImportContainer extends SourceRefElement implements IImportContainer { protected ImportContainer ( RubyScript parent ) { super ( parent ) ; } public boolean equals ( Object o ) { if ( ! ( o instanceof ImportContainer ) ) return false ; return super . equals ( o ) ; } public String getElementName ( ) { return "" ; } public int getElementType ( ) { return IMPORT_CONTAINER ; } public IImportDeclaration getImport ( String importName ) { return new RubyImport ( this , importName ) ; } public IRubyElement getPrimaryElement ( boolean checkOwner ) { RubyScript cu = ( RubyScript ) this . parent ; if ( checkOwner && cu . isPrimary ( ) ) return this ; return cu . getImportContainer ( ) ; } public ISourceRange getSourceRange ( ) throws RubyModelException { IRubyElement [ | |
2,898 | <s> package com . asakusafw . utils . java . internal . model . syntax ; import com . asakusafw . utils . java . model . syntax . BlockComment ; import com . asakusafw . utils . java . model . syntax . ModelKind ; import com . asakusafw . utils . java . model . syntax . Visitor ; public final class BlockCommentImpl extends ModelRoot implements BlockComment { private String string ; @ Override public String getString ( ) | |
2,899 | <s> package com . asakusafw . compiler . flow . join . processor ; import java . util . List ; import java . util . Set ; import com . asakusafw . compiler . common . TargetOperator ; import com . asakusafw . compiler . flow . DataClass ; import com . asakusafw . compiler . flow . DataClass . Property ; import com . asakusafw . compiler . flow . LineEndProcessor ; import com . asakusafw . compiler . flow . join . JoinResourceDescription ; import com . asakusafw . compiler . flow . join . operator . SideDataJoin ; import com . asakusafw . runtime . util . TypeUtil ; import com . asakusafw . utils . collections . Lists ; import com . asakusafw . utils . collections . Sets ; import com . asakusafw . utils . java . model . syntax . Expression ; import com . asakusafw . utils . java . model . syntax . ModelFactory ; import com . asakusafw . utils . java . model . syntax . Statement ; import com . asakusafw . vocabulary . flow . graph . FlowElementPortDescription ; import com . asakusafw . vocabulary . flow . graph . FlowResourceDescription ; import com . asakusafw . vocabulary . model . Joined ; @ TargetOperator ( SideDataJoin . class ) public class SideDataJoinFlowProcessor extends LineEndProcessor { @ Override public void emitLineEnd ( Context context ) { FlowResourceDescription resource = context . getResourceDescription ( SideDataJoin . ID_RESOURCE_MASTER ) ; SideDataKindFlowAnalyzer helper = new SideDataKindFlowAnalyzer ( context , ( JoinResourceDescription ) resource ) ; ModelFactory f = context . getModelFactory ( ) ; FlowElementPortDescription joinedPort = context . getOutputPort ( SideDataJoin . ID_OUTPUT_JOINED ) ; FlowElementPortDescription missedPort = context . getOutputPort ( SideDataJoin . ID_OUTPUT_MISSED ) ; DataObjectMirror resultCache = context . createModelCache ( joinedPort . getDataType ( ) ) ; DataClass outputType = getEnvironment ( ) . getDataClasses ( ) . load ( joinedPort . getDataType ( ) ) ; List < Statement > process = Lists . create ( ) ; process . add ( resultCache . createReset ( ) ) ; Joined annotation = TypeUtil . erase ( joinedPort . getDataType ( ) ) . getAnnotation ( Joined . class ) ; Set < String > saw = Sets . create ( ) ; for ( Joined . Term term : annotation . terms ( ) ) { DataClass inputType = getEnvironment ( ) . getDataClasses |