buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
private void doOneJar( File jarSource, File jarTarget ) throws TaskException { if( project.getJavaVersion().equals( Project.JAVA_1_1 ) ) { throw new TaskException( "The signjar task is only available on JDK versions 1.2 or greater" ); } if( null == alias ) ...
private void doOneJar( File jarSource, File jarTarget ) throws TaskException { if( project.getJavaVersion().equals( Project.JAVA_1_1 ) ) { throw new TaskException( "The signjar task is only available on JDK versions 1.2 or greater" ); } if( null == alias ) ...
private void process( File baseDir, String xmlFile, File destDir, File stylesheet ) throws TaskException { String fileExt = targetExtension; File outFile = null; File inFile = null; try { long styleSheetLastModified = styles...
private void process( File baseDir, String xmlFile, File destDir, File stylesheet ) throws TaskException { String fileExt = targetExtension; File outFile = null; File inFile = null; try { long styleSheetLastModified = styles...
public void execute() throws TaskException { if( baseDir == null && filesets.size() == 0 && "zip".equals( archiveType ) ) { throw new TaskException( "basedir attribute must be set, or at least " + "one fileset must be given!" ); } ...
public void execute() throws TaskException { if( baseDir == null && filesets.size() == 0 && "zip".equals( archiveType ) ) { throw new TaskException( "basedir attribute must be set, or at least " + "one fileset must be given!" ); } ...
public void execute() throws TaskException { checkConfiguration(); Vector files = getFileList(); // quick exit if the target is up to date if( isUpToDate( files ) ) return; log( "Building " + archiveType + ": " + cabFile.getAbsolutePath() ); ...
public void execute() throws TaskException { checkConfiguration(); Vector files = getFileList(); // quick exit if the target is up to date if( isUpToDate( files ) ) return; getLogger().info( "Building " + archiveType + ": " + cabFile.getAbsolutePat...
public void execute() throws TaskException { Commandline baseCmd = null;// the common portion of our cmd line DirectoryScanner scanner = null;// Scanner to find our inputs String[] files;// list of files to process // default srcDir to basedir if( srcDir == null...
public void execute() throws TaskException { Commandline baseCmd = null;// the common portion of our cmd line DirectoryScanner scanner = null;// Scanner to find our inputs String[] files;// list of files to process // default srcDir to basedir if( srcDir == null...
public void execute() throws TaskException { Commandline toExecute = new Commandline(); toExecute.setExecutable( "rpm" ); if( topDir != null ) { toExecute.createArgument().setValue( "--define" ); toExecute.createArgument().setValue( "_topdir" + t...
public void execute() throws TaskException { Commandline toExecute = new Commandline(); toExecute.setExecutable( "rpm" ); if( topDir != null ) { toExecute.createArgument().setValue( "--define" ); toExecute.createArgument().setValue( "_topdir" + t...
public void execute() throws TaskException { int fileProcessed = 0; if( file == null && ( filesets.size() == 0 ) ) { throw new TaskException( "Specify at least one source - a file or a fileset." ); } initValidator(); if( file != null ) ...
public void execute() throws TaskException { int fileProcessed = 0; if( file == null && ( filesets.size() == 0 ) ) { throw new TaskException( "Specify at least one source - a file or a fileset." ); } initValidator(); if( file != null ) ...
public void execute() throws TaskException { try { long start = System.currentTimeMillis(); String[] srcPathList = srcPath.list(); if( srcPathList.length == 0 ) { throw new TaskException( "srcdir attribute must be set!" ); ...
public void execute() throws TaskException { try { long start = System.currentTimeMillis(); String[] srcPathList = srcPath.list(); if( srcPathList.length == 0 ) { throw new TaskException( "srcdir attribute must be set!" ); ...
public void execute() throws TaskException { if( _srcDir == null ) _srcDir = resolveFile( "." ); NetCommand command = new NetCommand( this, "CSC", csc_exe_name ); command.setFailOnError( getFailFailOnError() ); //DEBUG helper command.setTraceCommandLi...
public void execute() throws TaskException { if( _srcDir == null ) _srcDir = resolveFile( "." ); NetCommand command = new NetCommand( this, "CSC", csc_exe_name ); command.setFailOnError( getFailFailOnError() ); //DEBUG helper command.setTraceCommandLi...
public void execute() throws TaskException { if( _srcDir == null ) _srcDir = resolveFile( "." ); //get dependencies list. DirectoryScanner scanner = super.getDirectoryScanner( _srcDir ); String[] dependencies = scanner.getIncludedFiles(); log( "assemb...
public void execute() throws TaskException { if( _srcDir == null ) _srcDir = resolveFile( "." ); //get dependencies list. DirectoryScanner scanner = super.getDirectoryScanner( _srcDir ); String[] dependencies = scanner.getIncludedFiles(); getLogger()....
public void runCommand() throws TaskException { int err = -1;// assume the worst try { if( _traceCommandLine ) { _owner.log( _commandLine.toString() ); } else { //in verbose mode we always...
public void runCommand() throws TaskException { int err = -1;// assume the worst try { if( _traceCommandLine ) { //_owner.getLogger().info( _commandLine.toString() ); } else { //in verbose...
public void execute() throws TaskException { // load command line with optional attributes Enumeration iter = optionalAttrs.keys(); while( iter.hasMoreElements() ) { String name = (String)iter.nextElement(); Object value = optionalAttrs.get( name ...
public void execute() throws TaskException { // load command line with optional attributes Enumeration iter = optionalAttrs.keys(); while( iter.hasMoreElements() ) { String name = (String)iter.nextElement(); Object value = optionalAttrs.get( name ...
public void execute() throws TaskException { //Be sure everything has been set. if( outfile == null ) { throw new TaskException( "outfile attribute is required! Please set." ); } if( !haveAddFiles() && !haveMergeFiles() ) { throw ne...
public void execute() throws TaskException { //Be sure everything has been set. if( outfile == null ) { throw new TaskException( "outfile attribute is required! Please set." ); } if( !haveAddFiles() && !haveMergeFiles() ) { throw ne...
public void execute() throws TaskException { // first off, make sure that we've got a srcdir if( src == null ) { throw new TaskException( "srcdir attribute must be set!" ); } String[] list = src.list(); if( list.length == 0 ) { ...
public void execute() throws TaskException { // first off, make sure that we've got a srcdir if( src == null ) { throw new TaskException( "srcdir attribute must be set!" ); } String[] list = src.list(); if( list.length == 0 ) { ...
public void execute() throws TaskException { if( !destinationDirectory.isDirectory() ) { throw new TaskException( "destination directory " + destinationDirectory.getPath() + " is not valid" ); } if( !sourceDirectory.isDire...
public void execute() throws TaskException { if( !destinationDirectory.isDirectory() ) { throw new TaskException( "destination directory " + destinationDirectory.getPath() + " is not valid" ); } if( !sourceDirectory.isDire...
public void transform() throws TaskException { checkOptions(); final long t0 = System.currentTimeMillis(); try { Element root = document.getDocumentElement(); XalanExecutor executor = XalanExecutor.newInstance( this ); executor.execute(...
public void transform() throws TaskException { checkOptions(); final long t0 = System.currentTimeMillis(); try { Element root = document.getDocumentElement(); XalanExecutor executor = XalanExecutor.newInstance( this ); executor.execute(...
protected AggregateTransformer caller; /** * Create a valid Xalan executor. It checks first if Xalan2 is present, if * not it checks for xalan1. If none is available, it fails. * * @param caller object containing the transformation information. * @return Description of the Returned Val...
protected AggregateTransformer caller; /** * Create a valid Xalan executor. It checks first if Xalan2 is present, if * not it checks for xalan1. If none is available, it fails. * * @param caller object containing the transformation information. * @return Description of the Returned Val...
public void doMail() throws MessagingException, AddressException, TaskException { Properties props = new Properties(); props.put( "mail.smtp.host", mailhost ); //Aside, the JDK is clearly unaware of the scottish 'session', which //involves excessive quantities of alcohol...
public void doMail() throws MessagingException, AddressException, TaskException { Properties props = new Properties(); props.put( "mail.smtp.host", mailhost ); //Aside, the JDK is clearly unaware of the scottish 'session', which //involves excessive quantities of alcohol...
protected void checkOptions() throws TaskException { if( tofile == null ) { throw new TaskException( "'tofile' attribute must be set." ); } if( snapshot == null ) { throw new TaskException( "'snapshot' attribute must be set." ); } ...
protected void checkOptions() throws TaskException { if( tofile == null ) { throw new TaskException( "'tofile' attribute must be set." ); } if( snapshot == null ) { throw new TaskException( "'snapshot' attribute must be set." ); } ...
public void getLocalpathCommand( Commandline cmd ) throws TaskException { if( m_LocalPath == null ) { return; } else { // make sure m_LocalDir exists, create it if it doesn't File dir = resolveFile( m_LocalPath ); if...
public void getLocalpathCommand( Commandline cmd ) throws TaskException { if( m_LocalPath == null ) { return; } else { // make sure m_LocalDir exists, create it if it doesn't File dir = resolveFile( m_LocalPath ); if...
public void getLocalpathCommand( Commandline cmd ) throws TaskException { if( m_LocalPath == null ) { return; } else { // make sure m_LocalDir exists, create it if it doesn't File dir = resolveFile( m_LocalPath ); if...
public void getLocalpathCommand( Commandline cmd ) throws TaskException { if( m_LocalPath == null ) { return; } else { // make sure m_LocalDir exists, create it if it doesn't File dir = resolveFile( m_LocalPath ); if...
public void modifyTestElement(TestElement element) { // Fetch data from screen fields if (customizer instanceof GenericTestBeanCustomizer) { GenericTestBeanCustomizer gtbc = (GenericTestBeanCustomizer) customizer; gtbc.saveGuiFields(); } configureTestElement(e...
public void modifyTestElement(TestElement element) { // Fetch data from screen fields if (customizer instanceof GenericTestBeanCustomizer) { GenericTestBeanCustomizer gtbc = (GenericTestBeanCustomizer) customizer; gtbc.saveGuiFields(); } configureTestElement(e...
public static final String DOM_SUPPORTED_MEDIATYPES_ONLY = "supported-mediatypes-only";
public static final String DOM_SUPPORTED_MEDIATYPES_ONLY = "supported-media-types-only";
public void testPagedTable() throws Exception { executeTest(IncrementalTableNavigationPage.class, "IncrementalTableNavigationPage_ExpectedResult_1.html"); Page page = (IncrementalTableNavigationPage)application.getLastRenderedPage(); Link link = (Link)page.get("nextNext"); executedListener(IncrementalTableNa...
public void testPagedTable() throws Exception { executeTest(IncrementalTableNavigationPage.class, "IncrementalTableNavigationPage_ExpectedResult_1.html"); Page page = application.getLastRenderedPage(); Link link = (Link)page.get("nextNext"); executedListener(IncrementalTableNavigationPage.class, link, "Incre...
public Task addProperty() { Property p=(Property)p1.createTask("property"); p.setUserProperty(true); properties.addElement( p ); return p; } }
public Task createProperty() { Property p=(Property)p1.createTask("property"); p.setUserProperty(true); properties.addElement( p ); return p; } }
private void doNetRexxCompile() throws BuildException { project.log("Using NetRexx compiler", project.MSG_VERBOSE); String classpath = getCompileClasspath(); StringBuffer compileOptions = new StringBuffer(); StringBuffer fileList = new StringBuffer(); // create an array of s...
private void doNetRexxCompile() throws BuildException { project.log("Using NetRexx compiler", project.MSG_VERBOSE); String classpath = getCompileClasspath(); StringBuffer compileOptions = new StringBuffer(); StringBuffer fileList = new StringBuffer(); // create an array of s...
public void testLoadableDetachableModel() { LoadableDetachableModel model = new MyLoadableDetachableModel(); String expected = "Model:classname=[" + model.getClass().getName() + "]" + ":attached=false" + ":tempModelObject=[null]"; assertEquals(expected, model.toString()); model.attach(); expected = "Mo...
public void testLoadableDetachableModel() { LoadableDetachableModel model = new MyLoadableDetachableModel(); String expected = "Model:classname=[" + model.getClass().getName() + "]" + ":attached=false" + ":tempModelObject=[null]"; assertEquals(expected, model.toString()); model.getObject(null); expecte...
public void setAlignment (int alignment) { checkWidget (); if ((style & SWT.SEPARATOR) != 0) return; if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) == 0) return; style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER); style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER); boolean isRTL = (style & SWT.RIGHT_TO_LE...
public void setAlignment (int alignment) { checkWidget (); if ((style & SWT.SEPARATOR) != 0) return; if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) == 0) return; style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER); style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER); boolean isRTL = (style & SWT.RIGHT_TO_LE...
protected HTTPSampleResult sample(URL url, String method, boolean areFollowingRedirect, int frameDepth) { HTTPSampleResult res = createSampleResult(url, method); HttpClient httpClient = setupClient(url); HttpRequestBase httpRequest = null; try { URI...
protected HTTPSampleResult sample(URL url, String method, boolean areFollowingRedirect, int frameDepth) { HTTPSampleResult res = createSampleResult(url, method); HttpClient httpClient = setupClient(url); HttpRequestBase httpRequest = null; try { URI...
public void addArgument( String argument ) { if( argument != null && argument.length() != 0 ) { _commandLine.createArgument().setValue( argument ); } }
public void addArgument( String argument ) { if( argument != null && argument.length() != 0 ) { _commandLine.addArgument( argument ); } }
protected void logAndAddFilesToCompile( JspC jspc, ArrayList compileList, Commandline cmd ) { getLogger().debug( "Compilation args: " + cmd.toString() ); StringBuffer niceSourceList = new StringBuffer( "File...
protected void logAndAddFilesToCompile( JspC jspc, ArrayList compileList, Commandline cmd ) { getLogger().debug( "Compilation args: " + cmd.toString() ); StringBuffer niceSourceList = new StringBuffer( "File...
public void execute() throws TaskException { checkOptions(); try { Commandline cmdl = new Commandline(); // we need to run Coverage from his directory due to dll/jar issues cmdl.setExecutable( new File( home, "jpcovreport" ).getAbsolutePath() )...
public void execute() throws TaskException { checkOptions(); try { Commandline cmdl = new Commandline(); // we need to run Coverage from his directory due to dll/jar issues cmdl.setExecutable( new File( home, "jpcovreport" ).getAbsolutePath() )...
public void getLoginCommand( Commandline cmd ) { if( m_vssLogin == null ) { return; } else { cmd.createArgument().setValue( FLAG_LOGIN + m_vssLogin ); } }
public void getLoginCommand( Commandline cmd ) { if( m_vssLogin == null ) { return; } else { cmd.addArgument( FLAG_LOGIN + m_vssLogin ); } }
public void sampleOccurred(SampleEvent e) { SampleResult s = e.getResult(); // System.out.println("SO "+me+this.getName()+" // "+Thread.currentThread().getName() // +" "+s.getSampleLabel()); if (myName == null) { myName = getName(); } if (myTotals == null) { synchronized (accumulators) { myT...
public void sampleOccurred(SampleEvent e) { SampleResult s = e.getResult(); // System.out.println("SO "+me+this.getName()+" // "+Thread.currentThread().getName() // +" "+s.getSampleLabel()); if (myName == null) { myName = getName(); } if (myTotals == null) { synchronized (accumulators) { myT...
public void appendTo(Select sel, ExpContext ctx, BinaryOpExpState bstate, SQLBuffer buf, boolean val1Null, boolean val2Null) { if (val1Null && val2Null) buf.appendValue(null).append(" IS NOT ").appendValue(null); else if (val1Null || val2Null) { Val val = (val1Null) ...
public void appendTo(Select sel, ExpContext ctx, BinaryOpExpState bstate, SQLBuffer buf, boolean val1Null, boolean val2Null) { if (val1Null && val2Null) buf.append("1 <> 1"); else if (val1Null || val2Null) { Val val = (val1Null) ? getValue2() : getValue1(); ...
private static void checkVersions() { versionsOK=true; checkVersion(BooleanPropertyConverter.class,"1.4"); checkVersion(HashTreeConverter.class,"1.2"); checkVersion(IntegerPropertyConverter.class,"1.3"); checkVersion(LongPropertyConverter.class,"1.3"); checkVersion(MultiPropertyConverter.class,"1.3"); c...
private static void checkVersions() { versionsOK=true; checkVersion(BooleanPropertyConverter.class,"1.4"); checkVersion(HashTreeConverter.class,"1.2"); checkVersion(IntegerPropertyConverter.class,"1.3"); checkVersion(LongPropertyConverter.class,"1.3"); checkVersion(MultiPropertyConverter.class,"1.3"); c...
protected void setUp() throws Exception { super.setUp(); assertNotNull(containerUnderTest); assertTrue(containerUnderTest.startsWith("ecf.discovery.")); container = ContainerFactory.getDefault().createContainer(containerUnderTest); discoveryContainer = getAdapter(IDiscoveryContainerAdapter.class); assert...
protected void setUp() throws Exception { super.setUp(); assertNotNull(containerUnderTest); assertTrue(containerUnderTest.startsWith("ecf.discovery.")); container = ContainerFactory.getDefault().createContainer(containerUnderTest); discoveryContainer = getAdapter(IDiscoveryContainerAdapter.class); assert...
public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); shell.setLayout(new FillLayout()); shell.setText("ExpandBar Example"); ExpandBar bar = new ExpandBar (shell, SWT.V_SCROLL); Image image = new Image(display, Snippet223.class.getResourceAsStream("eclipse...
public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); shell.setLayout(new FillLayout()); shell.setText("ExpandBar Example"); ExpandBar bar = new ExpandBar (shell, SWT.V_SCROLL); Image image = display.getSystemImage(SWT.ICON_QUESTION); // First item Com...
public void processElement(String elementName) { buildElement = new BuildElement(getLocation(), elementName); setModelElement(buildElement); for (Iterator i = getAttributes(); i.hasNext();) { String attributeName = (String) i.next(); buildElement...
public void processElement(String elementName) { buildElement = new BuildElement(getLocation(), elementName); setModelElement(buildElement); for (Iterator i = getAttributes(); i.hasNext();) { String attributeName = (String) i.next(); buildElement...
public void processElement(String elementName) throws SAXParseException { if (project == null) { project = new Project(getElementSource(), getLocation()); setModelElement(project); project.setDefaultTarget(getAttribute(DEFAULT_ATTR)); pro...
public void processElement(String elementName) throws SAXParseException { if (project == null) { project = new Project(getElementSource(), getLocation()); setModelElement(project); project.setDefaultTarget(getAttribute(DEFAULT_ATTR)); pro...
public void processElement(String elementName) throws SAXParseException { target = new Target(getLocation(), getAttribute(NAME_ATTR)); setModelElement(target); target.setDescription(getAttribute(DESC_ATTR)); target.setAspects(getAspects()); String depends = getAttri...
public void processElement(String elementName) throws SAXParseException { target = new Target(getLocation(), getAttribute(NAME_ATTR)); setModelElement(target); target.setDescription(getAttribute(DESC_ATTR)); target.addAspectAttributes(getAspectAttributes()); String ...
public static void main (String[] args) { final List<MetaModel> mms = new ArrayList<MetaModel> (); mms.add (new JavaBeansMetaModel ()); final CompositeTypesystem ts = BackendTypesystemFactory.createWithoutUml(); { final XpandBackendContributor xp = new XpandBack...
public static void main (String[] args) { final List<MetaModel> mms = new ArrayList<MetaModel> (); mms.add (new JavaBeansMetaModel ()); final CompositeTypesystem ts = BackendTypesystemFactory.createWithoutUml(); { final XpandBackendContributor xp = new XpandBack...
public void connect(ID connectID, IConnectContext connectContext) throws ContainerConnectException { // Actually do join here if (connectID == null) throw new ContainerConnectException(Messages.IRCChannelContainer_Exception_TargetID_Null); if (connectWaiting) throw new ContainerConnectException(Messages.IR...
public void connect(ID connectID, IConnectContext connectContext) throws ContainerConnectException { // Actually do join here if (connectID == null) throw new ContainerConnectException(Messages.IRCChannelContainer_Exception_TargetID_Null); if (connectWaiting) throw new ContainerConnectException(Messages.IR...
public void connect(ID connectID, IConnectContext connectContext) throws ContainerConnectException { if (connection != null) throw new ContainerConnectException(Messages.IRCRootContainer_Exception_Already_Connected); if (connectID == null) throw new ContainerConnectException(Messages.IRCRootContainer_Excepti...
public void connect(ID connectID, IConnectContext connectContext) throws ContainerConnectException { if (connection != null) throw new ContainerConnectException(Messages.IRCRootContainer_Exception_Already_Connected); if (connectID == null) throw new ContainerConnectException(Messages.IRCRootContainer_Excepti...
public boolean repeatCommand(IMessageHandler handler) { if (null == buildManager) { MessageUtil.abort(handler, "repeatCommand called before runCommand"); return false; } try { //buildManager.setMessageHandler(handler); CountingMessageHandler counter ...
public boolean repeatCommand(IMessageHandler handler) { if (null == buildManager) { MessageUtil.abort(handler, "repeatCommand called before runCommand"); return false; } try { //buildManager.setMessageHandler(handler); CountingMessageHandler counter ...
public final MarkupStream getMarkupStream(final MarkupContainer container, final boolean throwException) { if (container == null) { throw new IllegalArgumentException("Parameter 'container' must not be 'null'."); } // Look for associated markup Markup markup = getMarkup(new ContainerInfo(container), ...
public final MarkupStream getMarkupStream(final MarkupContainer container, final boolean throwException) { if (container == null) { throw new IllegalArgumentException("Parameter 'container' must not be 'null'."); } // Look for associated markup Markup markup = getMarkup(new ContainerInfo(container), ...
public Constructor getConstructor() { if (constructor == null) { try { constructor = declaringType.getDeclaredConstructor(getParameterTypes()); } catch (Exception ex) { ; // nothing we can do, caller will see null } } return constructor; }
public Constructor getConstructor() { if (constructor == null) { try { constructor = getDeclaringType().getDeclaredConstructor(getParameterTypes()); } catch (Exception ex) { ; // nothing we can do, caller will see null } } return constructor; }
public Field getField() { if (field == null) { try { field = declaringType.getDeclaredField(getName()); } catch (Exception ex) { ; // nothing we can do, caller will see null } } return field; }
public Field getField() { if (field == null) { try { field = getDeclaringType().getDeclaredField(getName()); } catch (Exception ex) { ; // nothing we can do, caller will see null } } return field; }
public Constructor getInitializer() { if (constructor == null) { try { constructor = declaringType.getDeclaredConstructor(getParameterTypes()); } catch (Exception ex) { ; // nothing we can do, caller will see null } } return constructor; }
public Constructor getInitializer() { if (constructor == null) { try { constructor = getDeclaringType().getDeclaredConstructor(getParameterTypes()); } catch (Exception ex) { ; // nothing we can do, caller will see null } } return constructor; }
public boolean canBeSeenBy( InvocationSite invocationSite, Scope scope) { return false; } }; if (m.parameters != null && m.parameters.length != 0) { scope.problemReporter().signalError(m.sourceStart(), m.sourceEnd(), "only zero-argument constructors allowed...
public boolean canBeSeenBy( InvocationSite invocationSite, Scope scope) { return false; } }; if (m.parameters != null && m.parameters.length != 0) { scope.problemReporter().signalError(m.sourceStart(), m.sourceEnd(), "only zero-argument constructors allowed...
private static void sendLine( String line, OutputStream outPipe ) throws IOException { outPipe.write( line.getBytes() ); outPipe.flush(); }
private static void sendLine( String line, OutputStream outPipe ) throws IOException { outPipe.write( line.getBytes() ); // TODO - charset? outPipe.flush(); }
public SampleResult sample(Entry e) { SampleResult res = new SampleResult(); res.setSuccessful(false); // Assume failure String remote = getRemoteFilename(); String local = getLocalFilename(); boolean binaryTransfer = isBinaryMode(); res.setSampleLabel(getName()); ...
public SampleResult sample(Entry e) { SampleResult res = new SampleResult(); res.setSuccessful(false); // Assume failure String remote = getRemoteFilename(); String local = getLocalFilename(); boolean binaryTransfer = isBinaryMode(); res.setSampleLabel(getName()); ...
private void writeToClient(SampleResult res, OutputStream out, boolean forcedHTTPS) throws IOException { try { String responseHeaders = massageResponseHeaders(res, forcedHTTPS); out.write(responseHeaders.getBytes()); out.write(CRLF_BYTES); out.write(res.getRes...
private void writeToClient(SampleResult res, OutputStream out, boolean forcedHTTPS) throws IOException { try { String responseHeaders = massageResponseHeaders(res, forcedHTTPS); out.write(responseHeaders.getBytes()); // TODO - charset? out.write(CRLF_BYTES); o...
private String setConnectionHeaders(URL url, String host, String method) throws IOException { HeaderManager headers = getHeaderManager(); AuthManager auth = getAuthManager(); StringBuilder hbuf = new StringBuilder(); // Allow Headers to override Host setting hbuf.append("...
private String setConnectionHeaders(URL url, String host, String method) throws IOException { HeaderManager headers = getHeaderManager(); AuthManager auth = getAuthManager(); StringBuilder hbuf = new StringBuilder(); // Allow Headers to override Host setting hbuf.append("...
public final static String encode(String s) { return encode(s.getBytes()); }
public final static String encode(String s) { return encode(s.getBytes()); // TODO - charset? }
public void write(OutputStream os, String s) { try { os.write(s.getBytes()); os.flush(); } catch (IOException e) { log.warn("Write error", e); } log.debug("Wrote: " + s); return; }
public void write(OutputStream os, String s) { try { os.write(s.getBytes()); // TODO - charset? os.flush(); } catch (IOException e) { log.warn("Write error", e); } log.debug("Wrote: " + s); return; }
public static void main(String[] args) { if (args.length == 3) { int parser = 0; String file = null; int loops = 1000; if (args[0] != null) { if (!args[0].equals("jaxb")) { parser = 1; } } ...
public static void main(String[] args) { if (args.length == 3) { int parser = 0; String file = null; int loops = 1000; if (args[0] != null) { if (!args[0].equals("jaxb")) { parser = 1; } } ...
private int getBodyLength(String postBody, String contentEncoding) throws IOException { if(contentEncoding != null && contentEncoding.length() > 0) { return postBody.getBytes(contentEncoding).length; } else { // Most browsers use ISO-8859-1 as default enco...
private int getBodyLength(String postBody, String contentEncoding) throws IOException { if(contentEncoding != null && contentEncoding.length() > 0) { return postBody.getBytes(contentEncoding).length; } else { // Most browsers use ISO-8859-1 as default enco...
public void handleEvent(Event evt) { ++count; if(silent) return; System.out.print("EVT "+count+": '"+ evt.getType()+ "' listener '"+(evt.getCurrentNode()).getNodeName()+ "' target '"+((Node)evt.getTarget()).getNodeName()+ ...
public void handleEvent(Event evt) { ++count; if(silent) return; System.out.print("EVT "+count+": '"+ evt.getType()+ "' listener '"+((Node)evt.getCurrentTarget()).getNodeName()+ "' target '"+((Node)evt.getTarget()).getNodeName(...
private static long dosToJavaTime(long dosTime) { Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, (int) ((dosTime >> 25) & 0x7f) + 1980); cal.set(Calendar.MONTH, (int) ((dosTime >> 21) & 0x0f) - 1); cal.set(Calendar.DATE, (int) (dosTime >> 16) & 0x1f); cal.set(C...
private static long dosToJavaTime(long dosTime) { Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, (int) ((dosTime >> 25) & 0x7f) + 1980); cal.set(Calendar.MONTH, (int) ((dosTime >> 21) & 0x0f) - 1); cal.set(Calendar.DATE, (int) (dosTime >> 16) & 0x1f); cal.set(C...
public String getText () { checkWidget(); return text; } void hookEvents () { super.hookEvents(); if (labelHandle != 0) { OS.g_signal_connect (labelHandle, OS.mnemonic_activate, display.windowProc3, MNEMONIC_ACTIVATE); } }
public String getText () { checkWidget(); return text; } void hookEvents () { super.hookEvents(); if (labelHandle != 0) { OS.g_signal_connect_closure_by_id (labelHandle, display.signalIds [MNEMONIC_ACTIVATE], 0, display.closures [MNEMONIC_ACTIVATE], false); } }
public String getText () { checkWidget (); if ((style & SWT.SEPARATOR) != 0) return ""; return text; } void hookEvents () { super.hookEvents(); if (labelHandle != 0) { OS.g_signal_connect (labelHandle, OS.mnemonic_activate, display.windowProc3, MNEMONIC_ACTIVATE); } }
public String getText () { checkWidget (); if ((style & SWT.SEPARATOR) != 0) return ""; return text; } void hookEvents () { super.hookEvents(); if (labelHandle != 0) { OS.g_signal_connect_closure_by_id (labelHandle, display.signalIds [MNEMONIC_ACTIVATE], 0, display.closures [MNEMONIC_ACTIVATE], false); } }
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize(handle, wHint, hHint, changed); if ((style & SWT.HORIZONTAL) != 0) { if (wHint == SWT.DEFAULT) size....
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize(handle, wHint, hHint, changed); if ((style & SWT.HORIZONTAL) != 0) { if (wHint == SWT.DEFAULT) size....
public int getSelectionIndex () { checkWidget(); return OS.gtk_notebook_get_current_page (handle); } int /*long*/ gtk_focus (int /*long*/ widget, int /*long*/ directionType) { return 0; } int /*long*/ gtk_switch_page (int /*long*/ widget, int /*long*/ page, int /*long*/ page_num) { int index = OS.gtk_notebook_get...
public int getSelectionIndex () { checkWidget(); return OS.gtk_notebook_get_current_page (handle); } int /*long*/ gtk_focus (int /*long*/ widget, int /*long*/ directionType) { return 0; } int /*long*/ gtk_switch_page (int /*long*/ widget, int /*long*/ page, int /*long*/ page_num) { int index = OS.gtk_notebook_get...
public String getToolTipText () { checkWidget (); return toolTipText; } int /*long*/ gtk_mnemonic_activate (int /*long*/ widget, int /*long*/ arg1) { return parent.gtk_mnemonic_activate (widget, arg1); } void hookEvents () { super.hookEvents (); if (labelHandle != 0) OS.g_signal_connect (labelHandle, OS.mnemonic...
public String getToolTipText () { checkWidget (); return toolTipText; } int /*long*/ gtk_mnemonic_activate (int /*long*/ widget, int /*long*/ arg1) { return parent.gtk_mnemonic_activate (widget, arg1); } void hookEvents () { super.hookEvents (); if (labelHandle != 0) OS.g_signal_connect_closure_by_id (labelHandl...
public TextLayout (Device device) { if (device == null) device = Device.getDevice(); if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); this.device = device; int[] buffer = new int[1]; OS.ATSUCreateTextLayout(buffer); if (buffer[0] == 0) SWT.error(SWT.ERROR_NO_HANDLES); layout = buffer[0]; setLayoutContro...
public TextLayout (Device device) { if (device == null) device = Device.getDevice(); if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); this.device = device; int[] buffer = new int[1]; OS.ATSUCreateTextLayout(buffer); if (buffer[0] == 0) SWT.error(SWT.ERROR_NO_HANDLES); layout = buffer[0]; setLayoutContro...
public void run() { log.info("running clientengine run method"); testListeners = new SearchByClass(TestListener.class); sampleListeners = new ConvertListeners(); HashTree testTree = getTestTree(); PreCompiler compiler = new PreCompiler(); synchronized(testTree) { testTree.traverse(compiler); testTree...
public void run() { log.info("running clientengine run method"); testListeners = new SearchByClass(TestListener.class); sampleListeners = new ConvertListeners(); HashTree testTree = getTestTree(); PreCompiler compiler = new PreCompiler(true); // limit the changes to client only test elements synchronized(t...
protected String resolveExecutable(String exec, boolean mustSearchPath) { if (!resolveExecutable) { return exec; } // try to find the executable File executableFile = FILE_UTILS.resolveFile(getProject().getBaseDir(), exec); if (executableFile.exists()) { ...
protected String resolveExecutable(String exec, boolean mustSearchPath) { if (!resolveExecutable) { return exec; } // try to find the executable File executableFile = getProject().resolveFile(exec); if (executableFile.exists()) { return executableFile....
public void execute() throws BuildException { if (property == null || property.length() == 0) { throw new BuildException("no property specified"); } if (destDir == null) { destDir = FILE_UTILS.resolveFile(getProject().getBaseDir(),"."); } File tfile = ...
public void execute() throws BuildException { if (property == null || property.length() == 0) { throw new BuildException("no property specified"); } if (destDir == null) { destDir = getProject().resolveFile("."); } File tfile = FILE_UTILS.createTempFil...
private void touch(Resource r, long defaultTimestamp) { if (fileNameMapper == null) { if (r instanceof FileResource) { // use this to create file and deal with non-writable files touch(((FileResource) r).getFile(), defaultTimestamp); } else { ...
private void touch(Resource r, long defaultTimestamp) { if (fileNameMapper == null) { if (r instanceof FileResource) { // use this to create file and deal with non-writable files touch(((FileResource) r).getFile(), defaultTimestamp); } else { ...
public static Type makeBcelType(UnresolvedType type) { return Type.getType(type.getErasureSignature()); } static Type[] makeBcelTypes(UnresolvedType[] types) { Type[] ret = new Type[types.length]; for (int i = 0, len = types.length; i < len; i++) { ret[i] = makeBcelType(...
public static Type makeBcelType(UnresolvedType type) { return Type.getType(type.getErasureSignature()); } static Type[] makeBcelTypes(UnresolvedType[] types) { Type[] ret = new Type[types.length]; for (int i = 0, len = types.length; i < len; i++) { ret[i] = makeBcelType(...
public void execute() throws BuildException { if (usedMatchingTask) { log("DEPRECATED - Use of the implicit FileSet is deprecated. Use a nested fileset element instead."); } if (file == null && dir == null && filesets.size() == 0) { throw new BuildException("At leas...
public void execute() throws BuildException { if (usedMatchingTask) { log("DEPRECATED - Use of the implicit FileSet is deprecated. Use a nested fileset element instead."); } if (file == null && dir == null && filesets.size() == 0) { throw new BuildException("At leas...
private void writePropertyFile(Properties properties, File dir) throws BuildException { BufferedOutputStream bos = null; try { bos = new BufferedOutputStream( new FileOutputStream(new File(dir, linkFileName))); properties.store(bos, "Symlinks from " + ...
private void writePropertyFile(Properties properties, File dir) throws BuildException { BufferedOutputStream bos = null; try { bos = new BufferedOutputStream( new FileOutputStream(new File(dir, linkFileName))); properties.store(bos, "Symlinks from " + ...
public String getText (int columnIndex) { checkWidget (); return getText (columnIndex, true); } String getText (int columnIndex, boolean checkData) { if (checkData && !parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED); int validColumnCount = Math.max (1, parent.columns.length); if (!(0 <= columnInde...
public String getText (int columnIndex) { checkWidget (); return getText (columnIndex, true); } String getText (int columnIndex, boolean checkData) { if (checkData && !parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED); int validColumnCount = Math.max (1, parent.columns.length); if (!(0 <= columnInde...
public int indexOf (TreeItem item) { checkWidget (); if (item == null) error (SWT.ERROR_NULL_ARGUMENT); if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); if (item.parentItem != this) return -1; return item.getIndex (); } /* * Returns true if the receiver is currently available (though not necessary in t...
public int indexOf (TreeItem item) { checkWidget (); if (item == null) error (SWT.ERROR_NULL_ARGUMENT); if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); if (item.parentItem != this) return -1; return item.getIndex (); } /* * Returns true if the receiver is currently available (though not necessary in t...
public void setSelection (int index) { checkWidget (); if ((style & SWT.MULTI) != 0) deselectAll (); select (index, true); if ((style & SWT.MULTI) != 0) { if (index >= 0) setFocusIndex (index); } }
public void setSelection (int index) { checkWidget (); deselectAll (); select (index, true); if ((style & SWT.MULTI) != 0) { if (index >= 0) setFocusIndex (index); } }
package org.apache.wicket.examples.authentication1; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apa...
package org.apache.wicket.examples.authentication1; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apa...
package org.apache.wicket.examples.authentication2; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apa...
package org.apache.wicket.examples.authentication2; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apa...
package org.apache.wicket.examples.authentication3; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apa...
package org.apache.wicket.examples.authentication3; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apa...
public static String join(String separator, String... fragments) { if (fragments.length < 1) { // no elements return ""; } else if (fragments.length < 2) { // single element return fragments[0]; } else { // two or more elements StringBuffer buff = new StringBuffer(128); if (fragme...
public static String join(String separator, String... fragments) { if ((fragments == null) || (fragments.length < 1)) { // no elements return ""; } else if (fragments.length < 2) { // single element return fragments[0]; } else { // two or more elements StringBuffer buff = new StringB...
public TableItem (Table parent, int style, int index) { this (parent, style, index, true); } TableItem (Table parent, int style, int index, boolean notifyParent) { super (parent, style); int validItemIndex = parent.itemsCount; if (!(0 <= index && index <= validItemIndex)) error (SWT.ERROR_INVALID_RANGE); this.pare...
public TableItem (Table parent, int style, int index) { this (parent, style, index, true); } TableItem (Table parent, int style, int index, boolean notifyParent) { super (parent, style); int validItemIndex = parent.itemsCount; if (!(0 <= index && index <= validItemIndex)) error (SWT.ERROR_INVALID_RANGE); this.pare...
public All(Val val) { super(val); }
public All(Val val) { super(val, true); }
public Any(Val val) { super(val); }
public Any(Val val) { super(val, true); }
package org.apache.wicket; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 ...
package org.apache.wicket; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 ...
public final void onSubmit() { if (!(getRequestCycle().getRequestTarget() instanceof AjaxRequestTarget)) { onSubmit(null, getForm()); } }
public final void onSubmit() { if (AjaxRequestTarget.get() == null) { onSubmit(null, getForm()); } }
import org.apache.wicket.IRequestHandler; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache Licens...
import org.apache.wicket.IRequestHandler; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache Licens...
import org.apache.wicket.IRequestHandler; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache Licens...
import org.apache.wicket.IRequestHandler; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache Licens...
public DBIdentifier[] getSecondaryTableIdentifiers() { if (_seconds == null) return new DBIdentifier[0]; return (DBIdentifier[]) _seconds.keySet().toArray(new DBIdentifier[]{ }); }
public DBIdentifier[] getSecondaryTableIdentifiers() { if (_seconds == null) return new DBIdentifier[0]; return (DBIdentifier[]) _seconds.keySet().toArray(new DBIdentifier[_seconds.size()]); }
public Object getValue(Discriminator discrim, boolean adapt) { if (discrim.getValue() != null) return discrim.getValue(); if (StringUtils.isEmpty(_value)) { return discrim.getMappingRepository().getMappingDefaults(). getDiscriminatorValue(discrim, adapt); ...
public Object getValue(Discriminator discrim, boolean adapt) { if (discrim.getValue() != null) return discrim.getValue(); if (StringUtils.isEmpty(_value)) { return discrim.getMappingRepository().getMappingDefaults(). getDiscriminatorValue(discrim, adapt); ...
public Object toDataStoreValue(ValueMapping vm, Object val, JDBCStore store) { if (val == null) return null; if (_ordinal) return new Integer(((Enum) val).ordinal()); return ((Enum) val).name(); }
public Object toDataStoreValue(ValueMapping vm, Object val, JDBCStore store) { if (val == null) return null; if (_ordinal) return Integer.valueOf(((Enum) val).ordinal()); return ((Enum) val).name(); }
public Object getDefault() { if (_default != null) return _default; if (_defaultStr == null) return null; switch (_javaType) { case JavaTypes.BOOLEAN: case JavaTypes.BOOLEAN_OBJ: _default = ("true".equals(_defaultStr)) ? Boolea...
public Object getDefault() { if (_default != null) return _default; if (_defaultStr == null) return null; switch (_javaType) { case JavaTypes.BOOLEAN: case JavaTypes.BOOLEAN_OBJ: _default = ("true".equals(_defaultStr)) ? Boolea...
public void setString(PreparedStatement stmnt, int idx, String val, Column col) throws SQLException { // oracle NCHAR/NVARCHAR/NCLOB unicode columns require some // special handling to configure them correctly; see: // http://www.oracle.com/technology/sample_code/tech/java/ ...
public void setString(PreparedStatement stmnt, int idx, String val, Column col) throws SQLException { // oracle NCHAR/NVARCHAR/NCLOB unicode columns require some // special handling to configure them correctly; see: // http://www.oracle.com/technology/sample_code/tech/java/ ...
private void publishExportEvent(ExportRegistration exportRegistration) { Throwable exception = exportRegistration.getException(); org.osgi.service.remoteserviceadmin.ExportReference exportReference = (exception == null) ? exportRegistration .getExportReference() : null; RemoteServiceAdminEvent rsaEvent = new...
private void publishExportEvent(ExportRegistration exportRegistration) { Throwable exception = exportRegistration.getException(); org.osgi.service.remoteserviceadmin.ExportReference exportReference = (exception == null) ? exportRegistration .getExportReference() : null; RemoteServiceAdminEvent rsaEvent = new...
private static void assertNotFinal(Class type) { if (Modifier.isFinal(type.getModifiers())) throw new UnsupportedException(_loc.get("proxy-final", type)); }
private static void assertNotFinal(Class type) { if (Modifier.isFinal(type.getModifiers())) throw new UnsupportedException(_loc.get("no-proxy-final", type)); }
public Object convert( final Object object, final Context context ) throws ConverterException { final String string = (String)object; if( string.equals( "true" ) ) { return Boolean.TRUE; } else if( string.equals( "false" ) ) { retur...
public Object convert( final Object object, final Object context ) throws ConverterException { final String string = (String)object; if( string.equals( "true" ) ) { return Boolean.TRUE; } else if( string.equals( "false" ) ) { return...
public Object convert( final Object object, final Context context ) throws ConverterException { try { return new Byte( (String)object ); } catch( final NumberFormatException nfe ) { final String message = REZ.getString( "convert.bad-byte.er...
public Object convert( final Object object, final Object context ) throws ConverterException { try { return new Byte( (String)object ); } catch( final NumberFormatException nfe ) { final String message = REZ.getString( "convert.bad-byte.err...
public Object convert( final Object object, final Context context ) throws ConverterException { //TODO: Should we use ContextClassLoader here??? try { return Class.forName( (String)object ); } catch( final Exception e ) { final Stri...
public Object convert( final Object object, final Object context ) throws ConverterException { //TODO: Should we use ContextClassLoader here??? try { return Class.forName( (String)object ); } catch( final Exception e ) { final Strin...
public Object convert( final Object object, final Context context ) throws ConverterException { try { return new Double( (String)object ); } catch( final NumberFormatException nfe ) { final String message = REZ.getString( "convert.bad-doubl...
public Object convert( final Object object, final Object context ) throws ConverterException { try { return new Double( (String)object ); } catch( final NumberFormatException nfe ) { final String message = REZ.getString( "convert.bad-double...
public Object convert( final Class destination, final Object original, final Context context ) throws ConverterException
public Object convert( final Class destination, final Object original, final Object context ) throws ConverterException
public Object convert( final Object object, final Context context ) throws ConverterException { try { return new Float( (String)object ); } catch( final NumberFormatException nfe ) { final String message = REZ.getString( "convert.bad-float....
public Object convert( final Object object, final Object context ) throws ConverterException { try { return new Float( (String)object ); } catch( final NumberFormatException nfe ) { final String message = REZ.getString( "convert.bad-float.e...