id
int32 0
3k
| input
stringlengths 43
33.8k
| gt
stringclasses 1
value |
---|---|---|
1,800 | <s> package net . sf . sveditor . core . db . expr ; import net . sf . sveditor . core . db . SVDBItemType ; public class SVDBIdentifierExpr extends SVDBExpr { public String fId ; public SVDBIdentifierExpr ( ) { this ( ( String ) null ) ; } public SVDBIdentifierExpr ( String id ) { | |
1,801 | <s> package org . rubypeople . rdt . internal . ui . packageview ; import java . lang . reflect . InvocationTargetException ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . Iterator ; import java . util . List ; import java . util . Set ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IAdaptable ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . MultiStatus ; import org . eclipse . core . runtime . SubProgressMonitor ; import org . eclipse . jface . dialogs . ProgressMonitorDialog ; import org . eclipse . jface . operation . IRunnableWithProgress ; import org . eclipse . jface . util . Assert ; import org . eclipse . jface . util . TransferDragSourceListener ; import org . eclipse . jface . viewers . ISelection ; import org . eclipse . jface . viewers . ISelectionProvider ; import org . eclipse . jface . viewers . IStructuredSelection ; import org . eclipse . swt . dnd . DND ; import org . eclipse . swt . dnd . DragSourceAdapter ; import org . eclipse . swt . dnd . DragSourceEvent ; import org . eclipse . swt . dnd . FileTransfer ; import org . eclipse . swt . dnd . Transfer ; import org . eclipse . swt . widgets . Shell ; import org . eclipse . ui . actions . WorkspaceModifyOperation ; import org . rubypeople . rdt | |
1,802 | <s> package org . rubypeople . rdt . internal . debug . ui . launcher ; import org . eclipse . osgi . util . NLS ; public class LauncherMessages extends NLS { private static final String BUNDLE_NAME = | |
1,803 | <s> package org . oddjob . scheduling ; import java . text . DecimalFormat ; public class TimeDisplay { private final int days ; private final int hours ; private final int minutes ; private final int seconds ; private final int milliseconds ; public TimeDisplay ( long time ) { milliseconds = ( int ) ( time % 1000 ) ; long remainder = time / 1000 ; seconds = ( int ) remainder % 60 ; remainder = remainder / 60 ; minutes = ( int ) remainder % 60 ; remainder = remainder / 60 ; hours = ( int ) remainder % 24 ; days = ( int ) remainder / 24 ; } public int getDays ( ) { return days ; } public int getHours ( ) { return hours ; } public int getMinutes ( ) { return minutes ; } public int getSeconds ( ) { return | |
1,804 | <s> package com . asakusafw . compiler . operator . io ; import java . io . IOException ; import com . asakusafw . compiler . operator . model . MockHoge ; import com . asakusafw . runtime . io . ModelOutput ; import com . asakusafw . runtime . io . RecordEmitter ; public final class MockHogeOutput implements ModelOutput < MockHoge > { private final RecordEmitter emitter ; public MockHogeOutput ( RecordEmitter emitter ) { if ( emitter == null ) { | |
1,805 | <s> package org . rubypeople . rdt . refactoring . core . extractconstant ; import org . jruby . ast . Node ; import org . rubypeople . rdt . core . RubyConventions ; import org . rubypeople . rdt . internal . core . util . ASTUtil ; import org . rubypeople . rdt . refactoring . core . IRefactoringConfig ; import org . rubypeople . rdt . refactoring . core . IRefactoringContext ; import org . rubypeople . rdt . refactoring . core . NodeFactory ; import org . rubypeople . rdt . refactoring . core . RefactoringContext ; import org . rubypeople . rdt . refactoring . core . SelectionNodeProvider ; import org . rubypeople . rdt . refactoring . documentprovider . DocumentProvider ; import org . rubypeople . rdt . refactoring . documentprovider . IDocumentProvider ; public class ExtractConstantConfig implements IRefactoringConfig { private | |
1,806 | <s> package net . sf . sveditor . core . db . persistence ; import java . io . DataInput ; import java . io . DataOutput ; import java . io . IOException ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . HashSet ; import java . util . List ; import java . util . Map ; import java . util . Map . Entry ; import java . util . Set ; import net . sf . sveditor . core . db . SVDBLocation ; public abstract class SVDBPersistenceRWBase implements IDBPersistenceTypes { private byte fTmp [ ] ; protected DataInput fIn ; protected DataOutput fOut ; public void init ( DataInput in ) { fIn = in ; fOut = null ; } public void init ( DataOutput out ) { fOut = out ; fIn = null ; } public void close ( ) { } public SVDBLocation readSVDBLocation ( ) throws DBFormatException { int type = readRawType ( ) ; if ( type == TYPE_NULL ) { return null ; } if ( type != TYPE_SVDB_LOCATION ) { throw new DBFormatException ( "" + type ) ; } int line = readInt ( ) ; int pos = readInt ( ) ; return new SVDBLocation ( line , pos ) ; } public String readString ( ) throws DBFormatException { int type = readRawType ( ) ; if ( type == TYPE_NULL ) { return null ; } if ( type != TYPE_STRING ) { throw new DBFormatException ( "" + type ) ; } int len = readInt ( ) ; if ( len < 0 ) { throw new DBFormatException ( "" + len ) ; } if ( fTmp == null || fTmp . length < len ) { fTmp = new byte [ len ] ; } try { fIn . readFully ( fTmp , 0 , len ) ; } catch ( IOException e ) { throw new DBFormatException ( "" + e . getMessage ( ) ) ; } String ret = new String ( fTmp , 0 , len ) ; return ret ; } public int readRawType ( ) throws DBFormatException { int ret = - 1 ; if ( fIn == null ) { throw new DBFormatException ( "" + fOut ) ; } try { ret = fIn . readByte ( ) ; } catch ( IOException e ) { throw new DBFormatException ( "" + e . getMessage ( ) ) ; } if ( ret < TYPE_INT_8 || ret >= TYPE_MAX ) { throw new DBFormatException ( "" + ret ) ; } return ret ; } public Map < String , String > readMapStringString ( ) throws DBFormatException { Map < String , String > ret = new HashMap < String , String > ( ) ; int type = readRawType ( ) ; if ( type == TYPE_NULL ) { return null ; } if ( type != TYPE_MAP ) { throw new DBFormatException ( "" + type ) ; } int size = readInt ( ) ; for ( int i = 0 ; i < size ; i ++ ) { String key = readString ( ) ; String val = readString ( ) ; ret . put ( key , val ) ; } return ret ; } public List < Long > readLongList ( ) throws DBFormatException { int type = readRawType ( ) ; if ( type == TYPE_NULL ) { return null ; } if ( type != TYPE_LONG_LIST ) { throw new DBFormatException ( "" + type ) ; } int size = readInt ( ) ; List < Long > ret = new ArrayList < Long > ( ) ; for ( int i = 0 ; i < size ; i ++ ) { ret . add ( readLong ( ) ) ; } return ret ; } public Set < Long > readLongSet ( ) throws DBFormatException { int type = readRawType ( ) ; if ( type == TYPE_NULL ) { return null ; } if ( type != TYPE_LONG_SET ) { throw new DBFormatException ( "" + type ) ; } int size = readInt ( ) ; Set < Long > ret = new HashSet < Long > ( ) ; for ( int i = 0 ; i < size ; i ++ ) { ret . add ( readLong ( ) ) ; } return ret ; } public List < Integer > readIntList ( ) throws DBFormatException { int type = readRawType ( ) ; if ( type == TYPE_NULL ) { return null ; } if ( type != TYPE_INT_LIST ) { throw new DBFormatException ( "" + type ) ; } int size = readInt ( ) ; List < Integer > ret = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < size ; i ++ ) { ret . add ( readInt ( ) ) ; } return ret ; } public Set < Integer > readIntSet ( ) throws DBFormatException { int type = readRawType ( ) ; if ( type == TYPE_NULL ) { return null ; } if ( type != TYPE_INT_SET ) { throw new DBFormatException ( "" + type ) ; } int size = readInt ( ) ; Set < Integer > ret = new HashSet < Integer > ( ) ; for ( int i = 0 ; i < size ; i ++ ) { ret . add ( readInt ( ) ) ; } return ret ; } public List < String > readStringList ( ) throws DBFormatException { int type = readRawType ( ) ; if ( type == TYPE_NULL ) { return null ; } if ( type != TYPE_STRING_LIST ) { throw new DBFormatException ( "" + type ) ; } int size = readInt ( ) ; List < String > ret = new ArrayList < String > ( ) ; for ( int i = 0 ; i < size ; i ++ ) { ret . add ( readString ( ) ) ; } return ret ; } public Set < String > readStringSet ( ) throws DBFormatException { int type = readRawType ( ) ; if ( type == TYPE_NULL ) { return null ; } if ( type != TYPE_STRING_SET ) { throw new DBFormatException ( "" + type ) ; } int size | |
1,807 | <s> package net . sf . sveditor . core . db . index ; import java . io . File ; import java . util . List ; import net . sf . sveditor . core . db . ISVDBItemBase ; import net . sf . sveditor . core . db . ISVDBNamedItem ; import net . sf . sveditor . core . db . SVDBFile ; import net . sf . sveditor . core . db . SVDBInclude ; import net . sf . sveditor . core . db . SVDBItem ; import net . sf . sveditor . core . db . SVDBItemType ; import net . sf . sveditor . core . db . SVDBPreProcCond ; import net . sf . sveditor . core . db . SVDBScopeItem ; import net . sf . sveditor . core . scanner . IDefineProvider ; public class SVDBFileTreeUtils { private boolean fDebugEn = false ; private ISVDBIndex fIndex ; public SVDBFileTreeUtils ( ) { } public void setIndex ( ISVDBIndex index ) { fIndex = index ; } public void resolveConditionals ( SVDBFileTree file , IDefineProvider dp ) { processScope ( file . getSVDBFile ( ) , dp , file , null ) ; } private static SVDBFileTree findBestIncParent ( SVDBFileTree file , SVDBFileTree p1 , SVDBFileTree p2 ) { File file_dir = new File ( file . getFilePath ( ) ) . getParentFile ( ) ; File p1_dir = new File ( p1 . getFilePath ( ) ) . getParentFile ( ) ; File p2_dir = new File ( p2 . getFilePath ( ) ) . getParentFile ( ) ; if ( file_dir . equals ( p1_dir ) && ! file_dir . equals ( p2_dir ) ) { return p1 ; } else if ( file_dir . equals ( p2_dir ) && ! file_dir . equals ( p1_dir ) ) { return p2 ; } else { return p1 ; } } private void processFile ( IDefineProvider dp , SVDBFileTree file , List < SVDBFileTree > file_l ) { debug ( "" + file . getFilePath ( ) + ")" ) ; file . setFileProcessed ( true ) ; processScope ( file . getSVDBFile ( ) , dp , file , file_l ) ; if ( fDebugEn ) { debug ( " File \"" + file . getFilePath ( ) + "\" complete" ) ; for ( String f : file . getIncludedFiles ( ) ) { debug ( "" + f ) ; } for ( String f : file . getIncludedByFiles ( ) ) { debug ( "" + f ) ; } } debug ( "" + file . getFilePath ( ) + ")" ) ; } private void processScope ( SVDBScopeItem scope , IDefineProvider dp , SVDBFileTree file , List < SVDBFileTree > file_l ) { List < ISVDBItemBase > it_l = scope . getItems ( ) ; debug ( "" + scope . getName ( ) ) ; for ( int i = 0 ; i < it_l . size ( ) ; i ++ ) { ISVDBItemBase it = it_l . get ( i ) ; if ( it . getType ( ) == SVDBItemType . PreProcCond ) { SVDBPreProcCond c = ( SVDBPreProcCond ) it ; debug ( "cond=" + c . getConditional ( ) ) ; debug ( "" + c . getName ( ) + " " + c . getConditional ( ) ) ; String cond = c . getConditional ( ) ; boolean defined = dp . isDefined ( cond , it . getLocation ( ) . getLine ( ) ) ; if ( ( defined && c . getName ( ) . equals ( "ifdef" ) ) || ( ! defined && c . getName ( ) . equals ( "ifndef" ) ) ) { while ( i + 1 < it_l . size ( ) && it_l . get ( i + 1 ) . getType ( ) == SVDBItemType . PreProcCond && ( ( ( ISVDBNamedItem ) it_l . get ( i + 1 ) ) . getName ( ) . equals ( "else" ) || ( ( ISVDBNamedItem ) it_l . get ( i + 1 ) ) . getName ( ) . equals ( "elsif" ) ) ) { debug ( "" ) ; it_l . remove ( i + 1 ) ; } it_l . remove ( i ) ; if ( fDebugEn ) { debug ( "" + c . getName ( ) + ")" | |
1,808 | <s> package org . rubypeople . rdt . internal . ti . util ; import java . util . Collection ; import java . util . Collections ; import java . util . HashSet ; import java . util . Set ; import org . jruby . ast . ArrayNode ; import org . jruby . ast . FCallNode ; import org . jruby . ast . Node ; import org . jruby . ast . StrNode ; import org . jruby . ast . SymbolNode ; import org . rubypeople . rdt . internal . core . parser . InOrderVisitor ; public class AttributeLocator extends InOrderVisitor { private Set < String > attributes ; public Collection < String > findInstanceAttributesInScope ( Node rootNode ) { if ( rootNode == null ) return Collections . emptyList ( ) ; attributes = new HashSet < String > ( ) ; rootNode . accept ( this ) ; Collection < String > result = Collections . unmodifiableSet ( attributes ) ; attributes = null ; return result ; } @ Override public Object visitFCallNode ( FCallNode fCallNode ) { String attrPrefix = null ; if ( isInstanceAttributeDeclaration ( fCallNode . getName ( ) ) ) { attrPrefix = "@" ; } else if ( isClassAttributeDeclaration ( fCallNode . getName ( ) ) ) { attrPrefix = "@@" ; } if ( attrPrefix == null ) return super . visitFCallNode ( fCallNode ) ; Node argsNode = fCallNode . getArgsNode ( ) ; if ( ! ( argsNode instanceof ArrayNode ) ) return super . visitFCallNode ( fCallNode ) ; ArrayNode arrayNode = ( ArrayNode ) argsNode ; for ( Node argNode : arrayNode . childNodes ( ) ) { if ( argNode instanceof SymbolNode ) { attributes . add ( attrPrefix + ( ( SymbolNode ) argNode ) . getName ( ) ) ; } | |
1,809 | <s> package org . oddjob . monitor . control ; import java . beans . PropertyChangeListener ; import java . lang . reflect . InvocationTargetException ; import java . lang . reflect . Method ; import java . util . HashMap ; import java . util . Map ; import org . apache . log4j . Logger ; public class PropertyChangeHelper { private static final Logger logger = Logger . getLogger ( PropertyChangeHelper . class ) ; private static final Map < Class < ? > , PropertyChangeHelper > helpers = new HashMap < Class < ? > , PropertyChangeHelper > ( ) ; private Method addPropListenerMethod ; private Method removePropListenerMethod ; private PropertyChangeHelper ( Class < ? > bean ) { Class < ? > beanClass = bean . getClass ( ) ; Class < ? > [ ] argClasses = { PropertyChangeListener . class } ; try { addPropListenerMethod = beanClass . getMethod ( "" , argClasses ) ; removePropListenerMethod = beanClass . getMethod ( "" , argClasses ) ; } catch ( SecurityException e ) { logger . debug ( e ) ; } catch ( NoSuchMethodException e ) { } } private static PropertyChangeHelper lookup ( Class < ? > bean ) { synchronized ( helpers ) { PropertyChangeHelper helper | |
1,810 | <s> package org . rubypeople . eclipse . shams . runtime ; import java . util . HashMap ; import java . util . Map ; import org . eclipse . core . runtime . preferences . IEclipsePreferences ; import org . eclipse . core . runtime . preferences . IPreferenceNodeVisitor ; import org . osgi . service . prefs . BackingStoreException ; import org . osgi . service . prefs . Preferences ; public class ShamPreferences implements IEclipsePreferences { private Map data = new HashMap ( ) ; public void addNodeChangeListener ( INodeChangeListener listener ) { throw new ShamException ( ) ; } public void removeNodeChangeListener ( INodeChangeListener listener ) { throw new ShamException ( ) ; } public void addPreferenceChangeListener ( IPreferenceChangeListener listener ) { throw new ShamException ( ) ; } public void removePreferenceChangeListener ( IPreferenceChangeListener listener ) { throw new ShamException ( ) ; } public void removeNode ( ) throws BackingStoreException { throw new ShamException ( ) ; } public Preferences node ( String path ) { throw new ShamException ( ) ; } public void accept ( IPreferenceNodeVisitor visitor ) throws BackingStoreException { throw new ShamException ( ) ; } public void put ( String key , String value ) { data . put ( key , value ) ; } public String get ( String key , String def ) { Object value = data . get ( key ) ; if ( value == null ) return def ; return ( String ) value ; } public void remove ( String key ) { throw new ShamException ( ) ; } public void clear ( ) throws BackingStoreException { throw new ShamException ( ) ; } public void putInt ( String key , int value ) { throw new ShamException ( ) ; } public int getInt ( String key , int def ) { throw new ShamException ( ) ; } public void putLong ( String key , long value ) { throw new ShamException ( ) ; } public long getLong ( String key , long def | |
1,811 | <s> package org . rubypeople . rdt . refactoring . core . extractmethod ; import java . util . ArrayList ; import java . util . Collection ; import java . util . LinkedHashMap ; import java . util . Map ; import java . util . Observable ; import org . jruby . ast . BlockNode ; import org . jruby . ast . DAsgnNode ; import org . jruby . ast . DVarNode ; import org . jruby . ast . DefsNode ; import org . jruby . ast . LocalAsgnNode ; import org . jruby . ast . Node ; import org . rubypeople . rdt . refactoring . core . NodeFactory ; import org . rubypeople . rdt . refactoring . core . NodeProvider ; import org . rubypeople . rdt . refactoring . nodewrapper . LocalNodeWrapper ; import org . rubypeople . rdt . refactoring . nodewrapper . VisibilityNodeWrapper ; import org . rubypeople . rdt . refactoring . util . NodeUtil ; public class ExtractedMethodHelper extends Observable { public static final VisibilityNodeWrapper . METHOD_VISIBILITY DEFAULT_VISIBILITY = VisibilityNodeWrapper . METHOD_VISIBILITY . PRIVATE ; private VisibilityNodeWrapper . METHOD_VISIBILITY visibility ; private Node selectedNodes ; private Collection < LocalNodeWrapper > localNodesNeededAsReturnValues ; private Map < Integer , LocalNodeWrapper > afterSelectionNodes ; private ArrayList < ExtractedArgument > argsOrdered ; private String methodName = "" ; private final boolean isStaticMethod ; public ExtractedMethodHelper ( ExtractMethodConfig config ) { selectedNodes = config . getSelectedNodes ( ) ; visibility = initVisibility ( config . hasEnclosingClassNode ( ) ) ; isStaticMethod = config . getEnclosingMethodNode ( ) instanceof DefsNode ; initAfterSelectionNodes ( config . getEnclosingScopeNode ( ) ) ; initNeededLocalNodes ( ) ; } public Node getSelectedNodes ( ) { return selectedNodes ; } private VisibilityNodeWrapper . METHOD_VISIBILITY initVisibility ( boolean isDefnNodeInClassNode ) { if ( isDefnNodeInClassNode ) { return DEFAULT_VISIBILITY ; } return VisibilityNodeWrapper . METHOD_VISIBILITY . NONE ; } private void initAfterSelectionNodes ( Node enclosingScopeNode ) { Collection < Node > allNodes = NodeProvider . getAllNodes ( enclosingScopeNode ) ; afterSelectionNodes = new LinkedHashMap < Integer , LocalNodeWrapper > ( ) ; int endPostOfLastSelectedNode = selectedNodes . getPosition ( ) . getEndOffset ( ) ; boolean isWrongScopeNode = false ; int endOfOtherScope = 0 ; for ( Node aktNode : allNodes ) { if ( NodeUtil . hasScope ( aktNode ) ) { if ( aktNode . getPosition ( ) . getEndOffset ( ) > endOfOtherScope ) { isWrongScopeNode = false ; endOfOtherScope = 0 ; } if ( ! containsSameNodes ( selectedNodes , aktNode ) ) { isWrongScopeNode = true ; int endOfAktNode = aktNode . getPosition ( ) . getEndOffset ( ) ; if ( endOfAktNode > endOfOtherScope ) { endOfOtherScope = endOfAktNode ; } } } if ( isLocalNodeOfEnclosingScope ( isWrongScopeNode , aktNode ) ) { int aktStartOffset = aktNode . getPosition ( ) . getStartOffset ( ) ; if ( aktStartOffset > endPostOfLastSelectedNode ) { LocalNodeWrapper localNode = new LocalNodeWrapper ( aktNode ) ; afterSelectionNodes . put ( Integer . valueOf ( localNode . getId ( ) ) , localNode ) ; } } } } private boolean containsSameNodes ( Node selectionScopeNode , Node aktScopeNode ) { if ( selectionScopeNode . childNodes ( ) . isEmpty ( ) ) { return false ; } Object nodeToFind = selectionScopeNode . childNodes ( ) . toArray ( ) [ 0 ] ; for ( Object aktNode : NodeProvider . getAllNodes ( aktScopeNode ) ) { if ( aktNode . equals ( nodeToFind ) ) { return true ; } } return false ; } private boolean isLocalNodeOfEnclosingScope ( boolean isWrongScopeNode , Node aktNode ) { return ! isWrongScopeNode && ( NodeUtil . nodeAssignableFrom ( aktNode , LocalNodeWrapper . LOCAL_NODES_CLASSES ) ) ; } private void initNeededLocalNodes ( ) { Collection < LocalNodeWrapper > allLocalNodes = LocalNodeWrapper . gatherLocalNodes ( selectedNodes ) ; Map < String , LocalNodeWrapper > firstOccurrenceIsNotDefinitionLocalNodes = new LinkedHashMap < String , LocalNodeWrapper > ( ) ; Map < String , LocalNodeWrapper > localNodesNeededAsReturnValues = new LinkedHashMap < String | |
1,812 | <s> package org . rubypeople . rdt . internal . ui ; import org . eclipse . jface . viewers . IBasicPropertyConstants ; import org . eclipse . ui . views . properties . IPropertyDescriptor ; import org . eclipse . ui . views . properties . IPropertySource ; import org . eclipse . ui . views . properties . PropertyDescriptor ; import org . rubypeople | |
1,813 | <s> package com . asakusafw . compiler . repository ; import java . util . Collections ; import java . util . Comparator ; import java . util . List ; import java . util . ServiceLoader ; import javax . lang . model . type . TypeMirror ; import org . slf4j . Logger ; import org . slf4j . LoggerFactory ; import com . asakusafw . compiler . common . Precondition ; import com . asakusafw . compiler . operator . DataModelMirror ; import com . asakusafw . compiler . operator . DataModelMirrorRepository ; import com . asakusafw . compiler . operator . OperatorCompilingEnvironment ; import com . asakusafw . utils . collections . Lists ; public class SpiDataModelMirrorRepository implements DataModelMirrorRepository { static final Logger LOG | |
1,814 | <s> package com . asakusafw . runtime . flow ; import java . io . IOException ; import java . util . Iterator ; import org . apache . hadoop . mapreduce . Reducer ; public abstract class SegmentedCombiner < KEY extends SegmentedWritable , VALUE extends SegmentedWritable > extends Reducer < KEY , VALUE , KEY , VALUE > { public static final String GET_RENDEZVOUS = "" ; protected abstract Rendezvous < VALUE > getRendezvous ( KEY key ) ; @ Override protected void reduce ( KEY key , Iterable < VALUE > values , Context context ) throws IOException , | |
1,815 | <s> package org . rubypeople . rdt . debug . core ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . debug . core . model . ILineBreakpoint ; public interface IRubyLineBreakpoint extends IRubyBreakpoint , ILineBreakpoint { public boolean supportsCondition ( ) ; public String getCondition ( ) throws CoreException ; public void setCondition ( String condition ) throws CoreException ; public boolean isConditionEnabled ( ) throws CoreException ; public void setConditionEnabled ( boolean enabled ) throws CoreException ; public boolean isConditionSuspendOnTrue ( ) throws CoreException ; | |
1,816 | <s> package com . asakusafw . windgate . stream . file ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . File ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . Scanner ; import org . junit . Rule ; import org . junit . Test ; import org . junit . rules . TemporaryFolder ; import com . asakusafw . windgate . core . DriverScript ; import com . asakusafw . windgate . core . ParameterList ; import com . asakusafw . windgate . core . ProcessScript ; import com . asakusafw . windgate . core . resource . DrainDriver ; import com . asakusafw . windgate . core . resource . SourceDriver ; import com . asakusafw . windgate . core . vocabulary . FileProcess ; import com . asakusafw . windgate . core . vocabulary . StreamProcess ; import com . asakusafw . windgate . stream . StringBuilderSupport ; public class FileResourceManipulatorTest { @ Rule public TemporaryFolder folder = new TemporaryFolder ( ) ; @ Test public void cleanupSource ( ) throws Exception { File file = folder . newFile ( "file" ) ; ProcessScript < StringBuilder > process = process ( "testing" , driver ( file . getName ( ) ) , dummy ( ) ) ; FileResourceManipulator manipulator = new FileResourceManipulator ( profile ( ) , new ParameterList ( ) ) ; assertThat ( file . exists ( ) , is ( true ) ) ; manipulator . cleanupSource ( process ) ; assertThat ( file . exists ( ) , is ( false ) ) ; manipulator . cleanupSource ( process ) ; } @ Test public void cleanupDrain ( ) throws Exception { File file = folder . newFile ( "file" ) ; ProcessScript < StringBuilder > process = process ( "testing" , dummy ( ) , driver ( file . getName ( ) ) ) ; FileResourceManipulator manipulator = new FileResourceManipulator ( profile ( ) , new ParameterList ( ) ) ; assertThat ( file . exists ( ) , is ( true ) ) ; manipulator . cleanupDrain ( process ) ; assertThat ( file . exists ( ) , is ( false ) ) ; manipulator . cleanupDrain ( process ) ; } @ Test public void createSourceForSource ( ) throws Exception { File file = folder . newFile ( "file" ) ; put ( file , "" , "" , "" ) ; ProcessScript < StringBuilder > process = process ( "testing" , driver ( file . getName ( ) ) , dummy ( ) ) ; FileResourceManipulator manipulator = new FileResourceManipulator ( profile ( ) , new ParameterList ( ) ) ; SourceDriver < StringBuilder > driver = manipulator . createSourceForSource ( process ) ; try { driver . prepare ( ) ; test ( driver , "" , "" , "" ) ; } finally { driver . close ( ) ; } } @ Test public void createDrainForSource ( ) throws Exception { File file = folder . newFile ( "file" ) ; ProcessScript < StringBuilder > process = process ( "testing" , driver ( file . getName ( ) ) , dummy ( ) ) ; FileResourceManipulator manipulator = new FileResourceManipulator ( profile ( ) , new ParameterList ( ) ) ; DrainDriver < StringBuilder > driver = manipulator . createDrainForSource ( process ) ; try { driver . prepare ( ) ; driver . put ( new StringBuilder ( "" ) ) ; driver . put ( new StringBuilder ( "" ) ) ; driver . put ( new StringBuilder ( "" ) ) ; } finally { driver . close ( ) ; } test ( file , "" , "" , "" ) ; } | |
1,817 | <s> package org . rubypeople . rdt . internal . formatter ; import java . io . IOException ; import java . io . InputStream ; import java . util . ArrayList ; import java . util . Hashtable ; import java . util . List ; import javax . xml . parsers . DocumentBuilderFactory ; import javax . xml . parsers . FactoryConfigurationError ; import javax . xml . parsers . ParserConfigurationException ; import junit . framework . Assert ; import junit . framework . TestCase ; import org . eclipse . jface . text . BadLocationException ; import org . eclipse . jface . text . IDocument ; import org . eclipse . text . edits . MalformedTreeException ; import org . eclipse . text . edits . TextEdit ; import org . rubypeople . rdt . core . formatter . CodeFormatter ; import org . w3c . dom . Document ; import org . w3c . dom . Node ; import org . w3c . dom . NodeList ; import org . xml . sax . SAXException ; public abstract class AbstractCodeFormatterTestCase extends TestCase { private static class TestData { public TestData ( String formattedText , String unformattedText , String assertionMessage ) { this . formattedText = formattedText ; this . unformattedText = unformattedText ; this . assertionMessage = assertionMessage ; } public String formattedText ; public String unformattedText ; public String assertionMessage ; } private static final boolean VERBOSE = false ; private Hashtable < String , List < TestData > > testMap ; public AbstractCodeFormatterTestCase ( String name ) throws SAXException , IOException , ParserConfigurationException , FactoryConfigurationError { super ( name ) ; testMap = new Hashtable < String , List < TestData > > ( ) ; this . parseXmlConfiguration ( ) ; } private String stripFirstNewLine ( String input ) { return input . substring ( input . indexOf ( "n" ) + 1 ) ; } private void parseXmlConfiguration ( ) throws SAXException , IOException , ParserConfigurationException , FactoryConfigurationError { Document document = DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) . parse ( getInputDataStream ( ) ) ; NodeList tests = document . getElementsByTagName ( "test" ) ; for ( int i = 0 ; i < tests . getLength ( ) ; i ++ ) { Node test = tests . item ( i ) ; String name = test . getAttributes ( ) . getNamedItem ( "ID" ) . getNodeValue ( ) ; List < TestData > partList = new ArrayList < TestData > ( ) ; NodeList | |
1,818 | <s> package og . android . tether ; import java . io . File ; import java . io . FileInputStream ; import java . io . FileOutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . lang . reflect . Field ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . Hashtable ; import java . util . List ; import java . util . Properties ; import java . util . UUID ; import com . google . analytics . tracking . android . EasyTracker ; import og . android . tether . data . ClientData ; import og . android . tether . system . Configuration ; import og . android . tether . system . ConfigurationAdv ; import og . android . tether . system . CoreTask ; import og . android . tether . system . WebserviceTask ; import android . app . AlarmManager ; import android . app . Application ; import android . app . Notification ; import android . app . NotificationManager ; import android . app . PendingIntent ; import android . content . Context ; import android . content . Intent ; import android . content . SharedPreferences ; import android . content . pm . PackageInfo ; import android . content . pm . PackageManager ; import android . location . Location ; import android . location . LocationManager ; import android . net . Uri ; import android . os . Build ; import android . os . Bundle ; import android . os . Handler ; import android . os . Looper ; import android . os . Message ; import android . os . PowerManager ; import android . preference . PreferenceManager ; import android . provider . Settings ; import android . provider . Settings . SettingNotFoundException ; import android . telephony . TelephonyManager ; import android . util . Log ; import android . widget . Toast ; public class TetherApplication extends Application { public static final String MSG_TAG = "" ; public static final String MESHCLIENT_GOOGLE_PLAY_URL = "" ; public static final String MESSAGE_LAUNCH_CHECK = "" ; public final String DEFAULT_PASSPHRASE = "" ; public final String DEFAULT_LANNETWORK = "" ; public final String DEFAULT_ENCSETUP = "" ; public final String DEFAULT_SSID = "OpenGarden" ; public String deviceType = Configuration . DEVICE_GENERIC ; public String interfaceDriver = Configuration . DRIVER_WEXT ; public ConfigurationAdv configurationAdv = new ConfigurationAdv ( ) ; public boolean startupCheckPerformed = false ; static final int CLIENT_CONNECT_ACDISABLED = 0 ; static final int CLIENT_CONNECT_AUTHORIZED = 1 ; static final int CLIENT_CONNECT_NOTAUTHORIZED = 2 ; static TetherApplication singleton ; private PowerManager powerManager = null ; private PowerManager . WakeLock wakeLock = null ; public SharedPreferences settings = null ; public SharedPreferences . Editor preferenceEditor = null ; public NotificationManager notificationManager ; private Notification notification ; private int clientNotificationCount = 0 ; private PendingIntent mainIntent ; private PendingIntent accessControlIntent ; ArrayList < ClientData > clientDataAddList = new ArrayList < ClientData > ( ) ; ArrayList < String > clientMacRemoveList = new ArrayList < String > ( ) ; boolean accessControlSupported = true ; int lastTemperature = 0 ; public CoreTask . Whitelist whitelist = null ; public CoreTask . WpaSupplicant wpasupplicant = null ; public CoreTask . TiWlanConf tiwlan = null ; public CoreTask . TetherConfig tethercfg = null ; public CoreTask . DnsmasqConfig dnsmasqcfg = null ; public CoreTask . HostapdConfig hostapdcfg = null ; public CoreTask . BluetoothConfig btcfg = null ; public CoreTask coretask = null ; public FBManager FBManager = null ; boolean offeredMeshclient = false ; private static final String APPLICATION_PROPERTIES_URL = "" ; private static final String APPLICATION_DOWNLOAD_URL = "" ; private static final String APPLICATION_STATS_URL = "" ; static final String FORUM_URL = "" ; static final String FORUM_RSS_URL = "" ; static final String MESSAGE_POST_STATS = "" ; static final String MESSAGE_REPORT_STATS = "" ; @ Override public void onCreate ( ) { Log . d ( MSG_TAG , "" ) ; EasyTracker . getInstance ( ) . setContext ( getApplicationContext ( ) ) ; TetherApplication . singleton = this ; this . coretask = new CoreTask ( ) ; try { this . coretask . setPath ( this . getApplicationContext ( ) . getFilesDir ( ) . getParent ( ) ) ; } catch ( Exception e ) { this . coretask . setPath ( "" ) ; } Log . d ( MSG_TAG , "" + this . coretask . DATA_FILE_PATH ) ; this . checkDirs ( ) ; this . deviceType = Configuration . getDeviceType ( ) ; this . interfaceDriver = Configuration . getWifiInterfaceDriver ( this . deviceType ) ; this . settings = PreferenceManager . getDefaultSharedPreferences ( this ) ; this . preferenceEditor = settings . edit ( ) ; this . whitelist = this . coretask . new Whitelist ( ) ; this . wpasupplicant = this . coretask . new WpaSupplicant ( ) ; this . tiwlan = this . coretask . new TiWlanConf ( ) ; this . tethercfg = this . coretask . new TetherConfig ( ) ; this . tethercfg . read ( ) ; this . dnsmasqcfg = this . coretask . new DnsmasqConfig ( ) ; this . hostapdcfg = this . coretask . new HostapdConfig ( ) ; this . btcfg = this . coretask . new BluetoothConfig ( ) ; powerManager = ( PowerManager ) getSystemService ( Context . POWER_SERVICE ) ; wakeLock = powerManager . newWakeLock ( PowerManager . SCREEN_DIM_WAKE_LOCK , "" ) ; if ( this . settings . getBoolean ( "" , false ) ) { FBManager = new FBManager ( this ) ; FBManager . extendAccessTokenIfNeeded ( this , null ) ; } this . notificationManager = ( NotificationManager ) this . getSystemService ( Context . NOTIFICATION_SERVICE ) ; this . notification = new Notification ( R . drawable . start_notification , "" , System . currentTimeMillis ( ) ) ; this . mainIntent = PendingIntent . getActivity ( this , 0 , new Intent ( this , MainActivity . class ) , 0 ) ; this . accessControlIntent = PendingIntent . getActivity ( this , 1 , new Intent ( this , AccessControlActivity . class ) , 0 ) ; requestStatsAlarm ( ) ; updateDeviceParametersAdv ( ) ; updateConfiguration ( ) ; } @ Override public void onTerminate ( ) { Log . d ( MSG_TAG , "" ) ; this . notificationManager . cancelAll ( ) ; } public synchronized void addClientData ( ClientData clientData ) { this . clientDataAddList . add ( clientData ) ; } public synchronized void removeClientMac ( String mac ) { this . clientMacRemoveList . add ( mac ) ; } public synchronized ArrayList < ClientData > getClientDataAddList ( ) { ArrayList < ClientData > tmp = this . clientDataAddList ; this . clientDataAddList = new ArrayList < ClientData > ( ) ; return tmp ; } public synchronized ArrayList < String > getClientMacRemoveList ( ) { ArrayList < String > tmp = this . clientMacRemoveList ; this . clientMacRemoveList = new ArrayList < String > ( ) ; return tmp ; } public synchronized void resetClientMacLists ( ) { this . clientDataAddList = new ArrayList < ClientData > ( ) ; this . clientMacRemoveList = new ArrayList < String > ( ) ; } public void updateConfiguration ( ) { Log . d ( MSG_TAG , "" ) ; if ( ! this . settings . getString ( "devicepref" , "default" ) . equals ( "default" ) ) { updateConfigurationAdv ( ) ; return ; } long startStamp = System . currentTimeMillis ( ) ; boolean bluetoothPref = this . settings . getBoolean ( "bluetoothon" , false ) ; boolean encEnabled = this . settings . getBoolean ( "encpref" , false ) ; boolean acEnabled = this . settings . getBoolean ( "acpref" , false ) ; String ssid = this . settings . getString ( "ssidpref" , DEFAULT_SSID ) ; String txpower = this . settings . getString ( "txpowerpref" , "disabled" ) ; String lannetwork = this . settings . getString ( "" , DEFAULT_LANNETWORK ) ; String wepkey = this . settings . getString ( "" , DEFAULT_PASSPHRASE ) ; String wepsetupMethod = this . settings . getString ( "encsetuppref" , DEFAULT_ENCSETUP ) ; String channel = this . settings . getString ( "channelpref" , "1" ) ; String subnet = lannetwork . substring ( 0 , lannetwork . lastIndexOf ( "." ) ) ; this . tethercfg . read ( ) ; this . tethercfg . put ( "device.type" , deviceType ) ; this . tethercfg . put ( "tether.mode" , bluetoothPref ? "bt" : "wifi" ) ; this . tethercfg . put ( "wifi.essid" , ssid ) ; this . tethercfg . put ( "wifi.channel" , channel ) ; this . tethercfg . put ( "ip.network" , lannetwork . split ( "/" ) [ 0 ] ) ; this . tethercfg . put ( "ip.gateway" , subnet + ".254" ) ; if ( Configuration . enableFixPersist ( ) ) { this . tethercfg . put ( "" , "true" ) ; } else { this . tethercfg . put ( "" , "false" ) ; } if ( Configuration . enableFixRoute ( ) ) { this . tethercfg . put ( "" , "true" ) ; } else { this . tethercfg . put ( "" , "false" ) ; } if ( Configuration . getDeviceType ( ) . equals ( Configuration . DEVICE_NEXUSONE ) && Configuration . getWifiInterfaceDriver ( this . deviceType ) . equals ( Configuration . DRIVER_SOFTAP_GOG ) ) { this . tethercfg . put ( "" , "wl0.1" ) ; } else { this . tethercfg . put ( "" , this . coretask . getProp ( "" ) ) ; } this . tethercfg . put ( "wifi.txpower" , txpower ) ; if ( encEnabled ) { if ( this . interfaceDriver . startsWith ( "softap" ) ) { this . tethercfg . put ( "" , "wpa2-psk" ) ; } else if ( this . interfaceDriver . equals ( Configuration . DRIVER_HOSTAP ) ) { this . tethercfg . put ( "" , "unused" ) ; } else { this . tethercfg . put ( "" , "wep" ) ; } this . tethercfg . put ( "" , wepkey ) ; if ( wepsetupMethod . equals ( "auto" ) ) { wepsetupMethod = Configuration . getEncryptionAutoMethod ( deviceType ) ; } this . tethercfg . put ( "wifi.setup" , wepsetupMethod ) ; if ( wepsetupMethod . equals ( "" ) ) { if ( this . wpasupplicant . exists ( ) == false ) { this . installWpaSupplicantConfig ( ) ; } Hashtable < String , String > values = new Hashtable < String , String > ( ) ; values . put ( "ssid" , "\"" + this . settings . getString ( "ssidpref" , DEFAULT_SSID ) + "\"" ) ; values . put ( "wep_key0" , "\"" + this . settings . getString ( "" , DEFAULT_PASSPHRASE ) + "\"" ) ; this . wpasupplicant . write ( values ) ; } } else { this . tethercfg . put ( "" , "open" ) ; this . tethercfg . put ( "" , "none" ) ; if ( this . wpasupplicant . exists ( ) ) { this . wpasupplicant . remove ( ) ; } } this . tethercfg . put ( "wifi.driver" , Configuration . getWifiInterfaceDriver ( deviceType ) ) ; if ( this . tethercfg . write ( ) == false ) { Log . e ( MSG_TAG , "" ) ; } this . dnsmasqcfg . set ( lannetwork ) ; if ( this . dnsmasqcfg . write ( ) == false ) { Log . e ( MSG_TAG , "" ) ; } if ( this . interfaceDriver . equals ( Configuration . DRIVER_HOSTAP ) ) { this . installHostapdConfig ( ) ; this . hostapdcfg . read ( ) ; if ( this . deviceType . equals ( Configuration . DEVICE_DROIDX ) ) { this . hostapdcfg . put ( "ssid" , ssid ) ; this . hostapdcfg . put ( "channel" , channel ) ; if ( encEnabled ) { this . hostapdcfg . put ( "wpa" , "" + 2 ) ; this . hostapdcfg . put ( "wpa_pairwise" , "CCMP" ) ; this . hostapdcfg . put ( "rsn_pairwise" , "CCMP" ) ; this . hostapdcfg . put ( "" , wepkey ) ; } } else if ( this . deviceType . equals ( Configuration . DEVICE_BLADE ) ) { this . hostapdcfg . put ( "ssid" , ssid ) ; this . hostapdcfg . put ( "channel_num" , channel ) ; if ( encEnabled ) { this . hostapdcfg . put ( "wpa" , "" + 2 ) ; this . hostapdcfg . put ( "wpa_key_mgmt" , "WPA-PSK" ) ; this . hostapdcfg . put ( "wpa_pairwise" , "CCMP" ) ; this . hostapdcfg . put ( "" , wepkey ) ; } } if ( this . hostapdcfg . write ( ) == false ) { Log . e ( MSG_TAG , "" ) ; } } this . btcfg . set ( lannetwork ) ; if ( this . btcfg . write ( ) == false ) { Log . e ( MSG_TAG , "" ) ; } if ( acEnabled ) { if ( this . whitelist . exists ( ) == false ) { try { this . whitelist . touch ( ) ; } catch ( IOException e ) { Log . e ( MSG_TAG , "" ) ; e . printStackTrace ( ) ; } } } else { if ( this . whitelist . exists ( ) ) { this . whitelist . remove ( ) ; } } if ( deviceType . equals ( Configuration . DEVICE_DREAM ) ) { Hashtable < String , String > values = new Hashtable < String , String > ( ) ; values . put ( "" , this . settings . getString ( "ssidpref" , DEFAULT_SSID ) ) ; values . put ( "" , this . settings . getString ( "channelpref" , "1" ) ) ; this . tiwlan . write ( values ) ; } Log . d ( MSG_TAG , "" + ( System . currentTimeMillis ( ) - startStamp ) + "" ) ; } public String getTetherNetworkDevice ( ) { boolean bluetoothPref = this . settings . getBoolean ( "bluetoothon" , false ) ; if ( bluetoothPref ) return "bnep" ; else { if ( Configuration . getDeviceType ( ) . equals ( Configuration . DEVICE_NEXUSONE ) && Configuration . getWifiInterfaceDriver ( this . deviceType ) . equals ( Configuration . DRIVER_SOFTAP_GOG ) ) { return "wl0.1" ; } else { return this . coretask . getProp ( "" ) ; } } } public boolean isConfigurationAdv ( ) { return ! this . settings . getString ( "devicepref" , "default" ) . equals ( "default" ) || ! this . settings . getString ( "setuppref" , "default" ) . equals ( "default" ) ; } public void updateDeviceParametersAdv ( ) { Log . d ( MSG_TAG , "" ) ; String device = this . settings . getString ( "devicepref" , "default" ) ; if ( device . equals ( "default" ) ) { device = Configuration . getDeviceType ( ) ; } else if ( device . equals ( "auto" ) ) { this . configurationAdv = new ConfigurationAdv ( ) ; } else { this . configurationAdv = new ConfigurationAdv ( device ) ; } } public ConfigurationAdv getDeviceParametersAdv ( ) { return this . configurationAdv ; } public void updateConfigurationAdv ( ) { Log . d ( MSG_TAG , "" ) ; long startStamp = System . currentTimeMillis ( ) ; updateDeviceParametersAdv ( ) ; boolean encEnabled = this . settings . getBoolean ( "encpref" , false ) ; boolean acEnabled = this . settings . getBoolean ( "acpref" , false ) ; boolean bluetoothPref = this . settings . getBoolean ( "bluetoothon" , false ) ; String ssid = this . settings . getString ( "ssidpref" , DEFAULT_SSID ) ; String txpower = this . settings . getString ( "txpowerpref" , "disabled" ) ; String lannetwork = this . settings . getString ( "" , DEFAULT_LANNETWORK ) ; String wepkey = this . settings . getString ( "" , DEFAULT_PASSPHRASE ) ; String wepsetupMethod = this . settings . getString ( "encsetuppref" , DEFAULT_ENCSETUP ) ; String channel = this . settings . getString ( "channelpref" , "1" ) ; boolean mssclampingEnabled = this . settings . getBoolean ( "" , false ) ; boolean routefixEnabled = this . settings . getBoolean ( "routefixpref" , false ) ; String primaryDns = this . settings . getString ( "" , "8.8.8.8" ) ; String secondaryDns = this . settings . getString ( "" , "8.8.4.4" ) ; boolean hideSSID = this . settings . getBoolean ( "hidessidpref" , false ) ; boolean reloadDriver = this . settings . getBoolean ( "" , true ) ; String setupMethod = this . settings . getString ( "setuppref" , "auto" ) ; if ( configurationAdv . isTiadhocSupported ( ) == false ) { if ( setupMethod . equals ( "auto" ) ) { setupMethod = configurationAdv . getAutoSetupMethod ( ) ; } } else { setupMethod = "tiwlan0" ; } Log . d ( MSG_TAG , "" + setupMethod ) ; String subnet = lannetwork . substring ( 0 , lannetwork . lastIndexOf ( "." ) ) ; this . tethercfg . put ( "" , "adv" ) ; this . tethercfg . put ( "tether.mode" , bluetoothPref ? "bt" : "wifi" ) ; this . tethercfg . put ( "device.type" , configurationAdv . getDevice ( ) ) ; this . tethercfg . put ( "wifi.essid" , ssid ) ; this . tethercfg . put ( "wifi.channel" , channel ) ; this . tethercfg . put ( "ip.network" , lannetwork . split ( "/" ) [ 0 ] ) ; this . tethercfg . put ( "ip.gateway" , subnet + ".254" ) ; this . tethercfg . put ( "ip.netmask" , "" ) ; this . tethercfg . put ( "dns.primary" , primaryDns ) ; this . tethercfg . put ( "" , secondaryDns ) ; if ( mssclampingEnabled ) { this . tethercfg . put ( "mss.clamping" , "true" ) ; } else { this . tethercfg . put ( "mss.clamping" , "false" ) ; } if ( hideSSID ) { this . tethercfg . put ( "" , "1" ) ; } else { this . tethercfg . put ( "" , "0" ) ; } if ( reloadDriver ) { this . tethercfg . put ( "" , "true" ) ; } else { this . tethercfg . put ( "" , "false" ) ; } if ( routefixEnabled ) { this . tethercfg . put ( "" , "true" ) ; } else { this . tethercfg . put ( "" , "false" ) ; } this . tethercfg . put ( "" , "" + configurationAdv . isGenericSetupSection ( ) ) ; this . tethercfg . put ( "" , this . coretask . getProp ( "" ) ) ; this . tethercfg . put ( "wifi.driver" , setupMethod ) ; if ( setupMethod . equals ( "wext" ) ) { this . tethercfg . put ( "" , this . tethercfg . get ( "" ) ) ; if ( encEnabled ) { this . tethercfg . put ( "" , "wep" ) ; } } else if ( setupMethod . equals ( "netd" ) ) { this . tethercfg . put ( "" , configurationAdv . getNetdInterface ( ) ) ; if ( encEnabled ) { this . tethercfg . put ( "" , configurationAdv . getEncryptionIdentifier ( ) ) ; } else { this . tethercfg . put ( "" , configurationAdv . getOpennetworkIdentifier ( ) ) ; } } else if ( setupMethod . equals ( "hostapd" ) ) { this . tethercfg . put ( "" , configurationAdv . getHostapdKernelModulePath ( ) ) ; this . tethercfg . put ( "" , configurationAdv . getHostapdKernelModuleName ( ) ) ; this . tethercfg . put ( "" , configurationAdv . getHostapdPath ( ) ) ; this . tethercfg . put ( "" , configurationAdv . getHostapdInterface ( ) ) ; if ( encEnabled ) { this . tethercfg . put ( "" , "unused" ) ; } if ( configurationAdv . getHostapdLoaderCmd ( ) == null || configurationAdv . getHostapdLoaderCmd ( ) . length ( ) <= 0 ) { this . tethercfg . put ( "" , "disabled" ) ; } else { this . tethercfg . put ( "" , configurationAdv . getHostapdLoaderCmd ( ) ) ; } } else if ( setupMethod . equals ( "tiwlan0" ) ) { this . tethercfg . put ( "" , configurationAdv . getTiadhocInterface ( ) ) ; if ( encEnabled ) { this . tethercfg . put ( "" , "wep" ) ; } } else if ( setupMethod . startsWith ( "softap" ) ) { this . tethercfg . put ( "" , configurationAdv . getSoftapInterface ( ) ) ; this . tethercfg . put ( "" , configurationAdv . getSoftapFirmwarePath ( ) ) ; if ( encEnabled ) { this . tethercfg . put ( "" , configurationAdv . getEncryptionIdentifier ( ) ) ; } else { this . tethercfg . put ( "" , configurationAdv . getOpennetworkIdentifier ( ) ) ; } } this . tethercfg . put ( "" , configurationAdv . getWifiLoadCmd ( ) ) ; this . tethercfg . put ( "" , configurationAdv . getWifiUnloadCmd ( ) ) ; this . tethercfg . put ( "wifi.txpower" , txpower ) ; if ( encEnabled ) { this . tethercfg . put ( "" , wepkey ) ; if ( wepsetupMethod . equals ( "auto" ) ) { if ( configurationAdv . isWextSupported ( ) ) { wepsetupMethod = "iwconfig" ; } else if ( configurationAdv . isTiadhocSupported ( ) ) { wepsetupMethod = "" ; } } this . tethercfg . put ( "wifi.setup" , wepsetupMethod ) ; if ( wepsetupMethod . equals ( "" ) ) { if ( this . wpasupplicant . exists ( ) == false ) { this . installWpaSupplicantConfig ( ) ; } Hashtable < String , String > values = new Hashtable < String , String > ( ) ; values . put ( "ssid" , "\"" + this . settings . getString ( "ssidpref" , DEFAULT_SSID ) + "\"" ) ; values . put ( "wep_key0" , "\"" + this . settings . getString ( "" , DEFAULT_PASSPHRASE ) + "\"" ) ; this . wpasupplicant . write ( values ) ; } } else { this . tethercfg . put ( "" , "open" ) ; this . tethercfg . put ( "" , "none" ) ; if ( this . wpasupplicant . exists ( ) ) { this . wpasupplicant . remove ( ) ; } } String [ ] lanparts = lannetwork . split ( "\\." ) ; this . tethercfg . put ( "dhcp.iprange" , lanparts [ 0 ] + "." + lanparts [ 1 ] + "." + lanparts [ 2 ] + ".100," + lanparts [ 0 ] + "." + lanparts [ 1 ] + "." + lanparts [ 2 ] + ".108,12h" ) ; if ( this . tethercfg . write ( ) == false ) { Log . e ( MSG_TAG , "" ) ; } if ( setupMethod . equals ( "hostapd" ) ) { this . installHostapdConfig ( configurationAdv . getHostapdTemplate ( ) ) ; this . hostapdcfg . read ( ) ; if ( configurationAdv . getHostapdTemplate ( ) . equals ( "droi" ) ) { this . hostapdcfg . put ( "ssid" , ssid ) ; this . hostapdcfg . put ( "channel" , channel ) ; this . hostapdcfg . put ( "interface" , configurationAdv . getHostapdInterface ( ) ) ; if ( encEnabled ) { this . hostapdcfg . put ( "wpa" , "" + 2 ) ; this . hostapdcfg . put ( "wpa_pairwise" , "CCMP" ) ; this . hostapdcfg . put ( "rsn_pairwise" , "CCMP" ) ; this . hostapdcfg . put ( "" , wepkey ) ; } } else if ( configurationAdv . getHostapdTemplate ( ) . equals ( "mini" ) ) { this . hostapdcfg . put ( "ssid" , ssid ) ; this . hostapdcfg . put ( "channel_num" , channel ) ; if ( encEnabled ) { this . hostapdcfg . put ( "wpa" , "" + 2 ) ; this . hostapdcfg . put ( "wpa_key_mgmt" , "WPA-PSK" ) ; this . hostapdcfg . put ( "wpa_pairwise" , "CCMP" ) ; this . hostapdcfg . put ( "" , wepkey ) ; } } else if ( configurationAdv . getHostapdTemplate ( ) . equals ( "tiap" ) ) { this . hostapdcfg . put ( "ssid" , ssid ) ; this . hostapdcfg . put ( "channel" , channel ) ; this . hostapdcfg . put ( "interface" , configurationAdv . getHostapdInterface ( ) ) ; if ( encEnabled ) { this . hostapdcfg . put ( "wpa" , "" + 2 ) ; this . hostapdcfg . put ( "wpa_pairwise" , "CCMP" ) ; this . hostapdcfg . put ( "rsn_pairwise" , "CCMP" ) ; this . hostapdcfg . put ( "" , wepkey ) ; } } if ( this . hostapdcfg . write ( ) == false ) { Log . e ( MSG_TAG , "" ) ; } } if ( acEnabled ) { if ( this . whitelist . exists ( ) == false ) { try { this . whitelist . touch ( ) ; } catch ( IOException e ) { Log . e ( MSG_TAG , "" ) ; e . printStackTrace ( ) ; } } } else { if ( this . whitelist . exists ( ) ) { this . whitelist . remove ( ) ; } } if ( configurationAdv . isTiadhocSupported ( ) ) { TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0644" , R . raw . tiwlan_ini ) ; Hashtable < String , String > values = this . tiwlan . get ( ) ; values . put ( "" , this . settings . getString ( "ssidpref" , DEFAULT_SSID ) ) ; values . put ( "" , this . settings . getString ( "channelpref" , "1" ) ) ; this . tiwlan . write ( values ) ; } else { File tiwlanconf = new File ( TetherApplication . this . coretask . DATA_FILE_PATH + "" ) ; if ( tiwlanconf . exists ( ) ) { tiwlanconf . delete ( ) ; } } Log . d ( MSG_TAG , "" + ( System . currentTimeMillis ( ) - startStamp ) + "" ) ; } public void installHostapdConfig ( String hostapdTemplate ) { if ( hostapdTemplate . equals ( "droi" ) ) { this . copyFile ( this . coretask . DATA_FILE_PATH + "" , "0644" , R . raw . hostapd_conf_droi ) ; } else if ( hostapdTemplate . equals ( "mini" ) ) { this . copyFile ( this . coretask . DATA_FILE_PATH + "" , "0644" , R . raw . hostapd_conf_mini ) ; } else if ( hostapdTemplate . equals ( "tiap" ) ) { this . copyFile ( this . coretask . DATA_FILE_PATH + "" , "0644" , R . raw . hostapd_conf_tiap ) ; } } public boolean isWakeLockDisabled ( ) { return this . settings . getBoolean ( "wakelockpref" , true ) ; } public boolean isSyncDisabled ( ) { return this . settings . getBoolean ( "syncpref" , false ) ; } public boolean isUpdatecDisabled ( ) { return this . settings . getBoolean ( "updatepref" , false ) ; } public boolean showDonationDialog ( ) { return this . settings . getBoolean ( "donatepref" , true ) ; } public void releaseWakeLock ( ) { try { if ( this . wakeLock != null && this . wakeLock . isHeld ( ) ) { Log . d ( MSG_TAG , "" ) ; this . wakeLock . release ( ) ; } } catch ( Exception ex ) { Log . d ( MSG_TAG , "" + ex . getMessage ( ) ) ; } } public void acquireWakeLock ( ) { try { if ( this . isWakeLockDisabled ( ) == false ) { Log . d ( MSG_TAG , "" ) ; this . wakeLock . acquire ( ) ; } } catch ( Exception ex ) { Log . d ( MSG_TAG , "" + ex . getMessage ( ) ) ; } } public int getNotificationType ( ) { return Integer . parseInt ( this . settings . getString ( "" , "2" ) ) ; } public void showStartNotification ( String message ) { notification . flags = Notification . FLAG_ONGOING_EVENT ; notification . setLatestEventInfo ( this , getString ( R . string . global_application_name ) , message , this . mainIntent ) ; this . notificationManager . notify ( - 1 , this . notification ) ; } public Notification getStartNotification ( String message ) { notification . flags = Notification . FLAG_ONGOING_EVENT ; notification . setLatestEventInfo ( this , getString ( R . string . global_application_name ) , message , this . mainIntent ) ; return notification ; } Handler clientConnectHandler = new Handler ( ) { public void handleMessage ( Message msg ) { ClientData clientData = ( ClientData ) msg . obj ; TetherApplication . this . showClientConnectNotification ( clientData , msg . what ) ; } } ; public void showClientConnectNotification ( ClientData clientData , int authType ) { int notificationIcon = R . drawable . secmedium ; String notificationString = "" ; switch ( authType ) { case CLIENT_CONNECT_ACDISABLED : notificationIcon = R . drawable . secmedium ; notificationString = getString ( R . string . global_application_accesscontrol_disabled ) ; break ; case CLIENT_CONNECT_AUTHORIZED : notificationIcon = R . drawable . sechigh ; notificationString = getString ( R . string . global_application_accesscontrol_authorized ) ; break ; case CLIENT_CONNECT_NOTAUTHORIZED : notificationIcon = R . drawable . seclow ; notificationString = getString ( R . string . global_application_accesscontrol_authorized ) ; } Log . d ( MSG_TAG , "New (" + notificationString + "" + clientData . getClientName ( ) + " - " + clientData . getMacAddress ( ) ) ; Notification clientConnectNotification = new Notification ( notificationIcon , getString ( R . string . global_application_name ) , System . currentTimeMillis ( ) ) ; clientConnectNotification . tickerText = clientData . getClientName ( ) + " (" + clientData . getMacAddress ( ) + ")" ; if ( ! this . settings . getString ( "notifyring" , "" ) . equals ( "" ) ) clientConnectNotification . sound = Uri . parse ( this . settings . getString ( "notifyring" , "" ) ) ; if ( this . settings . getBoolean ( "" , true ) ) clientConnectNotification . vibrate = new long [ ] { 100 , 200 , 100 , 200 } ; if ( this . accessControlSupported ) clientConnectNotification . setLatestEventInfo ( this , getString ( R . string . global_application_name ) + " - " + notificationString , clientData . getClientName ( ) + " (" + clientData . getMacAddress ( ) + ") " + getString ( R . string . global_application_connected ) + " ..." , this . accessControlIntent ) ; else clientConnectNotification . setLatestEventInfo ( this , getString ( R . string . global_application_name ) + " - " + notificationString , clientData . getClientName ( ) + " (" + clientData . getMacAddress ( ) + ") " + getString ( R . string . global_application_connected ) + " ..." , this . mainIntent ) ; clientConnectNotification . flags = Notification . FLAG_AUTO_CANCEL ; this . notificationManager . notify ( this . clientNotificationCount , clientConnectNotification ) ; this . clientNotificationCount ++ ; } public boolean binariesExists ( ) { File file = new File ( this . coretask . DATA_FILE_PATH + "/bin/tether" ) ; return file . exists ( ) ; } public void installWpaSupplicantConfig ( ) { this . copyFile ( this . coretask . DATA_FILE_PATH + "" , "0644" , R . raw . wpa_supplicant_conf ) ; } public void installHostapdConfig ( ) { if ( this . deviceType . equals ( Configuration . DEVICE_DROIDX ) ) { this . copyFile ( this . coretask . DATA_FILE_PATH + "" , "0644" , R . raw . hostapd_conf_droidx ) ; } else if ( this . deviceType . equals ( Configuration . DEVICE_BLADE ) ) { this . copyFile ( this . coretask . DATA_FILE_PATH + "" , "0644" , R . raw . hostapd_conf_blade ) ; } } Handler displayMessageHandler = new Handler ( ) { public void handleMessage ( Message msg ) { if ( msg . obj != null ) { TetherApplication . this . displayToastMessage ( ( String ) msg . obj ) ; } super . handleMessage ( msg ) ; } } ; public void installFiles ( ) { String message = null ; if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "/bin/tether" , "0755" , R . raw . tether ) ; } if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "/bin/dnsmasq" , "0755" , R . raw . dnsmasq ) ; } if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0755" , R . raw . iptables ) ; } if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0755" , R . raw . iptables2 ) ; } if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0755" , R . raw . ifconfig ) ; } if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0755" , R . raw . iwconfig ) ; } if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0755" , R . raw . ultra_bcm_config ) ; } if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "/bin/pand" , "0755" , R . raw . pand ) ; } if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0755" , R . raw . blue_up_sh ) ; } if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0755" , R . raw . blue_down_sh ) ; } if ( Configuration . enableFixPersist ( ) ) { if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0755" , R . raw . fixpersist_sh ) ; } } if ( Configuration . enableFixRoute ( ) ) { if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0755" , R . raw . fixroute_sh ) ; } } if ( message == null ) { message = TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0644" , R . raw . dnsmasq_conf ) ; TetherApplication . this . coretask . updateDnsmasqFilepath ( ) ; } if ( message == null ) { TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0644" , R . raw . tiwlan_ini ) ; } if ( message == null ) { TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0644" , R . raw . tether_edify ) ; } if ( message == null ) { TetherApplication . this . copyFile ( TetherApplication . this . coretask . DATA_FILE_PATH + "" , "0644" , R . raw . tether_conf ) ; } TetherApplication . this . coretask . chmod ( TetherApplication . this . coretask . DATA_FILE_PATH + "/conf/" , "0755" ) ; if ( message == null ) { message = getString ( R . string . global_application_installed ) ; } Message msg = new Message ( ) ; msg . obj = message ; TetherApplication . this . displayMessageHandler . sendMessage ( msg ) ; } public static Object getDeclaredField ( Class < ? > c , String name ) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException { Field f = c . getDeclaredField ( name ) ; f . setAccessible ( true ) ; return f . get ( c ) ; } public static Object getDeclaredField ( String className , String fieldName ) throws SecurityException , IllegalArgumentException , NoSuchFieldException , IllegalAccessException , ClassNotFoundException { return getDeclaredField ( Class . forName ( className ) , fieldName ) ; } public boolean isProviderSupported ( String checkProvider ) { List < String > providers ; try { LocationManager lm = ( LocationManager ) getSystemService ( Context . LOCATION_SERVICE ) ; providers = lm . getAllProviders ( ) ; } catch ( Throwable e ) { return false ; } for ( String provider : providers ) { if ( checkProvider . equals ( provider ) ) { return true ; } } return false ; } private boolean isPackageInstalled ( String packageName ) { PackageManager packageManager = getPackageManager ( ) ; boolean installed = false ; try { packageManager . getPackageInfo ( packageName , PackageManager . GET_ACTIVITIES ) ; installed = true ; } catch ( PackageManager . NameNotFoundException e ) { } return installed ; } public boolean isPhone ( ) { TelephonyManager tm = ( TelephonyManager ) getSystemService ( Context . TELEPHONY_SERVICE ) ; switch ( tm . getPhoneType ( ) ) { case TelephonyManager . PHONE_TYPE_NONE : return false ; case TelephonyManager . PHONE_TYPE_GSM : case TelephonyManager . PHONE_TYPE_CDMA : default : return true ; } } public void reportStats ( int status , boolean synchronous ) { final HashMap < String , Object > h = new HashMap < String , Object > ( ) ; String aid = null ; try { aid = Settings . Secure . getString ( getContentResolver ( ) , Settings . Secure . ANDROID_ID ) ; } catch ( NullPointerException e ) { Log . e ( "" , "" , e ) ; } if ( aid != null ) { h . put ( "aid" , aid ) ; } String uuid = "" ; for ( int i = 0 ; i < 2 ; i ++ ) { if ( aid != null ) { uuid += aid ; } try { uuid += getDeclaredField ( android . os . Build . class , "SERIAL" ) ; } catch ( IllegalArgumentException e ) { } catch ( IllegalAccessException e ) { } catch ( NoSuchFieldError e ) { } catch ( SecurityException e ) { } catch ( NoSuchFieldException e ) { } } if ( uuid . length ( ) < 32 ) { uuid = settings . getString ( "uuid" , UUID . randomUUID ( ) . toString ( ) ) ; settings . edit ( ) . putString ( "uuid" , uuid ) . commit ( ) ; } else { uuid = ( uuid . substring ( 0 , 8 ) + "-" + uuid . substring ( 8 , 12 ) + "-" + uuid . substring ( 12 , 16 ) + "-" + uuid . substring ( 16 , 20 ) + "-" + uuid . substring ( | |
1,819 | <s> package org . oddjob . logging . cache ; import junit . framework . TestCase ; import org . oddjob . Structural ; import org . oddjob . logging . ArchiveNameResolver ; import org . oddjob . logging . LogEnabled ; import org . oddjob . logging . LogEvent ; import org . oddjob . logging . LogHelper ; import org . oddjob . logging . LogLevel ; import org . oddjob . logging . LogListener ; import org . oddjob . logging . cache . StructuralArchiverCache ; import org . oddjob . structural . StructuralEvent ; import org . oddjob . structural . StructuralListener ; public class StructuralArchiverCacheTest extends TestCase { public class Thing implements LogEnabled { public String loggerName ( ) { return "thing" ; } } class MyLL implements LogListener { LogEvent lev ; int count ; public void logEvent ( LogEvent logEvent ) { count ++ ; lev = logEvent ; } } class R implements ArchiveNameResolver { public String resolveName ( Object component ) { return LogHelper . getLogger ( component ) ; } } public void testAddEvent ( ) { Thing thing = new Thing ( ) ; StructuralArchiverCache test = new StructuralArchiverCache ( thing , new R ( ) ) ; assertEquals ( - 1 , test . getLastMessageNumber ( "thing" ) ) ; MyLL ll = new MyLL ( ) ; test . addLogListener ( ll , thing , LogLevel . DEBUG , - 1 , 2000 ) ; assertNull ( ll . lev ) ; test . addEvent ( "thing" , LogLevel . DEBUG , "Hello" ) ; assertEquals ( "Hello" , ll . lev . getMessage ( ) ) ; assertEquals ( 0 , ll . lev . getNumber ( ) ) ; } public void testBadAddListeners ( ) { Thing thing = new Thing ( ) ; StructuralArchiverCache test = new StructuralArchiverCache ( thing , new R ( ) ) ; MyLL ll = new MyLL ( ) ; test . addLogListener ( ll , thing , LogLevel . DEBUG , - 1 , 2000 ) ; assertNull ( ll . lev ) ; test . removeLogListener ( ll , thing ) ; test . addLogListener ( ll , thing , LogLevel . DEBUG , 2 , - 1 ) ; assertNull ( ll . lev ) ; test . removeLogListener ( ll , thing ) ; } public void TestAddListenLater ( ) { Thing t = new Thing ( ) ; StructuralArchiverCache lai = new StructuralArchiverCache ( t , new R ( ) ) ; lai . addEvent ( "thing" , LogLevel . DEBUG , "x" ) ; lai . addEvent ( "thing" , LogLevel . DEBUG , "y" ) ; lai . addEvent ( "thing" , LogLevel . DEBUG , "z" ) ; assertEquals ( 2 , lai . getLastMessageNumber ( "thing" ) ) ; MyLL ll = new MyLL ( ) ; lai . addLogListener ( ll , "thing" , LogLevel . DEBUG , - 1 , 2 ) ; assertEquals ( "z" , | |
1,820 | <s> package com . asakusafw . compiler . flow . debugging ; import java . lang . annotation . Documented ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; @ Target | |
1,821 | <s> package test . modelgen . table . io ; import java . io . IOException ; import javax . annotation . Generated ; import test . modelgen . table . model . PurchaseTran ; import com . asakusafw . runtime . io . ModelOutput ; import com . asakusafw . runtime . io . RecordEmitter ; @ Generated ( "" ) @ SuppressWarnings ( "deprecation" ) public final class PurchaseTranModelOutput implements ModelOutput < PurchaseTran > { private final RecordEmitter emitter ; public PurchaseTranModelOutput ( RecordEmitter emitter ) { if ( emitter == null ) { throw new IllegalArgumentException ( ) ; } this . emitter = emitter ; } @ Override public void write ( PurchaseTran model ) throws IOException { emitter . emit ( model . getSidOption ( ) ) ; emitter . emit ( model . getVersionNoOption ( ) ) ; emitter . emit ( model . getRgstDatetimeOption ( ) ) ; emitter . emit ( model . getUpdtDatetimeOption ( ) ) ; emitter . emit ( model . getPurchaseNoOption ( ) ) ; emitter . emit ( model . getPurchaseTypeOption ( ) ) ; emitter . emit ( model . getTradeTypeOption ( ) ) ; emitter . emit ( model . getTradeNoOption ( ) ) ; emitter . emit ( model . getLineNoOption ( ) ) ; emitter . emit ( model . getDeliveryDateOption ( ) ) ; emitter . emit ( model . getStoreCodeOption ( ) ) ; emitter . emit ( model . getBuyerCodeOption ( ) ) ; emitter . emit ( model . getPurchaseTypeCodeOption ( ) ) ; emitter . emit ( model . getSellerCodeOption ( ) ) ; emitter . emit ( model . getTenantCodeOption ( ) ) ; emitter . emit ( model . getNetPriceTotalOption ( ) ) ; emitter . emit ( model . getSellingPriceTotalOption ( ) ) ; emitter . emit ( model . getShipmentStoreCodeOption ( ) ) ; emitter . emit ( model . getShipmentSalesTypeCodeOption ( ) ) ; emitter . emit ( model . getDeductionCodeOption ( ) ) ; emitter | |
1,822 | <s> package net . sf . sveditor . core . parser ; import net . sf . sveditor . core . db . ISVDBAddChildItem ; import net . sf . sveditor . core . db . SVDBLocation ; import net . sf . sveditor . core . db . SVDBTypeInfo ; import net . sf . sveditor . core . db . SVDBTypeInfoBuiltin ; import net . sf . sveditor . core . db . stmt . SVDBVarDeclItem ; import net . sf . sveditor . core . db . stmt . SVDBVarDeclStmt ; import net . sf . sveditor . core . scanner . SVKeywords ; public class SVBlockItemDeclParser extends SVParserBase { public SVBlockItemDeclParser ( ISVParser parser ) { super ( parser ) ; } public void parse ( ISVDBAddChildItem parent , SVDBTypeInfo type , SVDBLocation start ) throws SVParseException { parse ( parent , type , start , true ) ; } public void parse ( ISVDBAddChildItem parent , SVDBTypeInfo type , SVDBLocation start | |
1,823 | <s> package com . asakusafw . runtime . model ; import java . lang . annotation . Documented ; import java . lang . annotation . ElementType ; import java . | |
1,824 | <s> package hudson . jbpm . hibernate ; import hudson . model . Hudson ; import hudson . model . Job ; import org . jbpm . context . exe . Converter ; public | |
1,825 | <s> package com . asakusafw . compiler . flow . example ; import com . asakusafw . compiler . flow . testing . model . Ex1 ; import com . asakusafw . compiler . flow . testing . model . Ex2 ; import com . asakusafw . compiler . flow . testing . operator . ExOperatorFactory ; import com . asakusafw . compiler . flow . testing . operator . ExOperatorFactory . Cogroup ; import com . asakusafw . compiler . flow . testing . operator . | |
1,826 | <s> package org . oddjob . schedules . schedules ; import java . text . ParseException ; import java . util . Calendar ; import java . util . Date ; import java . util . TimeZone ; import junit . framework . TestCase ; import org . apache . log4j . Logger ; import org . oddjob . arooa . utils . DateHelper ; import org . oddjob . arooa . utils . SpringSafeCalendar ; import org . oddjob . arooa . utils . TimeParser ; import org . oddjob . schedules . IntervalTo ; import org . oddjob . schedules . ScheduleResult ; import org . oddjob . schedules . ScheduleRoller ; public class DailyOverDSTBoundryTest extends TestCase { private static final Logger logger = Logger . getLogger ( DailyOverDSTBoundryTest . class ) ; @ Override protected void setUp ( ) throws Exception { super . setUp ( ) ; logger . info ( "" + getName ( ) + "" ) ; } public void testCalendarAssuptionsAutumn ( ) throws ParseException { TimeZone . setDefault ( TimeZone . getTimeZone ( "" ) ) ; Date saturday1AM_BST = DateHelper . parseDateTime ( "" ) ; Calendar cal1 = Calendar . getInstance ( TimeZone . getTimeZone ( "" ) ) ; cal1 . setTime ( saturday1AM_BST ) ; cal1 . add ( Calendar . DATE , 1 ) ; assertEquals ( 1 * 60 * 60 * 1000L , cal1 . get ( Calendar . DST_OFFSET ) ) ; Date sunday1AM_BST = new Date ( DateHelper . parseDateTime ( "" ) . getTime ( ) + 1 ) ; logger . info ( "" + saturday1AM_BST ) ; assertEquals ( sunday1AM_BST , cal1 . getTime ( ) ) ; cal1 . add ( Calendar . HOUR , 1 ) ; Date sunday1AM_GMT = DateHelper . parseDateTime ( "" ) ; logger . info ( "" + sunday1AM_GMT ) ; assertEquals ( sunday1AM_GMT , cal1 . getTime ( ) ) ; TimeZone . setDefault ( null ) ; } public void testCalendarAssuptionsSpring ( ) throws ParseException { TimeZone . setDefault ( TimeZone . getTimeZone ( "" ) ) ; Date saturday_Midnight = DateHelper . parseDateTime ( "" ) ; Calendar cal1 = Calendar . getInstance ( ) ; cal1 . setTime ( saturday_Midnight ) ; cal1 . add ( Calendar . DATE , 1 ) ; Date sundayMidnight_GMT = DateHelper . parseDateTime ( "" ) ; assertEquals ( sundayMidnight_GMT , cal1 . getTime ( ) ) ; Date saturday1AM_GMT = DateHelper . parseDateTime ( "" ) ; Calendar cal2 = Calendar . getInstance ( ) ; cal2 . setTime ( saturday1AM_GMT ) ; cal2 . add ( Calendar . DATE , 1 ) ; assertEquals ( sundayMidnight_GMT , cal2 . getTime ( ) ) ; assertEquals ( 23 * 60 * 60 * 1000L , sundayMidnight_GMT . getTime ( ) - saturday1AM_GMT . getTime ( ) ) ; cal2 . add ( Calendar . HOUR , 1 ) ; Date sunday_2AM_BST = DateHelper . parseDateTime ( "" ) ; logger . info ( "" + sunday_2AM_BST ) ; assertEquals ( sunday_2AM_BST , cal2 . getTime ( ) ) ; TimeZone . setDefault ( null ) ; } public void testDateParsing ( ) throws ParseException { TimeZone . setDefault ( TimeZone . getTimeZone ( "" ) ) ; Calendar cal = Calendar . getInstance ( ) ; Date oneAM = DateHelper . parseDateTime ( "" ) ; logger . info ( "" + oneAM ) ; cal . setTime ( oneAM ) ; assertEquals ( 1 * 60 * 60 * 1000L , cal . get ( Calendar . DST_OFFSET ) ) ; assertEquals ( 2 , cal . get ( Calendar . HOUR ) ) ; Date twoAM = DateHelper . parseDateTime ( "" ) ; cal . setTime ( twoAM ) ; assertEquals ( 1 * 60 * 60 * 1000L , cal . get ( Calendar . DST_OFFSET ) ) ; assertEquals ( 2 , cal . get ( Calendar . HOUR ) ) ; assertEquals ( oneAM , twoAM ) ; Date midnightGMT = DateHelper . parseDateTime ( "" ) ; logger . info ( "" + midnightGMT ) ; cal . setTime ( midnightGMT ) ; assertEquals ( 0L , cal . get ( Calendar . DST_OFFSET ) ) ; assertEquals ( 0 , cal . get ( Calendar . HOUR ) ) ; long interval = DateHelper . parseDateTime ( "" ) . getTime ( ) - DateHelper . parseDateTime ( "" ) . getTime ( ) ; assertEquals ( 10 * 60 * 1000L , interval ) ; interval = DateHelper . parseDateTime ( "" ) . getTime ( ) - DateHelper . parseDateTime ( "" ) . getTime ( ) ; assertEquals ( - 50 * 60 * 1000L , interval ) ; interval = DateHelper . parseDateTime ( "" ) . getTime ( ) - DateHelper . parseDateTime ( "" ) . getTime ( ) ; assertEquals ( 10 * 60 * 1000L , interval ) ; } public void testDayLightSavingInAutumnWithAtBoundry ( ) throws ParseException { TimeZone . setDefault ( TimeZone . getTimeZone ( "" ) ) ; DailySchedule test = new DailySchedule ( ) ; test . setAt ( "01:00" ) ; ScheduleRoller roller = new ScheduleRoller ( test ) ; ScheduleResult [ ] results = roller . resultsFrom ( DateHelper . parseDateTime ( "" ) ) ; ScheduleResult expected ; expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 0 ] ) ; expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 1 ] ) ; expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 2 ] ) ; TimeZone . setDefault ( null ) ; } public void testDayLightSavingInSpringWithAtBoundry ( ) throws ParseException { TimeZone . setDefault ( TimeZone . getTimeZone ( "" ) ) ; DailySchedule test = new DailySchedule ( ) ; test . setAt ( "01:00" ) ; ScheduleRoller roller = new ScheduleRoller ( test ) ; ScheduleResult [ ] results = roller . resultsFrom ( DateHelper . parseDate ( "" ) ) ; IntervalTo expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 0 ] ) ; expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 1 ] ) ; expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 2 ] ) ; expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 3 ] ) ; TimeZone . setDefault ( null ) ; } public void testDayLightSavingInAutumnWithAtBoundry2 ( ) throws ParseException { TimeZone . setDefault ( TimeZone . getTimeZone ( "" ) ) ; DailySchedule test = new DailySchedule ( ) ; test . setAt ( "02:00" ) ; ScheduleRoller roller = new ScheduleRoller ( test ) ; ScheduleResult [ ] results = roller . resultsFrom ( DateHelper . parseDateTime ( "" ) ) ; ScheduleResult expected ; expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 0 ] ) ; expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 1 ] ) ; expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 2 ] ) ; TimeZone . setDefault ( null ) ; } public void testDayLightSavingInSpringWithAtBoundry2 ( ) throws ParseException { TimeZone . setDefault ( TimeZone . getTimeZone ( "" ) ) ; DailySchedule test = new DailySchedule ( ) ; test . setAt ( "02:00" ) ; ScheduleRoller roller = new ScheduleRoller ( test ) ; ScheduleResult [ ] results = roller . resultsFrom ( DateHelper . parseDate ( "" ) ) ; IntervalTo expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 0 ] ) ; expected = new IntervalTo ( DateHelper . parseDateTime ( "" ) ) ; assertEquals ( expected , results [ 1 ] ) ; expected = new IntervalTo ( DateHelper . parseDateTime | |
1,827 | <s> package com . asakusafw . testdriver . core ; import java . io . IOException ; import java . net . URI ; public interface DataModelSourceProvider { < T > DataModelSource open ( DataModelDefinition < T | |
1,828 | <s> package test . modelgen . table . io ; import java . io . IOException ; import javax . annotation . Generated ; import test . modelgen . table . model . ImportTarget2Rl ; import com . asakusafw . runtime . io . ModelOutput ; import com . asakusafw . runtime . io . RecordEmitter ; @ Generated ( "" ) @ | |
1,829 | <s> package com . asakusafw . compiler . flow ; import java . lang . annotation . Annotation ; import java . util . Map ; import com . asakusafw . compiler . common . NameGenerator ; import com . asakusafw . compiler . common . Precondition ; import com . asakusafw . compiler . common . TargetOperator ; import com . asakusafw . utils . java . model . syntax . Expression ; import com . asakusafw . utils . java . model . util . ImportBuilder ; import com . asakusafw . vocabulary . flow . graph . FlowElementAttributeProvider ; import com . asakusafw . vocabulary . flow . graph . FlowResourceDescription ; import com . asakusafw . vocabulary . flow . graph . OperatorDescription ; import com . asakusafw . vocabulary . operator . Identity ; public abstract class LinePartProcessor extends LineProcessor { @ Override public final Kind getKind ( ) { return Kind . LINE_PART ; } public abstract void emitLinePart ( Context context ) ; public static class Context extends LineProcessorContext { private final Expression input ; private Expression resultValue ; public Context ( FlowCompilingEnvironment environment , FlowElementAttributeProvider element , ImportBuilder | |
1,830 | <s> package org . springframework . samples . petclinic . jpa ; import java . util . List ; import org . springframework . samples . petclinic . aspects . UsageLogAspect ; public class HibernateEntityManagerClinicTests extends AbstractJpaClinicTests { private UsageLogAspect usageLogAspect ; @ Override protected String [ ] getConfigPaths ( | |
1,831 | <s> package org . oddjob . jmx . general ; import java . io . IOException ; import java . util . HashMap ; import java . util . Map ; import java . util . Set ; import javax . management . InstanceNotFoundException ; import javax . management . IntrospectionException ; import javax . management . MBeanServerConnection ; import javax . management . ObjectName ; import javax . management . ReflectionException ; import org . oddjob . arooa . ClassResolver ; public class MBeanCacheMap implements MBeanCache { private final MBeanServerConnection mBeanServer ; private final ClassResolver classRresolver ; private final Map < ObjectName , MBeanNode > beans = new HashMap < ObjectName , MBeanNode > ( ) ; public MBeanCacheMap ( MBeanServerConnection mBeanServer , ClassResolver classResolver ) { this . mBeanServer = mBeanServer ; this . classRresolver = classResolver ; } public MBeanNode findBean ( ObjectName objectName ) throws IntrospectionException , InstanceNotFoundException , ReflectionException , IOException { MBeanNode bean = beans . get ( objectName ) ; if ( bean == null ) { MBeanNode [ ] beans = findBeans ( objectName ) ; if ( beans . length == 0 ) { throw new IllegalArgumentException ( "" + objectName ) ; } if ( beans . length > 1 ) { throw new IllegalArgumentException ( "" + objectName ) ; } bean = beans | |
1,832 | <s> package de . fuberlin . wiwiss . d2rq ; import com . hp . hpl . jena . shared . JenaException ; public class D2RQException extends JenaException { public static final int UNSPECIFIED = 0 ; public static final int MAPPING_NO_DATABASE = 1 ; public static final int CLASSMAP_DUPLICATE_DATABASE = 2 ; public static final int CLASSMAP_NO_DATABASE = 3 ; public static final int CLASSMAP_INVALID_DATABASE = 4 ; public static final int CLASSMAP_NO_PROPERTYBRIDGES = 5 ; public static final int RESOURCEMAP_DUPLICATE_BNODEIDCOLUMNS = 6 ; public static final int RESOURCEMAP_DUPLICATE_URICOLUMN = 7 ; public static final int RESOURCEMAP_DUPLICATE_URIPATTERN = 8 ; public static final int RESOURCEMAP_ILLEGAL_CONTAINSDUPLICATE = 9 ; public static final int RESOURCEMAP_MISSING_PRIMARYSPEC = 10 ; public static final int RESOURCEMAP_DUPLICATE_PRIMARYSPEC = 11 ; public static final int RESOURCEMAP_DUPLICATE_TRANSLATEWITH = 12 ; public static final int RESOURCEMAP_INVALID_TRANSLATEWITH = 13 ; public static final int PROPERTYBRIDGE_DUPLICATE_BELONGSTOCLASSMAP = 14 ; public static final int PROPERTYBRIDGE_INVALID_BELONGSTOCLASSMAP = 15 ; public static final int PROPERTYBRIDGE_DUPLICATE_COLUMN = 16 ; public static final int PROPERTYBRIDGE_DUPLICATE_PATTERN = 17 ; public static final int PROPERTYBRIDGE_DUPLICATE_DATATYPE = 18 ; public static final int PROPERTYBRIDGE_DUPLICATE_LANG = 19 ; public static final int PROPERTYBRIDGE_DUPLICATE_REFERSTOCLASSMAP = 20 ; public static final int PROPERTYBRIDGE_INVALID_REFERSTOCLASSMAP = 21 ; public static final int PROPERTYBRIDGE_DUPLICATE_VALUEMAXLENGTH = 22 ; public static final int PROPERTYBRIDGE_CONFLICTING_DATABASES = 24 ; public static final int PROPERTYBRIDGE_LANG_AND_DATATYPE = 25 ; public static final int PROPERTYBRIDGE_NONLITERAL_WITH_DATATYPE = 26 ; public static final int PROPERTYBRIDGE_NONLITERAL_WITH_LANG = 27 ; public static final int TRANSLATIONTABLE_TRANSLATION_AND_JAVACLASS = 28 ; public static final int TRANSLATIONTABLE_TRANSLATION_AND_HREF = 29 ; public static final int TRANSLATIONTABLE_HREF_AND_JAVACLASS = 30 ; public static final int TRANSLATIONTABLE_DUPLICATE_JAVACLASS = 31 ; public static final int TRANSLATIONTABLE_DUPLICATE_HREF = 32 ; public static final int TRANSLATION_MISSING_DBVALUE = 33 ; public static final int TRANSLATION_MISSING_RDFVALUE = 34 ; public static final int DATABASE_DUPLICATE_JDBCDSN = 35 ; public static final int DATABASE_DUPLICATE_JDBCDRIVER = 36 ; public static final int DATABASE_MISSING_JDBCDRIVER = 37 ; public static final int DATABASE_DUPLICATE_USERNAME = 38 ; public static final int DATABASE_DUPLICATE_PASSWORD = 39 ; public static final int DATABASE_JDBCDRIVER_CLASS_NOT_FOUND = 42 ; public static final int D2RQ_SQLEXCEPTION = 43 ; public static final int SQL_INVALID_RELATIONNAME = 44 ; public static final int SQL_INVALID_ATTRIBUTENAME = 45 ; public static final int SQL_INVALID_ALIAS = 46 ; public static final int SQL_INVALID_JOIN = 47 ; public static final int MAPPING_RESOURCE_INSTEADOF_LITERAL = 48 ; public static final int MAPPING_LITERAL_INSTEADOF_RESOURCE = 49 ; public static final int RESOURCEMAP_ILLEGAL_URIPATTERN = 50 ; public static final int DATABASE_MISSING_DSN = 51 ; public static final int MUST_BE_NUMERIC = 52 ; public static final int RESOURCEMAP_DUPLICATE_CONSTANTVALUE = 53 ; public static final int CLASSMAP_INVALID_CONSTANTVALUE = 53 ; public static final int D2RQ_DB_CONNECTION_FAILED = 54 ; public static final int MAPPING_UNKNOWN_D2RQ_PROPERTY = 55 ; public static final int MAPPING_UNKNOWN_D2RQ_CLASS = 56 ; public static final int PROPERTYBRIDGE_DUPLICATE_SQL_EXPRESSION = 57 ; public static final int MAPPING_TYPECONFLICT = 58 ; public static final int PROPERTYBRIDGE_DUPLICATE_URI_SQL_EXPRESSION = 59 ; public static final int PROPERTYBRIDGE_DUPLICATE_LIMIT = 60 ; public static final int PROPERTYBRIDGE_DUPLICATE_LIMITINVERSE = 61 ; public static final int PROPERTYBRIDGE_DUPLICATE_ORDER = 62 ; public static final int PROPERTYBRIDGE_DUPLICATE_ORDERDESC = 63 ; public static final int DATABASE_ALREADY_CONNECTED = | |
1,833 | <s> package net . sf . sveditor . core ; import java . util . ArrayList ; import java . util . Comparator ; import java . util . List ; public class SortUtils { public static List < String > sortStringList ( List < String > l , boolean ascending ) { List < String > ret = new ArrayList < String > ( ) ; ret . addAll ( l ) ; return ret ; } @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public | |
1,834 | <s> package org . oddjob . jmx ; import org . oddjob . jmx . server . ServerInfo ; public class MockRemoteOddjobBean implements RemoteOddjobBean { public void noop ( ) { throw new | |
1,835 | <s> package org . rubypeople . rdt . internal . debug . ui . launcher ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . debug . core . ILaunchConfiguration ; import org . eclipse . debug . core . ILaunchConfigurationWorkingCopy ; import org . eclipse . debug . ui . AbstractLaunchConfigurationTab ; import org . eclipse . swt . SWT ; import org . eclipse . swt . events . ModifyEvent ; import org . eclipse . swt . events . ModifyListener ; import org . eclipse . swt . events . SelectionAdapter ; import org . eclipse . swt . events . SelectionEvent ; import org . eclipse . swt . graphics . Image ; 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 . swt . widgets . Text ; import org . rubypeople . rdt . debug . ui . RdtDebugUiConstants ; import org . rubypeople . rdt . debug . ui . RdtDebugUiImages ; import org . rubypeople . rdt . internal . debug . ui . RdtDebugUiMessages ; import org . rubypeople . rdt . internal . debug . ui . RdtDebugUiPlugin ; import org . rubypeople . rdt . internal . launching . RubyLaunchConfigurationAttribute ; import org . rubypeople . rdt . internal . ui . util . DirectorySelector ; import org . rubypeople . rdt . launching . IRubyLaunchConfigurationConstants ; public class RubyArgumentsTab extends AbstractLaunchConfigurationTab { protected Text interpreterArgsText , programArgsText ; protected DirectorySelector workingDirectorySelector ; protected Button useDefaultWorkingDirectoryButton ; public RubyArgumentsTab ( ) { super ( ) ; } public void createControl ( Composite parent ) { Composite composite = createPageRoot ( parent ) ; new Label ( composite , SWT . NONE ) . setText ( RdtDebugUiMessages . LaunchConfigurationTab_RubyArguments_working_dir ) ; workingDirectorySelector = new DirectorySelector ( composite ) ; workingDirectorySelector . setBrowseDialogMessage ( RdtDebugUiMessages . LaunchConfigurationTab_RubyArguments_working_dir_browser_message ) ; workingDirectorySelector . setLayoutData ( new GridData ( GridData . FILL_HORIZONTAL ) ) ; workingDirectorySelector . addModifyListener ( new ModifyListener ( ) { public void modifyText ( ModifyEvent e ) { updateLaunchConfigurationDialog ( ) ; } } ) ; Composite defaultWorkingDirectoryComposite = new Composite ( composite , SWT . NONE ) ; GridLayout layout = new GridLayout ( ) ; layout . numColumns = 2 ; defaultWorkingDirectoryComposite . setLayout ( layout ) ; useDefaultWorkingDirectoryButton = new Button ( defaultWorkingDirectoryComposite , SWT . CHECK ) ; useDefaultWorkingDirectoryButton . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { setUseDefaultWorkingDirectory ( ( ( Button ) e . getSource ( ) ) . getSelection ( ) ) ; } } ) ; new Label ( defaultWorkingDirectoryComposite , SWT . NONE ) . setText ( RdtDebugUiMessages . LaunchConfigurationTab_RubyArguments_working_dir_use_default_message ) ; defaultWorkingDirectoryComposite . pack ( ) ; Label verticalSpacer = new Label ( composite , SWT . NONE ) ; new Label ( composite , SWT . NONE ) . setText ( RdtDebugUiMessages . LaunchConfigurationTab_RubyArguments_interpreter_args_box_title ) ; interpreterArgsText = new Text ( composite , SWT . MULTI | SWT . V_SCROLL | SWT . BORDER ) ; interpreterArgsText . setLayoutData ( new GridData ( GridData . FILL_BOTH ) ) ; interpreterArgsText . addModifyListener ( new ModifyListener ( ) { public void modifyText ( ModifyEvent evt ) { updateLaunchConfigurationDialog ( ) ; } } ) ; new Label ( composite , SWT . NONE ) . setText ( RdtDebugUiMessages . LaunchConfigurationTab_RubyArguments_program_args_box_title ) ; programArgsText = new Text ( composite , SWT . MULTI | SWT . V_SCROLL | SWT . BORDER ) ; programArgsText . setLayoutData ( new GridData ( GridData . FILL_BOTH ) ) ; programArgsText . addModifyListener ( new ModifyListener ( ) { public void modifyText ( ModifyEvent evt ) { updateLaunchConfigurationDialog ( ) ; } } ) ; } protected void setUseDefaultWorkingDirectory ( boolean useDefault ) { if ( useDefaultWorkingDirectoryButton . getSelection ( ) != useDefault ) useDefaultWorkingDirectoryButton . setSelection ( useDefault ) ; if ( useDefault ) { workingDirectorySelector . setSelectionText ( ( String ) "" ) ; } workingDirectorySelector . setEnabled ( ! useDefault ) ; } public void setDefaults ( ILaunchConfigurationWorkingCopy configuration ) { configuration . setAttribute ( RubyLaunchConfigurationAttribute . USE_DEFAULT_WORKING_DIRECTORY , true ) ; configuration . setAttribute ( IRubyLaunchConfigurationConstants . ATTR_WORKING_DIRECTORY , ( String ) null ) ; configuration . setAttribute ( ILaunchConfiguration . ATTR_SOURCE_LOCATOR_ID , RdtDebugUiConstants . RUBY_SOURCE_LOCATOR ) ; } public void initializeFrom ( ILaunchConfiguration configuration ) { String workingDirectory = "" , interpreterArgs = "" , programArgs = "" ; boolean useDefaultWorkDir = true ; try { | |
1,836 | <s> package net . sf . sveditor . core . parser ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . List ; import java . util . Set ; import net . sf . sveditor . core . db . ISVDBAddChildItem ; import net . sf . sveditor . core . db . SVDBFieldItem ; import net . sf . sveditor . core . db . SVDBItemType ; import net . sf . sveditor . core . db . SVDBLocation ; import net . sf . sveditor . core . db . SVDBParamValueAssignList ; import net . sf . sveditor . core . db . SVDBTypeInfo ; import net . sf . sveditor . core . db . SVDBTypeInfoBuiltin ; import net . sf . sveditor . core . db . SVDBTypeInfoClassItem ; import net . sf . sveditor . core . db . SVDBTypeInfoClassType ; import net . sf . sveditor . core . db . SVDBTypeInfoEnum ; import net . sf . sveditor . core . db . SVDBTypeInfoEnumerator ; import net . sf . sveditor . core . db . SVDBTypeInfoFwdDecl ; import net . sf . sveditor . core . db . SVDBTypeInfoStruct ; import net . sf . sveditor . core . db . SVDBTypeInfoUnion ; import net . sf . sveditor . core . db . SVDBTypeInfoUserDef ; import net . sf . sveditor . core . db . expr . SVDBExpr ; import net . sf . sveditor . core . db . expr . SVDBRangeExpr ; import net . sf . sveditor . core . db . stmt . SVDBTypedefStmt ; import net . sf . sveditor . core . db . stmt . SVDBVarDeclItem ; import net . sf . sveditor . core . db . stmt . SVDBVarDeclStmt ; import net . sf . sveditor . core . db . stmt . SVDBVarDimItem ; import net . sf . sveditor . core . db . stmt . SVDBVarDimItem . DimType ; import net . sf . sveditor . core . scanner . SVKeywords ; public class SVDataTypeParser extends SVParserBase { public static final Set < String > IntegerAtomType ; public static final Set < String > IntegerVectorType ; public static final Set < String > IntegerTypes ; public static final Set < String > NonIntegerType ; public static final Set < String > NetType ; public static final Set < String > BuiltInTypes ; static { IntegerAtomType = new HashSet < String > ( ) ; IntegerAtomType . add ( "byte" ) ; IntegerAtomType . add ( "shortint" ) ; IntegerAtomType . add ( "int" ) ; IntegerAtomType . add ( "longint" ) ; IntegerAtomType . add ( "integer" ) ; IntegerAtomType . add ( "time" ) ; IntegerAtomType . add ( "genvar" ) ; IntegerVectorType = new HashSet < String > ( ) ; IntegerVectorType . add ( "bit" ) ; IntegerVectorType . add ( "logic" ) ; IntegerVectorType . add ( "reg" ) ; IntegerTypes = new HashSet < String > ( ) ; IntegerTypes . addAll ( IntegerAtomType ) ; IntegerTypes . addAll ( IntegerVectorType ) ; NonIntegerType = new HashSet < String > ( ) ; NonIntegerType . add ( "shortreal" ) ; NonIntegerType . add ( "real" ) ; NonIntegerType . add ( "realtime" ) ; NetType = new HashSet < String > ( ) ; NetType . add ( "supply0" ) ; NetType . add ( "supply1" ) ; NetType . add ( "tri" ) ; NetType . add ( "triand" ) ; NetType . add ( "trior" ) ; NetType . add ( "trireg" ) ; NetType . add ( "tri0" ) ; NetType . add ( "tri1" ) ; NetType . add ( "uwire" ) ; NetType . add ( "wire" ) ; NetType . add ( "wand" ) ; NetType . add ( "wor" ) ; NetType . add ( "input" ) ; NetType . add ( "output" ) ; NetType . add ( "inout" ) ; BuiltInTypes = new HashSet < String > ( ) ; BuiltInTypes . add ( "string" ) ; BuiltInTypes . add ( "chandle" ) ; BuiltInTypes . add ( "event" ) ; } public SVDataTypeParser ( ISVParser parser ) { super ( parser ) ; } public SVDBTypeInfo data_type ( int qualifiers ) throws SVParseException { SVDBTypeInfo type = null ; SVToken tok ; if ( fDebugEn ) { debug ( "" + fLexer . peek ( ) ) ; } qualifiers |= parsers ( ) . SVParser ( ) . scan_qualifiers ( false ) ; tok = fLexer . consumeToken ( ) ; fLexer . ungetToken ( tok ) ; if ( fLexer . peekKeyword ( IntegerVectorType ) ) { SVDBTypeInfoBuiltin builtin_type = new SVDBTypeInfoBuiltin ( fLexer . eatToken ( ) ) ; if ( fLexer . peekKeyword ( "signed" , "unsigned" ) ) { builtin_type . setAttr ( fLexer . peekKeyword ( "signed" ) ? SVDBTypeInfoBuiltin . TypeAttr_Signed : SVDBTypeInfoBuiltin . TypeAttr_Unsigned ) ; fLexer . eatToken ( ) ; } while ( fLexer . peekOperator ( "[" ) ) { if ( fDebugEn ) { debug ( "" ) ; } builtin_type . setArrayDim ( vector_dim ( ) ) ; } type = builtin_type ; } else if ( fLexer . peekKeyword ( NetType ) ) { debug ( "NetType" ) ; SVDBTypeInfoBuiltin builtin_type = new SVDBTypeInfoBuiltin ( fLexer . eatToken ( ) ) ; if ( fLexer . peekOperator ( "(" ) ) { tok = fLexer . consumeToken ( ) ; if ( fLexer . peekOperator ( SVKeywords . fStrength ) ) { String strength1 = fLexer . readKeyword ( SVKeywords . fStrength ) ; fLexer . readOperator ( "," ) ; String strength2 = fLexer . readKeyword ( SVKeywords . fStrength ) ; fLexer . readOperator ( ")" ) ; } else { fLexer . ungetToken ( tok ) ; } } if ( fLexer . peekOperator ( "[" ) ) { if ( fDebugEn ) { debug ( "" ) ; } builtin_type . setVectorDim ( vector_dim ( ) ) ; } if ( fLexer . peekOperator ( "#" ) ) { fParsers . exprParser ( ) . delay_expr ( 3 ) ; } type = builtin_type ; } else if ( fLexer . peekKeyword ( IntegerAtomType ) ) { SVDBTypeInfoBuiltin builtin_type = new SVDBTypeInfoBuiltin ( fLexer . eatToken ( ) ) ; if ( fLexer . peekKeyword ( "signed" , "unsigned" ) ) { builtin_type . setAttr ( fLexer . peekKeyword ( "signed" ) ? SVDBTypeInfoBuiltin . TypeAttr_Signed : SVDBTypeInfoBuiltin . TypeAttr_Unsigned ) ; fLexer . eatToken ( ) ; } type = builtin_type ; } else if ( fLexer . peekKeyword ( NonIntegerType ) ) { type = new SVDBTypeInfoBuiltin ( fLexer . eatToken ( ) ) ; } else if ( fLexer . peekKeyword ( "struct" , "union" ) ) { tok = fLexer . readKeywordTok ( "struct" , "union" ) ; if ( tok . getImage ( ) . equals ( "union" ) ) { if ( fLexer . peekKeyword ( "tagged" ) ) { fLexer . eatToken ( ) ; } } if ( fLexer . peekKeyword ( "packed" ) ) { fLexer . eatToken ( ) ; } if ( fLexer . peekKeyword ( "signed" , "unsigned" ) ) { fLexer . eatToken ( ) ; } type = ( tok . getImage ( ) . equals ( "union" ) ) ? new SVDBTypeInfoUnion ( ) : new SVDBTypeInfoStruct ( ) ; struct_union_body ( ( ISVDBAddChildItem ) type ) ; } else if ( fLexer . peekKeyword ( "enum" ) ) { type = enum_type ( ) ; type . setName ( "" ) ; } else if ( fLexer . peekKeyword ( BuiltInTypes ) ) { type = new SVDBTypeInfoBuiltin ( fLexer . eatToken ( ) ) ; } else if ( fLexer . peekKeyword ( "virtual" ) || ( qualifiers & SVDBFieldItem . FieldAttr_Virtual ) != 0 ) { if ( fLexer . peekKeyword ( "virtual" ) ) { fLexer . eatToken ( ) ; } if ( fLexer . peekKeyword ( "interface" ) ) { fLexer . eatToken ( ) ; } tok = fLexer . readIdTok ( ) ; SVDBTypeInfoUserDef ud_type = new SVDBTypeInfoUserDef ( tok . getImage ( ) ) ; if ( fLexer . peekOperator ( "#" ) ) { SVDBParamValueAssignList plist = parsers ( ) . paramValueAssignParser ( ) . parse ( true ) ; ud_type . setParameters ( plist ) ; } if ( fLexer . peekOperator ( "." ) ) { fLexer . eatToken ( ) ; String id = fLexer . readId ( ) ; ud_type . setName ( ud_type . getName ( ) + "." + id ) ; } type = ud_type ; } else if ( fLexer . peekKeyword ( "type" ) ) { type = new SVDBTypeInfoBuiltin ( fLexer . eatToken ( ) ) ; error ( "" ) ; } else if ( fLexer . peekKeyword ( "class" ) ) { fLexer . eatToken ( ) ; SVDBTypeInfoFwdDecl type_fwd = new SVDBTypeInfoFwdDecl ( "class" , fLexer . readId ( ) ) ; if ( fLexer . peekOperator ( "#" ) ) { if ( fLexer . peekOperator ( "#" ) ) { fLexer . eatToken ( ) ; if ( fLexer . peekOperator ( "(" ) ) { fLexer . skipPastMatch ( "(" , ")" ) ; } else { fLexer . eatToken ( ) ; } } } | |
1,837 | <s> package com . devtty . gat . data ; import javax . enterprise . inject . Produces ; | |
1,838 | <s> package fi . koku . services . entity . customerservice . model ; public enum CommunityRole { FATHER ( "father" ) , MOTHER ( "mother" ) , FAMILY_MEMBER ( "family" ) , DEPENDANT ( "dependant" ) , CHILD ( "child" ) , PARENT ( | |
1,839 | <s> package com . asakusafw . compiler . windgate . testing . jdbc ; import java . sql . ParameterMetaData ; import java . sql . PreparedStatement ; import java . sql . ResultSet ; import java . sql . SQLException ; import java . util . List ; import java . util . Map ; import java . util . TreeMap ; import org . apache . hadoop . io . Text ; import com . asakusafw . compiler . windgate . testing . model . Simple ; import com . asakusafw . windgate . core . vocabulary . DataModelJdbcSupport ; public final class SimpleJdbcSupport implements DataModelJdbcSupport < Simple > { private static final Map < String , Integer > PROPERTY_POSITIONS ; static { Map < String , Integer > map = new TreeMap < String , Integer > ( ) ; map . put ( "VALUE" , 0 ) ; PROPERTY_POSITIONS = map ; } @ Override public Class < Simple > getSupportedType ( ) { return Simple . class ; } @ Override public boolean isSupported ( List < String > columnNames ) { if ( columnNames == null ) { throw new IllegalArgumentException ( "" ) ; } if ( columnNames . isEmpty ( ) ) { return false ; } try { this . createPropertyVector ( columnNames ) ; return true ; } catch ( IllegalArgumentException e ) { return false ; } } @ Override public DataModelJdbcSupport . DataModelResultSet < Simple > createResultSetSupport ( ResultSet resultSet , List < String > columnNames ) { if ( resultSet == null ) { throw new IllegalArgumentException ( "" ) ; } if ( columnNames == null ) { throw new IllegalArgumentException ( "" ) ; } int [ ] vector = this . createPropertyVector ( columnNames ) ; return new ResultSetSupport ( resultSet , vector ) ; } @ Override public DataModelJdbcSupport . DataModelPreparedStatement < Simple > createPreparedStatementSupport ( PreparedStatement statement , List < String > columnNames ) { if ( statement == null ) { throw new IllegalArgumentException ( "" ) ; } if ( columnNames == null ) { throw new IllegalArgumentException ( "" ) ; } int [ ] vector = this . createPropertyVector ( columnNames ) ; return new PreparedStatementSupport | |
1,840 | <s> package org . oddjob . sql ; import java . io . FilterOutputStream ; import java . io . IOException ; import java . io . OutputStream ; import java . util . List ; import org . apache . log4j . Logger ; import org . oddjob . arooa . ArooaSession ; import org . oddjob . arooa . convert . ArooaConversionException ; import org . oddjob . arooa . deploy . annotations . ArooaHidden ; import org . oddjob . arooa . life . ArooaSessionAware ; import org . oddjob . beanbus . BadBeanException ; import org . oddjob . beanbus . BeanBus ; import org . oddjob . beanbus . BeanSheet ; import org . oddjob . beanbus . BusAware ; import org . oddjob . beanbus . BusEvent ; import org . oddjob . beanbus . BusException ; import org . oddjob . beanbus . BusListener ; import org . oddjob . beanbus . CrashBusException ; import org . oddjob . beanbus . StageEvent ; import org . oddjob . beanbus . StageListener ; import org . oddjob . io . StdoutType ; import org . oddjob . util . StreamPrinter ; public class SQLResultsSheet implements SQLResultsProcessor , ArooaSessionAware , BusAware { private static final Logger logger = Logger . getLogger ( SQLResultsSheet . class ) ; private OutputStream output ; private boolean dataOnly ; private ArooaSession session ; private long elapsedTime = System . currentTimeMillis ( ) ; @ Override @ ArooaHidden public void setArooaSession ( ArooaSession session ) { this . session = session ; } @ Override public void accept ( Object bean ) throws BadBeanException { elapsedTime = System . currentTimeMillis ( ) - elapsedTime ; if ( output == null ) { return ; } if ( bean instanceof List < ? > ) { List < ? > iterable = ( List < ? > ) bean ; BeanSheet sheet = new BeanSheet ( ) ; sheet . setOutput ( new FilterOutputStream ( output ) { public void close ( ) throws IOException { } ; { } } ) ; sheet . setArooaSession ( session ) ; sheet . setNoHeaders ( dataOnly ) ; sheet . accept ( iterable ) ; if ( ! dataOnly ) { new StreamPrinter ( output ) . println ( ) ; new StreamPrinter ( output ) . println ( "[" + iterable . size ( ) + " rows, " + elapsedTime + " ms.]" ) ; } } else if ( bean instanceof UpdateCount ) { if ( ! dataOnly ) { UpdateCount updateCount = ( UpdateCount ) bean ; new StreamPrinter ( output ) . println ( "[" + updateCount . getCount ( ) + "" + elapsedTime + " ms.]" ) ; } } else { throw new BadBeanException ( bean , "" ) ; } } public OutputStream getOutput ( ) { return output ; } public void setOutput ( OutputStream output ) { this . output = output ; } public boolean isDataOnly ( ) { return dataOnly ; } public void setDataOnly ( boolean dataOnly ) { this . dataOnly = dataOnly ; } @ Override @ ArooaHidden public void setBus ( BeanBus bus | |
1,841 | <s> package org . rubypeople . rdt . internal . launching ; import java . util . ArrayList ; import java . util . List ; import org . eclipse . core . runtime . CoreException ; 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 . IRuntimeLoadpathEntry2 ; import org . rubypeople . rdt . launching . IRuntimeLoadpathEntryResolver ; import org . rubypeople . rdt . launching . IVMInstall ; import org . rubypeople . rdt . launching . RubyRuntime ; public class DefaultEntryResolver implements IRuntimeLoadpathEntryResolver { public IRuntimeLoadpathEntry [ ] resolveRuntimeLoadpathEntry ( IRuntimeLoadpathEntry entry , ILaunchConfiguration configuration ) throws CoreException { IRuntimeLoadpathEntry2 entry2 = ( IRuntimeLoadpathEntry2 ) entry ; IRuntimeLoadpathEntry [ ] entries = entry2 . getRuntimeLoadpathEntries ( configuration ) ; List < IRuntimeLoadpathEntry > resolved = new ArrayList < IRuntimeLoadpathEntry > ( | |
1,842 | <s> package com . asakusafw . compiler . flow . stage ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . IOException ; import java . util . List ; import org . apache . hadoop . io . RawComparator ; import org . apache . hadoop . io . Writable ; import org . junit . Test ; import com . asakusafw . compiler . flow . JobflowCompilerTestRoot ; import com . asakusafw . compiler . flow . example . CoGroupStage ; import com . asakusafw . compiler . flow . plan . StageBlock ; import com . asakusafw . compiler . flow . plan . StageGraph ; import com . asakusafw . compiler . flow . stage . ShuffleModel . Segment ; import com . asakusafw . compiler . flow . testing . model . Ex1 ; import com . asakusafw . compiler . flow . testing . model . Ex2 ; import com . asakusafw . runtime . flow . SegmentedWritable ; import com . asakusafw . utils . java . model . syntax . Name ; import com . asakusafw . vocabulary . flow . FlowDescription ; public class ShuffleGroupingComparatorEmitterTest extends JobflowCompilerTestRoot { @ Test public void simple ( ) throws Exception { ShuffleModel analyzed = shuffle ( CoGroupStage . class ) ; ShuffleGroupingComparatorEmitter emitter = new ShuffleGroupingComparatorEmitter ( environment ) ; Name key = emitKey ( analyzed ) ; Name name = emitter . emit ( analyzed , key ) ; ClassLoader loader = start ( ) ; @ SuppressWarnings ( "unchecked" ) RawComparator < Writable > cmp = ( RawComparator < Writable > ) create ( loader , name ) ; SegmentedWritable k1 = ( SegmentedWritable ) create ( loader , key ) ; SegmentedWritable k2 = ( SegmentedWritable ) create ( loader , key ) ; List < Segment > segments = analyzed . getSegments ( ) ; assertThat ( segments . size ( ) , is ( 2 ) ) ; Segment seg1 = segments . get ( 0 ) ; Segment seg2 = segments . get ( 1 ) ; assertThat ( seg1 . getTerms ( ) . size ( ) , is ( 2 ) ) ; assertThat ( seg2 . getTerms ( ) . size ( ) , is ( 2 ) ) ; Ex1 ex1 = new Ex1 ( ) ; ex1 . setSid ( 1 ) ; ex1 . setValue ( 100 ) ; ex1 . setStringAsString ( "ex1" ) ; Ex2 ex2 = new Ex2 ( ) ; ex2 . setSid ( 2 ) ; ex2 . setValue ( 100 ) ; ex2 . setStringAsString ( "ex2" ) ; setShuffleKey | |
1,843 | <s> package com . asakusafw . dmdl . thundergate . util ; import java . text . MessageFormat ; import java . util . List ; import java . util . Map ; import java . util . TreeMap ; import com . asakusafw . dmdl . thundergate . model . JoinedModelDescription ; import com . asakusafw . dmdl . thundergate . model . ModelDescription ; import com . asakusafw . dmdl . thundergate . model . ModelProperty ; import com . asakusafw . dmdl . thundergate . model . Source ; import com . asakusafw . utils . collections . Lists ; public class JoinedModelBuilder extends ModelBuilder < JoinedModelBuilder > { private final List < String > columns ; private final Side left ; private final Side right ; public JoinedModelBuilder ( String name , ModelDescription left , String leftAlias , ModelDescription right , String rightAlias ) { super ( name ) ; if ( left == null ) { throw new IllegalArgumentException ( "" ) ; } if ( right == null ) { throw new IllegalArgumentException ( "" ) ; } this . columns = Lists . create ( ) ; this . left = new Side ( left ) ; this . right = new Side ( right ) ; if ( leftAlias != null ) { this . left . alias = leftAlias ; } if ( rightAlias != null ) { this . right . alias = rightAlias ; } if ( this . left . alias . equals ( this . right . alias ) ) { throw new IllegalArgumentException ( MessageFormat . format ( "" , this . left . alias ) ) ; } } public JoinedModelBuilder on ( String aProperty , String bProperty ) { if ( aProperty == null ) { throw new IllegalArgumentException ( "" ) ; } if ( bProperty == null ) { throw new IllegalArgumentException ( "" ) ; } Ref a = resolve ( aProperty ) ; Ref b = resolve ( bProperty ) ; if ( a . side == b . side ) { | |
1,844 | <s> package org . rubypeople . rdt . core . util ; import java . io . File ; import java . io . FileInputStream ; import java . io . FilenameFilter ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . UnsupportedEncodingException ; import java . util . regex . Pattern ; import org . eclipse . core . runtime . IPath ; import org . eclipse . core . runtime . Path ; import org . rubypeople . rdt . internal . core . util . CharOperation ; public abstract class Util { private static final String [ ] KEYWORDS = new String [ ] { "alias" , "and" , "BEGIN" , "begin" , "break" , "case" , "class" , "def" , "defined" , "do" , "else" , "elsif" , "END" , "end" , "ensure" , "false" , "for" , "if" , "in" , "module" , "next" , "nil" , "not" , "or" , "redo" , "rescue" , "retry" , "return" , "self" , "super" , "then" , "true" , "undef" , "unless" , "until" , "when" , "while" , "yield" } ; private static final String [ ] OPERATORS = new String [ ] { "::" , "." , "[]" , "**" , "-" , "+" , "!" , "~" , "*" , "/" , "%" , "+" , "-" , "<<" , ">>" , "&" , "|" , "^" , ">" , ">=" , "<" , "<=" , "<=>" , "==" , "===" , "!=" , "=~" , "!~" , "&&" , "||" , ".." , "..." , "=" , "+=" , "-=" , "*=" , "/=" , "||=" } ; public interface Displayable { public String displayString ( Object o ) ; } private static final int DEFAULT_READING_SIZE = 8192 ; public final static String UTF_8 = "UTF-8" ; public static String LINE_SEPARATOR = System . getProperty ( "" ) ; public static byte [ ] getFileByteContent ( File file ) throws IOException { InputStream stream = null ; try { stream = new FileInputStream ( file ) ; return getInputStreamAsByteArray ( stream , ( int ) file . length ( ) ) ; } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { } } } } public static String toString ( Object [ ] objects , Displayable renderer ) { if ( objects == null ) return "" ; StringBuffer buffer = new StringBuffer ( 10 ) ; for ( int i = 0 ; i < objects . length ; i ++ ) { if ( i > 0 ) buffer . append ( ", " ) ; buffer . | |
1,845 | <s> package hudson . jbpm ; import java . util . logging . Logger ; import hudson . Extension ; import hudson . model . AbstractBuild ; import hudson . model . ParametersAction ; import hudson . model . Run ; import hudson . model . TaskListener ; import hudson . model . listeners . RunListener ; import org . jbpm . JbpmConfiguration ; import org . jbpm . JbpmContext ; import org . jbpm . taskmgmt . exe . TaskInstance ; @ Extension public class HudsonRunListener extends RunListener { private static Logger log = Logger . getLogger ( HudsonRunListener . class . getName ( ) ) ; public HudsonRunListener ( ) { super ( AbstractBuild . class ) ; } @ Override public synchronized void onCompleted ( Run r , TaskListener listener ) { ParametersAction parameters = r . getAction ( ParametersAction . class ) ; if ( parameters == null ) { return ; } String task = ( String ) parameters . getValue ( "task" ) ; if ( task == null ) { return ; } long taskInstanceId = Integer . parseInt ( task ) ; JbpmContext context = JbpmConfiguration . getInstance ( ) . createJbpmContext ( ) ; try { TaskInstance taskInstance = context . loadTaskInstance ( taskInstanceId ) ; PluginImpl . injectTransientVariables ( taskInstance . getProcessInstance ( ) . getContextInstance ( ) ) ; taskInstance . setVariableLocally ( "result" , r . | |
1,846 | <s> package org . oddjob . tools . doclet . utils ; import junit . framework . TestCase ; import org . mockito . Mockito ; import com . sun . javadoc . ClassDoc ; import com . sun . javadoc . PackageDoc ; import com . sun . javadoc . SeeTag ; public class SeeTagProcessorTest extends TestCase { public void testProcessSeeTag ( ) { PackageDoc packageDoc = Mockito . mock ( PackageDoc . class ) ; Mockito . when ( packageDoc . | |
1,847 | <s> package org . rubypeople . rdt . refactoring . tests . core . mergewithexternalclassparts ; import junit . framework . Test ; import junit . framework . TestSuite ; import org . rubypeople . rdt . refactoring . tests . FileTestSuite ; import org . rubypeople . rdt | |
1,848 | <s> package com . asakusafw . runtime . stage ; public class StageResource { private String location ; private String name ; public StageResource ( String location , String name ) { if ( location == null ) { throw new IllegalArgumentException ( "" ) ; } if ( name == null ) { throw new IllegalArgumentException ( "" ) ; } | |
1,849 | <s> package com . asakusafw . compiler . flow . processor ; import com . asakusafw . compiler . common . TargetOperator ; import com . asakusafw . compiler . flow . DataClass ; import com . asakusafw . compiler . flow . DataClass . Property ; import com . asakusafw . compiler . flow . LinePartProcessor ; import com . asakusafw . utils . java . model . syntax . Expression ; import com . asakusafw . vocabulary . flow . graph . FlowElementPortDescription ; import com . | |
1,850 | <s> package com . pogofish . jadt ; import static org . junit . Assert . assertEquals ; import static org . junit . Assert . assertTrue ; import static org . junit . Assert . fail ; import java . io . FileNotFoundException ; import org . junit . Test ; public class VersionTest { @ Test public void testHappy ( ) { final String version = new Version ( ) . getVersion ( ) ; assertTrue ( "" + version + "" , version . equals ( "" ) || version . matches ( "" ) ) ; } @ Test public void testMissingFile ( ) throws | |
1,851 | <s> package org . rubypeople . rdt . internal . ui . wizards ; import java . util . Collection ; import org . eclipse . core . runtime . Assert ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . ui . dialogs . ISelectionStatusValidator ; import org . rubypeople . rdt . internal . ui . dialogs . StatusInfo ; public class TypedElementSelectionValidator implements ISelectionStatusValidator { private IStatus fgErrorStatus = new StatusInfo ( IStatus . ERROR , "" ) ; private IStatus fgOKStatus = new StatusInfo ( ) ; private Class [ ] fAcceptedTypes ; private boolean fAllowMultipleSelection ; private Collection fRejectedElements ; public TypedElementSelectionValidator ( Class [ ] acceptedTypes , boolean allowMultipleSelection ) { this ( acceptedTypes , allowMultipleSelection , null ) ; } public TypedElementSelectionValidator ( Class [ ] acceptedTypes , boolean allowMultipleSelection , Collection rejectedElements ) { Assert . isNotNull ( acceptedTypes ) ; fAcceptedTypes = acceptedTypes ; fAllowMultipleSelection = allowMultipleSelection ; fRejectedElements = rejectedElements ; } public IStatus validate ( Object [ ] elements ) { if ( isValid ( elements ) ) { return fgOKStatus ; } return fgErrorStatus ; } private boolean | |
1,852 | <s> package com . asakusafw . compiler . flow . logging ; import org . slf4j . Logger ; import org . slf4j . LoggerFactory ; import com . asakusafw . compiler . flow . FlowCompilingEnvironment ; import com . asakusafw . compiler . flow . FlowGraphRewriter ; import com . asakusafw . compiler . flow . plan . FlowGraphUtil ; import com . asakusafw . utils . java . model . syntax . Name ; import com . asakusafw . vocabulary . flow . graph . FlowElement ; import com . asakusafw . vocabulary . flow . graph . FlowElementKind ; import com . asakusafw . vocabulary . flow . graph . FlowGraph ; import com . asakusafw . vocabulary . flow . graph . FlowPartDescription ; import com . asakusafw . vocabulary . flow . graph . FlowResourceDescription ; import com . asakusafw . vocabulary . flow . graph . OperatorDescription ; import com . asakusafw . vocabulary . operator . Logging ; import com . asakusafw . vocabulary . operator . Logging . Level ; public class LoggingFilter extends FlowCompilingEnvironment . Initialized implements FlowGraphRewriter { static final Logger LOG = LoggerFactory . getLogger ( LoggingFilter . class ) ; @ Override public boolean rewrite ( FlowGraph graph ) throws RewriteException { if ( getEnvironment ( ) . getOptions ( ) . isEnableDebugLogging ( ) ) { LOG . info ( "" ) ; return false ; } LOG . info ( "" ) ; return rewriteGraph ( graph ) ; } private boolean rewriteGraph ( FlowGraph graph ) { boolean modified = false ; for ( FlowElement element : FlowGraphUtil . collectElements ( graph ) ) { if ( element . getDescription ( ) . getKind ( ) == FlowElementKind . FLOW_COMPONENT ) { FlowPartDescription desc = ( FlowPartDescription ) element . getDescription ( ) ; rewriteGraph ( desc . getFlowGraph ( ) ) ; } else if ( isDebugLogging ( element ) ) { LOG . debug ( "" , element ) ; FlowGraphUtil . skip ( element | |
1,853 | <s> package com . aptana . rdt . internal . parser . warnings ; import java . util . HashMap ; import java . util . Map ; import org . jruby . ast . ClassNode ; import org . jruby . ast . DefnNode ; import org . rubypeople . rdt . core . parser . warnings . RubyLintVisitor ; import com . aptana . rdt . AptanaRDTPlugin ; import com . aptana . rdt . IProblem ; public class MethodMissingWithoutRespondTo extends RubyLintVisitor { private static final String RESPOND_TO = "respond_to?" ; private static final String METHOD_MISSING = "" ; private Map < String , DefnNode > methods = new HashMap < String , DefnNode > ( ) ; public MethodMissingWithoutRespondTo ( String contents ) { super ( AptanaRDTPlugin . getDefault ( ) . getOptions ( ) , contents ) ; } @ Override protected String getOptionKey ( ) { return AptanaRDTPlugin . COMPILER_PB_METHOD_MISSING_NO_RESPOND_TO ; } @ Override public Object visitDefnNode ( DefnNode iVisited ) { methods . put ( iVisited . getName ( ) , iVisited ) ; return super . visitDefnNode ( iVisited ) ; } @ | |
1,854 | <s> package org . rubypeople . rdt . internal . ui . wizards . buildpaths . newsourcepage ; import org . eclipse . core . resources . IFolder ; import org . eclipse . core . runtime . Assert ; import org . eclipse . jface . dialogs . IDialogConstants ; import org . eclipse . jface . dialogs . MessageDialog ; import org . eclipse . swt . SWT ; import org . eclipse . swt . events . SelectionAdapter ; import org . eclipse . swt . events . SelectionEvent ; import org . eclipse . swt . events . SelectionListener ; import org . eclipse . swt . layout . GridLayout ; import org . eclipse . swt . widgets . Button ; import org . eclipse . swt . widgets . Composite ; import org . eclipse . swt . widgets . Control ; import org . eclipse . swt . widgets . Shell ; import org . rubypeople . rdt . internal . corext . util . Messages ; import org . rubypeople . rdt . internal . ui . wizards . NewWizardMessages ; import org . rubypeople . rdt . internal . ui . wizards . buildpaths . newsourcepage . LoadpathModifierQueries . IRemoveLinkedFolderQuery ; class RemoveLinkedFolderDialog extends MessageDialog { private int fRemoveStatus = IRemoveLinkedFolderQuery . REMOVE_BUILD_PATH_AND_FOLDER ; private Button fRemoveBuildPathAndFolder ; private Button fRemoveBuildPath ; RemoveLinkedFolderDialog ( final Shell shell , final IFolder folder ) { super ( shell , NewWizardMessages . LoadpathModifierQueries_confirm_remove_linked_folder_label , null , Messages . format ( NewWizardMessages . LoadpathModifierQueries_confirm_remove_linked_folder_message , new Object [ ] { folder . getFullPath ( ) } ) , MessageDialog . QUESTION , new String [ ] { IDialogConstants . YES_LABEL , IDialogConstants . NO_LABEL } , 0 ) ; Assert . isTrue ( folder . isLinked ( ) ) ; } protected Control createCustomArea ( final Composite parent ) { final Composite composite = new Composite ( parent , SWT . NONE ) ; composite . setLayout ( new GridLayout ( ) ) ; fRemoveBuildPathAndFolder = new Button ( composite , SWT . RADIO ) ; | |
1,855 | <s> package org . oddjob . util ; import java . util . Date ; public class DefaultClock | |
1,856 | <s> package org . rubypeople . rdt . internal . testunit . ui ; import org . eclipse . swt . graphics . Image ; public class ProgressImages { private static final int PROGRESS_STEPS = 9 ; private static final String BASE = "prgss/" ; private static final String FAILURE = "ff" ; private static final String OK = "ss" ; private Image [ ] fOKImages = new Image [ PROGRESS_STEPS ] ; private Image [ ] fFailureImages = new Image [ PROGRESS_STEPS ] ; private void load ( ) { if ( isLoaded ( ) ) return ; for ( int i = 0 ; i < PROGRESS_STEPS ; i ++ ) { String okname = BASE + OK + Integer . toString ( i + 1 ) + ".gif" ; fOKImages [ i ] = createImage ( okname ) ; String failurename = BASE + FAILURE + Integer . toString ( i + 1 ) + ".gif" ; fFailureImages [ i ] = createImage ( failurename ) ; } } private Image createImage ( String name ) { return TestunitPlugin . getImageDescriptor ( name ) . createImage ( ) ; } public void dispose ( | |
1,857 | <s> package org . rubypeople . rdt . internal . debug . core . parsing ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . Status ; import org . rubypeople . rdt . debug . core . RdtDebugCorePlugin ; import org . rubypeople . rdt . internal . debug . core . model . RubyProcessingException ; import org . xmlpull . v1 . XmlPullParser ; public class LoadResultReader extends XmlStreamReader { private LoadResult loadResult ; public LoadResultReader ( XmlPullParser xpp ) { super ( xpp ) ; } public LoadResultReader ( AbstractReadStrategy readStrategy ) { super ( readStrategy ) ; } public IStatus readLoadResult ( ) throws RubyProcessingException { this . loadResult = new LoadResult ( ) ; try { this . read ( ) ; } catch ( Exception ex ) { RdtDebugCorePlugin . log ( ex ) ; } int code = IStatus . ERROR ; if ( loadResult . isOk ( ) ) code = IStatus . OK ; StringBuilder builder = new StringBuilder ( ) ; if ( loadResult . exceptionType != null ) builder . append ( loadResult . exceptionType ) . append ( ": " ) ; builder . append ( loadResult . exceptionMessage ) ; return new Status ( | |
1,858 | <s> package net . sf . sveditor . core . fileset ; import java . util . ArrayList ; import java . util . List ; public class SVFileSet { protected String fBaseLocation ; protected List < String > fIncludes ; protected List < String > fExcludes ; public SVFileSet ( String base_location ) { fBaseLocation = base_location ; fIncludes = new ArrayList < String > ( ) ; fExcludes = new ArrayList < String > ( ) ; } public String getBase ( ) { return fBaseLocation ; } public void addInclude ( String inc ) { fIncludes . add ( inc ) ; } public void addExclude ( String exc ) { fExcludes . add | |
1,859 | <s> package net . sf . sveditor . core . docs . model ; import java . io . File ; public class DocFile extends DocTopic { String fDocPath ; String fPageTitle ; String fOutPath ; public DocFile ( String name ) { super ( name , "" , "" ) ; setDocFile ( this ) ; } public void setOutPath ( String path ) { fOutPath = path ; } public String getOutPath ( ) { return fOutPath ; } | |
1,860 | <s> package net . sf . sveditor . ui ; import java . io . File ; import java . io . IOException ; import java . util . ArrayList ; import java . util . List ; import java . util . Map ; import java . util . MissingResourceException ; import java . util . ResourceBundle ; import java . util . StringTokenizer ; import java . util . WeakHashMap ; import net . sf . sveditor . core . SVCorePlugin ; import net . sf . sveditor . core . XMLTransformUtils ; import net . sf . sveditor . core . db . index . ISVDBIndex ; import net . sf . sveditor . core . log . ILogHandle ; import net . sf . sveditor . core . log . ILogLevel ; import net . sf . sveditor . core . log . ILogListener ; import net . sf . sveditor . core . log . LogFactory ; import net . sf . sveditor . core . templates . IExternalTemplatePathProvider ; import net . sf . sveditor . core . templates . ITemplateParameterProvider ; import net . sf . sveditor . core . templates . TemplateParameterProvider ; import net . sf . sveditor . core . templates . TemplateRegistry ; import net . sf . sveditor . ui . pref . SVEditorPrefsConstants ; import org . eclipse . core . runtime . jobs . Job ; import org . eclipse . jface . dialogs . IDialogSettings ; import org . eclipse . jface . preference . IPreferenceStore ; import org . eclipse . jface . resource . ImageDescriptor ; import org . eclipse . jface . text . templates . ContextTypeRegistry ; import org . eclipse . jface . text . templates . persistence . TemplateStore ; import org . eclipse . jface . util . IPropertyChangeListener ; import org . eclipse . jface . util . PropertyChangeEvent ; import org . eclipse . swt . SWT ; import org . eclipse . swt . graphics . Image ; import org . eclipse . swt . widgets . Display ; import org . eclipse . ui . IWorkbenchPage ; import org . eclipse . ui . console . ConsolePlugin ; import org . eclipse . ui . console . IConsole ; import org . eclipse . ui . console . MessageConsole ; import org . eclipse . ui . console . MessageConsoleStream ; import org . eclipse . ui . editors . text . EditorsUI ; import org . eclipse . ui . editors . text . templates . ContributionContextTypeRegistry ; import org . eclipse . ui . editors . text . templates . ContributionTemplateStore ; import org . eclipse . ui . plugin . AbstractUIPlugin ; import org . eclipse . ui . texteditor . AbstractDecoratedTextEditorPreferenceConstants ; import org . eclipse . ui . texteditor . ChainedPreferenceStore ; import org . osgi . framework . BundleContext ; public class SVUiPlugin extends AbstractUIPlugin implements IPropertyChangeListener , ILogListener , IExternalTemplatePathProvider { private class LogMessage { ILogHandle handle ; int type ; int level ; String message ; } public static final String PLUGIN_ID = "" ; private static SVUiPlugin fPlugin ; private ResourceBundle fResources ; private WeakHashMap < String , Image > fImageMap ; private MessageConsole fConsole ; private MessageConsoleStream fStdoutStream ; private MessageConsoleStream fStderrStream ; private ContributionContextTypeRegistry fContextRegistry ; private TemplateStore fTemplateStore ; private boolean fDebugConsole ; public static final String CUSTOM_TEMPLATES_KEY = "" ; public static final String SV_TEMPLATE_CONTEXT = "" ; private String fInsertSpaceTestOverride ; private boolean fStartRefreshJob = false ; private RefreshIndexJob fRefreshIndexJob ; private List < String > fTemplatePaths ; private TemplateParameterProvider fGlobalPrefsProvider ; private List < LogMessage > fLogMessageQueue ; private boolean fLogMessageScheduled ; public SVUiPlugin ( ) { fImageMap = new WeakHashMap < String , Image > ( ) ; fGlobalPrefsProvider = new TemplateParameterProvider ( ) ; fLogMessageQueue = new ArrayList < SVUiPlugin . LogMessage > ( ) ; } public void start ( BundleContext context ) throws Exception { super . start ( context ) ; fPlugin = this ; LogFactory . getDefault ( ) . addLogListener ( this ) ; getPreferenceStore ( ) . addPropertyChangeListener ( this ) ; SVCorePlugin . getDefault ( ) . setDebugLevel ( getDebugLevel ( getPreferenceStore ( ) . getString ( SVEditorPrefsConstants . P_DEBUG_LEVEL_S ) ) ) ; SVCorePlugin . getDefault ( ) . getSVDBIndexRegistry ( ) . setEnableAutoRebuild ( getPreferenceStore ( ) . getBoolean ( SVEditorPrefsConstants . P_AUTO_REBUILD_INDEX ) ) ; TemplateRegistry rgy = SVCorePlugin . getDefault ( ) . getTemplateRgy ( ) ; rgy . addPathProvider ( this ) ; update_template_paths ( ) ; update_global_parameters ( ) ; } public static IWorkbenchPage getActivePage | |
1,861 | <s> package org . rubypeople . rdt . refactoring . core . renamelocal ; import org . rubypeople . rdt . refactoring . core . IRefactoringContext ; import org . rubypeople . rdt . refactoring . core . RubyRefactoring ; import org . rubypeople | |
1,862 | <s> package com . asakusafw . runtime . stage . input ; import java . io . IOException ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import org . apache . hadoop . mapreduce . JobContext ; import org . apache . hadoop . mapreduce . Mapper ; public abstract class SplitCombiner { protected abstract List < StageInputSplit > combine ( JobContext context , List < StageInputSplit > splits ) throws IOException , InterruptedException ; public static final class Util { private Util ( ) { return ; } public static Map < Class < ? extends Mapper < ? , ? , ? , ? > > , List < StageInputSplit . Source > > groupByMapper ( List < | |
1,863 | <s> package org . rubypeople . rdt . internal . ui . dnd ; import org . eclipse . jface . util . Assert ; import org . eclipse . jface . util . TransferDragSourceListener ; import org . eclipse . jface . viewers . IStructuredSelection ; import org . eclipse . jface . viewers . StructuredViewer ; import org . eclipse . swt . dnd . DragSourceEvent ; public class RdtViewerDragAdapter extends DelegatingDragAdapter { private StructuredViewer fViewer ; public RdtViewerDragAdapter ( StructuredViewer viewer , TransferDragSourceListener [ ] listeners ) { super ( listeners ) ; Assert . isNotNull ( viewer ) ; fViewer = viewer ; } public void dragStart ( DragSourceEvent event ) { IStructuredSelection selection = ( IStructuredSelection ) | |
1,864 | <s> package org . rubypeople . rdt . internal . core ; import org . rubypeople . rdt . core . ISourceRange ; class | |
1,865 | <s> package com . asakusafw . testdriver . bulkloader ; import java . util . Calendar ; import com . asakusafw . testdriver . model . SimpleDataModelDefinition ; import com . asakusafw . thundergate . runtime . cache . ThunderGateCacheSupport ; 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_DATETIME" } ) public class CacheSupport implements ThunderGateCacheSupport { @ OriginalName ( "NUMBER" ) public Integer number ; @ OriginalName ( "TEXT" ) public String text ; @ OriginalName ( "C_BOOL" ) public Boolean booleanValue ; @ OriginalName ( "C_DATETIME" ) public Calendar datetimeValue ; public Integer inferOriginalName ; @ Override public long __tgc__DataModelVersion ( ) { return 0 ; } @ Override public boolean __tgc__Deleted ( ) { return Boolean . TRUE . equals ( booleanValue ) ; } @ Override public long __tgc__SystemId ( ) { return number ; } @ Override public String __tgc__TimestampColumn ( ) { return "C_DATETIME" ; } @ Override public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = prime * result + ( ( booleanValue == null ) ? 0 : booleanValue . hashCode ( ) ) ; result = prime * result + ( ( datetimeValue == null ) ? 0 : datetimeValue . hashCode ( ) ) ; result = prime * result + ( ( | |
1,866 | <s> package net . sf . sveditor . core . docs . model ; import java . util . ArrayList ; import java . util . List ; public class DocTopic implements IDocTopic { private String fTitle ; private String fSummary ; private String fKeyword ; private String fTopic ; private String fBody ; private List < DocTopic > fChildren ; private String fEnclosingPkg ; private String fEnclosingClass ; private DocFile fDocFile ; public DocTopic ( ) { fTitle = "" ; fChildren = new ArrayList < DocTopic > ( ) ; fSummary = "" ; fBody = "" ; fEnclosingPkg = "" ; fEnclosingClass = "" ; fDocFile = null ; } public DocTopic ( String topicTitle , String topicTypeName , String keyword ) { this ( ) ; setTitle ( topicTitle ) ; setTopic ( topicTypeName ) ; setKeyword ( keyword ) ; } public String getQualifiedName ( ) { String ret = fTitle ; if ( ! fEnclosingClass . isEmpty ( ) ) { ret = fEnclosingClass + "::" + ret ; } if ( ! fEnclosingPkg . isEmpty ( ) ) { ret = fEnclosingPkg + "::" + ret ; } return ret ; } public String getTitle ( ) { return fTitle ; } public void setTitle ( String title ) { fTitle = title ; } public void addChild ( DocTopic child ) { fChildren . add ( child ) ; child . setDocFile ( getDocFile ( ) ) ; } public List < DocTopic > getChildren ( ) { return fChildren ; } | |
1,867 | <s> package org . rubypeople . rdt . internal . core . search . matching ; import org . rubypeople . rdt . core . search . SearchPattern ; import org . rubypeople . rdt . internal . core . search . indexing . IIndexConstants ; import org . rubypeople . rdt . internal . core . util . CharOperation ; public class QualifiedTypeDeclarationPattern extends TypeDeclarationPattern implements IIndexConstants { public char [ ] qualification ; public int packageIndex ; public QualifiedTypeDeclarationPattern ( char [ ] qualification , char [ ] simpleName , char typeSuffix , int matchRule ) { this ( matchRule ) ; this . qualification = isCaseSensitive ( ) ? qualification : CharOperation . toLowerCase ( qualification ) ; this . simpleName = ( isCaseSensitive ( ) || isCamelCase ( ) ) ? simpleName : CharOperation . toLowerCase ( simpleName ) ; this . typeSuffix = typeSuffix ; ( ( InternalSearchPattern ) this ) . mustResolve = this . qualification != null || typeSuffix != TYPE_SUFFIX ; } QualifiedTypeDeclarationPattern ( int matchRule ) { super ( matchRule ) ; } public void decodeIndexKey ( char [ ] key ) { int slash = CharOperation . indexOf ( SEPARATOR , key , 0 ) ; this . simpleName = CharOperation . subarray ( key , 0 , | |
1,868 | <s> package org . oddjob . framework ; import java . lang . annotation . ElementType ; import java . lang . annotation . Retention ; import java . lang . annotation . RetentionPolicy ; import java . lang . annotation . Target ; | |
1,869 | <s> package com . asakusafw . compiler . testing . flow ; import com . asakusafw . compiler . flow . testing . model . Ex1 ; import com . asakusafw . compiler . testing . TemporaryOutputDescription ; public class Out2ExporterDesc extends TemporaryOutputDescription { @ Override public Class < ? > getModelType ( ) { return Ex1 . | |
1,870 | <s> package com . asakusafw . compiler . fileio . io ; import java . io . IOException ; import com . asakusafw . compiler . fileio . model . ExSummarized2 ; import com . asakusafw . runtime . io . ModelInput ; import com . asakusafw . runtime . io . RecordParser ; public final class ExSummarized2Input implements ModelInput < ExSummarized2 > { private final RecordParser parser ; public ExSummarized2Input ( RecordParser parser ) { if ( parser == null ) { throw new IllegalArgumentException | |
1,871 | <s> package handson . springbatch ; import java . util . List ; import org . springframework . batch . item . ItemReader ; import org . springframework . batch . item . NonTransientResourceException ; import org . springframework . batch . item . ParseException ; import org . springframework . batch . item . UnexpectedInputException ; import org . springframework . stereotype . Component ; import com . google . common . collect . Lists ; @ Component public class HelloWorldReader implements ItemReader < String > { private List < String > names = Lists . newArrayList ( "Aaron" , | |
1,872 | <s> package net . sf . sveditor . core . db . index ; import java . lang . ref . Reference ; import java . lang . ref . WeakReference ; import java . util . ArrayList ; import java . util . List ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . SubProgressMonitor ; public class SVDBIndexCollectionMgr { private List < Reference < SVDBIndexCollection > > fIndexCollectionList ; private boolean fCreateShadowIndexes ; public SVDBIndexCollectionMgr ( ) { fIndexCollectionList = new ArrayList < Reference < SVDBIndexCollection > > ( ) ; } public void addIndexCollection ( SVDBIndexCollection c ) { fIndexCollectionList . add ( new WeakReference < SVDBIndexCollection > ( c ) ) ; } public void setCreateShadowIndexes ( boolean create ) { boolean fire = ( fCreateShadowIndexes != create ) ; if ( fire ) { for ( int i = 0 ; i < fIndexCollectionList . size ( ) ; i ++ ) { if ( fIndexCollectionList . get ( i ) . get ( ) != null ) { fIndexCollectionList . get ( i ) . get ( ) . settingsChanged ( ) ; } else { fIndexCollectionList . remove ( i ) ; i -- ; } } } fCreateShadowIndexes = create ; } public boolean getCreateShadowIndexes ( ) | |
1,873 | <s> package org . oddjob . launch ; import java . io . File ; import java . io . FilenameFilter ; import java . net . MalformedURLException ; import java . net . URL ; import java . text . CharacterIterator ; import java . text . StringCharacterIterator ; public final class Locator { private Locator ( ) { } public static File getClassSource ( Class c ) { String classResource = c . getName ( ) . replace ( '.' , '/' ) + ".class" ; return getResourceSource ( c . getClassLoader ( ) , classResource ) ; } public static File getResourceSource ( ClassLoader c , String resource ) { if ( c == null ) { c = Locator . class . getClassLoader ( ) ; } URL url = c . getResource ( resource ) ; if ( url != null ) { String u = url . toString ( ) ; if ( u . startsWith ( "jar:file:" ) ) { int pling = u . indexOf ( "!" ) ; String jarName = u . substring ( 4 , pling ) ; return new File ( fromURI ( jarName ) ) ; } else if ( u . startsWith ( "file:" ) ) { int tail = u . indexOf ( resource ) ; String dirName = u . substring ( 0 , tail ) ; return new File ( fromURI ( dirName ) ) ; } } return null ; } public static String fromURI ( String uri ) { if ( ! uri . startsWith ( "file:" ) ) { throw new IllegalArgumentException ( "" ) ; } if ( uri . startsWith ( "file://" ) ) { uri = uri . substring ( 7 ) ; } else { uri = uri . substring ( 5 ) ; } uri = uri . replace ( '/' , File . separatorChar ) ; if ( File . pathSeparatorChar == ';' && uri . startsWith ( "\\" ) && uri . length ( ) > 2 && Character . isLetter ( uri . charAt ( 1 ) ) && uri . lastIndexOf ( ':' ) > - 1 ) { uri = uri . substring ( 1 ) ; } StringBuffer sb = new StringBuffer ( ) ; CharacterIterator iter = new StringCharacterIterator ( uri ) ; for ( char c = iter . first ( ) ; c != CharacterIterator . DONE ; c = iter . next ( ) ) { if ( c == '%' ) { char c1 = iter . next ( ) ; if ( c1 != CharacterIterator . DONE ) { int i1 = Character . digit ( c1 , 16 ) ; char c2 = iter . next ( ) ; if ( c2 != CharacterIterator . DONE ) { int i2 = Character . digit ( c2 , 16 ) ; sb . append ( ( char ) ( ( i1 << 4 ) + i2 ) ) ; } } } else { sb . append | |
1,874 | <s> package org . rubypeople . rdt . refactoring . tests . core . renamemethod . conditioncheck ; import java . io . FileNotFoundException ; import java . io . IOException ; import org . rubypeople . rdt . refactoring . core . renamemethod . MethodRenamer ; import org . rubypeople . rdt . refactoring . core . renamemethod . RenameMethodConditionChecker ; import org . rubypeople . rdt . refactoring . core . renamemethod . RenameMethodConfig ; import org . rubypeople . rdt . refactoring . tests . FilePropertyData ; import org . rubypeople . rdt . refactoring . tests . FileTestData ; import org . rubypeople . rdt . refactoring . tests . RefactoringConditionTestCase ; public class RenameMethodConditionTester extends RefactoringConditionTestCase { private RenameMethodConfig config ; private FilePropertyData testData ; public RenameMethodConditionTester ( String fileName ) { super ( fileName ) ; } @ Override public void runTest ( ) throws FileNotFoundException , IOException { testData | |
1,875 | <s> package fruit ; import java . io . Serializable ; import org . oddjob . arooa . convert . ConversionProvider ; import org . oddjob . arooa . convert . ConversionRegistry ; import org . oddjob . arooa . convert . Convertlet ; import org . oddjob . arooa . convert . ConvertletException ; public interface Flavour extends Serializable { public static class Conversions implements ConversionProvider { public void registerWith ( ConversionRegistry registry ) { registry . register ( Flavour . class , String . class , new Convertlet < Flavour , String > ( | |
1,876 | <s> package com . asakusafw . runtime . directio . hadoop ; import java . io . IOException ; import java . text . MessageFormat ; import java . util . List ; import org . apache . commons . logging . Log ; import org . apache . commons . logging . LogFactory ; import org . apache . hadoop . conf . Configurable ; import org . apache . hadoop . conf . Configuration ; import org . apache . hadoop . fs . FileSystem ; import com . asakusafw . runtime . directio . AbstractDirectDataSource ; import com . asakusafw . runtime . directio . Counter ; import com . asakusafw . runtime . directio . DataFormat ; import com . asakusafw . runtime . directio . DirectDataSource ; import com . asakusafw . runtime . directio . DirectDataSourceProfile ; import com . asakusafw . runtime . directio . DirectInputFragment ; import com . asakusafw . runtime . directio . OutputAttemptContext ; import com . asakusafw . runtime . directio . OutputTransactionContext ; import com . asakusafw . runtime . directio . ResourceInfo ; import com . asakusafw . runtime . directio . ResourcePattern ; import com . asakusafw . runtime . directio . keepalive . KeepAliveDataSource ; import com . asakusafw . runtime . io . ModelInput ; import com . asakusafw . runtime . io . ModelOutput ; public class HadoopDataSource extends AbstractDirectDataSource implements Configurable { static final Log LOG = LogFactory . getLog ( HadoopDataSource . class ) ; private volatile DirectDataSource core ; | |
1,877 | <s> package org . rubypeople . rdt . internal . ui . search ; import java . util . StringTokenizer ; import org . rubypeople . rdt . core . IField ; import org . rubypeople . rdt . core . IImportDeclaration ; import org . rubypeople . rdt . core . IType ; import org . rubypeople . rdt . core . search . IRubySearchConstants ; import org . rubypeople . rdt . core . search . SearchMatch ; import org . rubypeople . rdt . internal . ui . RubyPlugin ; import org . rubypeople . rdt . ui . search . ElementQuerySpecification ; import org . rubypeople . rdt . ui . search . PatternQuerySpecification ; import org . rubypeople . rdt . ui . search . QuerySpecification ; abstract class MatchFilter { private static final String SETTINGS_LAST_USED_FILTERS = "" ; public static MatchFilter [ ] getLastUsedFilters ( ) { String string = RubyPlugin . getDefault ( ) . getDialogSettings ( ) . get ( SETTINGS_LAST_USED_FILTERS ) ; if ( string != null && string . length ( ) > 0 ) { return decodeFiltersString ( string ) ; } return getDefaultFilters ( ) ; } public static void setLastUsedFilters ( MatchFilter [ ] filters ) { String encoded = encodeFilters ( filters ) ; RubyPlugin . getDefault ( ) . getDialogSettings ( ) . put ( SETTINGS_LAST_USED_FILTERS , encoded ) ; } public static MatchFilter [ ] getDefaultFilters ( ) { return new MatchFilter [ ] { IMPORT_FILTER } ; } private static String encodeFilters ( MatchFilter [ ] enabledFilters ) { StringBuffer buf = new StringBuffer ( ) ; buf . append ( enabledFilters . length ) ; for ( int i = 0 ; i < enabledFilters . length ; i ++ ) { buf . append ( ';' ) ; buf . append ( enabledFilters [ i ] . getID ( ) ) ; } return buf . toString ( ) ; } private static MatchFilter [ ] decodeFiltersString ( String encodedString ) { StringTokenizer tokenizer = new StringTokenizer ( encodedString , String . valueOf ( ';' ) ) ; MatchFilter [ ] res ; try { int count = Integer . valueOf ( tokenizer . nextToken ( ) ) . intValue ( ) ; res = new MatchFilter [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { res [ i ] | |
1,878 | <s> package org . rubypeople . rdt . ui . actions ; import org . eclipse . jface . action . Action ; import org . eclipse . jface . text . ITextSelection ; import org . eclipse . jface . util . Assert ; import org . eclipse . jface . viewers . ISelection ; import org . eclipse . jface . viewers . ISelectionChangedListener ; import org . eclipse . jface . viewers . ISelectionProvider ; import org . eclipse . jface . viewers . IStructuredSelection ; import org . eclipse . jface . viewers . SelectionChangedEvent ; import org . eclipse . swt . widgets . Shell ; import org . eclipse . ui . IWorkbenchSite ; public abstract class SelectionDispatchAction extends Action implements ISelectionChangedListener { private IWorkbenchSite fSite ; | |
1,879 | <s> package org . oddjob . monitor . model ; import java . beans . PropertyChangeEvent ; import java . beans . PropertyChangeListener ; import javax . swing . KeyStroke ; import org . oddjob . monitor . context . ExplorerContext ; import junit . framework . TestCase ; public class JobActionTest extends TestCase { public void testEnabledPropertyNotification ( ) { class MyAction extends JobAction { @ Override protected void doPrepare ( ExplorerContext explorerContext ) { } @ Override protected void doFree ( ExplorerContext explorerContext ) { } @ Override protected void doAction ( ) throws Exception { } public String getName ( ) { return null ; } public String | |
1,880 | <s> package net . sf . sveditor . core . scanner ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . List ; import java . util . Map ; import java . util . Set ; import java . util . Stack ; import net . sf . sveditor . core . db . ISVDBChildItem ; import net . sf . sveditor . core . db . SVDBMacroDef ; import net . sf . sveditor . core . db . SVDBMacroDefParam ; import net . sf . sveditor . core . db . utils . SVDBItemPrint ; import net . sf . sveditor . core . log . LogFactory ; import net . sf . sveditor . core . log . LogHandle ; import net . sf . sveditor . core . scanutils . ITextScanner ; import net . sf . sveditor . core . scanutils . StringTextScanner ; public class SVPreProcDefineProvider implements IDefineProvider { private static final boolean fDebugEn = false ; private static final boolean fDebugChEn = false ; private boolean fDebugUndefinedMacros = false ; private String fFilename ; private int fLineno ; private Stack < String > fExpandStack ; private Stack < Boolean > fEnableOutputStack ; private LogHandle fLog ; private IPreProcMacroProvider fMacroProvider ; private List < IPreProcErrorListener > fErrorListeners ; public SVPreProcDefineProvider ( IPreProcMacroProvider macro_provider ) { fExpandStack = new Stack < String > ( ) ; fEnableOutputStack = new Stack < Boolean > ( ) ; fLog = LogFactory . getLogHandle ( "" ) ; fMacroProvider = macro_provider ; fErrorListeners = new ArrayList < IPreProcErrorListener > ( ) ; } public void addErrorListener ( IPreProcErrorListener l ) { fErrorListeners . add ( l ) ; } public void removeErrorListener ( IPreProcErrorListener l ) { fErrorListeners . remove ( l ) ; } public void error ( String msg , String filename , int lineno ) { for ( IPreProcErrorListener l : fErrorListeners ) { l . preProcError ( msg , filename , lineno ) ; } } public void setMacroProvider ( IPreProcMacroProvider provider ) { fMacroProvider = provider ; } public IPreProcMacroProvider getMacroProvider ( ) { return fMacroProvider ; } public void addDefines ( Map < String , String > defs ) { for ( String key : defs . keySet ( ) ) { fMacroProvider . setMacro ( key , defs . get ( key ) ) ; } } public boolean isDefined ( String name , int lineno ) { SVDBMacroDef m = fMacroProvider . findMacro ( name , lineno ) ; if ( m != null ) { return ( m . getLocation ( ) == null || m . getLocation ( ) . getLine ( ) <= lineno ) ; } else { return false ; } } public synchronized String expandMacro ( String str , String filename , int lineno ) { StringTextScanner scanner = new StringTextScanner ( new StringBuilder ( str ) ) ; fFilename = filename ; fLineno = lineno ; if ( fDebugEn ) { debug ( "" + str ) ; } if ( fMacroProvider == null ) { fLog . error ( "" ) ; if ( fDebugEn ) { debug ( "" + str ) ; debug ( "" ) ; } return "" ; } fMacroProvider . setMacro ( "__FILE__" , "\"" + fFilename + "\"" ) ; fMacroProvider . setMacro ( "__LINE__" , "" + fLineno ) ; fExpandStack . clear ( ) ; fEnableOutputStack . clear ( ) ; fEnableOutputStack . push ( true ) ; expandMacro ( scanner ) ; if ( fDebugEn ) { debug ( "" + str ) ; debug ( " Result: " + scanner . getStorage ( ) . toString ( ) ) ; } return scanner . getStorage ( ) . toString ( ) ; } private int expandMacro ( StringTextScanner scanner ) { if ( fDebugEn ) { debug ( "" ) ; } int macro_start = scanner . getOffset ( ) ; int ch = scanner . get_ch ( ) ; if ( ch != '`' ) { System . out . println ( "" + "" + ( char ) ch + "\" @ " + fFilename + ":" + fLineno ) ; try { throw new Exception ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } String key = scanner . readPreProcIdentifier ( scanner . get_ch ( ) ) ; if ( key == null ) { ch = scanner . get_ch ( ) ; fLog . error ( "" + ( char ) ch ) ; scanner . unget_ch ( ch ) ; } else if ( key . equals ( "ifdef" ) || key . equals ( "ifndef" ) || key . equals ( "else" ) || key . equals ( "endif" ) ) { } else { fExpandStack . push ( key ) ; ch = scanner . skipWhite ( scanner . get_ch ( ) ) ; SVDBMacroDef m = fMacroProvider . findMacro ( key , fLineno ) ; Set < String > referenced_macros = new HashSet < String > ( ) ; if ( m == null ) { error ( "macro \"" + key + "\" undefined" ) ; if ( fDebugUndefinedMacros ) { fLog . error ( "macro \"" + key + "" + fFilename + ":" + fLineno ) ; } if ( ch == '(' ) { ch = skipPastMatchSkipStrings ( scanner , '(' , ')' ) ; scanner . unget_ch ( ch ) ; } int newline_count = 0 ; for ( int i = macro_start ; i < scanner . getOffset ( ) ; i ++ ) { if ( scanner . charAt ( i ) == '\n' ) { newline_count ++ ; } } if ( newline_count > 0 ) { StringBuilder replace = new StringBuilder ( ) ; while ( newline_count > 0 ) { replace . append ( "n" ) ; newline_count -- ; } scanner . replace ( macro_start , scanner . getOffset ( ) , replace . toString ( ) ) ; } else { scanner . replace ( macro_start , scanner . getOffset ( ) , "" ) ; } return 0 ; } List < String > params = null ; if ( ch == '(' ) { StringTextScanner scanner_s ; if ( fDebugEn ) { debug ( "" + scanner . getStorage ( ) ) ; } expandMacroRefs ( new StringTextScanner ( scanner , scanner . getOffset ( ) ) , referenced_macros ) ; if ( fDebugEn ) { debug ( "" + scanner . getStorage ( ) ) ; } params = parse_params ( m , scanner ) ; scanner_s = new StringTextScanner ( scanner , macro_start , scanner . getOffset ( ) ) ; expandMacro ( scanner_s , m , params , referenced_macros ) ; if ( fDebugEn ) { debug ( "" + m . getName ( ) + " is: " + scanner . getStorage ( ) . toString ( ) ) ; } ch = scanner . get_ch ( ) ; } else { StringTextScanner scanner_s = new StringTextScanner ( scanner , macro_start , scanner . getOffset ( ) ) ; expandMacro ( scanner_s , m , null , referenced_macros ) ; scanner . seek ( scanner_s . getOffset ( ) - 1 ) ; if ( fDebugEn ) { debug ( "" + scanner_s . getStorage ( ) . toString ( ) ) ; } } fExpandStack . pop ( ) ; if ( fDebugEn ) { debug ( "" ) ; } } return 0 ; } private int skipPastMatchSkipStrings ( ITextScanner scanner , int ch1 , int ch2 ) { int ch ; int lcnt = 1 , rcnt = 0 ; while ( ( ch = scanner . get_ch ( ) ) != - 1 ) { if ( ch == ch1 ) { lcnt ++ ; } else if ( ch == ch2 ) { rcnt ++ ; } else if ( ch == '"' ) { skipPastString ( scanner ) ; } if ( lcnt == rcnt ) { break ; } } return scanner . get_ch ( ) ; } private void skipPastString ( ITextScanner scanner ) { int ch ; int last_ch = - 1 ; while ( ( ch = scanner . get_ch ( ) ) != - 1 ) { if ( ch == '"' && last_ch != '\\' ) { break ; } if ( last_ch == '\\' && ch == '\\' ) { last_ch = - 1 ; } else { last_ch = ch ; } } } private void expandMacro ( StringTextScanner scanner , SVDBMacroDef m , List < String > params_vals , Set < String > referenced_params ) { boolean expand_params = ( params_vals != null ) ; List < String > param_names = new ArrayList < String > ( ) ; for ( int i = 0 ; i < m . getParameters ( ) . size ( ) ; i ++ ) { SVDBMacroDefParam mp = m . getParameters ( ) . get ( i ) ; param_names . add ( mp . getName ( ) ) ; if ( i >= params_vals . size ( ) && mp . getValue ( ) != null ) { if ( fDebugEn ) { debug ( "" + mp . getValue ( ) + "" + mp . getName ( ) ) ; } params_vals . add ( mp . getValue ( ) ) ; } } if ( fDebugEn ) { debug ( "" + m . getName ( ) + ")" ) ; debug ( " text=" + scanner . substring ( scanner . getOffset ( ) , scanner . getLimit ( ) ) ) ; } if ( expand_params ) { expand_params = ( params_vals . size ( ) == param_names . size ( ) ) ; if ( params_vals . size ( ) != param_names . size ( ) ) { fLog . error ( "" + m . getName ( ) + "" + params_vals . size ( ) + " vs " + m . getParameters ( ) . size ( ) ) ; fLog . error ( "" + fFilename + ":" + fLineno ) ; if ( fDebugEn ) { try { throw new Exception ( ) ; } catch ( Exception e ) { fLog . debug ( "" , e ) ; } } } } if ( m . getDef ( ) == null ) { System . out . println ( "" + m . getName ( ) + "\" is null" ) ; ISVDBChildItem top = m ; while ( top . getParent ( ) != null ) { top = top . getParent ( ) ; } System . out . println ( "" ) ; SVDBItemPrint . printItem ( top ) ; walkStack ( ) ; } if ( fDebugEn ) { debug ( "def=" + m . getDef ( ) ) ; } if ( m . getDef ( ) == null ) { System . out . println ( "Macro \"" + m . getName ( ) + "" + m . getLocation ( ) . getLine ( ) + " is null" ) ; scanner . replace ( scanner . getOffset ( ) , scanner . getLimit ( ) , "" ) ; } else { scanner . replace ( scanner . getOffset ( ) , scanner . getLimit ( ) , m . getDef ( ) ) ; } if ( expand_params ) { expandParameterRefs ( new StringTextScanner ( scanner ) , param_names , params_vals ) ; } if ( ! referenced_params . contains ( m . getName ( ) ) ) { referenced_params . add ( m . getName ( ) ) ; expandMacroRefs ( new StringTextScanner ( scanner ) , referenced_params ) ; referenced_params . remove ( m . getName ( ) ) ; } else { } if ( fDebugEn ) { debug ( " text=" + scanner . getStorage ( ) . toString ( ) ) ; debug ( "" + m . getName ( ) + ")" ) ; } } private List < String > parse_params ( SVDBMacroDef m , StringTextScanner scanner ) { if ( fDebugEn ) { debug ( "" + m . getName ( ) + ")" ) ; debug ( " str=" + scanner . getStorage ( ) . substring ( scanner . getOffset ( ) ) ) ; } List < String > params = new ArrayList < String > ( ) ; int ch = scanner . get_ch ( ) ; for ( int i = 0 ; i < m . getParameters ( ) . size ( ) ; i ++ ) { ch = scanner . skipWhite ( ch ) ; int p_start = scanner . getOffset ( ) - 1 ; if ( ch == - 1 ) { break ; } scanner . unget_ch ( ch ) ; do { ch = scanner . get_ch ( ) ; if ( ch == '(' ) { ch = skipPastMatchSkipStrings ( scanner , '(' , ')' ) ; if ( fDebugEn ) { debug ( "" + ( char ) ch ) ; } } else if ( ch == '{' ) { ch = skipPastMatchSkipStrings ( scanner , '{' , '}' ) ; if ( fDebugEn ) { debug ( "" + ( char ) ch ) ; } } else if ( ch == '"' ) { while ( ( ch = scanner . get_ch ( ) ) != - 1 && ch != '"' && ch != '\n' ) { } if ( ch == '"' ) { ch = scanner . get_ch ( ) ; } } } while ( ch != - 1 && ch != ',' && ch != ')' ) ; int p_end = scanner . getOffset ( ) ; String param ; if ( scanner . getStorage ( ) . charAt ( p_start ) == '`' ) { StringTextScanner scanner_s = new StringTextScanner ( new StringBuilder ( scanner . substring ( p_start , p_end - 1 ) ) ) ; if ( fDebugEn ) { debug ( "" + scanner . substring ( p_start , p_end - 1 ) + "\"" ) ; } if ( Character . isJavaIdentifierStart ( scanner . getStorage ( ) . charAt ( p_start + 1 ) ) ) { expandMacro ( scanner_s ) ; } else { while ( ( ch = scanner_s . get_ch ( ) ) != - 1 ) { if ( ch == '`' ) { int ch2 = scanner_s . get_ch ( ) ; if ( ch2 == '`' ) { scanner_s . delete ( scanner_s . getOffset ( ) - 2 , scanner_s . getOffset ( ) ) ; } else { scanner_s . delete ( scanner_s . getOffset ( ) - 2 , scanner_s . getOffset ( ) - 1 ) ; } } } } param = scanner_s . getStorage ( ) . toString ( ) ; if ( fDebugEn ) { debug ( "" + param ) ; } } else { param = scanner . getStorage ( ) . substring ( p_start , p_end - 1 ) ; if ( fDebugEn ) { debug ( "" + param ) ; } } params . add ( param . trim ( ) ) ; debug ( "" + ( char ) ch ) ; if ( ch == ',' || ch == ')' ) { if ( ch == ')' ) { ch = scanner . get_ch ( ) ; break ; } ch = scanner . get_ch ( ) ; } } scanner . unget_ch ( ch ) ; if ( fDebugEn ) { for ( String s : params ) { debug ( "Param: \"" + s + "\"" ) ; } debug ( "" + m . getName ( ) + ") => " + params . size ( ) + "" + ( char ) ch ) ; } return params ; } private void expandParameterRefs ( StringTextScanner scanner , List < String > param_names , List < String > param_vals ) { int ch ; if ( fDebugEn ) { for ( int i = 0 ; i < param_names . size ( ) ; i ++ ) { debug ( "Param[" + i + "] " + param_names . get ( i ) + " = " + param_vals . get ( i ) ) ; } debug ( "" ) ; debug ( "pre=" + scanner . getStorage ( ) ) ; } int last_ch = - 1 ; while ( ( ch = scanner . get_ch ( ) ) != - 1 ) { if ( ch == '"' && last_ch != '`' ) { while ( ( ch = scanner . get_ch ( ) ) != - 1 && ch != '"' ) { } } else if ( ch == '`' && last_ch == '`' ) { scanner . replace ( scanner . getOffset ( ) - 2 , scanner . getOffset ( ) , "" ) ; } else if ( Character . isJavaIdentifierStart ( ch ) ) { int p_start = scanner . getOffset ( ) - 1 ; int p_end ; String key = scanner . readPreProcIdentifier ( ch ) ; debug ( "offset=" + scanner . getOffset ( ) + " limit=" + scanner . getLimit ( ) ) ; if ( scanner . getOffset ( ) >= scanner . getLimit ( ) && key . length ( ) == 1 ) { debug ( "" ) ; p_end = scanner . getOffset ( ) ; } else { p_end = scanner . getOffset ( ) - 1 ; } int index = param_names . indexOf ( key ) ; if ( index != - 1 && index < param_vals . size ( ) ) { if ( fDebugEn ) { debug ( "" + key + "\" with \"" + param_vals . get ( index ) + "\"" ) ; debug ( "start_p=" + p_start + " end_p=" + p_end + " offset-1=" + ( scanner . getOffset ( ) - 1 ) ) ; } scanner . replace ( p_start , p_end , param_vals . get ( index ) ) ; } } last_ch = ch ; } if ( fDebugEn ) { debug ( "" ) ; debug ( "post=" + scanner . getStorage ( ) ) ; } } private void expandMacroRefs ( StringTextScanner scanner , Set < String > referenced_params ) { int ch ; int iteration = 0 ; int marker = - 1 ; if ( fDebugEn ) { debug ( "" ) ; debug ( "pre=" + scanner . getStorage ( ) . substring ( scanner . getOffset ( ) , scanner . getLimit ( ) ) ) ; } while ( ( ch = scanner . get_ch ( ) ) != - 1 ) { iteration ++ ; if ( fDebugChEn ) { debug ( "ch=\"" + ( | |
1,881 | <s> package net . sf . sveditor . core . hierarchy ; import java . util . List ; import net . sf . sveditor . core . db . SVDBClassDecl ; import net . sf . sveditor . core . db . index . ISVDBIndexIterator ; import net . sf . sveditor . core . db . refs . SVDBSubClassRefFinder ; import net . sf . sveditor . core . db . search . SVDBFindSuperClass ; public class ClassHierarchyTreeFactory { private ISVDBIndexIterator fIndexIt ; public ClassHierarchyTreeFactory ( ISVDBIndexIterator index_it ) { fIndexIt = index_it ; } public HierarchyTreeNode build ( SVDBClassDecl cls ) { | |
1,882 | <s> package org . oddjob . jmx ; import org . oddjob . arooa . ArooaSession ; import org . oddjob . arooa . life . ArooaSessionAware ; import org . oddjob . arooa . types . ValueFactory ; import org . oddjob . jmx . handlers . VanillaServerHandlerFactory ; import org . oddjob . jmx . server . ServerInterfaceHandlerFactory ; | |
1,883 | <s> package com . asakusafw . compiler . yaess . testing . io ; import java . io . IOException ; import com . asakusafw . compiler . yaess . testing . model . Dummy ; import com . asakusafw . runtime . io . ModelInput ; import com . asakusafw . runtime . io . RecordParser ; public final class DummyInput implements ModelInput < Dummy > { private final RecordParser parser ; | |
1,884 | <s> package com . aptana . rdt . internal . core . gems ; import java . util . Set ; import com . aptana . rdt . core . gems . Gem ; public class GemOnePointTwoParserTest extends AbstractGemParserTestCase { public void testParsingLocalGems ( ) throws GemParseException { String contents = getContents ( "" ) ; Set < Gem > gems = getParser ( ) . parse ( contents ) ; assertEquals ( 7 , gems . size ( ) ) ; } public void testRubygems1dot3 ( ) throws GemParseException { String | |
1,885 | <s> package com . asakusafw . dmdl . directio . csv . driver ; import java . util . Arrays ; import java . util . Map ; import com . asakusafw . dmdl . Diagnostic ; import com . asakusafw . dmdl . Diagnostic . Level ; import com . asakusafw . dmdl . directio . csv . driver . CsvFieldTrait . Kind ; import com . asakusafw . dmdl . model . AstAttribute ; import com . asakusafw . dmdl . model . AstAttributeElement ; import com . asakusafw . dmdl . model . BasicTypeKind ; import com . asakusafw . dmdl . semantics . DmdlSemantics ; import com . asakusafw . dmdl . semantics . PropertyDeclaration ; import com . asakusafw . dmdl . semantics . Type ; import com . asakusafw . dmdl . semantics . type . BasicType ; import com . asakusafw . dmdl . spi . PropertyAttributeDriver ; import com . asakusafw . dmdl . util . AttributeUtil ; public class CsvFieldDriver extends PropertyAttributeDriver { public static final String TARGET_NAME = "" ; public static final String ELEMENT_NAME = "name" ; @ Override public String getTargetName ( ) { return TARGET_NAME ; } @ Override public void process ( DmdlSemantics environment , PropertyDeclaration declaration , AstAttribute attribute ) { Map < String , AstAttributeElement > elements = AttributeUtil . getElementMap ( attribute ) ; String value = AttributeUtil . takeString ( environment , attribute , elements , ELEMENT_NAME , false ) ; environment . reportAll ( AttributeUtil . reportInvalidElements ( attribute , | |
1,886 | <s> package com . aptana . rdt . internal . ui . preferences ; import org . eclipse . core . runtime . preferences . InstanceScope ; import org . eclipse . jface . preference . BooleanFieldEditor ; import org . eclipse . jface . preference . FieldEditorPreferencePage ; import org . eclipse . jface . preference . FileFieldEditor ; import org . eclipse . jface . preference . IPreferenceStore ; import org . eclipse . jface . preference . StringButtonFieldEditor ; import org . eclipse . ui . IWorkbench ; import org . eclipse . ui . IWorkbenchPreferencePage ; import org . rubypeople . rdt . ui . EclipsePreferencesAdapter ; import com . aptana . rdt . AptanaRDTPlugin ; import com . aptana . rdt . ui . AptanaRDTUIPlugin ; import com . aptana . rdt . ui . preferences . IPreferenceConstants ; public class GemPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { private FileFieldEditor gemScriptEditor ; private EclipsePreferencesAdapter store ; public GemPreferencePage ( ) { super ( GRID ) ; setPreferenceStore ( AptanaRDTUIPlugin . getDefault ( ) . getPreferenceStore ( ) ) ; setDescription ( "" ) ; } public void createFieldEditors ( ) { gemScriptEditor = new FileFieldEditor ( com . aptana . rdt . core . preferences . IPreferenceConstants . GEM_SCRIPT_PATH , "" , true , StringButtonFieldEditor . VALIDATE_ON_KEY_STROKE , getFieldEditorParent ( ) ) ; addField ( gemScriptEditor ) ; | |
1,887 | <s> package com . sun . phobos . script . util ; import javax . script . ScriptException ; public class ExtendedScriptException extends ScriptException { public ExtendedScriptException ( Throwable cause , String message , String fileName , int lineNumber , int columnNumber ) { super ( message , fileName , lineNumber , columnNumber ) ; initCause ( cause ) ; } public ExtendedScriptException ( String s ) { super ( s ) ; } public ExtendedScriptException ( Exception e ) { super ( e ) ; } | |
1,888 | <s> package org . rubypeople . rdt . internal . core . parser . warnings ; import org . rubypeople . rdt . core . parser . warnings . RubyLintVisitor ; | |
1,889 | <s> package org . springframework . samples . petclinic ; import java . util . Collection ; import org . springframework . dao . DataAccessException ; public interface Clinic { Collection < Vet > getVets ( ) throws DataAccessException ; Collection < PetType > getPetTypes ( ) throws DataAccessException ; Collection < Owner > findOwners | |
1,890 | <s> package org . rubypeople . rdt . internal . ui . preferences ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . Iterator ; import java . util . Map ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . jface . text . Assert ; 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 . Button ; import org . eclipse . swt . widgets . Composite ; import org . eclipse . swt . widgets . Control ; import org . eclipse . swt . widgets . Label ; import org . rubypeople . rdt . internal . ui . dialogs . StatusInfo ; import org . rubypeople . rdt . internal . ui . util . PixelConverter ; import org . rubypeople . rdt . ui . PreferenceConstants ; class MarkOccurrencesConfigurationBlock implements IPreferenceConfigurationBlock { private OverlayPreferenceStore fStore ; private Map fCheckBoxes = new HashMap ( ) ; private SelectionListener fCheckBoxListener = new SelectionListener ( ) { public void widgetDefaultSelected ( SelectionEvent e ) { } public void widgetSelected ( SelectionEvent e ) { Button button = ( Button ) e . widget ; fStore . setValue ( ( String ) fCheckBoxes . get ( button ) , button . getSelection ( ) ) ; } } ; private ArrayList fMasterSlaveListeners = new ArrayList ( ) ; private StatusInfo fStatus ; public MarkOccurrencesConfigurationBlock ( OverlayPreferenceStore store ) { Assert . isNotNull ( store ) ; fStore = store ; fStore . addKeys ( createOverlayStoreKeys ( ) ) ; } private OverlayPreferenceStore . OverlayKey [ ] createOverlayStoreKeys ( ) { ArrayList overlayKeys = new ArrayList ( ) ; overlayKeys . add ( new OverlayPreferenceStore . OverlayKey ( OverlayPreferenceStore . BOOLEAN , PreferenceConstants . EDITOR_MARK_OCCURRENCES ) ) ; overlayKeys . add ( new OverlayPreferenceStore . OverlayKey ( OverlayPreferenceStore . BOOLEAN , PreferenceConstants . EDITOR_MARK_TYPE_OCCURRENCES ) ) ; overlayKeys . add ( new OverlayPreferenceStore . OverlayKey ( OverlayPreferenceStore . BOOLEAN , PreferenceConstants . EDITOR_MARK_METHOD_OCCURRENCES ) ) ; overlayKeys . add ( new OverlayPreferenceStore . OverlayKey ( OverlayPreferenceStore . BOOLEAN , PreferenceConstants . EDITOR_MARK_CONSTANT_OCCURRENCES ) ) ; overlayKeys . add ( new OverlayPreferenceStore . OverlayKey ( OverlayPreferenceStore . BOOLEAN , PreferenceConstants . EDITOR_MARK_FIELD_OCCURRENCES ) ) ; overlayKeys . add ( new OverlayPreferenceStore . OverlayKey ( OverlayPreferenceStore . BOOLEAN , PreferenceConstants . EDITOR_MARK_LOCAL_VARIABLE_OCCURRENCES ) ) ; overlayKeys . add ( new OverlayPreferenceStore . OverlayKey ( OverlayPreferenceStore . BOOLEAN , PreferenceConstants . EDITOR_MARK_METHOD_EXIT_POINTS ) ) ; overlayKeys . add ( new OverlayPreferenceStore . OverlayKey ( OverlayPreferenceStore . BOOLEAN , PreferenceConstants . EDITOR_STICKY_OCCURRENCES ) ) ; OverlayPreferenceStore . OverlayKey [ ] keys = new OverlayPreferenceStore . OverlayKey [ overlayKeys . size ( ) ] ; overlayKeys . toArray ( keys ) ; return keys ; } public Control createControl ( Composite parent ) { Composite composite = new Composite ( parent , SWT . NONE ) ; GridLayout layout = new GridLayout ( ) ; layout . numColumns = 1 ; composite . setLayout ( layout ) ; String label ; label = PreferencesMessages . MarkOccurrencesConfigurationBlock_markOccurrences ; Button master = addCheckBox ( composite , label , PreferenceConstants . EDITOR_MARK_OCCURRENCES , 0 ) ; label = PreferencesMessages . MarkOccurrencesConfigurationBlock_markTypeOccurrences ; Button slave = addCheckBox ( composite , label , PreferenceConstants . EDITOR_MARK_TYPE_OCCURRENCES , 0 ) ; createDependency ( master , PreferenceConstants . EDITOR_STICKY_OCCURRENCES , slave ) ; label = PreferencesMessages . MarkOccurrencesConfigurationBlock_markConstantOccurrences ; slave = addCheckBox ( composite , label , PreferenceConstants . EDITOR_MARK_CONSTANT_OCCURRENCES , 0 ) ; createDependency ( master , PreferenceConstants . EDITOR_MARK_CONSTANT_OCCURRENCES , slave ) ; label = PreferencesMessages . MarkOccurrencesConfigurationBlock_markLocalVariableOccurrences ; slave = addCheckBox ( composite , label , PreferenceConstants . EDITOR_MARK_LOCAL_VARIABLE_OCCURRENCES , 0 ) ; createDependency ( master , PreferenceConstants . EDITOR_MARK_LOCAL_VARIABLE_OCCURRENCES , slave ) ; label = PreferencesMessages . MarkOccurrencesConfigurationBlock_markMethodExitPoints ; slave = addCheckBox ( composite , label , PreferenceConstants . EDITOR_MARK_METHOD_EXIT_POINTS , 0 ) ; createDependency ( master , PreferenceConstants . EDITOR_MARK_METHOD_EXIT_POINTS , slave ) ; addFiller ( composite ) ; label = PreferencesMessages | |
1,891 | <s> package com . asakusafw . testdriver . directio ; import static org . hamcrest . Matchers . * ; import static org . junit . Assert . * ; import java . io . File ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . LinkedList ; import java . util . List ; import java . util . Scanner ; import org . apache . hadoop . io . Text ; import org . junit . Rule ; import org . junit . Test ; import org . junit . rules . TemporaryFolder ; import org . junit . runner . RunWith ; import org . junit . runners . Parameterized ; import org . junit . runners . Parameterized . Parameters ; import com . asakusafw . runtime . directio . DataFormat ; import com . asakusafw . runtime . directio . hadoop . HadoopDataSource ; import com . asakusafw . runtime . directio . hadoop . HadoopDataSourceProfile ; import com . asakusafw . runtime . io . ModelOutput ; import com . asakusafw . testdriver . core . SpiImporterPreparator ; @ RunWith ( Parameterized . class ) public class DirectFileInputPreparatorTest { @ Rule public final ProfileContext profile = new ProfileContext ( ) ; @ Rule public final TemporaryFolder folder = new TemporaryFolder ( ) ; private final Class < ? extends DataFormat < Text > > format ; @ Parameters public static List < Object [ ] > data ( ) { return Arrays . asList ( new Object [ ] [ ] { { MockStreamFormat . class } , { MockFileFormat . class } , } ) ; } public DirectFileInputPreparatorTest ( Class < ? extends DataFormat < Text > > format ) { this . format = format ; } @ Test public void truncate ( ) throws Exception { profile . add ( "root" , HadoopDataSource . class , "/" ) ; profile . add ( "root" , HadoopDataSourceProfile . KEY_PATH , folder . getRoot ( ) . toURI ( ) . toURL ( ) . toString ( ) ) ; profile . put ( ) ; DirectFileInputPreparator testee = new DirectFileInputPreparator ( ) ; File file = put ( "" , "" ) ; File deep = put ( "" , "" ) ; File outer = put ( "" , "" ) ; assertThat ( file . exists ( ) , is ( true ) ) ; assertThat ( deep . exists ( ) , is ( true ) ) ; assertThat ( outer . exists ( ) , is ( true ) ) ; testee . truncate ( new MockInputDescription ( "base" , "something" , format ) , profile . getTextContext ( ) ) ; assertThat ( file . exists ( ) , is ( false ) ) ; assertThat ( deep . exists ( ) , is ( false ) ) ; assertThat ( outer . exists ( ) , is ( true ) ) ; } @ Test public void truncate_empty ( ) throws Exception { profile . add ( "root" , HadoopDataSource . class , "/" ) ; profile . add ( "root" , HadoopDataSourceProfile . KEY_PATH , folder . getRoot ( ) . toURI ( ) . toURL ( ) . toString ( ) ) ; profile . put ( ) ; DirectFileInputPreparator testee = new DirectFileInputPreparator ( ) ; testee . truncate ( new MockInputDescription ( "base" , "something" , format ) , profile . getTextContext ( ) ) ; } @ Test public void truncate_variable ( ) throws Exception { profile . add ( "root" , HadoopDataSource . class , "/" ) ; profile . add ( "root" , HadoopDataSourceProfile . KEY_PATH , folder . getRoot ( ) . toURI ( ) . toURL ( ) . toString ( ) ) ; profile . put ( ) ; DirectFileInputPreparator testee = new DirectFileInputPreparator ( ) ; File file = put ( "" , "" ) ; File deep = put ( "" , "" ) ; File outer = put ( "" , "" ) ; assertThat ( file . exists ( ) , is ( true ) ) ; assertThat ( deep . exists ( ) , is ( true ) ) ; assertThat ( outer . exists ( ) , is ( true ) ) ; testee . truncate ( new MockInputDescription ( "${target}" , "something" , format ) , profile . getTextContext ( "target" , "base" ) ) ; assertThat ( file . exists ( ) , is ( false ) ) ; assertThat ( deep . exists ( ) , is ( false ) ) ; assertThat ( outer . exists ( ) , is ( true ) ) ; } @ Test public void createOutput ( ) throws Exception { profile . add ( "root" , HadoopDataSource . class , "/" ) ; profile . add ( "root" , HadoopDataSourceProfile . KEY_PATH , folder . getRoot ( ) . toURI ( ) . toURL ( ) . toString ( ) ) ; profile . put ( ) ; DirectFileInputPreparator testee = new DirectFileInputPreparator ( ) ; ModelOutput < Text > output = testee . createOutput ( new MockTextDefinition ( ) , new MockInputDescription ( "base" , "input.txt" , format ) , profile . getTextContext ( ) ) ; put ( output , "" ) ; assertThat ( get ( "" ) , is ( Arrays . asList ( "" ) ) ) ; } @ Test public void createOutput_multirecord ( ) throws Exception { profile . add ( "root" , HadoopDataSource . class , "/" ) ; profile . add ( "root" , HadoopDataSourceProfile . KEY_PATH , folder . getRoot ( ) . toURI ( ) . toURL ( ) . toString ( ) ) ; profile . put ( ) ; DirectFileInputPreparator testee = new DirectFileInputPreparator ( ) ; ModelOutput < Text > output = testee . createOutput ( new MockTextDefinition ( ) , new MockInputDescription ( "base" , "input.txt" , format ) , profile . getTextContext ( ) ) ; put ( output , "Hello1" , "Hello2" , "Hello3" ) ; List < String > list = get ( "" ) ; assertThat ( list . size ( ) , is ( 3 ) ) ; assertThat ( list , hasItem ( "Hello1" ) ) ; assertThat ( list , hasItem ( "Hello2" ) ) ; assertThat ( list , hasItem ( "Hello3" ) ) ; } @ Test public void createOutput_variables ( ) throws Exception { profile . add ( "root" , HadoopDataSource . class , "/" ) ; profile . add ( "root" , HadoopDataSourceProfile . KEY_PATH , folder . getRoot ( ) . toURI ( ) . toURL ( ) . toString ( ) ) ; profile . put ( ) ; DirectFileInputPreparator testee = new DirectFileInputPreparator ( ) ; ModelOutput < Text > output = testee . createOutput ( new MockTextDefinition ( ) , new MockInputDescription ( "${vbase}" , "" , format ) , profile . getTextContext ( "vbase" , "base" , "vinput" , "input" ) ) ; put ( output , "" ) ; assertThat ( get ( "" ) , is ( Arrays . asList ( "" ) ) ) ; } @ Test public void createInput_placeholders ( ) throws Exception { profile . add ( "root" , HadoopDataSource . class , "/" ) ; profile . add ( "root" , HadoopDataSourceProfile . KEY_PATH , folder . getRoot ( ) . toURI ( ) . toURL ( ) . toString ( ) ) ; profile . put ( ) ; DirectFileInputPreparator testee = new DirectFileInputPreparator ( ) ; ModelOutput < Text > output = testee . createOutput ( new MockTextDefinition ( ) , new MockInputDescription ( "base" , "" , format ) , profile . getTextContext ( ) ) ; put ( output , "" ) ; List < File > files = find ( "base" ) ; assertThat ( files . toString ( ) , files . size ( ) , is ( 1 ) ) ; assertThat ( get ( files . get ( 0 ) ) , is ( Arrays . asList ( "" ) ) ) ; } @ Test public void createOutput_placeholders ( ) throws Exception { profile . add ( "root" , HadoopDataSource . class , "/" ) ; profile . add ( "root" , HadoopDataSourceProfile . KEY_PATH , folder . getRoot ( ) . toURI ( ) . toURL ( ) | |
1,892 | <s> package com . asakusafw . utils . java . jsr199 . testing ; import java . io . ByteArrayInputStream ; import java . io . ByteArrayOutputStream ; import java . io . InputStream ; import java . io . OutputStream ; import java . net . URI ; import java . net . URISyntaxException ; import java . text . MessageFormat ; import javax . tools . JavaFileObject ; import javax . tools . SimpleJavaFileObject ; public class VolatileClassFile extends SimpleJavaFileObject { public static final String SCHEME = VolatileClassFile . class . getName ( ) ; private String binaryName ; volatile byte [ ] contents ; public VolatileClassFile ( String binaryName ) { this ( binaryName , new byte [ 0 ] ) ; } public VolatileClassFile ( String binaryName , byte [ ] contents ) { super ( toUri ( binaryName ) , JavaFileObject . Kind . | |
1,893 | <s> package com . asakusafw . testdriver . core ; import java . io . File ; import java . io . IOException ; import java . io . PrintWriter ; import java . net . URL ; import java . net . URLClassLoader ; import java . util . Arrays ; import org . junit . Rule ; import org . junit . rules . TemporaryFolder ; public abstract class SpiTestRoot { @ Rule public TemporaryFolder temporaryFolder = new TemporaryFolder ( ) ; public ClassLoader register ( Class < ? > api , Class < ? > ... services ) { File classpath = temporaryFolder . newFolder ( "classpath" ) ; try { File serviceFolder = new File ( classpath , "" ) ; serviceFolder . mkdirs ( ) ; PrintWriter output = new PrintWriter ( new File ( serviceFolder , api . getName ( ) ) ) ; try { for ( Class < ? > serviceClass : services ) { output . println ( serviceClass . getName ( ) ) ; } } | |
1,894 | <s> package org . rubypeople . rdt . refactoring . core . rename ; import org . eclipse . osgi . util . NLS ; public class Messages extends NLS { private static final String BUNDLE_NAME = "" ; public static String RenameConditionChecker_NothingSelected ; public static String RenameRefactoring_Name ; | |
1,895 | <s> package de . fuberlin . wiwiss . d2rq . algebra ; import java . util . ArrayList ; import java . util . Collection ; import java . util . Collections ; import java . util . HashMap ; import java . util . Iterator ; import java . util . List ; import java . util . Map ; public class AliasMap extends ColumnRenamer { public static final AliasMap NO_ALIASES = new AliasMap ( Collections . < Alias > emptySet ( ) ) ; public static AliasMap create1 ( RelationName original , RelationName alias ) { return new AliasMap ( Collections . singletonList ( new Alias ( original , alias ) ) ) ; } public static class Alias { private RelationName original ; private RelationName alias ; public Alias ( RelationName original , RelationName alias ) { this . original = original ; this . alias = alias ; } public RelationName original ( ) { return this . original ; } public RelationName alias ( ) { return this . alias ; } public int hashCode ( ) { return this . original . hashCode ( ) ^ this . alias . hashCode ( ) ; } public boolean equals ( Object o ) { if ( ! ( o instanceof Alias ) ) return false ; return this . alias . equals ( ( ( Alias ) o ) . alias ) && this . original . equals ( ( ( Alias ) o ) . original ) ; } public String toString ( ) { return this . original + " AS " + this . alias ; } } private Map < RelationName , Alias > byAlias = new HashMap < RelationName , Alias > ( ) ; private Map < RelationName , Alias > byOriginal = new HashMap < RelationName , Alias > ( ) ; public AliasMap ( Collection < Alias > aliases ) { for ( Alias alias : aliases ) { this . byAlias . put ( alias . alias ( ) , alias ) ; this . byOriginal . put ( alias . original ( ) , alias ) ; } } public boolean isAlias ( RelationName name ) { return this . byAlias . containsKey ( name ) ; } public boolean hasAlias ( RelationName original ) { return this . byOriginal . containsKey ( original ) ; } public RelationName applyTo ( RelationName original ) { if ( ! hasAlias ( original ) ) { return original ; } Alias alias = ( Alias ) this . byOriginal . get ( original ) ; return alias . alias ( ) ; } public RelationName originalOf ( RelationName name ) { if ( ! isAlias ( name ) ) { return name ; } Alias alias = ( Alias ) this . byAlias . get ( name ) ; return alias . original ( ) ; } public Attribute applyTo ( Attribute attribute ) { if ( ! hasAlias ( attribute . relationName ( ) ) ) { return attribute ; } return new Attribute ( applyTo ( attribute . relationName ( ) ) , attribute . attributeName ( ) ) ; } public Attribute originalOf ( Attribute attribute ) { if ( ! isAlias ( | |
1,896 | <s> package com . asakusafw . bulkloader . common ; import java . io . Closeable ; import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import com . asakusafw . bulkloader . log . Log ; public class StreamRedirectThread extends Thread { static final Log LOG = new Log ( StreamRedirectThread . class ) ; private final InputStream input ; private final OutputStream output ; private final boolean closeInput ; private final boolean closeOutput ; public StreamRedirectThread ( InputStream input , OutputStream output ) { this ( input , output , false , false ) ; } public StreamRedirectThread ( InputStream input , OutputStream output , boolean closeInput , boolean closeOutput ) { if ( input == null ) { throw new IllegalArgumentException ( "" ) ; } if ( output == null ) { throw new IllegalArgumentException ( "" ) ; } this . input = input ; this . output = output ; this . closeInput = closeInput ; this . closeOutput = closeOutput ; } @ Override public void run ( ) { boolean outputFailed = false ; try { InputStream in = input ; OutputStream out = output ; byte [ ] buf = new byte [ 256 ] ; while ( true ) { int read = in . read ( buf ) ; if ( read == - 1 ) | |
1,897 | <s> package test . modelgen . table . io ; import java . io . IOException ; import javax . annotation . Generated ; import test . modelgen . table . model . ImportTarget1Rl ; import com . asakusafw . runtime . io . ModelOutput ; import com . asakusafw . runtime . io . RecordEmitter ; @ Generated ( "" ) @ SuppressWarnings ( "deprecation" ) public final class ImportTarget1RlModelOutput implements ModelOutput < ImportTarget1Rl > { private final RecordEmitter emitter ; public ImportTarget1RlModelOutput ( RecordEmitter emitter ) { if ( emitter == null ) { throw new IllegalArgumentException ( ) ; } this . emitter = emitter ; } @ Override public void write ( ImportTarget1Rl model ) throws IOException { emitter . emit ( model . getSidOption ( ) ) ; | |
1,898 | <s> package org . rubypeople . rdt . internal . formatter ; public class EndBlockMarker | |
1,899 | <s> package org . rubypeople . rdt . internal . debug . ui ; import org . eclipse . core . resources . IResource ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . core . runtime . IStatus ; import org . eclipse . core . runtime . Status ; import org . eclipse . core . runtime . jobs . Job ; import org . eclipse . debug . core . DebugPlugin ; import org . eclipse . debug . core . ILaunch ; import org . eclipse . debug . core . ILaunchManager ; import org . eclipse . ui . IEditorPart ; import org . eclipse . ui . IPartListener ; import org . eclipse . ui . IPropertyListener ; import org . eclipse . ui . IWindowListener ; import org . eclipse . ui . IWorkbenchPage ; import org . eclipse . ui . IWorkbenchPart ; import org . eclipse . ui . IWorkbenchWindow ; import org . eclipse . ui . |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.