buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public void addAll(StatCalculator calc) { Iterator iter = values.iterator(); while (iter.hasNext()) { addValue((Number) iter.next()); } }
public void addAll(StatCalculator calc) { Iterator iter = calc.values.iterator(); while (iter.hasNext()) { addValue((Number) iter.next()); } }
protected CharSequence getIndicatorUrl() { IRequestHandler handler = new ResourceReferenceRequestHandler( AbstractDefaultAjaxBehavior.INDICATOR); return RequestCycle.get().renderUrlFor(handler); }
protected CharSequence getIndicatorUrl() { IRequestHandler handler = new ResourceReferenceRequestHandler( AbstractDefaultAjaxBehavior.INDICATOR); return RequestCycle.get().urlFor(handler); }
public Component getLoadingComponent(final String markupId) { IRequestHandler handler = new ResourceReferenceRequestHandler( AbstractDefaultAjaxBehavior.INDICATOR); return new Label(markupId, "<img alt=\"Loading...\" src=\"" + RequestCycle.get().renderUrlFor(handler) + "\"/>").setEscapeModelStrings(false); ...
public Component getLoadingComponent(final String markupId) { IRequestHandler handler = new ResourceReferenceRequestHandler( AbstractDefaultAjaxBehavior.INDICATOR); return new Label(markupId, "<img alt=\"Loading...\" src=\"" + RequestCycle.get().urlFor(handler) + "\"/>").setEscapeModelStrings(false); }
public void onComponentTag(Component component, ComponentTag tag) { ResourceReference ref = new SharedResourceReference(RESOURCE_NAME); final String uploadFieldId = (uploadField == null) ? "" : uploadField.getMarkupId(); tag.put("onsubmit", "var def=new Wicket.WUPB.Def('" + component.getMarkupId() + "', '"...
public void onComponentTag(Component component, ComponentTag tag) { ResourceReference ref = new SharedResourceReference(RESOURCE_NAME); final String uploadFieldId = (uploadField == null) ? "" : uploadField.getMarkupId(); tag.put("onsubmit", "var def=new Wicket.WUPB.Def('" + component.getMarkupId() + "', '"...
protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); IRequestHandler handler = new ResourceReferenceRequestHandler(getNodeIcon(node)); tag.put("style", "background-image: url('" + RequestCycle.get().renderUrlFor(handler) + "')"); } }; }
protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); IRequestHandler handler = new ResourceReferenceRequestHandler(getNodeIcon(node)); tag.put("style", "background-image: url('" + RequestCycle.get().urlFor(handler) + "')"); } }; }
public final void respond(final IRequestCycle requestCycle) { RequestCycle rc = (RequestCycle)requestCycle; Url oldBaseURL = rc.getUrlRenderer().getBaseUrl(); WebRequest request = (WebRequest)requestCycle.getRequest(); Url baseURL = Url.parse(request.getHeader("Wicket-Ajax-BaseURL"), request.getCharset()); ...
public final void respond(final IRequestCycle requestCycle) { RequestCycle rc = (RequestCycle)requestCycle; Url oldBaseURL = rc.getUrlRenderer().getBaseUrl(); WebRequest request = (WebRequest)requestCycle.getRequest(); Url baseURL = Url.parse(request.getHeader("Wicket-Ajax-BaseURL"), request.getCharset()); ...
public final void setSrcAttribute(final ComponentTag tag) { // If locale has changed from the initial locale used to attach image // resource, then we need to reload the resource in the new locale Locale l = component.getLocale(); String s = component.getStyle(); String v = component.getVariation(); if (r...
public final void setSrcAttribute(final ComponentTag tag) { // If locale has changed from the initial locale used to attach image // resource, then we need to reload the resource in the new locale Locale l = component.getLocale(); String s = component.getStyle(); String v = component.getVariation(); if (r...
protected final CharSequence getURL() { if (resourceReference != null) { // TODO post 1.2: should we have support for locale changes when the // resource reference (or resource??) is set manually.. // We should get a new resource reference for the current locale // then // that points to the same r...
protected final CharSequence getURL() { if (resourceReference != null) { // TODO post 1.2: should we have support for locale changes when the // resource reference (or resource??) is set manually.. // We should get a new resource reference for the current locale // then // that points to the same r...
protected final void onComponentTag(final ComponentTag tag) { // Default handling for tag super.onComponentTag(tag); // only set the href attribute when the resource exists if (resourceReference != null) { // Set href to link to this link's linkClicked method ResourceReferenceRequestHandler...
protected final void onComponentTag(final ComponentTag tag) { // Default handling for tag super.onComponentTag(tag); // only set the href attribute when the resource exists if (resourceReference != null) { // Set href to link to this link's linkClicked method ResourceReferenceRequestHandler...
public void respond(IRequestCycle requestCycle) { WebRequest webRequest = (WebRequest)requestCycle.getRequest(); HttpServletRequest request = ((ServletWebRequest)webRequest).getHttpServletRequest(); Integer port = null; if (protocol == Protocol.HTTP) { if (httpsConfig.getHttpPort() != 80) { port ...
public void respond(IRequestCycle requestCycle) { WebRequest webRequest = (WebRequest)requestCycle.getRequest(); HttpServletRequest request = ((ServletWebRequest)webRequest).getHttpServletRequest(); Integer port = null; if (protocol == Protocol.HTTP) { if (httpsConfig.getHttpPort() != 80) { port ...
public void testLenientPackageResourceMatching() throws Exception { ResourceReference invalidResource = new PackageResourceReference(PackageResourceTest.class, "i_do_not_exist.txt", Locale.ENGLISH, null, null); assertNotNull( "resource packaged3.txt SHOULD be available as a packaged resource even if it does...
public void testLenientPackageResourceMatching() throws Exception { ResourceReference invalidResource = new PackageResourceReference(PackageResourceTest.class, "i_do_not_exist.txt", Locale.ENGLISH, null, null); assertNotNull( "resource packaged3.txt SHOULD be available as a packaged resource even if it does...
// 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...
import org.apache.wicket.request.resource.ResourceReference; /* * 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 unde...
import org.apache.wicket.request.resource.ResourceReference; /* * 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 unde...
public FormComponentFeedbackBorder(final String id) { super(id); add(new ErrorIndicator("errorIndicator")); }
public FormComponentFeedbackBorder(final String id) { super(id); addToBorder(new ErrorIndicator("errorIndicator")); }
public BoxBorderTestPage_11() { Border border = new TogglePanel("border", new Model<String>("model")); add(border); border.addToBody(new Label("label", "my test")); }
public BoxBorderTestPage_11() { Border border = new TogglePanel("border", new Model<String>("model")); add(border); border.add(new Label("label", "my test")); }
public BoxBorderTestPage_9() { Border myBorder = new BorderComponent1("myBorder"); add(myBorder); Fragment panel1 = new Fragment("fragmentsWillBeRenderedHere", "fragmentSource", myBorder.getBodyContainer()); myBorder.addToBody(panel1); }
public BoxBorderTestPage_9() { Border myBorder = new BorderComponent1("myBorder"); add(myBorder); Fragment panel1 = new Fragment("fragmentsWillBeRenderedHere", "fragmentSource", myBorder.getBodyContainer()); myBorder.add(panel1); }
public FormBorder(final String id) { super(id); form = new Form<Void>("myForm"); add(form); form.add(getBodyContainer()); }
public FormBorder(final String id) { super(id); form = new Form<Void>("myForm"); addToBorder(form); form.add(getBodyContainer()); }
public HideableBorderPage() { border = new HideableBorder("hideable"); add(border); border.addToBody(new Label("content", "label")); }
public HideableBorderPage() { border = new HideableBorder("hideable"); add(border); border.add(new Label("content", "label")); }
public MyApplicationBorder(final String id) { super(id); Border border = new BoxBorder("boxBorder"); add(border); border.add(getBodyContainer()); }
public MyApplicationBorder(final String id) { super(id); Border border = new BoxBorder("boxBorder"); addToBorder(border); border.add(getBodyContainer()); }
public void onClick() { expanded = !expanded; getBodyContainer().setVisible(expanded); } }; link.add(new Label("titleLabel", titleModel)); add(link); }
public void onClick() { expanded = !expanded; getBodyContainer().setVisible(expanded); } }; link.add(new Label("titleLabel", titleModel)); addToBorder(link); }
protected void onSubmit() { super.onSubmit(); info("form submitted"); } }; LocalizedFeedbackBorder brdr = new LocalizedFeedbackBorder("fieldborder"); TextField<String> field = new TextField<String>("field", new Model<String>("")); field.info("info on field"); brdr.addToBody(field.setRequired(...
protected void onSubmit() { super.onSubmit(); info("form submitted"); } }; LocalizedFeedbackBorder brdr = new LocalizedFeedbackBorder("fieldborder"); TextField<String> field = new TextField<String>("field", new Model<String>("")); field.info("info on field"); brdr.add(field.setRequired(true))...
public boolean accept(FeedbackMessage message) { return feedback.getFilter().accept(message) && message.isError(); } }); return "border: 1px solid " + (error ? "red" : "green"); } })); add(brdr); }
public boolean accept(FeedbackMessage message) { return feedback.getFilter().accept(message) && message.isError(); } }); return "border: 1px solid " + (error ? "red" : "green"); } })); addToBorder(brdr); }
private void addToBorder(final Component child) { border.addToBody(child); }
private void addToBorder(final Component child) { border.add(child); }
public BookingForm(String s) { super(s); setDefaultModel(new CompoundPropertyModel<Booking>(booking)); TextField<String> name = new TextField<String>("partyDetails.name"); name.setRequired(Boolean.TRUE); name.add(new StringValidator.LengthBetweenValidator(1, 30)); FormComponentFeedbackBorder nam...
public BookingForm(String s) { super(s); setDefaultModel(new CompoundPropertyModel<Booking>(booking)); TextField<String> name = new TextField<String>("partyDetails.name"); name.setRequired(Boolean.TRUE); name.add(new StringValidator.LengthBetweenValidator(1, 30)); FormComponentFeedbackBorder nam...
public OrderByBorder(final String id, final String property, final ISortStateLocator stateLocator, final OrderByLink.ICssProvider cssProvider) { super(id); OrderByLink link = newOrderByLink("orderByLink", property, stateLocator); add(link); add(new OrderByLink.CssModifier(link, cssProvider)); link.add(ge...
public OrderByBorder(final String id, final String property, final ISortStateLocator stateLocator, final OrderByLink.ICssProvider cssProvider) { super(id); OrderByLink link = newOrderByLink("orderByLink", property, stateLocator); addToBorder(link); add(new OrderByLink.CssModifier(link, cssProvider)); lin...
public void setData (String key, Object value) { checkDevice (); if (key == null) error (SWT.ERROR_NULL_ARGUMENT); if (key.equals (DISPATCH_EVENT_KEY)) { if (value == null || value instanceof int []) { dispatchEvents = (int []) value; if (value == null) putGdkEvents (); return; } } if (key.equals (SE...
public void setData (String key, Object value) { checkDevice (); if (key == null) error (SWT.ERROR_NULL_ARGUMENT); if (key.equals (DISPATCH_EVENT_KEY)) { if (value == null || value instanceof int []) { dispatchEvents = (int []) value; if (value == null) putGdkEvents (); return; } } if (key.equals (SE...
public void hello(String from) { System.out.println(this.getClass().getName()+".hello from="+from); }
public void hello(String from) { System.out.println("hello from="+from); }
public static Type makeBcelType(UnresolvedType type) { return Type.getType(type.getSignature()); }
public static Type makeBcelType(UnresolvedType type) { return Type.getType(type.getErasureSignature()); }
private static final long serialVersionUID = 1L; }; link.setMarkupId("link"); link.setBodyModel(Model.of(linkBody)); mockPageWithLink.add(link); wicketTester.startPage(mockPageWithLink); TagTester tagTester = wicketTester.getTagById("link"); Assert.assertEquals(linkBody, tagTester.getValue()); }
private static final long serialVersionUID = 1L; }; link.setMarkupId("link"); link.setBody(Model.of(linkBody)); mockPageWithLink.add(link); wicketTester.startPage(mockPageWithLink); TagTester tagTester = wicketTester.getTagById("link"); Assert.assertEquals(linkBody, tagTester.getValue()); }
public void onClick() { } }; linkWithLabel.setBodyModel(Model.of("A link that provides its body with Link.setBodyLabel(someModel)")); add(linkWithLabel); }
public void onClick() { } }; linkWithLabel.setBody(Model.of("A link that provides its body with Link.setBodyLabel(someModel)")); add(linkWithLabel); }
private void matchInvokeInstruction(LazyMethodGen mg, InstructionHandle ih, InvokeInstruction invoke, BcelShadow enclosingShadow, List shadowAccumulator) { String methodName = invoke.getName(cpg); if (methodName.startsWith(NameMangler.PREFIX)) { Member method = BcelWorld.makeMethodSignature(clazz,...
private void matchInvokeInstruction(LazyMethodGen mg, InstructionHandle ih, InvokeInstruction invoke, BcelShadow enclosingShadow, List shadowAccumulator) { String methodName = invoke.getName(cpg); if (methodName.startsWith(NameMangler.PREFIX)) { Member method = world.makeMethodSignature(clazz, inv...
public CompoundFieldValueFactory(IFieldValueFactory f1, IFieldValueFactory f2) { if (f1 == null) { throw new IllegalArgumentException("argument [f1] cannot be null"); } if (f2 == null) { throw new IllegalArgumentException("argument [f1] cannot be null"); } delegates.add(f1); delegates.add(f2); ...
public CompoundFieldValueFactory(IFieldValueFactory f1, IFieldValueFactory f2) { if (f1 == null) { throw new IllegalArgumentException("argument [f1] cannot be null"); } if (f2 == null) { throw new IllegalArgumentException("argument [f2] cannot be null"); } delegates.add(f1); delegates.add(f2); ...
public void test_Constructor() { final int COUNT = 5000000; PerformanceMeter meter = createMeter("ImageLoader constr."); meter.start(); for (int i = 0; i < COUNT; i++) { new ImageLoader(); } meter.stop(); disposeMeter(meter); }
public void test_Constructor() { final int COUNT = 25000000; PerformanceMeter meter = createMeter("ImageLoader constr."); meter.start(); for (int i = 0; i < COUNT; i++) { new ImageLoader(); } meter.stop(); disposeMeter(meter); }
public PersistentAttributeType getPersistentAttributeType() { if (fmd.isEmbedded()) return PersistentAttributeType.EMBEDDED; if (fmd.isElementCollection()) return PersistentAttributeType.ELEMENT_COLLECTION; return PersistentAttributeType.BASIC;...
public PersistentAttributeType getPersistentAttributeType() { if (fmd.isEmbeddedPC()) return PersistentAttributeType.EMBEDDED; if (fmd.isElementCollection()) return PersistentAttributeType.ELEMENT_COLLECTION; return PersistentAttributeType.BASI...
public ComponentReferenceApplication() { getPages().setHomePage(Home.class); }
public ComponentReferenceApplication() { getPages().setHomePage(Index.class); }
private void executeAjaxUrlWithLastBaseUrl(Url url) throws IOException, ResourceStreamNotFoundException, ParseException { tester.getRequest().setUrl(url); tester.getRequest().addHeader("Wicket-Ajax-BaseURL", tester.getWicketAjaxBaserUrlFromLastRequest()); 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.getWicketAjaxBaseUrlFromLastRequest()); tester.getRequest().addHeader("Wicket-Ajax", "true")...
private static Collection getObjects(Class extendsClass) throws Exception { String exName = extendsClass.getName(); Object myThis = new String(); Iterator classes = ClassFinder .findClassesThatExtend( JMeterUtils.getSearchPaths(), ...
private static Collection getObjects(Class extendsClass) throws Exception { String exName = extendsClass.getName(); Object myThis = ""; Iterator classes = ClassFinder .findClassesThatExtend( JMeterUtils.getSearchPaths(), new C...
public void setMonitor(boolean truth) { this.setProperty(MONITOR, JOrphanUtils.booleanToString(truth)); }
public void setMonitor(boolean truth) { this.setProperty(MONITOR, truth); }
public SampleResult sample(Entry e) { SampleResult parent = new SampleResult(); boolean isOK = false; // Did sample succeed? boolean deleteMessages = getDeleteMessages(); parent.setSampleLabel(getName()); String samplerString = toString(); parent.setSamplerData(samp...
public SampleResult sample(Entry e) { SampleResult parent = new SampleResult(); boolean isOK = false; // Did sample succeed? boolean deleteMessages = getDeleteMessages(); parent.setSampleLabel(getName()); String samplerString = toString(); parent.setSamplerData(samp...
public void setMechanism(Mechanism mechanism) { setProperty(MECHANISM, mechanism.toString()); }
public void setMechanism(Mechanism mechanism) { setProperty(MECHANISM, mechanism.name(), Mechanism.BASIC_DIGEST.name()); }
private final StructureTreeModel NO_STRUCTURE_MODEL = new StructureTreeModel(new SwingTreeViewNode(StructureModel.NO_STRUCTURE, new AbstractIcon(null), new ArrayList()));
private final StructureTreeModel NO_STRUCTURE_MODEL = new StructureTreeModel(new SwingTreeViewNode(AspectJModel.NO_STRUCTURE, new AbstractIcon(null), new ArrayList()));
public void testMainClassNodeInfo() throws IOException { StructureModel model = Ajde.getDefault().getStructureModelManager().getModel(); assertTrue("model exists", model != null); assertTrue("root exists", model.getRoot() != null); File testFile = openFile("figures-coverage/figures/Main.java"); I...
public void testMainClassNodeInfo() throws IOException { AspectJModel model = Ajde.getDefault().getStructureModelManager().getModel(); assertTrue("model exists", model != null); assertTrue("root exists", model.getRoot() != null); File testFile = openFile("figures-coverage/figures/Main.java"); IPr...
public void containmentHierarchyUpdated(StructureModel rootNode); }
public void containmentHierarchyUpdated(AspectJModel rootNode); }
public void setAdditionalparam( String add ) throws TaskException { m_command.createArgument().setLine( add ); }
public void setAdditionalparam( String add ) throws TaskException { m_command.addLine( add ); }
protected Commandline createCommand( final File listFile ) throws TaskException { final Commandline cmd = new Commandline(); cmd.setExecutable( "cabarc" ); cmd.addArgument( "-r" ); cmd.addArgument( "-p" ); if( !m_compress ) { cmd.addArgument( ...
protected Commandline createCommand( final File listFile ) throws TaskException { final Commandline cmd = new Commandline(); cmd.setExecutable( "cabarc" ); cmd.addArgument( "-r" ); cmd.addArgument( "-p" ); if( !m_compress ) { cmd.addArgument( ...
protected void execP4Command( final String command, ExecOutputHandler handler ) throws TaskException { try { final Commandline cmd = new Commandline(); cmd.setExecutable( "p4" ); //Check API for these - it's how CVS d...
protected void execP4Command( final String command, ExecOutputHandler handler ) throws TaskException { try { final Commandline cmd = new Commandline(); cmd.setExecutable( "p4" ); //Check API for these - it's how CVS d...
private Commandline createCommand() throws TaskException { final Commandline cmd = new Commandline(); cmd.setExecutable( "rpm" ); if( m_topDir != null ) { cmd.addArgument( "--define" ); cmd.addArgument( "_topdir" + m_topDir ); } cm...
private Commandline createCommand() throws TaskException { final Commandline cmd = new Commandline(); cmd.setExecutable( "rpm" ); if( m_topDir != null ) { cmd.addArgument( "--define" ); cmd.addArgument( "_topdir" + m_topDir ); } cm...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize (handle, wHint, hHint, changed); Rectangle trim = computeTrim (0, 0, size.x, size.y); size.x = trim....
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize (handle, wHint, hHint, changed); Rectangle trim = computeTrim (0, 0, size.x, size.y); size.x = trim....
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize (handle, wHint, hHint, changed); Rectangle trim = computeTrim (0, 0, size.x, size.y); size.x = trim....
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize (handle, wHint, hHint, changed); Rectangle trim = computeTrim (0, 0, size.x, size.y); size.x = trim....
public void addText(char[] buf, int start, int end) { addText(new String(buf, start, end).trim()); }
public void addText(char[] buf, int start, int end) { addText(new String(buf, start, end)); }
public void testComponentTagAttributeModification() throws Exception { // Validate the document String document = tester.getServletResponse().getDocument(); log.info(document); Assert.assertTrue(validateDocument(document)); }
public void testComponentTagAttributeModification() throws Exception { // Validate the document String document = tester.getLastResponse().getTextResponse().toString(); log.info(document); Assert.assertTrue(validateDocument(document)); }
private static ReflectionBasedReferenceTypeDelegate create15Delegate(ReferenceType forReferenceType, Class forClass, ClassLoader usingClassLoader, World inWorld) { try { Class delegateClass = Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate",true,usingClassLoader);//,false,usin...
private static ReflectionBasedReferenceTypeDelegate create15Delegate(ReferenceType forReferenceType, Class forClass, ClassLoader usingClassLoader, World inWorld) { try { Class delegateClass = Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate"); ReflectionBasedReferenceTypeDel...
private static void notifyLocaleChangeListeners() { LocaleChangeEvent event = new LocaleChangeEvent(JMeterUtils.class, locale); Iterator<LocaleChangeListener> iterator = ((Vector) localeChangeListeners.clone()).iterator(); while (iterator.hasNext()) { LocaleChangeListener listen...
private static void notifyLocaleChangeListeners() { LocaleChangeEvent event = new LocaleChangeEvent(JMeterUtils.class, locale); Iterator<LocaleChangeListener> iterator = ((Vector<LocaleChangeListener>) localeChangeListeners.clone()).iterator(); while (iterator.hasNext()) { Local...
public static void setLoggingLevels(Properties appProperties) { Iterator props = appProperties.keySet().iterator(); while (props.hasNext()) { String prop = (String) props.next(); if (prop.startsWith(LOG_PRIORITY + ".")) //$NON_NLS-1$ // don't match the empty categ...
public static void setLoggingLevels(Properties appProperties) { Iterator<?> props = appProperties.keySet().iterator(); while (props.hasNext()) { String prop = (String) props.next(); if (prop.startsWith(LOG_PRIORITY + ".")) //$NON_NLS-1$ // don't match the empty ca...
public Object getTypeInfo(int nodeIndex) { if (nodeIndex == -1) { return null; } int chunk = nodeIndex >> CHUNK_SHIFT; int index = nodeIndex & CHUNK_MASK; Object value = fNodeValue[chunk][index]; if (value != null) { fNodeVal...
public Object getTypeInfo(int nodeIndex) { if (nodeIndex == -1) { return null; } int chunk = nodeIndex >> CHUNK_SHIFT; int index = nodeIndex & CHUNK_MASK; Object value = fNodeValue[chunk] != null ? fNodeValue[chunk][index] : null; if (va...
public static JMenu makeMenu(Collection menuInfo, String actionCommand, String menuName) { Iterator iter = menuInfo.iterator(); JMenu menu = new JMenu(menuName); while (iter.hasNext()) { MenuInfo info = (MenuInfo) iter.next(); menu.add(makeMenuItem(info.label, info.cl...
public static JMenu makeMenu(Collection menuInfo, String actionCommand, String menuName) { Iterator iter = menuInfo.iterator(); JMenu menu = new JMenu(menuName); while (iter.hasNext()) { MenuInfo info = (MenuInfo) iter.next(); menu.add(makeMenuItem(info.getLabel(), in...
public void deselectAll () { checkWidget (); deselect (null, 0); } void destroyItem (TableColumn column) { int index = 0; while (index < columnCount) { if (columns [index] == column) break; index++; } for (int i=0; i<itemCount; i++) { TableItem item = items [i]; if (item != null) { if (columnCount <= ...
public void deselectAll () { checkWidget (); deselect (null, 0); } void destroyItem (TableColumn column) { int index = 0; while (index < columnCount) { if (columns [index] == column) break; index++; } for (int i=0; i<itemCount; i++) { TableItem item = items [i]; if (item != null) { if (columnCount <= ...
public void deselectAll () { checkWidget (); ignoreSelect = true; /* * Bug in the Macintosh. When the DataBroswer selection flags includes * both kDataBrowserNeverEmptySelectionSet and kDataBrowserSelectOnlyOne, * two items are selected when SetDataBrowserSelectedItems() is called * with kDataBrowserItemsAssign...
public void deselectAll () { checkWidget (); ignoreSelect = true; /* * Bug in the Macintosh. When the DataBroswer selection flags includes * both kDataBrowserNeverEmptySelectionSet and kDataBrowserSelectOnlyOne, * two items are selected when SetDataBrowserSelectedItems() is called * with kDataBrowserItemsAssign...
private long getReadCount(Class<?> c) { CacheStatistics stats = getStatistics(); if (stats != null) stats.getReadCount(c); return NO_STATS; }
private long getReadCount(Class<?> c) { CacheStatistics stats = getStatistics(); if (stats != null) return stats.getReadCount(c); return NO_STATS; }
private static final long serialVersionUID = 6802729912091130335L; Object[] errorSubstText=null; Element errorElem = null; ComplexTypeRecoverableError() { super(); } ComplexTypeRecoverableError(String msgKey, Object[] args, Element e) { s...
private static final long serialVersionUID = 6802729912091130335L; Object[] errorSubstText=null; Element errorElem = null; ComplexTypeRecoverableError() { super(); } ComplexTypeRecoverableError(String msgKey, Object[] args, Element e) { s...
protected void respond() { RequestCycle requestCycle = RequestCycle.get(); IResourceStream resourceStream = getResponse(); if (resourceStream != null) { requestCycle.setRequestTarget(new ResourceStreamRequestTarget(resourceStream, getResponseType())); } else { requestCycle.setRequestTarget(ne...
protected void respond() { RequestCycle requestCycle = RequestCycle.get(); IResourceStream resourceStream = getResponse(); if (resourceStream != null) { requestCycle.setRequestTarget(new ResourceStreamRequestTarget(resourceStream, getResponseType())); } else { requestCycle.setRequestTarget(Em...
public String toString() { return page.toString(); }
public String toString() { return "PageRequestTarget@" + hashCode() + "{page=" + page + "}"; }
public String toString() { return resourceKey; }
public String toString() { return "SharedResourceRequestTarget@" + hashCode() + "{" + resourceKey + "}"; }
private void merge(final IMarkupFragment markup, final IMarkupFragment baseMarkup, int extendIndex) { // True if either <wicket:head> or <head> has been processed boolean wicketHeadProcessed = false; // True, if <head> was found boolean foundHeadTag = false; // Add all elements from the base markup to t...
private void merge(final IMarkupFragment markup, final IMarkupFragment baseMarkup, int extendIndex) { // True if either <wicket:head> or <head> has been processed boolean wicketHeadProcessed = false; // True, if <head> was found boolean foundHeadTag = false; // Add all elements from the base markup to t...
public AbstractPageManager(IPageManagerContext context) { this.context = (IPageManagerContext)Args.notNull(context, "context"); }
public AbstractPageManager(IPageManagerContext context) { this.context = Args.notNull(context, "context"); }
public int getNextToken() { while (pos < document.length()) { char ch = document.charAt(pos); if (ch == '<') { return processDirective(); } else { return processText(); } } return END; }
public int getNextToken() { if (pos < document.length()) { char ch = document.charAt(pos); if (ch == '<') { return processDirective(); } else { return processText(); } } return END; }
protected boolean isMetaInfResourcesSupported() { if (META_INF_RESOURCES_SUPPORTED == null) { int majorVersion = WebApplication.get().getServletContext().getMajorVersion(); META_INF_RESOURCES_SUPPORTED = majorVersion >= 3; } return META_INF_RESOURCES_SUPPORTED.booleanValue(); }
protected boolean isMetaInfResourcesSupported() { if (META_INF_RESOURCES_SUPPORTED == null) { int majorVersion = WebApplication.get().getServletContext().getMajorVersion(); META_INF_RESOURCES_SUPPORTED = majorVersion >= 3; } return META_INF_RESOURCES_SUPPORTED; }
public void wicket1382() { WicketTester tester = new WicketTester(); AjaxyImagesPage page = (AjaxyImagesPage)tester.startPage(AjaxyImagesPage.class); TagTester tagTester = tester.getTagById(page.image.getMarkupId()); final String srcAttr = tagTester.getAttribute("src"); assertFalse( "Image has not be re...
public void wicket1382() { WicketTester tester = new WicketTester(); AjaxyImagesPage page = tester.startPage(AjaxyImagesPage.class); TagTester tagTester = tester.getTagById(page.image.getMarkupId()); final String srcAttr = tagTester.getAttribute("src"); assertFalse( "Image has not be rendered in Ajax re...
protected String getEventHandler() { return super.getEventHandler()+"return false;"; } }); }
protected String getEventHandler() { return "var ret="+super.getEventHandler()+"return !ret;"; } }); }
protected void addInterfaceParameters(final Request request, final RequestParameters parameters) { // Format of interface target parameter is // <page-map-name>:<path>:<version>:<interface>:<behaviourId> final String requestString = request.getParameter(INTERFACE_PARAMETER_NAME); if (requestString != null) ...
protected void addInterfaceParameters(final Request request, final RequestParameters parameters) { // Format of interface target parameter is // <page-map-name>:<path>:<version>:<interface>:<behaviourId> final String requestString = request.getParameter(INTERFACE_PARAMETER_NAME); if (requestString != null) ...
protected void scandir(String dir, String vpath, boolean fast) { try { if (!ftp.changeWorkingDirectory(dir)) { return; } FTPFile[] newfiles = ftp.listFiles(); if (newfiles == null) { ftp.changeT...
protected void scandir(String dir, String vpath, boolean fast) { try { if (!ftp.changeWorkingDirectory(dir)) { return; } FTPFile[] newfiles = ftp.listFiles(); if (newfiles == null) { ftp.changeT...
protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); String url = tag.getAttributes().getString("src"); url = url + ((url.indexOf("?") >= 0) ? "&" : "?"); url = url + "wicket:antiCache=" + System.currentTimeMillis(); tag.put("src", url); }
protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); String url = tag.getAttributes().getString("src"); url = url + ((url.indexOf("?") >= 0) ? "&amp;" : "?"); url = url + "wicket:antiCache=" + System.currentTimeMillis(); tag.put("src", url); }
protected boolean checkAccess() { final RequestCycle cycle = getRequestCycle(); boolean signedIn = cycle.getSession().getProperty("wicket.examples.signin2.user") != null; if (!signedIn) { cycle.redirectToInterceptPage(SignIn2.class); } return signedIn;...
protected boolean checkAccess() { final RequestCycle cycle = getRequestCycle(); boolean signedIn = cycle.getSession().getProperty("wicket.examples.signin2.user") != null; if (!signedIn) { cycle.redirectToInterceptPage(new SignIn2(null)); } return signe...
public int handle; /** * specifies the transparent pixel */ int transparentPixel = -1; /** * the GC which is drawing on the image */ GC memGC; /** * the alpha data for the image */ byte[] alphaData; /** * the global alpha value to be used for every pixel */ int alpha = -1; /** * th...
public int handle; /** * specifies the transparent pixel */ int transparentPixel = -1; /** * the GC which is drawing on the image */ GC memGC; /** * the alpha data for the image */ byte[] alphaData; /** * the global alpha value to be used for every pixel */ int alpha = -1; /** * th...
public void weaveAroundClosure(BcelAdvice munger, boolean hasDynamicTest) { InstructionFactory fact = getFactory(); enclosingMethod.setCanInline(false); // MOVE OUT ALL THE INSTRUCTIONS IN MY SHADOW INTO ANOTHER METHOD! LazyMethodGen callbackMethod = extractMethod( NameM...
public void weaveAroundClosure(BcelAdvice munger, boolean hasDynamicTest) { InstructionFactory fact = getFactory(); enclosingMethod.setCanInline(false); // MOVE OUT ALL THE INSTRUCTIONS IN MY SHADOW INTO ANOTHER METHOD! LazyMethodGen callbackMethod = extractMethod( NameM...
public String getPassword() { return password.getModelObjectAsString(); }
public String getPassword() { return password.getInput(); }
protected boolean renameFile(File sourceFile, File destFile, boolean filtering, boolean overwrite) throws IOException, BuildException { if (destFile.isDirectory() || filtering || getFilterSets().size() > 0 || getFilterChains().size() > 0) { return...
protected boolean renameFile(File sourceFile, File destFile, boolean filtering, boolean overwrite) throws IOException, BuildException { if (destFile.isDirectory() || filtering || getFilterSets().size() > 0 || getFilterChains().size() > 0) { return...
public String filter(String line) { if (from == null) { throw new BuildException("Missing from in stringreplace"); } StringBuffer ret = new StringBuffer(); int start = 0; int found = line.indexOf(from); while (found >= 0) { ...
public String filter(String line) { if (from == null) { throw new BuildException("Missing from in stringreplace"); } StringBuffer ret = new StringBuffer(); int start = 0; int found = line.indexOf(from); while (found >= 0) { ...
public void testProcessing() throws Exception { testLog.debug("Testing Generic Controller"); GenericController controller = new GenericController(); GenericController sub_1 = new GenericController(); sub_1.addTestElement(new TestSampler("one")); sub_1.addTestElement(new TestSampler("two")); controll...
public void testProcessing() throws Exception { testLog.debug("Testing Generic Controller"); GenericController controller = new GenericController(); GenericController sub_1 = new GenericController(); sub_1.addTestElement(new TestSampler("one")); sub_1.addTestElement(new TestSampler("two")); controll...
public void testProcessing() throws Exception { GenericController controller = new GenericController(); GenericController sub_1 = new GenericController(); sub_1.addTestElement(new TestSampler("one")); sub_1.addTestElement(new TestSampler("two")); controller.addTestElement(sub_1); controller.addTestE...
public void testProcessing() throws Exception { GenericController controller = new GenericController(); GenericController sub_1 = new GenericController(); sub_1.addTestElement(new TestSampler("one")); sub_1.addTestElement(new TestSampler("two")); controller.addTestElement(sub_1); controller.addTestE...
private String nextName(GenericController c) { Sampler s = c.next(); if (s == null) { return null; } else { return s.getPropertyAsString(TestElement.NAME); } }
private String nextName(GenericController c) { Sampler s = c.next(); if (s == null) { return null; } else { return s.getName(); } }
public void updateControl() { if (text != null) { String string = getFormattedString(style); ignoreVerify = true; text.setText(string); ignoreVerify = false; } redraw(); }
public void setYear (int year) { checkWidget(); //if (!isValid(Calendar.YEAR, year)) return; if (year < MIN_YEAR || year > MAX_YEAR) return; calendar.set(Calendar.YEAR, year); updateControl(); } int unformattedIntValue(int fieldName, String newText, boolean adjust, int max) { int newValue; try { newValue = In...
private Map properties; MSNRosterEntry(IRoster roster, Contact contact, Namespace namespace) { this.roster = roster; this.contact = contact; groups = Collections.EMPTY_LIST; properties = new HashMap(1); try { id = (MSNID) namespace.createInstance(new Object[] { contact .getEmail() }); } catch (ID...
private Map properties; MSNRosterEntry(IRoster roster, Contact contact, Namespace namespace) { this.roster = roster; this.contact = contact; groups = Collections.EMPTY_LIST; properties = new HashMap(1); try { id = (MSNID) namespace.createInstance(new Object[] { contact .getEmail() }); } catch (ID...
package org.eclipse.xtend.middleend.javaannotations; /* Copyright (c) 2008 Arno Haase. 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, and is available at http://www.eclipse.org/legal/epl-v10.htm...
package org.eclipse.xtend.middleend.javaannotations; /* Copyright (c) 2008 Arno Haase. 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, and is available at http://www.eclipse.org/legal/epl-v10.htm...
package org.eclipse.xtend.middleend.javaannotations; /* Copyright (c) 2008 Arno Haase. 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, and is available at http://www.eclipse.org/legal/epl-v10.htm...
package org.eclipse.xtend.middleend.javaannotations; /* Copyright (c) 2008 Arno Haase. 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, and is available at http://www.eclipse.org/legal/epl-v10.htm...
public String getId () { if (shortName == null) { shortName = getClassLoaderName(); int index = shortName.lastIndexOf("."); shortName = shortName.substring(index + 1); } return shortName; }
public String getId () { if (shortName == null) { shortName = getClassLoaderName().replace('$','.'); int index = shortName.lastIndexOf("."); shortName = shortName.substring(index + 1); } return shortName; }
private boolean validateAndExecute() throws BuildException { if (file == null && filesets.size() == 0) { throw new BuildException( "Specify at least one source - a file or a fileset."); } if (file != null && file.exists() && file.isDirectory()) { thr...
private boolean validateAndExecute() throws BuildException { if (file == null && filesets.size() == 0) { throw new BuildException( "Specify at least one source - a file or a fileset."); } if (file != null && file.exists() && file.isDirectory()) { thr...
public boolean getSelection () { checkWidget(); if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return false; return OS.gtk_check_menu_item_get_active(handle); } int /*long*/ gtk_activate (int /*long*/ widget) { if ((style & SWT.CASCADE) != 0 && menu != null) return 0; /* * Bug in GTK. When an ancestor menu is disa...
public boolean getSelection () { checkWidget(); if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return false; return OS.gtk_check_menu_item_get_active(handle); } int /*long*/ gtk_activate (int /*long*/ widget) { if ((style & SWT.CASCADE) != 0 && menu != null) return 0; /* * Bug in GTK. When an ancestor menu is disa...
public boolean isEnabled () { return getEnabled () && parent.isEnabled (); } int Pt_CB_ACTIVATE (int widget, int info) { if ((style & SWT.CASCADE) != 0 && menu != null) { return OS.Pt_CONTINUE; } Event event = new Event (); if (info != 0) { PtCallbackInfo_t cbinfo = new PtCallbackInfo_t (); OS.memmove (cbin...
public boolean isEnabled () { return getEnabled () && parent.isEnabled (); } int Pt_CB_ACTIVATE (int widget, int info) { if ((style & SWT.CASCADE) != 0 && menu != null) { return OS.Pt_CONTINUE; } Event event = new Event (); if (info != 0) { PtCallbackInfo_t cbinfo = new PtCallbackInfo_t (); OS.memmove (cbin...
public LibraryApplicationBorder(MarkupContainer parent, final String id) { super(parent, id); Border boxBorder = new BoxBorder(this, "boxBorder"); newBorderBodyContainer(boxBorder); }
public LibraryApplicationBorder(MarkupContainer parent, final String id) { super(parent, id); Border boxBorder = new BoxBorder(this, "boxBorder"); setBorderBodyContainer(boxBorder); }
String ROLE = Executor.class.getName(); /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.my...
String ROLE = Executor.class.getName(); /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.my...
public static void main(String argv[]) { // too few parameters if (argv.length < 2) { printUsage(); System.exit(1); } XMLParserConfiguration parserConfiguration = null; String arg = null; int i = 0; arg = argv[i]; if (arg.equ...
public static void main(String argv[]) { // too few parameters if (argv.length < 2) { printUsage(); System.exit(1); } XMLParserConfiguration parserConfiguration = null; String arg = null; int i = 0; arg = argv[i]; if (arg.equ...
public boolean registerPreparser(String grammarType, XMLGrammarLoader loader) { if(loader == null) { // none specified! if(KNOWN_LOADERS.containsKey(grammarType)) { // got one; just instantiate it... String loaderName = (String)KNOWN_LOADERS.get(grammarType); ...
public boolean registerPreparser(String grammarType, XMLGrammarLoader loader) { if(loader == null) { // none specified! if(KNOWN_LOADERS.containsKey(grammarType)) { // got one; just instantiate it... String loaderName = (String)KNOWN_LOADERS.get(grammarType); ...
private Object internalUpdateModel() { final String indexOrId = getRequestString(); Object object = null; final List list = getValues(); if (indexOrId == null || "".equals(indexOrId)) { setModelObject(null); } else if (list instanceof IDetachableChoiceList) { object = ((IDetachableChoiceList)lis...
private Object internalUpdateModel() { final String indexOrId = getInput(); Object object = null; final List list = getValues(); if (indexOrId == null || "".equals(indexOrId)) { setModelObject(null); } else if (list instanceof IDetachableChoiceList) { object = ((IDetachableChoiceList)list).objec...
public Object component(final Component component) { // Get button final Button button = (Button)component; // Check for button-name or button-name.x request string if (!Strings.isEmpty(button.getRequestString()) || !Strings.isEmpty(getRequest().getParameter(button.getPath() + ".x"))) {...
public Object component(final Component component) { // Get button final Button button = (Button)component; // Check for button-name or button-name.x request string if (!Strings.isEmpty(button.getInput()) || !Strings.isEmpty(getRequest().getParameter(button.getPath() + ".x"))) { re...
public final void updateModel() { // Get the list of selected values Collection selectedValues = (Collection)getModelObject(); if (selectedValues != null) { selectedValues.clear(); } else { selectedValues = new ArrayList(); setModelObject(selectedValues); } // Get indices selected from re...
public final void updateModel() { // Get the list of selected values Collection selectedValues = (Collection)getModelObject(); if (selectedValues != null) { selectedValues.clear(); } else { selectedValues = new ArrayList(); setModelObject(selectedValues); } // Get indices selected from re...
public final void updateModel() { final int index = getRequestInt(NULL_VALUE); if (index != NULL_VALUE) { setModelObject(values.get(index)); } }
public final void updateModel() { final int index = inputAsInt(NULL_VALUE); if (index != NULL_VALUE) { setModelObject(values.get(index)); } }
protected void updateModel() { if (type != null) { // Set model to request string converted to the appropriate type setModelObject(getConverter().convert(getRequestString(), type)); } else { // Update String model super.updateModel(); ...
protected void updateModel() { if (type != null) { // Set model to request string converted to the appropriate type setModelObject(getConverter().convert(getInput(), type)); } else { // Update String model super.updateModel(); }...
public String getInput() { return component.getRequestString(); }
public String getInput() { return component.getInput(); }
package wicket.examples.util.hibernate; /* * $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 Li...
package wicket.examples.util.hibernate; /* * $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 Li...