buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public void clear (); }
public void removeAllItems (); }
public static Test suite() { TestSuite suite = new TestSuite("Java5/AspectJ5 tests"); //$JUnit-BEGIN$ suite.addTestSuite(MigrationTests.class); suite.addTest(Ajc150Tests.suite()); suite.addTestSuite(SCCSFixTests.class); suite.addTest(AccBridgeMethods.suite()); suite.addTestSuite(CovarianceTests....
public static Test suite() { TestSuite suite = new TestSuite("AspectJ1.5.0 tests"); //$JUnit-BEGIN$ suite.addTestSuite(MigrationTests.class); suite.addTest(Ajc150Tests.suite()); suite.addTestSuite(SCCSFixTests.class); suite.addTest(AccBridgeMethods.suite()); suite.addTestSuite(CovarianceTests.cl...
public Set<? extends Type> getKnownTypes() { final Set<Type> result = new HashSet(typeNameCache.getValues()); result.remove(null); return result; }
public Set<? extends Type> getKnownTypes() { final Set<Type> result = new HashSet<Type>(typeNameCache.getValues()); result.remove(null); return result; }
private Annotation getAnnotation(final int offset, final int length) { final IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput()); if (model == null) return null; Iterator iterator; if (model instanceof IAnnotationModelExtension2) { iterator = ((IAnnotationModelExtension2)...
private Annotation getAnnotation(final int offset, final int length) { final IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput()); if (model == null) return null; Iterator<?> iterator; if (model instanceof IAnnotationModelExtension2) { iterator = ((IAnnotationModelExtensio...
public void setTestPlanFile(String f) { testPlanFile = f; getMainFrame().setTitle(JMeterUtils.getExtendedFrameTitle(testPlanFile)); // Enable file revert action if a file is used getMainFrame().setFileRevertEnabled(f != null); getMainFrame().setProjectFileLoaded(f); try { FileSe...
public void setTestPlanFile(String f) { testPlanFile = f; getMainFrame().setExtendedFrameTitle(testPlanFile); // Enable file revert action if a file is used getMainFrame().setFileRevertEnabled(f != null); getMainFrame().setProjectFileLoaded(f); try { FileServer.getFileServer().s...
protected void zipFile( File file, ZipOutputStream zOut, String vPath ) throws IOException { // If the file being added is WEB-INF/web.xml, we warn if it's not the // one specified in the "webxml" attribute - or if it's being added twice, // meaning the same file is specified by ...
protected void zipFile( File file, ZipOutputStream zOut, String vPath ) throws IOException, TaskException { // If the file being added is WEB-INF/web.xml, we warn if it's not the // one specified in the "webxml" attribute - or if it's being added twice, // meaning the same file i...
protected void zipFile( File file, ZipOutputStream zOut, String vPath ) throws IOException { // If the file being added is WEB-INF/web.xml, we warn if it's not the // one specified in the "webxml" attribute - or if it's being added twice, // meaning the same file is specified by ...
protected void zipFile( File file, ZipOutputStream zOut, String vPath ) throws IOException, TaskException { // If the file being added is WEB-INF/web.xml, we warn if it's not the // one specified in the "webxml" attribute - or if it's being added twice, // meaning the same file i...
protected void onComponentTag(final ComponentTag tag) { // Default handling for component tag super.onComponentTag(tag); // must be attached to <input type="checkbox" .../> tag checkComponentTag(tag, "input"); checkComponentTagAttribute(tag, "type", "checkbox"); CheckGroup group = (CheckGroup)findParent...
protected void onComponentTag(final ComponentTag tag) { // Default handling for component tag super.onComponentTag(tag); // must be attached to <input type="checkbox" .../> tag checkComponentTag(tag, "input"); checkComponentTagAttribute(tag, "type", "checkbox"); CheckGroup group = (CheckGroup)findParent...
protected void onComponentTag(final ComponentTag tag) { // Default handling for component tag super.onComponentTag(tag); // must be attached to <input type="radio" .../> tag checkComponentTag(tag, "input"); checkComponentTagAttribute(tag, "type", "radio"); RadioGroup group = (RadioGroup)findParent(Radio...
protected void onComponentTag(final ComponentTag tag) { // Default handling for component tag super.onComponentTag(tag); // must be attached to <input type="radio" .../> tag checkComponentTag(tag, "input"); checkComponentTagAttribute(tag, "type", "radio"); RadioGroup group = (RadioGroup)findParent(Radio...
public void widgetSelected(SelectionEvent event) { if (!((Button) event.widget).getSelection ()) return; setExampleWidgetAlignment (); }; }; leftButton.addSelectionListener (selectionListener); centerButton.addSelectionListener (selectionListener); rightButton.addSelectionListener (selectionListen...
public void widgetSelected(SelectionEvent event) { if (!((Button) event.widget).getSelection ()) return; setExampleWidgetAlignment (); } }; leftButton.addSelectionListener (selectionListener); centerButton.addSelectionListener (selectionListener); rightButton.addSelectionListener (selectionListene...
public void widgetSelected(SelectionEvent event) { if (!((Button) event.widget).getSelection()) return; setExampleWidgetAlignment (); }; }; upButton.addSelectionListener(selectionListener); downButton.addSelectionListener(selectionListener); } /** * Creates the "Example" group. */ void crea...
public void widgetSelected(SelectionEvent event) { if (!((Button) event.widget).getSelection()) return; setExampleWidgetAlignment (); } }; upButton.addSelectionListener(selectionListener); downButton.addSelectionListener(selectionListener); } /** * Creates the "Example" group. */ void creat...
public void widgetSelected(SelectionEvent event) { if ((event.widget.getStyle() & SWT.RADIO) != 0) { if (!((Button) event.widget).getSelection ()) return; } recreateExampleWidgets (); }; }; shadowInButton.addSelectionListener (selectionListener); shadowOutButton.addSelectionListener (select...
public void widgetSelected(SelectionEvent event) { if ((event.widget.getStyle() & SWT.RADIO) != 0) { if (!((Button) event.widget).getSelection ()) return; } recreateExampleWidgets (); } }; shadowInButton.addSelectionListener (selectionListener); shadowOutButton.addSelectionListener (selecti...
public void widgetSelected(SelectionEvent event) { if ((event.widget.getStyle() & SWT.RADIO) != 0) { if (!((Button) event.widget).getSelection ()) return; } recreateExampleWidgets (); }; }; topButton.addSelectionListener (selectionListener); bottomButton.addSelectionListener (selectionListe...
public void widgetSelected(SelectionEvent event) { if ((event.widget.getStyle() & SWT.RADIO) != 0) { if (!((Button) event.widget).getSelection ()) return; } recreateExampleWidgets (); } }; topButton.addSelectionListener (selectionListener); bottomButton.addSelectionListener (selectionListen...
public void widgetSelected(SelectionEvent event) { if (!((Button) event.widget).getSelection ()) return; recreateExampleWidgets (); }; }; shadowEtchedInButton.addSelectionListener (selectionListener); shadowEtchedOutButton.addSelectionListener (selectionListener); shadowInButton.addSelectionListen...
public void widgetSelected(SelectionEvent event) { if (!((Button) event.widget).getSelection ()) return; recreateExampleWidgets (); } }; shadowEtchedInButton.addSelectionListener (selectionListener); shadowEtchedOutButton.addSelectionListener (selectionListener); shadowInButton.addSelectionListene...
public void widgetSelected(SelectionEvent event) { if ((event.widget.getStyle() & SWT.RADIO) != 0) { if (!((Button) event.widget).getSelection ()) return; } recreateExampleWidgets (); }; }; shadowInButton.addSelectionListener (selectionListener); shadowOutButton.addSelectionListener (select...
public void widgetSelected(SelectionEvent event) { if ((event.widget.getStyle() & SWT.RADIO) != 0) { if (!((Button) event.widget).getSelection ()) return; } recreateExampleWidgets (); } }; shadowInButton.addSelectionListener (selectionListener); shadowOutButton.addSelectionListener (selecti...
public void widgetSelected (SelectionEvent e) { setWidgetIncrement (); }; }); } /** * Create a group of widgets to control the page increment * attribute of the example widget. */ void createPageIncrementGroup() { /* Create the group */ Group pageIncrementGroup = new Group (controlGroup, ...
public void widgetSelected (SelectionEvent e) { setWidgetIncrement (); } }); } /** * Create a group of widgets to control the page increment * attribute of the example widget. */ void createPageIncrementGroup() { /* Create the group */ Group pageIncrementGroup = new Group (controlGroup, S...
public boolean signIn(final String username, final String password) { return true; } }; this.panel.setPersistent(true); this.form = (Form)panel.get("signInForm"); final ICrypt crypt = application.getCrypt(); final String encryptedPassword ...
public boolean signIn(final String username, final String password) { return true; } }; this.panel.setPersistent(true); this.form = (Form)panel.get("signInForm"); final ICrypt crypt = application.newCrypt(); final String encryptedPassword ...
private Markup loadMarkup(final String key, final IResourceStream markupResource) { try { synchronized (markupCache) { final Markup markup = application.getMarkupParser().readAndParse(markupResource); markupCache.put(key, markup); return markup; } } catch (ParseException e) { log.err...
private Markup loadMarkup(final String key, final IResourceStream markupResource) { try { synchronized (markupCache) { final Markup markup = application.newMarkupParser().readAndParse(markupResource); markupCache.put(key, markup); return markup; } } catch (ParseException e) { log.err...
public void testInfiniteLoop() throws Exception { LoopController loop = new LoopController(); loop.setLoops(-1); loop.addTestElement(new TestSampler("never run")); loop.setRunningVersion(true); loop.initialize(); for (int i = 0; i < 42; i++...
public void testInfiniteLoop() throws Exception { LoopController loop = new LoopController(); loop.setLoops(LoopController.INFINITE_LOOP_COUNT); loop.addTestElement(new TestSampler("never run")); loop.setRunningVersion(true); loop.initialize(); ...
protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) { final StringBuffer buffer = new StringBuffer(); final Object selected = getModelObject(); final IChoiceList choices = getChoices(); // Append default option buffer.append(getDefaultChoice(selected)); for ...
protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) { final StringBuffer buffer = new StringBuffer(); final Object selected = getModelObject(); final IChoiceList choices = getChoices(); // Append default option buffer.append(getDefaultChoice(selected)); for ...
protected final void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) { // Buffer to hold generated body final StringBuffer buffer = new StringBuffer(); // Iterate through choices final IChoiceList choices = getChoices(); // Loop through choices for (int i = 0; i < choi...
protected final void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) { // Buffer to hold generated body final StringBuffer buffer = new StringBuffer(); // Iterate through choices final IChoiceList choices = getChoices(); // Loop through choices for (int i = 0; i < choi...
public static void clearIncrementalStates() { for (Iterator iter = incrementalStates.values().iterator(); iter.hasNext();) { AjState element = (AjState) iter.next(); element.wipeAllKnowledge(); } incrementalStates.clear(); AsmManager.getDefault().createNewASM(); // forget what you know... }
public static void clearIncrementalStates() { for (Iterator iter = incrementalStates.values().iterator(); iter.hasNext();) { AjState element = (AjState) iter.next(); element.wipeAllKnowledge(); } incrementalStates.clear(); AsmManager.getDefault().createNewASM(null); // forget what you know... }
public Object convert(Object value, Class toType, Locale locale) { Converter converter = null; Object converted = null; try { converter = converterRegistry.lookup(toType, locale); if (converter != null) // we found a converter { ...
public Object convert(Object value, Class toType, Locale locale) { IConverter converter = null; Object converted = null; try { converter = converterRegistry.lookup(toType, locale); if (converter != null) // we found a converter { ...
public void run() { activate(); Message reply; while (isActive()) { reply = null; try { reply = consumer.receive(5000); if (reply != null) { if (log.isDebugEnabled()) { log.debug("Received m...
public void run() { activate(); Message reply; while (isActive()) { reply = null; try { reply = consumer.receive(5000); if (reply != null) { if (log.isDebugEnabled()) { log.debug("Received m...
private RSSUtils() {} static int[] getRSSwidths(int val, int n, int elements, int maxWidth, boolean noNarrow) { int[] widths = new int[elements]; int bar; int narrowMask = 0; for (bar = 0; bar < elements - 1; bar++) { narrowMask |= (1 << bar); int elmWidth = 1; int subVal; w...
public static int getRSSvalue(int[] widths, int maxWidth, boolean noNarrow) { int elements = widths.length; int n = 0; for (int i = 0; i < elements; i++) { n += widths[i]; } int val = 0; int narrowMask = 0; for (int bar = 0; bar < elements - 1; bar++) { int elmWidth; for ...
protected OpenJPAEntityManagerFactory getEmf(Map props) { props.put("openjpa.BrokerFactory", BrokerFactoryTest.class.getName()); return (OpenJPAEntityManagerFactory) getEmf(props); }
protected OpenJPAEntityManagerFactory getEmf(Map props) { props.put("openjpa.BrokerFactory", BrokerFactoryTest.class.getName()); return (OpenJPAEntityManagerFactory) super.getEmf(props); }
public static String getSourceLocation() { RuntimeException ex = new RuntimeException("assertion failed"); StringWriter writer = new StringWriter(); PrintWriter printer = new PrintWriter(writer); ex.printStackTrace(printer); String buf = writer.toString(); // skip the first line as well as every line related ...
public static String getSourceLocation() { RuntimeException ex = new RuntimeException("assertion failed"); StringWriter writer = new StringWriter(); PrintWriter printer = new PrintWriter(writer); ex.printStackTrace(printer); String buf = writer.toString(); // skip the first line as well as every line related ...
public XML11Configuration( SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings) { super(parentSettings); // create a vector to hold all the components in use // XML 1.0 specialized components fComponents = new ArrayList(); // XML 1.1 speciali...
public XML11Configuration( SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings) { super(parentSettings); // create a vector to hold all the components in use // XML 1.0 specialized components fComponents = new ArrayList(); // XML 1.1 speciali...
public void testHelloWorld() throws Exception { WicketTester tester = new WicketTester(new RepeaterApplication()); tester.startPage(Index.class); tester.assertContains("Wicket Examples - repeater views"); checkPage(tester, RepeatingPage.class); checkPage(tester, RefreshingPage.class); checkPage(tester, F...
public void testHelloWorld() throws Exception { WicketTester tester = new WicketTester(new RepeaterApplication()); tester.startPage(Index.class); tester.assertContains("Wicket Examples - repeater views"); checkPage(tester, RepeatingPage.class); checkPage(tester, RefreshingPage.class); checkPage(tester, F...
public interface 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 License, Versio...
public interface 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 License, Versio...
public abstract Resource getResource(); }
public abstract IResource getResource(); }
public interface IApplicationSettings /* * 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, V...
public interface IApplicationSettings /* * 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, V...
public void configure( final Configuration configuration ) throws ConfigurationException { final String[] attributes = configuration.getAttributeNames(); for( int i = 0; i < attributes.length; i++ ) { final String name = attributes[ i ]; final String value...
public void configure( final Configuration configuration ) throws ConfigurationException { final String[] attributes = configuration.getAttributeNames(); for( int i = 0; i < attributes.length; i++ ) { final String name = attributes[ i ]; final String value...
public void configure( final Configuration configuration ) throws ConfigurationException { final String[] attributes = configuration.getAttributeNames(); for( int i = 0; i < attributes.length; i++ ) { final String name = attributes[ i ]; final String value...
public void configure( final Configuration configuration ) throws ConfigurationException { final String[] attributes = configuration.getAttributeNames(); for( int i = 0; i < attributes.length; i++ ) { final String name = attributes[ i ]; final String value...
protected String getTypeName() { return m_type; } }
protected String getRoleShorthand() { return m_type; } }
public void configure( final Configuration configuration ) throws ConfigurationException { final DefaultConfiguration newConfiguration = new DefaultConfiguration( configuration.getName(), configuration.getLocation() ); final String[] attributes = configuration.getAttributeNa...
public void configure( final Configuration configuration ) throws ConfigurationException { final DefaultConfiguration newConfiguration = new DefaultConfiguration( configuration.getName(), configuration.getLocation() ); final String[] attributes = configuration.getAttributeNa...
public <T> T getBean(Class<T> requiredType) throws BeansException { Iterator<T> beans = getBeansOfType(requiredType).values().iterator(); if (beans.hasNext() == false) { throw new NoSuchBeanDefinitionException("bean of required type " + requiredType + " not found"); } final T bean = beans.next(); ...
public <T> T getBean(Class<T> requiredType) throws BeansException { Iterator<T> beans = getBeansOfType(requiredType).values().iterator(); if (beans.hasNext() == false) { throw new NoSuchBeanDefinitionException("bean of required type " + requiredType + " not found"); } final T bean = beans.next(); ...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0, height = 0; if (txnObject == 0) { if ((style & SWT.RIGHT) != 0) { OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlEditTextSingleLineTag, 1, new byte [] {1}); } Rect rect = new Rect (); OS.GetBe...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0, height = 0; if (txnObject == 0) { if ((style & SWT.RIGHT) != 0) { OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlEditTextSingleLineTag, 1, new byte [] {1}); } Rect rect = new Rect (); OS.GetBe...
public EndpointListenerHolder[] getMatchingEndpointListenerHolders( ServiceReference[] refs, EndpointDescription description) { if (refs == null) return null; List results = new ArrayList(); for (int i = 0; i < refs.length; i++) { EndpointListener listener = (EndpointListener) context .getService(r...
public EndpointListenerHolder[] getMatchingEndpointListenerHolders( ServiceReference[] refs, EndpointDescription description) { if (refs == null) return null; List results = new ArrayList(); for (int i = 0; i < refs.length; i++) { EndpointListener listener = (EndpointListener) context .getService(r...
protected URI createURI(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser, IServiceTypeID serviceTypeID, String serviceName) throws URISyntaxException { String path = "/" + serviceName; String str = endpointDescription.getContainerID().getName(); URI uri = null; while (true) { t...
protected URI createURI(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser, IServiceTypeID serviceTypeID, String serviceName) throws URISyntaxException { String path = "/" + serviceName; String str = endpointDescription.getId(); URI uri = null; while (true) { try { uri = new ...
private Collection<Function> getCandidates (Object... params) { final FunctionDefContextImpl fdc = (FunctionDefContextImpl) createEmptyFdc (new CompositeTypesystem ()); return new PolymorphicResolver ("operatorPlus").getBestFitCandidates (fdc.findFunctionCandidates (createEmptyExecutionContext(), "o...
private Collection<Function> getCandidates (Object... params) { final FunctionDefContextImpl fdc = (FunctionDefContextImpl) createEmptyFdc (new CompositeTypesystem ()); return new PolymorphicResolver ("operatorPlus").getBestFitCandidates (fdc.findFunctionCandidates ("operatorPlus", fdc.typesForParam...
protected final void onComponentTag(final ComponentTag tag) { super.onComponentTag(tag); tag.put("multiple", true); tag.put("size", Math.min(maxRows, getChoices().size())); }
protected final void onComponentTag(final ComponentTag tag) { super.onComponentTag(tag); tag.put("multiple", "multiple"); tag.put("size", Math.min(maxRows, getChoices().size())); }
public void setProtocol(String value) { setProperty(PROTOCOL, value); }
public void setProtocol(String value) { setProperty(PROTOCOL, value.toLowerCase()); }
private String qualify(Identifier name) { String value = name.getValue(); if (name.getNext() != null) { value += SyntaxConstants.NS_DELIM + qualify(name.getNext()); } return value; } }
public static String qualify(Identifier name) { String value = name.getValue(); if (name.getNext() != null) { value += SyntaxConstants.NS_DELIM + qualify(name.getNext()); } return value; } }
protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { CTabFolder folder = (CTabFolder)composite; CTabItem[] items = folder.items; // preferred width of tab area to show all tabs int tabW = 0; GC gc = new GC(folder); for (int i = 0; i < items.length; i++) { if (folder.singl...
protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { CTabFolder folder = (CTabFolder)composite; CTabItem[] items = folder.items; // preferred width of tab area to show all tabs int tabW = 0; GC gc = new GC(folder); for (int i = 0; i < items.length; i++) { if (folder.singl...
protected void addParentDirs(File baseDir, String entry, ZipOutputStream zOut, String prefix) throws IOException { if( !doFilesonly ) { Stack directories = new Stack(); int slashPos = entry.length(); while ((slashPos = entry.lastI...
protected void addParentDirs(File baseDir, String entry, ZipOutputStream zOut, String prefix) throws IOException { if( !doFilesonly ) { Stack directories = new Stack(); int slashPos = entry.length(); while ((slashPos = entry.lastI...
public IMarkupCache getMarkupCache() { if (this.markupCache == null) { // Construct markup cache for this application this.markupCache = new MarkupCache(); } return this.markupCache; }
public IMarkupCache getMarkupCache() { if (this.markupCache == null) { // Construct markup cache for this application this.markupCache = new MarkupCache(application); } return this.markupCache; }
public interface IColumn<T> extends ICellPopulator<T> /* * 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 A...
public interface IColumn<T> extends ICellPopulator<T> /* * 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 A...
public IConverter getConverter(Class/* <?> */type); }
public IConverter getConverter(Class< ? > type); }
private boolean isInBuildpath(ISourceModule source) throws ModelException { IScriptProject project = source.getScriptProject(); IBuildpathEntry[] entries = project.getRawBuildpath(); for (IBuildpathEntry entry : entries) { if (entry.getPath().equals(source.getParent().getPath()))...
private boolean isInBuildpath(ISourceModule source) throws ModelException { IScriptProject project = source.getScriptProject(); IBuildpathEntry[] entries = project.getRawBuildpath(); for (IBuildpathEntry entry : entries) { if (entry.getPath().isPrefixOf(source.getPath())) { ...
protected void appendDefaultButtonField(final MarkupStream markupStream, final ComponentTag openTag) { AppendingStringBuffer buffer = new AppendingStringBuffer(); // div that is not visible (but not display:none either) buffer.append("<div style=\"width:0px;height:0px;position:absolute;left:-100px;top:-100p...
protected void appendDefaultButtonField(final MarkupStream markupStream, final ComponentTag openTag) { AppendingStringBuffer buffer = new AppendingStringBuffer(); // div that is not visible (but not display:none either) buffer.append("<div style=\"width:0px;height:0px;position:absolute;left:-100px;top:-100p...
public void testopen() throws Exception { try { FS.readLine("test"); fail("Expected IOException"); } catch (IOException ignored){ } try { FS.write("test",""); fail("Expected IOException"); } catch (IOException ignored){ ...
public void testopen() throws Exception { try { FS.readLine("test"); fail("Expected IOException"); } catch (IOException ignored){ } try { FS.write("test",""); fail("Expected IOException"); } catch (IOException ignored){ ...
String exceptionType(); /* ******************************************************************* * Copyright (c) 2005 Contributors. * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution an...
String exceptionType(); /* ******************************************************************* * Copyright (c) 2005 Contributors. * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution an...
AjType getSoftenedExceptionType() throws ClassNotFoundException; /* ******************************************************************* * Copyright (c) 2005 Contributors. * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 ...
AjType getSoftenedExceptionType() throws ClassNotFoundException; /* ******************************************************************* * Copyright (c) 2005 Contributors. * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 ...
public void addAtAspectJAnnotations() { Annotation adviceAnnotation = null; String pointcutExpression = pointcutDesignator.getPointcut().toString(); String extraArgumentName = ""; if (extraArgument != null) { extraArgumentName = new String(extraArgument.name); } if (kind == AdviceKind.Before) { ad...
public void addAtAspectJAnnotations() { Annotation adviceAnnotation = null; String pointcutExpression = pointcutDesignator.getPointcut().toString(); String extraArgumentName = ""; if (extraArgument != null) { extraArgumentName = new String(extraArgument.name); } if (kind == AdviceKind.Before) { ad...
public void addURL(URL url) { this.addURL(url); }
public void addURL(URL url) { super.addURL(url); }
public WordGenerator() { try { final IResourceStream resource = Application.get().getResourceSettings().getResourceStreamLocator().locate(this.getClass(), "wicket/examples/hangman/WordList", null, Locale.getDefault(), ".txt"); final String wordlist = Streams.readString(resource.getInputStream()); t...
public WordGenerator() { try { final IResourceStream resource = Application.get().getResourceSettings().getResourceStreamFactory().locate(this.getClass(), "wicket/examples/hangman/WordList", null, Locale.getDefault(), ".txt"); final String wordlist = Streams.readString(resource.getInputStream()); th...
protected void mergeIn(TestElement element) { PropertyIterator iter = element.propertyIterator(); while (iter.hasNext()) { JMeterProperty prop = iter.next(); addProperty(prop, false); } }
protected void mergeIn(TestElement element) { PropertyIterator iter = element.propertyIterator(); while (iter.hasNext()) { JMeterProperty prop = iter.next(); addProperty(prop, true); } }
protected void buildMap(File fromDir, File toDir, String[] names, FileNameMapper mapper, Hashtable map) { String[] toCopy = null; if (forceOverwrite) { toCopy = names; } else { SourceFileScanner ds = new SourceFileScanner(); to...
protected void buildMap(File fromDir, File toDir, String[] names, FileNameMapper mapper, Hashtable map) { String[] toCopy = null; if (forceOverwrite) { toCopy = names; } else { SourceFileScanner ds = new SourceFileScanner(this); ...
public void setURI(String uri) throws BuildException { if (uri.equals(ProjectHelper.ANT_CORE_URI)) { uri = ""; } if (uri.startsWith("ant:") && !uri.startsWith("antlib:")) { throw new BuildException("Attempt to use a reserved URI " + uri); } this.uri = ...
public void setURI(String uri) throws BuildException { if (uri.equals(ProjectHelper.ANT_CORE_URI)) { uri = ""; } if (uri.startsWith("ant:")) { throw new BuildException("Attempt to use a reserved URI " + uri); } this.uri = uri; }
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals(ExitCommand.EXIT)) { doAction(e); } }
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals(ActionNames.EXIT)) { doAction(e); } }
private CMNode multiNodes(CMNode node, int num, boolean copyFirst) { if (num == 0) { return null; } if (num == 1) { return copyFirst ? copyNode(node) : node; } int num1 = num/2; return fNodeFactory.getCMBinOpNode(XSModelGroupImpl.MODELGROUP_SEQ...
private CMNode multiNodes(CMNode node, int num, boolean copyFirst) { if (num == 0) { return null; } if (num == 1) { return copyFirst ? copyNode(node) : node; } int num1 = num/2; return fNodeFactory.getCMBinOpNode(XSModelGroupImpl.MODELGROUP_SEQ...
public final MarkupContainer replace(final Component child) { if (child == null) { throw new IllegalArgumentException("argument child must be not null"); } if (log.isDebugEnabled()) { log.debug("Replacing " + child.getId() + " in " + this); } if (child.getParent() != this) { // Add to map ...
public final MarkupContainer replace(final Component child) { if (child == null) { throw new IllegalArgumentException("argument child must be not null"); } if (log.isDebugEnabled()) { log.debug("Replacing " + child.getId() + " in " + this); } if (child.getParent() != this) { // Add to map ...
public static void main(String args[]) throws Exception { System.out.println(" --- " + org.apache.xerces.framework.Version.fVersion + " --- "); Document doc = getNodeSet1(); NodeFilter nodefilter = null; boolean entityReferenceE...
public static void main(String args[]) throws Exception { System.out.println(" --- " + org.apache.xerces.impl.Version.fVersion + " --- "); Document doc = getNodeSet1(); NodeFilter nodefilter = null; boolean entityReferenceExpans...
public static void generateProxyCA(File keystore, String password, int validity) throws IOException { keystore.delete(); // any existing entries will be invalidated anyway // not strictly needed if(!new File(CACERT).delete()) { // Noop as we accept not to be able to delete it ...
public static void generateProxyCA(File keystore, String password, int validity) throws IOException { keystore.delete(); // any existing entries will be invalidated anyway // not strictly needed if(new File(CACERT).exists() && !new File(CACERT).delete()) { // Noop as we accept n...
public SchemaTool(JDBCConfiguration conf, String action) { if (action != null && !Arrays.asList(ACTIONS).contains(action)) throw new IllegalArgumentException("action == " + action); _conf = conf; _action = action; _ds = conf.getDataSource2(null); _log = conf.getL...
public SchemaTool(JDBCConfiguration conf, String action) { if (action != null && !Arrays.asList(ACTIONS).contains(action)) throw new IllegalArgumentException("action == " + action); _conf = conf; _action = action; _ds = ACTION_BUILD.equals(action) ? null : conf.getDataSo...
public static OutputStream createOutputStream(String uri) throws IOException { // URI was specified. Handle relative URIs. String expanded = XMLEntityManager.expandSystemId(uri, null, true); URL url = new URL(expanded != null ? expanded : uri); OutputStream out = null; String...
public static OutputStream createOutputStream(String uri) throws IOException { // URI was specified. Handle relative URIs. String expanded = XMLEntityManager.expandSystemId(uri, null, true); URL url = new URL(expanded != null ? expanded : uri); OutputStream out = null; String...
protected int namespaceCompareTo(BaseID o) { if (this == o) return 0; if (!this.getClass().equals(o.getClass())) return Integer.MIN_VALUE; return this.uri.compareTo(((URIID) o).uri); }
protected int namespaceCompareTo(BaseID o) { if (this == o) return 0; if (!this.getClass().equals(o.getClass())) return Integer.MIN_VALUE; return this.uri.compareTo((Object) ((URIID) o).uri); }
public String toString() { return index + "-" + (index + blockLength); }
public String toString() { return index + "-" + (index + blockLength); //$NON-NLS-1$ }
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = DEFAULT_WIDTH; int height = DEFAULT_HEIGHT; if ((style & SWT.SEPARATOR) != 0) { float /*double*/ lineWidth = ((NSBox)view).borderWidth (); if ((style & SWT.HORIZONTAL) != 0) { height = (int)Math.ceil (lineWidth * 2)...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = DEFAULT_WIDTH; int height = DEFAULT_HEIGHT; if ((style & SWT.SEPARATOR) != 0) { float /*double*/ lineWidth = ((NSBox)view).borderWidth (); if ((style & SWT.HORIZONTAL) != 0) { height = (int)Math.ceil (lineWidth * 2)...
public int getDigits () { checkWidget (); return OS.gtk_spin_button_get_digits (handle); } String getDecimalSeparator () { int /*long*/ ptr = OS.localeconv_decimal_point (); int length = OS.strlen (ptr); byte [] buffer = new byte [length]; OS.memmove (buffer, ptr, length); return new String (Converter.mbcsToWc...
public int getDigits () { checkWidget (); return OS.gtk_spin_button_get_digits (handle); } String getDecimalSeparator () { int /*long*/ ptr = OS.localeconv_decimal_point (); int length = OS.strlen (ptr); byte [] buffer = new byte [length]; OS.memmove (buffer, ptr, length); return new String (Converter.mbcsToWc...
private int primaryKeyOperation(ClassMapping mapping, boolean sel, Boolean asc, Joins joins, boolean aliasOrder) { if (!sel && asc == null) return 0; // if this mapping can't select the full pk values, then join to // super and recurse ClassMapping sup; i...
private int primaryKeyOperation(ClassMapping mapping, boolean sel, Boolean asc, Joins joins, boolean aliasOrder) { if (!sel && asc == null) return 0; // if this mapping can't select the full pk values, then join to // super and recurse ClassMapping sup; i...
protected void checkOptions() throws BuildException { if (tofile == null) { throw new BuildException("'tofile' attribute must be set."); } if (snapshot == null) { throw new BuildException("'snapshot' attribute must be set."); } if (home == null) { ...
protected void checkOptions() throws BuildException { if (tofile == null) { throw new BuildException("'tofile' attribute must be set."); } if (snapshot == null) { throw new BuildException("'snapshot' attribute must be set."); } if (home == null) { ...
protected void checkOptions() throws BuildException { // check coverage home if (home == null || !home.isDirectory()) { throw new BuildException("Invalid home directory. Must point to JProbe home directory"); } home = new File(home, "Coverage"); File jar = new Fil...
protected void checkOptions() throws BuildException { // check coverage home if (home == null || !home.isDirectory()) { throw new BuildException("Invalid home directory. Must point to JProbe home directory"); } home = new File(home, "coverage"); File jar = new Fil...
public Move() { setForceOverwrite( true ); }
public Move() { setOverwrite( true ); }
public void addArc(float x, float y, float width, float height, float startAngle, float arcAngle) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); float[] cmt = new float[6]; OS.CGAffineTransformMake(width / 2f, 0, 0, height / 2f, x + width / 2f, y + height / 2f, cmt); if (arcAngle < 0) { OS.CGPathAddAr...
public void addArc(float x, float y, float width, float height, float startAngle, float arcAngle) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); float[] cmt = new float[6]; OS.CGAffineTransformMake(width / 2f, 0, 0, height / 2f, x + width / 2f, y + height / 2f, cmt); if (arcAngle < 0) { OS.CGPathAddAr...
public boolean munge(BcelClassWeaver weaver) { LazyClassGen gen = weaver.getLazyClassGen(); if (!gen.getType().equals(cflowStackField.getDeclaringType())) return false; Field f = new FieldGen(cflowStackField.getModifiers(), BcelWorld.makeBcelType(cflowStackField.getReturnType()), cflowStackField.get...
public boolean munge(BcelClassWeaver weaver) { LazyClassGen gen = weaver.getLazyClassGen(); if (!gen.getType().equals(cflowStackField.getDeclaringType())) return false; Field f = new FieldGen(cflowStackField.getModifiers(), BcelWorld.makeBcelType(cflowStackField.getReturnType()), cflowStackField.get...
* Sets the id of this component. This method is private because the only * time a component's id can be set is in its constructor. * * @param id * The non-null id of this component */ final void setId(final String id) { if (id == null && !(this instanceof Page)) { throw new WicketRuntim...
* Sets the id of this component. This method is private because the only * time a component's id can be set is in its constructor. * * @param id * The non-null id of this component */ final void setId(final String id) { if (id == null && !(this instanceof Page)) { throw new WicketRuntim...
public IValueMap getAttributes() { if (attributes == null) { if (copyOf == this) { attributes = new ValueMap(); } else { attributes = new ValueMap(copyOf.attributes); } } return attributes; }
public IValueMap getAttributes() { if (attributes == null) { if ((copyOf == this) || (copyOf == null) || (copyOf.attributes == null)) { attributes = new ValueMap(); } else { attributes = new ValueMap(copyOf.attributes); } } return attributes; }
public NumberSpinner(String id, Number minimum, Number maximum, Number stepSize) { super(id, NumberSpinnerApplet.class); appletModel = new SpinnerNumberModel(); appletModel.setValue((Comparable)getModelObject()); appletModel.setMaximum((Comparable)maximum); appletModel.setMinimum((Comparable)minimum); app...
public NumberSpinner(String id, Number minimum, Number maximum, Number stepSize) { super(id, NumberSpinnerApplet.class); appletModel = new SpinnerNumberModel(); appletModel.setValue(getModelObject()); appletModel.setMaximum((Comparable)maximum); appletModel.setMinimum((Comparable)minimum); appletModel.set...
public int fallbackCompareTo(Object other) { ConcreteTypeMunger o = (ConcreteTypeMunger) other; return 0; }
public int fallbackCompareTo(Object other) { // ConcreteTypeMunger o = (ConcreteTypeMunger) other; return 0; }
private boolean mungeNewField(BcelClassWeaver weaver, NewFieldTypeMunger munger) { ResolvedMember initMethod = munger.getInitMethod(aspectType); LazyClassGen gen = weaver.getLazyClassGen(); ResolvedMember field = munger.getSignature(); ResolvedTypeX onType = weaver.getWorld().resolve(field.getDeclarin...
private boolean mungeNewField(BcelClassWeaver weaver, NewFieldTypeMunger munger) { /*ResolvedMember initMethod = */munger.getInitMethod(aspectType); LazyClassGen gen = weaver.getLazyClassGen(); ResolvedMember field = munger.getSignature(); ResolvedTypeX onType = weaver.getWorld().resolve(field.getDecl...
// non-private for testing LazyClassGen weave(UnwovenClassFile classFile, BcelObjectType classType) throws IOException { LazyClassGen ret = weave(classFile, classType, true); if (progressListener != null) { progressMade += progressPerClassFile; progressListener.setProgress(progressMade); progressListe...
// non-private for testing LazyClassGen weave(UnwovenClassFile classFile, BcelObjectType classType) throws IOException { LazyClassGen ret = weave(classFile, classType, true); if (progressListener != null) { progressMade += progressPerClassFile; progressListener.setProgress(progressMade); progressListe...
public void xtestTraceJar() { ResolvedTypeX trace = world.resolve(TypeX.forName("Trace")); fieldsTest(trace, Member.NONE); Member constr = Member.methodFromString("void Trace.<init>()"); //XXX need attribute fix - //methodsTest(trace, new Member[] { constr }); int...
public void xtestTraceJar() { ResolvedTypeX trace = world.resolve(TypeX.forName("Trace")); fieldsTest(trace, Member.NONE); /*Member constr = */Member.methodFromString("void Trace.<init>()"); //XXX need attribute fix - //methodsTest(trace, new Member[] { constr }); ...
private void checkIllegalInstanceofMatch(String pattern, String name) { try { TypePattern p = makeTypePattern(pattern); ResolvedTypeX type = world.resolve(name); FuzzyBoolean result = p.matchesInstanceof(type); } catch (AbortException e) { return; } assertTrue("matching " + pattern + " with " + nam...
private void checkIllegalInstanceofMatch(String pattern, String name) { try { TypePattern p = makeTypePattern(pattern); ResolvedTypeX type = world.resolve(name); /*FuzzyBoolean result = */p.matchesInstanceof(type); } catch (AbortException e) { return; } assertTrue("matching " + pattern + " with " +...
protected void weaveTestInner( BcelWeaver weaver, UnwovenClassFile classFile, String name, String outName) throws IOException { //int preErrors = currentResult.errorCount(); BcelObjectType classType = (BcelObjectType) world.resolve(classFile.getClassName()); LazyClassGen gen = weaver.weave(classFi...
protected void weaveTestInner( BcelWeaver weaver, UnwovenClassFile classFile, String name, String outName) throws IOException { //int preErrors = currentResult.errorCount(); BcelObjectType classType = (BcelObjectType) world.resolve(classFile.getClassName()); LazyClassGen gen = weaver.weave(classFi...
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; } } if (args[1] != null){ file = args[1]; } if (args[2] != n...
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; } } if (args[1] != null){ file = args[1]; } if (args[2] != n...
public void execute() throws BuildException { File savedDir = dir; int err = -1; try { err = executeJava(); if (fork && Execute.isFailure(err)) { if (failOnError) { throw new BuildException("Java returned: " + err, getLocation()); ...
public void execute() throws BuildException { File savedDir = dir; int err = -1; try { err = executeJava(); if (fork && err != 0) { if (failOnError) { throw new BuildException("Java returned: " + err, getLocation()); ...
public void execute() throws BuildException { if ("javadoc2".equals(getTaskType())) { log("!! javadoc2 is deprecated. Use javadoc instead. !!"); } Vector packagesToDoc = new Vector(); Path sourceDirs = new Path(getProject()); if (packageList != null && sourcePat...
public void execute() throws BuildException { if ("javadoc2".equals(getTaskType())) { log("!! javadoc2 is deprecated. Use javadoc instead. !!"); } Vector packagesToDoc = new Vector(); Path sourceDirs = new Path(getProject()); if (packageList != null && sourcePat...
public void execute() throws BuildException { validateAttributes(); //TODO: use ANTLR to parse the grammar file to do this. File generatedFile = getGeneratedFile(); boolean targetIsOutOfDate = target.lastModified() > generatedFile.lastModified(); boolean superGra...
public void execute() throws BuildException { validateAttributes(); //TODO: use ANTLR to parse the grammar file to do this. File generatedFile = getGeneratedFile(); boolean targetIsOutOfDate = target.lastModified() > generatedFile.lastModified(); boolean superGra...
private void doit() { Commandline commandLine = new Commandline(); // build the command line from what we got the format is // ccm co /t .. files // as specified in the CCM.EXE help commandLine.setExecutable(getCcmCommand()); commandLine.createArgument().setValue(ge...
private void doit() { Commandline commandLine = new Commandline(); // build the command line from what we got the format is // ccm co /t .. files // as specified in the CCM.EXE help commandLine.setExecutable(getCcmCommand()); commandLine.createArgument().setValue(ge...
public void execute() throws BuildException { // load command line with optional attributes Enumeration iter = optionalAttrs.keys(); while (iter.hasMoreElements()) { String name = (String) iter.nextElement(); Object value = optionalAttrs.get(name); cmdl....
public void execute() throws BuildException { // load command line with optional attributes Enumeration iter = optionalAttrs.keys(); while (iter.hasMoreElements()) { String name = (String) iter.nextElement(); Object value = optionalAttrs.get(name); cmdl....
public void execute() throws BuildException { // load command line with optional attributes Enumeration iter = optionalAttrs.keys(); while (iter.hasMoreElements()) { String name = (String) iter.nextElement(); Object value = optionalAttrs.get(name); cmdl....
public void execute() throws BuildException { // load command line with optional attributes Enumeration iter = optionalAttrs.keys(); while (iter.hasMoreElements()) { String name = (String) iter.nextElement(); Object value = optionalAttrs.get(name); cmdl....
protected void execute0(ExecuteStreamHandler handler) throws BuildException { final Execute process = new Execute(handler); log(cmdl.describeCommand(), Project.MSG_VERBOSE); process.setCommandline(cmdl.getCommandline()); try { if (Execute.isFailure(process.execute())) { ...
protected void execute0(ExecuteStreamHandler handler) throws BuildException { final Execute process = new Execute(handler); log(cmdl.describeCommand(), Project.MSG_VERBOSE); process.setCommandline(cmdl.getCommandline()); try { if (process.execute() != 0) { ...
protected void _execute(ExecuteStreamHandler handler) throws BuildException { // target has been checked as a .jj, see if there is a matching // java file and if it is needed to run to process the grammar String pathname = target.getAbsolutePath(); int pos = pathname.length() - ".jj"...
protected void _execute(ExecuteStreamHandler handler) throws BuildException { // target has been checked as a .jj, see if there is a matching // java file and if it is needed to run to process the grammar String pathname = target.getAbsolutePath(); int pos = pathname.length() - ".jj"...
private Link resolveAutomaticLink(final Page page, final MarkupStream markupStream, final String componentName, final ComponentTag tag) { final String originalHref = tag.getAttributes().getString("href"); final int pos = originalHref.indexOf(".html"); if (pos <= 0) { ...
private Link resolveAutomaticLink(final Page page, final MarkupStream markupStream, final String componentName, final ComponentTag tag) { final String originalHref = tag.getAttributes().getString("href"); final int pos = originalHref.indexOf(".html"); if (pos <= 0) { ...
private String getContents(final String resource) { try { final InputStream inputStream = getClass().getClassLoader().getResourceAsStream( "org/openarchitectureware/wizards/example/" + resource); final byte[] buffer = new byte[4096]; final ByteArrayOutputStream outputStream = new ByteArrayOutputStream...
private String getContents(final String resource) { try { final InputStream inputStream = getClass().getClassLoader().getResourceAsStream( "org/eclipse/xtend/shared/ui/wizards/example/" + resource); final byte[] buffer = new byte[4096]; final ByteArrayOutputStream outputStream = new ByteArrayOutputStr...
public boolean dragDetect (MouseEvent event) { checkWidget (); if (event == null) error (SWT.ERROR_NULL_ARGUMENT); return dragDetect (event.button, event.count, event.stateMask, event.x, event.y); } boolean dragDetect (int button, int count, int stateMask, int x, int y) { if (button != 1 || count != 1) return fals...
public boolean dragDetect (MouseEvent event) { checkWidget (); if (event == null) error (SWT.ERROR_NULL_ARGUMENT); return dragDetect (event.button, event.count, event.stateMask, event.x, event.y); } boolean dragDetect (int button, int count, int stateMask, int x, int y) { if (button != 1 || count != 1) return fals...
public String getDataEncodingWithDefault() { if (getDataEncodingNoDefault() == null && getContentType().startsWith("text/html")){ // $NON-NLS-1$ byte[] bytes=getResponseData(); // get the start of the file // TODO - charset? String prefix = new String(bytes,0,...
public String getDataEncodingWithDefault() { if (getDataEncodingNoDefault() == null && getContentType().startsWith("text/html")){ // $NON-NLS-1$ byte[] bytes=getResponseData(); // get the start of the file // TODO - charset? String prefix = new String(bytes,0,...
public void run() { log.info("Running the test!"); running = true; testList = new ArrayList(); SearchByClass testPlan = new SearchByClass(TestPlan.class); getTestTree().traverse(testPlan); Object[] plan = testPlan.getSearchResults().toArray(); if (plan.length == 0) ...
public void run() { log.info("Running the test!"); running = true; testList = new ArrayList(); SearchByClass testPlan = new SearchByClass(TestPlan.class); getTestTree().traverse(testPlan); Object[] plan = testPlan.getSearchResults().toArray(); if (plan.length == 0) ...