buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
package sprockets; /* * $Id$ * $Revision$ $Date$ * * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * ...
package sprockets; /* * $Id$ * $Revision$ $Date$ * * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * ...
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { if (!(_map instanceof PCPath)) throw new UnsupportedOperationException(); if (!(_key instanceof Const)) throw new UnsupportedOperationException(); GetMapValueExpStat...
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { if (!(_map instanceof PCPath)) throw new UnsupportedOperationException(); if (!(_key instanceof Const)) throw new UnsupportedOperationException(); GetMapValueExpStat...
public boolean getWideCaret() { return false; } boolean hasMarkedText (int /*long*/ id, int /*long*/ sel) { return text.length () != 0; } boolean insertText (int /*long*/ id, int /*long*/ sel, int /*long*/ string) { if (startOffset == -1) return true; NSString str = new NSString (string); if (str.isKindOfClass ...
public boolean getWideCaret() { return false; } boolean hasMarkedText (int /*long*/ id, int /*long*/ sel) { return text.length () != 0; } boolean insertText (int /*long*/ id, int /*long*/ sel, int /*long*/ string) { if (startOffset == -1) return true; NSString str = new NSString (string); if (str.isKindOfClass ...
public void serviceDiscovered(IServiceEvent anEvent) { events.add(anEvent); if(getEventCount() == amountOfEventsToExpect) { synchronized (this) { notifyAll(); } } }
public void serviceDiscovered(IServiceEvent anEvent) { events.add(anEvent); if(events.size() == amountOfEventsToExpect) { synchronized (this) { notifyAll(); } } }
public void serviceTypeDiscovered(IServiceTypeEvent anEvent) { events.add(anEvent); if(getEventCount() == amountOfEventsToExpect) { synchronized (this) { notifyAll(); } } }
public void serviceTypeDiscovered(IServiceTypeEvent anEvent) { events.add(anEvent); if(events.size() == amountOfEventsToExpect) { synchronized (this) { notifyAll(); } } }
public boolean eval() throws BuildException { initScriptRunner(); Object result = executeScript("ant_condition"); return getValue(); }
public boolean eval() throws BuildException { initScriptRunner(); executeScript("ant_condition"); return getValue(); }
public MostRecentlyUsedMap(final int maxEntries) { super(16, 0.7f, true); if (maxEntries <= 0) { throw new IllegalArgumentException("Must have at least one entry"); } this.maxEntries = maxEntries; }
public MostRecentlyUsedMap(final int maxEntries) { super(10, 0.75f, true); if (maxEntries <= 0) { throw new IllegalArgumentException("Must have at least one entry"); } this.maxEntries = maxEntries; }
public OpenJPAConfigurationImpl(boolean derivations, boolean loadGlobals) { super(false); String[] aliases; classResolverPlugin = addPlugin("ClassResolver", true); aliases = new String[] { "default", "org.apache.openjpa.util.ClassResolverImpl", // de...
public OpenJPAConfigurationImpl(boolean derivations, boolean loadGlobals) { super(false); String[] aliases; classResolverPlugin = addPlugin("ClassResolver", true); aliases = new String[] { "default", "org.apache.openjpa.util.ClassResolverImpl", // de...
public void setUp() { super.setUp( // DROP_TABLES, Person.class, Player.class, BattingOrder.class, Trainer.class, Game.class, Inning.class, Course.class, Student.class, Owner.class, Bicycle.class, Car.class, Home.class, ...
public void setUp() { super.setUp( CLEAR_TABLES, Person.class, Player.class, BattingOrder.class, Trainer.class, Game.class, Inning.class, Course.class, Student.class, Owner.class, Bicycle.class, Car.class, Home.class, Widget.cla...
public JDBCConfigurationImpl(boolean derivations, boolean loadGlobals) { super(false, false); String[] aliases; schema = addString("jdbc.Schema"); schemas = addStringList("jdbc.Schemas"); transactionIsolation = addInt("jdbc.TransactionIsolation"); aliases = new Stri...
public JDBCConfigurationImpl(boolean derivations, boolean loadGlobals) { super(false, false); String[] aliases; schema = addString("jdbc.Schema"); schemas = addStringList("jdbc.Schemas"); transactionIsolation = addInt("jdbc.TransactionIsolation"); aliases = new Stri...
public void testNsCurrent() { expectLog("ns.current", "Echo2 calledEcho2 inside a macro"); }
public void testNsCurrent() { expectLog("ns.current", "Echo2 inside a macroHello from x:p"); }
protected Session openSession() throws JSchException { JSch jsch = new JSch(); if (null != userInfo.getKeyfile()) { jsch.addIdentity(userInfo.getKeyfile(), "passphrase"); } if( knownHosts != null ) { log( "Using known hosts: " + knownHosts, Project.MSG_DEBUG ...
protected Session openSession() throws JSchException { JSch jsch = new JSch(); if (null != userInfo.getKeyfile()) { jsch.addIdentity(userInfo.getKeyfile()); } if( knownHosts != null ) { log( "Using known hosts: " + knownHosts, Project.MSG_DEBUG ); ...
public XSObject getItem(int index) { if (index < 0 || index >= fLength) return null; return fArray[index]; } } // class XSParticle
public XSObject item(int index) { if (index < 0 || index >= fLength) return null; return fArray[index]; } } // class XSParticle
public EmailPage() { Form<Void> form = new Form<Void>("form"); form.setDefaultModel(new CompoundPropertyModel<EmailPage>(this)); add(form); TextField<String> email = new TextField<String>("email"); email.add(EmailAddressValidator.getInstance()); form.add(email); }
public EmailPage() { Form<EmailPage> form = new Form<EmailPage>("form"); form.setDefaultModel(new CompoundPropertyModel<EmailPage>(this)); add(form); TextField<String> email = new TextField<String>("email"); email.add(EmailAddressValidator.getInstance()); form.add(email); }
public void XPathtestDefault() throws Exception { XPathFileContainer f = new XPathFileContainer("../build.xml", "/project/@default"); assertNotNull(f); assertTrue("Not empty", f.size() > 0); assertEquals("all", f.getXPathString(0)); }
public void XPathtestDefault() throws Exception { XPathFileContainer f = new XPathFileContainer("../build.xml", "/project/@default"); assertNotNull(f); assertTrue("Not empty", f.size() > 0); assertEquals("install", f.getXPathString(0)); }
String message() default ""; /** * 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, Versi...
String message() default ""; /** * 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, Versi...
public StandardParserConfiguration(SymbolTable symbolTable, GrammarPool grammarPool, XMLComponentManager parentSettings) { super(symbolTable, parentSettings); // add default recognized features final String[] reco...
public StandardParserConfiguration(SymbolTable symbolTable, GrammarPool grammarPool, XMLComponentManager parentSettings) { super(symbolTable, parentSettings); // add default recognized features final String[] reco...
public ProjectNavigator(AppContext context) { super(context); context.getEventBus().addMember(EventBus.MONITORING, new Handler()); setLayout(new GridLayout(1,1)); _tree = new JTree(); _tree.setModel(null); JScrollPane scroller = new JScrollPane(_tree); add(scro...
public ProjectNavigator(AppContext context) { super(context); context.getEventBus().addMember(EventBus.MONITORING, new Handler()); setLayout(new GridLayout(1,1)); _tree = new JTree(); _tree.setModel(null); JScrollPane scroller = new JScrollPane(_tree); add(scro...
public void execute() { if(!_file.exists()) { String message = _context.getResources().getMessage( getClass(), "noFile", new Object[] { _file.toString() }); _context.getEventBus(). postEvent(new ErrorEvent(_context, message)); } else {...
public void execute() { if(!_file.exists()) { String message = _context.getResources().getMessage( getClass(), "noFile", new Object[] { _file.toString() }); _context.getEventBus(). postEvent(new ErrorEvent(_context, message)); } else {...
public int getTopIndex () { checkWidget(); int /*long*/ [] path = new int /*long*/ [1]; OS.gtk_widget_realize (handle); if (!OS.gtk_tree_view_get_path_at_pos (handle, 1, 1, path, null, null, null)) return 0; if (path [0] == 0) return 0; int /*long*/ indices = OS.gtk_tree_path_get_indices (path[0]); int[] index =...
public int getTopIndex () { checkWidget(); int /*long*/ [] path = new int /*long*/ [1]; OS.gtk_widget_realize (handle); if (!OS.gtk_tree_view_get_path_at_pos (handle, 1, 1, path, null, null, null)) return 0; if (path [0] == 0) return 0; int /*long*/ indices = OS.gtk_tree_path_get_indices (path[0]); int[] index =...
public int getTopIndex () { checkWidget(); int /*long*/ [] path = new int /*long*/ [1]; OS.gtk_widget_realize (handle); if (!OS.gtk_tree_view_get_path_at_pos (handle, 1, 1, path, null, null, null)) return 0; if (path [0] == 0) return 0; int /*long*/ indices = OS.gtk_tree_path_get_indices (path[0]); int[] index =...
public int getTopIndex () { checkWidget(); int /*long*/ [] path = new int /*long*/ [1]; OS.gtk_widget_realize (handle); if (!OS.gtk_tree_view_get_path_at_pos (handle, 1, 1, path, null, null, null)) return 0; if (path [0] == 0) return 0; int /*long*/ indices = OS.gtk_tree_path_get_indices (path[0]); int[] index =...
public TreeItem getTopItem () { checkWidget (); int /*long*/ [] path = new int /*long*/ [1]; OS.gtk_widget_realize (handle); if (!OS.gtk_tree_view_get_path_at_pos (handle, 1, 1, path, null, null, null)) return null; if (path [0] == 0) return null; TreeItem item = null; int /*long*/ iter = OS.g_malloc (OS.GtkTree...
public TreeItem getTopItem () { checkWidget (); int /*long*/ [] path = new int /*long*/ [1]; OS.gtk_widget_realize (handle); if (!OS.gtk_tree_view_get_path_at_pos (handle, 1, 1, path, null, null, null)) return null; if (path [0] == 0) return null; TreeItem item = null; int /*long*/ iter = OS.g_malloc (OS.GtkTree...
public void setReferenceFiles( final Path path ) throws TaskException { //demand create pathlist if( null == m_referenceFiles ) { m_referenceFiles = new Path(); } m_referenceFiles.addPath( path ); }
public void setReferenceFiles( final Path path ) throws TaskException { //demand create pathlist if( null == m_referenceFiles ) { m_referenceFiles = new Path(); } m_referenceFiles.add( path ); }
private final ExecuteJava m_exec = new ExecuteJava(); /** * Set the class name. */ public void setClassname( final String className ) { m_exec.setClassName( className ); } /** * Add a classpath element. */ public void addClasspath( final Path classpath ) ...
private final ExecuteJava m_exec = new ExecuteJava(); /** * Set the class name. */ public void setClassname( final String className ) { m_exec.setClassName( className ); } /** * Add a classpath element. */ public void addClasspath( final Path classpath ) ...
public void addClasspath( final Path path ) throws TaskException { if( m_classpath == null ) { m_classpath = new Path(); } m_classpath.addPath( path ); }
public void addClasspath( final Path path ) throws TaskException { if( m_classpath == null ) { m_classpath = new Path(); } m_classpath.add( path ); }
public void addClasspath( final Path path ) { m_exe.getClassPath().addPath( path ); }
public void addClasspath( final Path path ) { m_exe.getClassPath().add( path ); }
public void addPath( Path path ) throws TaskException { if( m_path == null ) { m_path = path; } else { m_path.addPath( path ); } }
public void addPath( Path path ) throws TaskException { if( m_path == null ) { m_path = path; } else { m_path.add( path ); } }
private String m_value; public void addClasspath( Path classpath ) throws TaskException { if( m_classpath == null ) { m_classpath = classpath; } else { m_classpath.addPath( classpath ); } }
private String m_value; public void addClasspath( Path classpath ) throws TaskException { if( m_classpath == null ) { m_classpath = classpath; } else { m_classpath.add( classpath ); } }
public void setAutocommit( boolean autocommit ) { this.autocommit = autocommit; } /** * Adds an element to the classpath for loading the driver. * * @param classpath The new Classpath value */ public void addClasspath( Path classpath ) throws TaskException { ...
public void setAutocommit( boolean autocommit ) { this.autocommit = autocommit; } /** * Adds an element to the classpath for loading the driver. * * @param classpath The new Classpath value */ public void addClasspath( Path classpath ) throws TaskException { ...
protected Commandline setupModernJavacCommandlineSwitches( Commandline cmd ) throws TaskException { setupJavacCommandlineSwitches( cmd, true ); if( m_attributes.getSource() != null ) { cmd.addArgument( "-source" ); cmd.addArgument( m_attributes.getSource()...
protected Commandline setupModernJavacCommandlineSwitches( Commandline cmd ) throws TaskException { setupJavacCommandlineSwitches( cmd, true ); if( m_attributes.getSource() != null ) { cmd.addArgument( "-source" ); cmd.addArgument( m_attributes.getSource()...
protected Path getCompileClasspath() throws TaskException { // add dest dir to classpath so that previously compiled and // untouched classes are on classpath Path classpath = new Path(); classpath.addLocation( attributes.getBase() ); // add the classpath ...
protected Path getCompileClasspath() throws TaskException { // add dest dir to classpath so that previously compiled and // untouched classes are on classpath Path classpath = new Path(); classpath.addLocation( attributes.getBase() ); // add the classpath ...
public void setClasspath( final Path path ) { m_classpath.addPath( path ); }
public void setClasspath( final Path path ) { m_classpath.add( path ); }
public void evict(Class cls) { // Check MetaData throws a consistent exception with evict(Class, // Object) if(getMetaData(cls) != null) { _cache.removeAll(cls, false); } }
public void evict(Class cls) { // Check MetaData throws a consistent exception with evict(Class, // Object) if(getMetaData(cls) != null) { _cache.removeAll(cls, true); } }
public String getPath() { reset(); // force getting the resource on each request; return super.getPath(); } }; // create a link that displays the full image in a popup page ImagePopupLink popupImageLink = new ImagePopupLink("popupImageLink", cdModel); // create an image using the image resour...
public String getPath() { invalidate(); // force getting the resource on each request; return super.getPath(); } }; // create a link that displays the full image in a popup page ImagePopupLink popupImageLink = new ImagePopupLink("popupImageLink", cdModel); // create an image using the image r...
public Home(final PageParameters parameters) { final String word = parameters.getString("setWord"); if (word == null) { getGame().newGame(5, new WordGenerator()); } else { getGame().newGame(5, new WordGenerator(new String[] { word })); } add(new PageLink("start", Guess.class)); }
public Home(final PageParameters parameters) { final String word = parameters.getString("word"); if (word == null) { getGame().newGame(5, new WordGenerator()); } else { getGame().newGame(5, new WordGenerator(new String[] { word })); } add(new PageLink("start", Guess.class)); }
public void testHelloWorld() throws Exception { beginAt("/helloworld"); //this.dumpResponse(System.out); assertTitleEquals("Wicket Examples - helloworld"); assertXPath("//body/span[@wicket:id='message']", "Hello World"); assertWicketIdTagText("message", "Hello World"); ...
public void testHelloWorld() throws Exception { beginAt("/helloworld"); //this.dumpResponse(System.out); assertTitleEquals("Wicket Examples - helloworld"); assertXPath("//body/span[@wicket:id='message']", "Hello World!"); assertWicketIdTagText("message", "Hello World"); ...
public static void main(String args[]) throws Throwable { new MainVerboseAndShow().target(); if (!MessageHolder.startsAs(Arrays.asList(new String[]{ "info weaving 'ataspectj/ltwlog/MainVerboseAndShow'", "weaveinfo Type 'ataspectj.ltwlog.MainVerboseAndShow' (MainVerbos...
public static void main(String args[]) throws Throwable { new MainVerboseAndShow().target(); if (!MessageHolder.startsAs(Arrays.asList(new String[]{ "info weaving 'ataspectj/ltwlog/MainVerboseAndShow'", "weaveinfo Join point 'method-execution(void ataspectj.ltwlog.Mai...
protected Test findResidueInternal(Shadow shadow, ExposedState state) { int len = shadow.getArgCount(); // do some quick length tests first int numArgsMatchedByEllipsis = (len + arguments.ellipsisCount) - arguments.size(); if (numArgsMatchedByEllipsis < 0) return Literal.FALSE; // should never happen if (...
protected Test findResidueInternal(Shadow shadow, ExposedState state) { int len = shadow.getArgCount(); // do some quick length tests first int numArgsMatchedByEllipsis = (len + arguments.ellipsisCount) - arguments.size(); if (numArgsMatchedByEllipsis < 0) return Literal.FALSE; // should never happen if (...
public Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype) throws DOMException { if (doctype.getOwnerDocument() != null) { ...
public Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype) throws DOMException { if (doctype != null && doctype.getOwnerDoc...
public Object getAdapter(Class clazz) { if (clazz.equals(IChatID.class)) { return this; } else return super.getAdapter(clazz); }
public Object getAdapter(Class clazz) { if (clazz.isInstance(this)) { return this; } else return super.getAdapter(clazz); }
public void assertComponent(String path, Class expectedComponentClass) { Component component = getComponentFromLastRenderedPage(path); Assert.assertTrue("componet '" + Classes.name(component.getClass()) + "' is not type:" + Classes.name(expectedComponentClass), expectedComponentClass .isAssignableFrom(com...
public void assertComponent(String path, Class expectedComponentClass) { Component component = getComponentFromLastRenderedPage(path); Assert.assertTrue("component '" + Classes.name(component.getClass()) + "' is not type:" + Classes.name(expectedComponentClass), expectedComponentClass .isAssignableFrom(co...
private boolean validateDocument(String document, int expectedLinkClickCount) { HtmlDocumentValidator validator = new HtmlDocumentValidator(); Tag html = new Tag("html"); Tag head = new Tag("head"); html.addExpectedChild(head); Tag title = new Tag("title"); head.addExpectedChild(title); title.addExpected...
private boolean validateDocument(String document, int expectedLinkClickCount) { HtmlDocumentValidator validator = new HtmlDocumentValidator(); Tag html = new Tag("html"); Tag head = new Tag("head"); html.addExpectedChild(head); Tag title = new Tag("title"); head.addExpectedChild(title); title.addExpected...
private void executeAjaxUrlWithLastBaseUrl(Url url) throws IOException, ResourceStreamNotFoundException, ParseException { tester.getRequest().setUrl(url); tester.getRequest().addHeader("Wicket-Ajax-BaseURL", tester.getWicketAjaxBaseUrlFromLastRequest()); tester.getRequest().addHeader("Wicket-Ajax", "true")...
private void executeAjaxUrlWithLastBaseUrl(Url url) throws IOException, ResourceStreamNotFoundException, ParseException { tester.getRequest().setUrl(url); tester.getRequest().addHeader("Wicket-Ajax-BaseURL", tester.getWicketAjaxBaseUrlEncodedInLastResponse()); tester.getRequest().addHeader("Wicket-Ajax", "...
public void process() { // Change the request to a multipart web request so parameters are // parsed out correctly final HttpServletRequest request = ((WebRequest)getRequest()).getHttpServletRequest(); try { final MultipartWebRequest multipartWebRequest = new MultipartWebRequest(this, request); getReq...
public void process() { // Change the request to a multipart web request so parameters are // parsed out correctly final HttpServletRequest request = ((WebRequest)getRequest()).getHttpServletRequest(); try { final MultipartWebRequest multipartWebRequest = new MultipartWebRequest(this, request); getReq...
public void testNullComponent() { Assert.assertNull("Null component should skip resource load", loader.loadStringResource( null, "test.string", Locale.getDefault(), null, null)); }
public void testNullComponent() { Assert.assertNull("Null component should skip resource load", loader.loadStringResource( (Component)null, "test.string", Locale.getDefault(), null, null)); }
public boolean setParent (Composite parent) { checkWidget (); if (parent == null) error (SWT.ERROR_NULL_ARGUMENT); if (parent.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (this.parent == parent) return true; if (!isReparentable ()) return false; releaseChild (); Shell newShell = parent.getShell (), ol...
public boolean setParent (Composite parent) { checkWidget (); if (parent == null) error (SWT.ERROR_NULL_ARGUMENT); if (parent.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (this.parent == parent) return true; if (!isReparentable ()) return false; releaseChild (); Shell newShell = parent.getShell (), ol...
private void addStaticInitializer() { Code code = getOrCreateClassInitCode(true); if (_meta.getPCSuperclass() != null) { if (getCreateSubclass()) { code.constant().setValue(_meta.getFields().length); code.putstatic().setField(INHERIT, int.class); ...
private void addStaticInitializer() { Code code = getOrCreateClassInitCode(true); if (_meta.getPCSuperclass() != null) { if (getCreateSubclass()) { code.constant().setValue(0); code.putstatic().setField(INHERIT, int.class); } else { ...
public boolean isVisible () { checkWidget(); return isVisible && parent.isVisible () && hasFocus (); } void killFocus () { OS.DestroyCaret (); if (font != null) restoreIMEFont (); } void move () { moved = false; if (!OS.SetCaretPos (x, y)) return; if (OS.IsDBLocale) { POINT ptCurrentPos = new POINT (); if ...
public boolean isVisible () { checkWidget(); return isVisible && parent.isVisible () && hasFocus (); } void killFocus () { OS.DestroyCaret (); if (font != null) restoreIMEFont (); } void move () { moved = false; if (!OS.SetCaretPos (x, y)) return; if (OS.IsDBLocale) { POINT ptCurrentPos = new POINT (); if ...
public static void main(String[] args) { Display display = new Display(); final Shell shell = new Shell(display); shell.setText("PowerPoint Example"); shell.setLayout(new FillLayout()); try { OleFrame frame = new OleFrame(shell, SWT.NONE); clientSite = new OleClientSite(frame, SWT.NONE, "PowerPoint.Sh...
public static void main(String[] args) { Display display = new Display(); final Shell shell = new Shell(display); shell.setText("PowerPoint Example"); shell.setLayout(new FillLayout()); try { OleFrame frame = new OleFrame(shell, SWT.NONE); clientSite = new OleClientSite(frame, SWT.NONE, "PowerPoint.Sl...
public void run() { HttpRequestHdr request = new HttpRequestHdr(); SampleResult result = null; HeaderManager headers = null; HTTPSamplerBase sampler = null; try { request.parse(new BufferedInputStream(clientSocket.getInputStream())); sampler = request.getSampler(); /* * Create a Header Manage...
public void run() { HttpRequestHdr request = new HttpRequestHdr(); SampleResult result = null; HeaderManager headers = null; HTTPSamplerBase sampler = null; try { request.parse(new BufferedInputStream(clientSocket.getInputStream())); sampler = request.getSampler(); /* * Create a Header Manage...
protected FileTransferListener progressListener; static { try { String str = System.getProperty(FileTransferParams.class.getName() + ".FILECHUNKSIZE", "" + DEFAULT_CHUNK_SIZE); DEFAULT_CHUNK_SIZE = Integer.parseInt(str); str = System.getProperty(FileTransferParams.class.getName() + ".FILEWAITTIM...
protected FileTransferListener progressListener; static { try { String str = System.getProperty(FileTransferParams.class.getName() + ".FILECHUNKSIZE", "" + DEFAULT_CHUNK_SIZE); DEFAULT_CHUNK_SIZE = Integer.parseInt(str); str = System.getProperty(FileTransferParams.class.getName() + ".FILEWAITTIM...
public String getCharacterEncoding() { if (this.defaultEncoding == null) { return Application.get().getSettings().getResponseRequestEncoding(); } else { return this.defaultEncoding; } }
public String getCharacterEncoding() { if (this.defaultEncoding == null) { return Application.get().getRequestCycleSettings().getResponseRequestEncoding(); } else { return this.defaultEncoding; } }
private CookieValuePersisterSettings getSettings() { return RequestCycle.get().getApplication().getSettings().getCookieValuePersisterSettings(); }
private CookieValuePersisterSettings getSettings() { return RequestCycle.get().getApplication().getSecuritySettings().getCookieValuePersisterSettings(); }
public void addTreeListener(TreeListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Expand, typedListener); addListener (SWT.Collapse, typedListener); } int borderHandle () { return hwndParent !=...
public void addTreeListener(TreeListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Expand, typedListener); addListener (SWT.Collapse, typedListener); } int borderHandle () { return hwndParent !=...
public void run () { NSHTTPCookieStorage storage = NSHTTPCookieStorage.sharedHTTPCookieStorage (); NSURL url = NSURL.URLWithString (NSString.stringWith (CookieUrl)); NSArray cookies = storage.cookiesForURL (url); int count = cookies.count (); if (count == 0) return; NSString name = NSString....
public void run () { NSHTTPCookieStorage storage = NSHTTPCookieStorage.sharedHTTPCookieStorage (); NSURL url = NSURL.URLWithString (NSString.stringWith (CookieUrl)); NSArray cookies = storage.cookiesForURL (url); int count = (int)/*64*/cookies.count (); if (count == 0) return; NSString name ...
public void testMessages() { // bug 33474 // The build has happened, what messages did the compiler give, and do they // contain the information we expect? List msgs = NullIdeManager.getIdeManager().getCompilationSourceLineTasks(); if (2 != msgs.size()) { assertTrue("not two messages: " + m...
public void testMessages() { // bug 33474 // The build has happened, what messages did the compiler give, and do they // contain the information we expect? List msgs = NullIdeManager.getIdeManager().getCompilationSourceLineTasks(); if (2 != msgs.size()) { assertTrue("not two messages: " + m...
public void test() { String testLstFile = "testdata/StructureModelRegressionTest/example.lst"; File f = new File(testLstFile); assertTrue(testLstFile, f.canRead()); // TODO: enable when model is verified. // assertTrue("saved model: " + testLstFile, verifyAgainstSavedModel(testLstFile)...
public void test() { String testLstFile = AjdeTests.TESTDATA_PATH + "/StructureModelRegressionTest/example.lst"; File f = new File(testLstFile); assertTrue(testLstFile, f.canRead()); // TODO: enable when model is verified. // assertTrue("saved model: " + testLstFile, verifyAgainstSaved...
public void test_setImageIndentI() { if (SwtJunit.isCarbon || SwtJunit.isGTK) { //setImageIndent not implemented on Carbon tableItem.setImageIndent(1); return; } assertEquals(0, tableItem.getImageIndent()); tableItem.setImageIndent(1); assertEquals(1, tableItem.getImageIndent()); tableItem.setImageIndent...
public void test_setImageIndentI() { if (SwtJunit.isCarbon || SwtJunit.isCocoa || SwtJunit.isGTK) { //setImageIndent not implemented on Carbon tableItem.setImageIndent(1); return; } assertEquals(0, tableItem.getImageIndent()); tableItem.setImageIndent(1); assertEquals(1, tableItem.getImageIndent()); tabl...
public void setImage (Image image) { checkWidget(); if (image != null && image.isDisposed ()) { SWT.error(SWT.ERROR_INVALID_ARGUMENT); } Image oldImage = getImage(); if (image == null && oldImage == null) return; if (image != null && image.equals(oldImage)) return; super.setImage(image); if (!parent.updateTab...
public void setImage (Image image) { checkWidget(); if (image != null && image.isDisposed ()) { SWT.error(SWT.ERROR_INVALID_ARGUMENT); } Image oldImage = getImage(); if (image == null && oldImage == null) return; if (image != null && image.equals(oldImage)) return; super.setImage(image); if (!parent.updateTab...
public void setForeground (Color color) { checkWidget(); if (((state & FOREGROUND) == 0) && color == null) return; GdkColor gdkColor = null; if (color != null) { if (color.isDisposed ()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); gdkColor = color.handle; } boolean set = false; if (gdkColor == null) { int /*lon...
public void setForeground (Color color) { checkWidget(); if (((state & FOREGROUND) == 0) && color == null) return; GdkColor gdkColor = null; if (color != null) { if (color.isDisposed ()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); gdkColor = color.handle; } boolean set = false; if (gdkColor == null) { int /*lon...
public void setSynchronizer (Synchronizer synchronizer) { checkDevice (); if (synchronizer == null) error (SWT.ERROR_NULL_ARGUMENT); if (this.synchronizer != null) { this.synchronizer.runAsyncMessages(true); } this.synchronizer = synchronizer; } void showIMWindow (Control control) { imControl = control; if (p...
public void setSynchronizer (Synchronizer synchronizer) { checkDevice (); if (synchronizer == null) error (SWT.ERROR_NULL_ARGUMENT); if (this.synchronizer != null) { this.synchronizer.runAsyncMessages(true); } this.synchronizer = synchronizer; } void showIMWindow (Control control) { imControl = control; if (p...
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); } } boolean mnemonicHit (char key) { if (labelHandle...
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); } } boolean mnemonicHit (char key) { if (labelHandle...
public class NextIsNullException extends Exception { /* * 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 Ap...
public class NextIsNullException extends Exception { /* * 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 Ap...
private Filter createRemoteFilter() throws InvalidSyntaxException { // This filter looks for IHello instances that have the // 'service.imported' property set, as specified by OSGi 4.2 // remote services spec (Chapter 13) return bundleContext.createFilter("(|(" + org.osgi.framework.Constants.OBJECTCLASS +...
private Filter createRemoteFilter() throws InvalidSyntaxException { // This filter looks for IHello instances that have the // 'service.imported' property set, as specified by OSGi 4.2 // remote services spec (Chapter 13) return bundleContext.createFilter("(&(" + org.osgi.framework.Constants.OBJECTCLASS +...
public synchronized Object connect(ID remote, Object data, int timeout) throws ECFException { if (connection != null) throw new ECFException("already connected"); if (timeout > 0) SmackConfiguration.setPacketReplyTimeout(timeout); Roster.setDefaultSubscriptionMode(Roster.SUBSCRIPTION_MANUAL); final XMPP...
public synchronized Object connect(ID remote, Object data, int timeout) throws ECFException { if (connection != null) throw new ECFException("already connected"); if (timeout > 0) SmackConfiguration.setPacketReplyTimeout(timeout); Roster.setDefaultSubscriptionMode(Roster.SUBSCRIPTION_MANUAL); final XMPP...
private void unpackAttributes(World world) { Attribute[] attrs = field.getAttributes(); List as = BcelAttributes.readAjAttributes(attrs, getSourceContext(world)); for (Iterator iter = as.iterator(); iter.hasNext();) { AjAttribute a = (AjAttribute) iter.next(); if (a instanceof AjAttribute.AjSynthetic) { ...
private void unpackAttributes(World world) { Attribute[] attrs = field.getAttributes(); List as = BcelAttributes.readAjAttributes(attrs, getSourceContext(world),world.getMessageHandler()); for (Iterator iter = as.iterator(); iter.hasNext();) { AjAttribute a = (AjAttribute) iter.next(); if (a instanceof AjA...
private void unpackAjAttributes(World world) { List as = BcelAttributes.readAjAttributes(method.getAttributes(), getSourceContext(world)); //System.out.println("unpack: " + this + ", " + as); for (Iterator iter = as.iterator(); iter.hasNext();) { AjAttribute a = (AjAttribute) iter.next(); if (a instanceof ...
private void unpackAjAttributes(World world) { List as = BcelAttributes.readAjAttributes(method.getAttributes(), getSourceContext(world),world.getMessageHandler()); //System.out.println("unpack: " + this + ", " + as); for (Iterator iter = as.iterator(); iter.hasNext();) { AjAttribute a = (AjAttribute) iter.ne...
private void printAspectAttributes(PrintStream out) { ISourceContext context = null; if (enclosingClass != null && enclosingClass.getType() != null) { context = enclosingClass.getType().getSourceContext(); } List as = BcelAttributes.readAjAttributes(attributes, context); if (! as.isEmpty()) { out.print...
private void printAspectAttributes(PrintStream out) { ISourceContext context = null; if (enclosingClass != null && enclosingClass.getType() != null) { context = enclosingClass.getType().getSourceContext(); } List as = BcelAttributes.readAjAttributes(attributes, context,null); if (! as.isEmpty()) { out....
public void update(Graphics g) { /* * There are 4 steps to this: * - clear the double buffer * - paint the objects into the double buffer * - paint the status into the double buffer * - paint the doublebuffer into the buffer */ offGraphics.se...
public void update(Graphics g) { /* * There are 4 steps to this: * - clear the double buffer * - paint the objects into the double buffer * - paint the status into the double buffer * - paint the doublebuffer into the buffer */ offGraphics.se...
protected void setUp() throws Exception { super.setUp(); this.application = new WicketTester().getApplication(); Page page = new MockPageWithOneComponent(); this.component = new DummyComponent(page, "component", this.application); this.loader = createLoader(); }
protected void setUp() throws Exception { super.setUp(); this.application = new WicketTester(new DummyApplication()).getApplication(); Page page = new MockPageWithOneComponent(); this.component = new DummyComponent(page, "component", this.application); this.loader = createLoader(); }
protected JSLPServiceTypeID(final Namespace namespace, final String type) { super(namespace); try { st = new ServiceType(type); // verify that the ServiceType is proper Assert.isNotNull(st.toString()); Assert.isTrue(!st.toString().equals("")); //$NON-NLS-1$ final String na = st.getNamingAuthority()...
protected JSLPServiceTypeID(final Namespace namespace, final String type) { super(namespace); try { st = new ServiceType(type); // verify that the ServiceType is proper Assert.isNotNull(st.toString()); Assert.isTrue(!st.toString().equals("")); //$NON-NLS-1$ final String na = st.getNamingAuthority()...
public void addDisposeListener (DisposeListener listener) { checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Dispose, typedListener); } void addWidget () { } /** * Returns a style with exactly one style bit set out ...
public void addDisposeListener (DisposeListener listener) { checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Dispose, typedListener); } void addWidget () { } /** * Returns a style with exactly one style bit set out ...
public final int getCurrentPage() { int page = currentPage; /* * trim current page if its out of bounds this can happen if items are * added/deleted between requests */ if (page >= getPageCount()) { page = Math.max(getPageCount() - 1, 0); currentPage = page; return page; } return page...
public final int getCurrentPage() { int page = currentPage; /* * trim current page if its out of bounds this can happen if items are * added/deleted between requests */ if (page > 0 && page >= getPageCount()) { page = Math.max(getPageCount() - 1, 0); currentPage = page; return page; } ...
public void addDeclare(Declare declare) { // this is not extensible, oh well if (declare instanceof DeclareErrorOrWarning) { ShadowMunger m = new Checker((DeclareErrorOrWarning)declare); addShadowMunger(m); } else if (declare instanceof DeclarePrecedence) { declareDominates.add(declare); } else if (de...
public void addDeclare(Declare declare) { // this is not extensible, oh well if (declare instanceof DeclareErrorOrWarning) { ShadowMunger m = new Checker((DeclareErrorOrWarning)declare); addShadowMunger(m); } else if (declare instanceof DeclarePrecedence) { declareDominates.add(declare); } else if (de...
public static final String PLATFORM = "carbon"; }
public static final String PLATFORM = "carbon"; //$NON-NLS-1$ }
public static final String PLATFORM = "photon"; }
public static final String PLATFORM = "photon"; //$NON-NLS-1$ }
public static final String PLATFORM = "win32"; }
public static final String PLATFORM = "win32"; //$NON-NLS-1$ }
protected void setId(final String id) { this.id = id; } }
public void setId(final String id) { this.id = id; } }
public void setTimeout(String newTimeout) { this.setProperty(FILENAME, newTimeout); }
public void setTimeout(String newTimeout) { this.setProperty(TIMEOUT, newTimeout); }
public void addVerifyListener (VerifyListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Verify, typedListener); } int /*long*/ callWindowProc (int /*long*/ hwnd, int msg, int /*long*/ wParam, int /...
public void addVerifyListener (VerifyListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Verify, typedListener); } int /*long*/ callWindowProc (int /*long*/ hwnd, int msg, int /*long*/ wParam, int /...
protected void init() { super.init(); // Create border and add it to the page border = new LibraryApplicationBorder(this, "border"); }
protected void init() { super.init(); // Create border and add it to the page this.border = new LibraryApplicationBorder(this, "border"); }
public void setForce(boolean forceOverwrite) { this.forceOverwrite = force; }
public void setForce(boolean forceOverwrite) { this.forceOverwrite = forceOverwrite; }
public static void loadJMeterProperties(String file) { Properties p = new Properties(System.getProperties()); InputStream is = null; try { File f = new File(file); is = new FileInputStream(f); p.load(is); } catch (IOException e) { try {...
public static void loadJMeterProperties(String file) { Properties p = new Properties(System.getProperties()); InputStream is = null; try { File f = new File(file); is = new FileInputStream(f); p.load(is); } catch (IOException e) { try {...
protected void synchronizeData() { // no need to sync in the future needsSyncData(false); // fluff data DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) ownerDocument(); int attrQName = ownerDocument.getNodeName(fNodeIndex); StringPool pool = ownerDo...
protected void synchronizeData() { // no need to sync in the future needsSyncData(false); // fluff data DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) ownerDocument(); int attrQName = ownerDocument.getNodeName(fNodeIndex); StringPool pool = ownerDo...
public static Object clone(final Object object) { if (object == null) { return null; } else { try { final ByteArrayOutputStream out = new ByteArrayOutputStream(); new ObjectOutputStream(out).writeObject(object); return new ObjectInputStream(new ByteArrayInputStream(out.toByteArray())) ...
public static Object clone(final Object object) { if (object == null) { return null; } else { try { final ByteArrayOutputStream out = new ByteArrayOutputStream(256); new ObjectOutputStream(out).writeObject(object); return new ObjectInputStream(new ByteArrayInputStream(out.toByteArray())...
public void handleEvent (Event event) { log (event); } }; for (int i = 0; i < EVENT_NAMES.length; i++) { if (eventsFilter [i]) widget.addListener (((Integer)EVENT_NAMES[i][1]).intValue(), listener); } } } /** * Logs an untyped event to the event console. */ void log(Event event) { ...
public void handleEvent (Event event) { log (event); } }; for (int i = 0; i < EVENT_NAMES.length; i++) { if (eventsFilter [i]) widget.addListener (((Integer)EVENT_NAMES[i][1]).intValue(), listener); } } } /** * Logs an untyped event to the event console. */ void log(Event event) { ...
public void handleEvent (Event e) { System.out.println ("Select All"); } }); item.setText ("Select &All\tCtrl+A"); item.setAccelerator (SWT.CTRL + 'A'); shell.setSize (200, 200); shell.open (); while (!shell.isDisposed()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); }
public void handleEvent (Event e) { System.out.println ("Select All"); } }); item.setText ("Select &All\tCtrl+A"); item.setAccelerator (SWT.MOD1 + 'A'); shell.setSize (200, 200); shell.open (); while (!shell.isDisposed()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); }
private boolean validateDocument(String document) { System.out.println(document); HtmlDocumentValidator validator = new HtmlDocumentValidator(); Tag html = new Tag("html"); Tag head = new Tag("head"); html.addExpectedChild(head); Tag title = new Tag("title"); head.addExpectedChild(title); title.add...
private boolean validateDocument(String document) { System.out.println(document); HtmlDocumentValidator validator = new HtmlDocumentValidator(); Tag html = new Tag("html"); Tag head = new Tag("head"); html.addExpectedChild(head); Tag title = new Tag("title"); head.addExpectedChild(title); title.add...
public AndTypePattern(TypePattern left, TypePattern right) { super(false); //??? we override all methods that care about includeSubtypes this.left = left; this.right = right; setLocation(left.getSourceContext(), left.getStart(), right.getEnd()); }
public AndTypePattern(TypePattern left, TypePattern right) { super(false,false); //??? we override all methods that care about includeSubtypes this.left = left; this.right = right; setLocation(left.getSourceContext(), left.getStart(), right.getEnd()); }
public NotTypePattern(TypePattern pattern) { super(false); //??? we override all methods that care about includeSubtypes this.pattern = pattern; setLocation(pattern.getSourceContext(), pattern.getStart(), pattern.getEnd()); }
public NotTypePattern(TypePattern pattern) { super(false,false); //??? we override all methods that care about includeSubtypes this.pattern = pattern; setLocation(pattern.getSourceContext(), pattern.getStart(), pattern.getEnd()); }
public OrTypePattern(TypePattern left, TypePattern right) { super(false); //??? we override all methods that care about includeSubtypes this.left = left; this.right = right; setLocation(left.getSourceContext(), left.getStart(), right.getEnd()); }
public OrTypePattern(TypePattern left, TypePattern right) { super(false,false); //??? we override all methods that care about includeSubtypes this.left = left; this.right = right; setLocation(left.getSourceContext(), left.getStart(), right.getEnd()); }
public final String getJavascriptWidgetId() { return "YAHOO.wicket." + getJavascriptId(); }
public final String getJavascriptWidgetId() { return "YAHOO.org.apache.wicket." + getJavascriptId(); }
public void run() { running = true; long time; totalLag = 0; count = 0; while (running) { time = System.currentTimeMillis(); try { Thread.sleep(incr); } catch (Exception e) { } time = System.currentTimeMillis() - time; totalLag += time - incr; count++; } }
public void run() { running = true; long time; totalLag = 0; count = 0; while (running) { time = System.currentTimeMillis(); try { Thread.sleep(incr); } catch (InterruptedException e) { } time = System.currentTimeMillis() - time; totalLag += time - incr; count++; } }
public void setParameters(Collection parameters) throws InvalidVariableException { } static Object getNamedFunction(String functionName) throws InvalidVariableException { if (functions.containsKey(functionName)) { try { return (Function) ((Class) functions.get(functionName)).newInstance(); } catch (Exce...
public void setParameters(Collection parameters) throws InvalidVariableException { } static Object getNamedFunction(String functionName) throws InvalidVariableException { if (functions.containsKey(functionName)) { try { return ((Class) functions.get(functionName)).newInstance(); } catch (Exception e) { ...
public SampleResult sample(Entry e) { trace("sample()"); SampleResult res = new SampleResult(); boolean isOK = false; // Did sample succeed? String data = getData(); // Sampler data String response = null; res.setSampleLabel(getTitle()); /* * Perform the sampling */ res.sampleStart(); // Start t...
public SampleResult sample(Entry e) { trace("sample()"); SampleResult res = new SampleResult(); boolean isOK = false; // Did sample succeed? String data = getData(); // Sampler data String response = null; res.setSampleLabel(getTitle()); /* * Perform the sampling */ res.sampleStart(); // Start t...
protected Tag createTag(TagData tagData, Tag tag, String url) throws ParserException { String baseUrl = (String) tag.getAttribute("HREF"); String absoluteBaseUrl = ""; if (baseUrl != null && baseUrl.length() > 0) { absoluteBaseUrl = LinkProcessor.removeLastSlash(baseUrl.trim()); processor.setBaseUrl(absolu...
protected Tag createTag(TagData tagData, Tag tag, String url) throws ParserException { String baseUrl = (String) tag.getAttribute("HREF"); String absoluteBaseUrl = ""; if (baseUrl != null && baseUrl.length() > 0) { absoluteBaseUrl = baseUrl.trim(); processor.setBaseUrl(absoluteBaseUrl); } return new Ba...
public static Object get(Object key) { return (OnMessageSubscriber) client_map.get(key); }
public static Object get(Object key) { return client_map.get(key); }
public SampleResult sample(Entry e) { SampleResult res = new SampleResult(); boolean isSuccessful = false; res.setSampleLabel(getName()); res.setSamplerData(getPropertyAsString(TEST));// TODO improve this LdapClient ldap = new LdapClient(); try { ldap.connect(getServername(), getPort(), getRootdn(), ge...
public SampleResult sample(Entry e) { SampleResult res = new SampleResult(); boolean isSuccessful = false; res.setSampleLabel(getName()); res.setSamplerData(getPropertyAsString(TEST));// TODO improve this LdapClient ldap = new LdapClient(); try { ldap.connect(getServername(), getPort(), getRootdn(), ge...
public void showSelection () { checkWidget (); OS.SendMessage (handle, OS.EM_SCROLLCARET, 0, 0); } String verifyText (String string, int start, int end, Event keyEvent) { if (ignoreVerify) return string; Event event = new Event (); event.text = string; event.start = start; event.end = end; if (keyEvent != null...
public void showSelection () { checkWidget (); OS.SendMessage (handle, OS.EM_SCROLLCARET, 0, 0); } String verifyText (String string, int start, int end, Event keyEvent) { if (ignoreVerify) return string; Event event = new Event (); event.text = string; event.start = start; event.end = end; if (keyEvent != null...
// public int compare (Object object1, Object object2) { // TableItem item1 = (TableItem) object1, item2 = (TableItem) object2; // if (sortDirection == SWT.UP || sortDirection == SWT.NONE) { // return item1.getText (index).compareTo (item2.getText (index)); // } else { // return item2.getText (index).compa...
// public int compare (Object object1, Object object2) { // TableItem item1 = (TableItem) object1, item2 = (TableItem) object2; // if (sortDirection == SWT.UP || sortDirection == SWT.NONE) { // return item1.getText (index).compareTo (item2.getText (index)); // } else { // return item2.getText (index).compa...