buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
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 deselect (TreeItem item) { checkWidget (); if (item == null) error (SWT.ERROR_NULL_ARGUMENT); if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); ignoreSelect = true; /* * Bug in the Macintosh. When the DataBroswer selection flags includes * both kDataBrowserNeverEmptySelectionSet and kDataB...
public final MarkupStream getMarkupStream(final MarkupContainer container, final boolean enforceReload, final boolean throwException) { if (container == null) { throw new IllegalArgumentException("Parameter 'container' must not be 'null'."); } // Look for associated markup final Markup markup = getMar...
public final MarkupStream getMarkupStream(final MarkupContainer container, final boolean enforceReload, final boolean throwException) { if (container == null) { throw new IllegalArgumentException("Parameter 'container' must not be 'null'."); } // Look for associated markup final Markup markup = getMar...
public void updateModel() { Object object = getModelObject(); boolean isModelCollection = object instanceof Collection; /* * clear the model */ if (isModelCollection) { modelChanging(); ((Collection)object).clear(); } else { getModel().setObject(this, null); } /* * the input c...
public void updateModel() { Object object = getModelObject(); boolean isModelCollection = object instanceof Collection; /* * clear the model */ if (isModelCollection) { modelChanging(); ((Collection)object).clear(); } else { getModel().setObject(this, null); } /* * the input c...
public void testHelloWorld() throws Exception { beginAt("/niceurl"); this.dumpResponse(System.out); assertTitleEquals("Wicket Examples - niceurl"); assertTextInElement("message", "Hello World!"); }
public void testHelloWorld() throws Exception { beginAt("/niceurl"); this.dumpResponse(System.out); assertTitleEquals("Wicket Examples - niceurl"); assertTextPresent("This example displays how you can work with 'nice' urls for bookmarkable pages."); }
public void pack () { checkWidget (); int index = parent.indexOf (this); if (index == -1) return; int columnWidth = 0; int hwnd = parent.handle; int hDC = OS.GetDC (hwnd); int oldFont = 0, newFont = OS.SendMessage (hwnd, OS.WM_GETFONT, 0, 0); if (newFont != 0) oldFont = OS.SelectObject (hDC, newFont); int cp =...
public void pack () { checkWidget (); int index = parent.indexOf (this); if (index == -1) return; int columnWidth = 0; int hwnd = parent.handle; int hDC = OS.GetDC (hwnd); int oldFont = 0, newFont = OS.SendMessage (hwnd, OS.WM_GETFONT, 0, 0); if (newFont != 0) oldFont = OS.SelectObject (hDC, newFont); int cp =...
protected void onSubmit() { if (input.bool.booleanValue()) { info("Ok, ok... we'll check it"); } else { info("So you don't want it checked huh?"); } } }; add(form); // add a check box component that uses the model object's 'bool' // property. form.add(new CheckBox("...
protected void onSubmit() { if (input.bool) { info("Ok, ok... we'll check it"); } else { info("So you don't want it checked huh?"); } } }; add(form); // add a check box component that uses the model object's 'bool' // property. form.add(new CheckBox("bool")); }
public final Boolean getObject() { return Boolean.valueOf(isSelected()); }
public final Boolean getObject() { return isSelected(); }
public Integer next() { return new Integer(nextEntry().getKey()); } }
public Integer next() { return nextEntry().getKey(); } }
public Byte convertToObject(final String value, Locale locale) { final Number number = parse(value, Byte.MIN_VALUE, Byte.MAX_VALUE, locale); if (number == null) { return null; } return new Byte(number.byteValue()); }
public Byte convertToObject(final String value, Locale locale) { final Number number = parse(value, Byte.MIN_VALUE, Byte.MAX_VALUE, locale); if (number == null) { return null; } return number.byteValue(); }
public Character convertToObject(final String value, Locale locale) { int length = value.length(); if (length == 0) { return null; } else if (length == 1) { return new Character(value.charAt(0)); } throw newConversionException("Cannot convert '" + value + "' to Character", value, locale); }
public Character convertToObject(final String value, Locale locale) { int length = value.length(); if (length == 0) { return null; } else if (length == 1) { return value.charAt(0); } throw newConversionException("Cannot convert '" + value + "' to Character", value, locale); }
public Double convertToObject(final String value, Locale locale) { final Number number = parse(value, -Double.MAX_VALUE, Double.MAX_VALUE, locale); // Double.MIN is the smallest nonzero positive number, not the largest // negative number if (number == null) { return null; } return new Double(number...
public Double convertToObject(final String value, Locale locale) { final Number number = parse(value, -Double.MAX_VALUE, Double.MAX_VALUE, locale); // Double.MIN is the smallest nonzero positive number, not the largest // negative number if (number == null) { return null; } return number.doubleValu...
public Float convertToObject(final String value, Locale locale) { final Number number = parse(value, -Float.MAX_VALUE, Float.MAX_VALUE, locale); if (number == null) { return null; } return new Float(number.floatValue()); }
public Float convertToObject(final String value, Locale locale) { final Number number = parse(value, -Float.MAX_VALUE, Float.MAX_VALUE, locale); if (number == null) { return null; } return number.floatValue(); }
public Integer convertToObject(final String value, Locale locale) { final Number number = parse(value, Integer.MIN_VALUE, Integer.MAX_VALUE, locale); if (number == null) { return null; } return new Integer(number.intValue()); }
public Integer convertToObject(final String value, Locale locale) { final Number number = parse(value, Integer.MIN_VALUE, Integer.MAX_VALUE, locale); if (number == null) { return null; } return number.intValue(); }
public Long convertToObject(final String value, Locale locale) { final Number number = parse(value, Long.MIN_VALUE, Long.MAX_VALUE, locale); if (number == null) { return null; } return new Long(number.longValue()); }
public Long convertToObject(final String value, Locale locale) { final Number number = parse(value, Long.MIN_VALUE, Long.MAX_VALUE, locale); if (number == null) { return null; } return number.longValue(); }
public Short convertToObject(final String value, Locale locale) { final Number number = parse(value, Short.MIN_VALUE, Short.MAX_VALUE, locale); if (number == null) { return null; } return new Short(number.shortValue()); }
public Short convertToObject(final String value, Locale locale) { final Number number = parse(value, Short.MIN_VALUE, Short.MAX_VALUE, locale); if (number == null) { return null; } return number.shortValue(); }
public static Object[] randomSequence(int size, long seed) { Integer[] result = new Integer[size]; Random r = new Random(seed); for (int i = 0; i < result.length; i++) { result[i] = new Integer(r.nextInt(size)); } return result; }
public static Object[] randomSequence(int size, long seed) { Integer[] result = new Integer[size]; Random r = new Random(seed); for (int i = 0; i < result.length; i++) { result[i] = r.nextInt(size); } return result; }
public static Boolean toBoolean(final String s) throws StringValueConversionException { return Boolean.valueOf(isTrue(s)); }
public static Boolean toBoolean(final String s) throws StringValueConversionException { return isTrue(s); }
protected boolean acceptAbsolutePath(String path) { // First check the cache if (cache != null) { Boolean rtn = cache.get(path); if (rtn != null) { return rtn.booleanValue(); } } // Check typical files such as log4j.xml etc. if (super.acceptAbsolutePath(path) == false) { return false...
protected boolean acceptAbsolutePath(String path) { // First check the cache if (cache != null) { Boolean rtn = cache.get(path); if (rtn != null) { return rtn; } } // Check typical files such as log4j.xml etc. if (super.acceptAbsolutePath(path) == false) { return false; } // Che...
public String toString() { StringBuilder b = new StringBuilder(); Field[] fields = ClientProperties.class.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { Field field = fields[i]; // Ignore these fields if (field.getName().equals("serialVersionUID") == false && field.getName().st...
public String toString() { StringBuilder b = new StringBuilder(); Field[] fields = ClientProperties.class.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { Field field = fields[i]; // Ignore these fields if (field.getName().equals("serialVersionUID") == false && field.getName().st...
private static final long serialVersionUID = 240L; // Package access for use by Test code final static String SWITCH_VALUE = "SwitchController.value"; //$NON-NLS-1$
private static final long serialVersionUID = 240L; // Package access for use by Test code static final String SWITCH_VALUE = "SwitchController.value"; //$NON-NLS-1$
public static void main(String argv[]) { Arguments argopt = new Arguments(); argopt.setUsage( new String[] { "usage: java dom.DOMCount (options) uri ...", "", "options:", " -p name ...
public static void main(String argv[]) { Arguments argopt = new Arguments(); argopt.setUsage( new String[] { "usage: java dom.DOMCount (options) uri ...", "", "options:", " -p name ...
package org.apache.myrmidon.model; /* * 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 file. */ package org.apache.ant.project...
package org.apache.myrmidon.model; /* * 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 file. */ package org.apache.myrmidon.mo...
public String open () { String fullPath = null; fileNames = new String [0]; int /*long*/ method = 0; int /*long*/ methodImpl = 0; Callback callback = null; if ((style & SWT.SAVE) != 0) { NSSavePanel savePanel = NSSavePanel.savePanel(); panel = savePanel; if (!overwrite) { callback = new Callback(this, "_...
public String open () { String fullPath = null; fileNames = new String [0]; int /*long*/ method = 0; int /*long*/ methodImpl = 0; Callback callback = null; if ((style & SWT.SAVE) != 0) { NSSavePanel savePanel = NSSavePanel.savePanel(); panel = savePanel; if (!overwrite) { callback = new Callback(this, "_...
void runWithProgress(IProgressRunnable runnable); /******************************************************************************* * Copyright (c) 2008 EclipseSource and others. All rights reserved. This * program and the accompanying materials are made available under the terms of * the Eclipse Public License v1.0 wh...
void runWithProgress(IProgressRunnable runnable); /******************************************************************************* * Copyright (c) 2008 EclipseSource and others. All rights reserved. This * program and the accompanying materials are made available under the terms of * the Eclipse Public License v1.0 wh...
public IFuture execute(IProgressRunnable runnable, IProgressMonitor monitor) { Assert.isNotNull(runnable); AbstractFuture sof = createFuture(monitor); // Actually run the runnable immediately. See NOTE above sof.safeRun(runnable); return sof; }
public IFuture execute(IProgressRunnable runnable, IProgressMonitor monitor) { Assert.isNotNull(runnable); AbstractFuture sof = createFuture(monitor); // Actually run the runnable immediately. See NOTE above sof.runWithProgress(runnable); return sof; }
protected void safeRun(ISafeProgressRunner runner, IProgressRunnable progressRunnable) { runner.safeRun(progressRunnable); }
protected void safeRun(ISafeProgressRunner runner, IProgressRunnable progressRunnable) { runner.runWithProgress(progressRunnable); }
public void run() { preSafeRun(); sof.safeRun(progressRunnable); postSafeRun(); } }; }
public void run() { preSafeRun(); sof.runWithProgress(progressRunnable); postSafeRun(); } }; }
public static String fromURI(String uri) { // #8031: first try Java 1.4. Class uriClazz = null; try { uriClazz = Class.forName("java.net.URI"); } catch (ClassNotFoundException cnfe) { // Fine, Java 1.3 or earlier, do it by hand. } // Also check...
public static String fromURI(String uri) { // #8031: first try Java 1.4. Class uriClazz = null; try { uriClazz = Class.forName("java.net.URI"); } catch (ClassNotFoundException cnfe) { // Fine, Java 1.3 or earlier, do it by hand. } // Also check...
public void setWidth (int width) { checkLayout(); if (width < -1 || width == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (this.wrapWidth == width) return; freeRuns(); this.wrapWidth = width; } boolean shape (int /*long*/ hdc, StyleItem run, char[] chars, int[] glyphCount, int maxGlyphs, SCRIPT_PROPERTIES sp) { ...
public void setWidth (int width) { checkLayout(); if (width < -1 || width == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (this.wrapWidth == width) return; freeRuns(); this.wrapWidth = width; } boolean shape (int /*long*/ hdc, StyleItem run, char[] chars, int[] glyphCount, int maxGlyphs, SCRIPT_PROPERTIES sp) { ...
public void widgetSelected(SelectionEvent e) { eventConsole.append ("getItem(Point(" + menuMouseCoords + ")) returned: " + table1.getItem(menuMouseCoords)); eventConsole.append ("\n"); }; });
public void widgetSelected(SelectionEvent e) { eventConsole.append ("getItem(Point(" + menuMouseCoords + ")) returned: " + table1.getItem(menuMouseCoords)); eventConsole.append ("\n"); } });
public void widgetSelected(SelectionEvent e) { eventConsole.append ("getItem(Point(" + menuMouseCoords + ")) returned: " + t.getItem(menuMouseCoords)); eventConsole.append ("\n"); }; }); }
public void widgetSelected(SelectionEvent e) { eventConsole.append ("getItem(Point(" + menuMouseCoords + ")) returned: " + t.getItem(menuMouseCoords)); eventConsole.append ("\n"); } }); }
protected static ZipLong toDosTime(Date time) { int year = time.getYear() + 1900; int month = time.getMonth() + 1; if (year < 1980) { return DOS_TIME_MIN; } long value = ((year - 1980) << 25) | (month << 21) | (time.getDate...
protected static ZipLong toDosTime(Date time) { int year = time.getYear() + 1900; int month = time.getMonth() + 1; if (year < 1980) { return DOS_TIME_MIN; } long value = ((year - 1980) << 25) | (month << 21) | (time.getDate...
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); CustomControlExample instance = new CustomControlExample(shell); shell.setText(getResourceString("custom.window.title")); setShellSize(display, shell); shell.open...
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); CustomControlExample instance = new CustomControlExample(shell); shell.setText(getResourceString("custom.window.title")); setShellSize(shell); shell.open(); whi...
public void onInstantiation(Component component) { if (!Session.get().getAuthorizationStrategy().authorizeInstantiation(component.getClass())) { throw new UnauthorizedInstantiationException(component.getClass()); } }
public void onInstantiation(Component component) { if (!Session.get().getAuthorizationStrategy().isInstantiationAuthorized(component.getClass())) { throw new UnauthorizedInstantiationException(component.getClass()); } }
public Object getObject(Component component) { return (FormComponent.this.authorize(ENABLE) && FormComponent.this.isEnabled()) ? null : "disabled"; }
public Object getObject(Component component) { return (FormComponent.this.isActionAuthorized(ENABLE) && FormComponent.this.isEnabled()) ? null : "disabled"; }
public void testUninitialisedLocalizer() { StringResourceModel model = new StringResourceModel("simple.text", null, null); try
public void testUninitialisedLocalizer() { StringResourceModel model = new StringResourceModel("simple.text", null); try
package org.apache.wicket.response.filter; /* * 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 Licen...
package org.apache.wicket.response.filter; /* * 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 Licen...
public void testSelectForUpdateOverride() { OpenJPAEntityManager em = OpenJPAPersistence.cast(emf.createEntityManager()); DBDictionary dict = ((JDBCConfiguration) em.getConfiguration()) .getDBDictionaryInstance(); // hsql doesn't support locking; circumvent the test ...
public void testSelectForUpdateOverride() { OpenJPAEntityManager em = OpenJPAPersistence.cast(emf.createEntityManager()); DBDictionary dict = ((JDBCConfiguration) em.getConfiguration()) .getDBDictionaryInstance(); // hsql doesn't support locking; circumvent the test ...
private static final Localizer _loc = Localizer.forPackage (PNonTransState.class); void initialize(StateManagerImpl context) { context.setDirty(false); context.clearSavedFields(); // spec says all proxies to second class objects should be reset context.proxyFields(true,...
private static final Localizer _loc = Localizer.forPackage (PNonTransState.class); void initialize(StateManagerImpl context) { context.setDirty(false); context.clearSavedFields(); // spec says all proxies to second class objects should be reset context.proxyFields(true,...
public void startEntity(String name, XMLResourceIdentifier identifier, String encoding) throws XNIException { super.startEntity(name, identifier, encoding); boolean dtdEntity = name.equals("[dtd]"); if (dtdEntity) { // ca...
public void startEntity(String name, XMLResourceIdentifier identifier, String encoding) throws XNIException { super.startEntity(name, identifier, encoding); boolean dtdEntity = name.equals("[dtd]"); if (dtdEntity) { // ca...
private Object execute() { if (!isNative() && _query.getOperation() != QueryOperations.OP_SELECT) throw new InvalidStateException(_loc.get("not-select-query", getQueryString()), null, null, false); try { lock(); Map params = getParameterValues(); boolean registered =...
private Object execute() { if (!isNative() && _query.getOperation() != QueryOperations.OP_SELECT) throw new InvalidStateException(_loc.get("not-select-query", getQueryString()), null, null, false); try { lock(); Map params = getParameterValues(); boolean registered =...
public void setInitialization(Expression initialization) { this.initialization = initialization; } public EclipseTypeMunger build(ClassScope classScope) { EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(classScope); resolveOnType(classScope); if (classScope.referenceContext.binding == ...
public void setInitialization(Expression initialization) { this.initialization = initialization; } public EclipseTypeMunger build(ClassScope classScope) { EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(classScope); resolveOnType(classScope); if (ignoreFurtherInvestigation) return null...
public void actionPerformed(ActionEvent e) { JFileChooser chooser = FileDialoger.promptToOpenFile(); File file = chooser.getSelectedFile(); setValue(file); }
public void actionPerformed(ActionEvent e) { JFileChooser chooser = FileDialoger.promptToOpenFile(); File file = chooser.getSelectedFile(); setValue(file.getPath()); }
public void setUp() { // TODO - Hack until OPENJPA-1594 is addressed setUnsupportedDatabases(OracleDictionary.class, DB2Dictionary.class); // Disable tests for any DB that has supportsSelectForUpdate==false, like HSQLDictionary OpenJPAEntityManagerFactorySPI tempEMF = emf; ...
public void setUp() { // TODO - Hack until OPENJPA-1594 is addressed // setUnsupportedDatabases(OracleDictionary.class, DB2Dictionary.class); // Disable tests for any DB that has supportsSelectForUpdate==false, like HSQLDictionary OpenJPAEntityManagerFactorySPI tempEMF = emf...
// private void xxxName-n() {} // } // @Aspect public class ... LazyClassGen cg = new LazyClassGen( m_concreteAspect.name.replace('.', '/'), m_parent.getName(), null,//TODO AV - we could point to the aop.xml that defines it and use JSR-...
// private void xxxName-n() {} // } // @Aspect public class ... LazyClassGen cg = new LazyClassGen( m_concreteAspect.name.replace('.', '/'), m_parent.getName(), null,//TODO AV - we could point to the aop.xml that defines it and use JSR-...
protected Iterator renderIterator() { final int iterations = getIterations();
protected Iterator renderIterator() { final int iterations = size();
public Hashtable getFilterHash() { int filterSize = getFilters().size(); Hashtable filterHash = new Hashtable(filterSize); for (Enumeration e = getFilters().elements(); e.hasMoreElements();) { Filter filter = (Filter) e.nextElement(); filterHash.put(filter.getToken(), f...
public Hashtable getFilterHash() { int filterSize = getFilters().size(); Hashtable filterHash = new Hashtable(filterSize + 1); for (Enumeration e = getFilters().elements(); e.hasMoreElements();) { Filter filter = (Filter) e.nextElement(); filterHash.put(filter.getToken(...
public boolean accept(File f) { boolean accept = !f.isDirectory(); return accept; } }); // For each file, add it either as a real .class file or as a resource for (int i = 0; i < files.length; i++) { FileInputStream fis = new FileInputStream(files[i]); byte[] bytes = FileUtil.readAsByte...
public boolean accept(File f) { boolean accept = !f.isDirectory(); return accept; } }); // For each file, add it either as a real .class file or as a resource for (int i = 0; i < files.length; i++) { FileInputStream fis = new FileInputStream(files[i]); byte[] bytes = FileUtil.readAsByte...
private TypePattern parseAtomicTypePattern() { if (maybeEat("!")) { int startPos = tokenSource.peek(-1).getStart(); //??? we lose source location for true start of !type TypePattern p = new NotTypePattern(parseAtomicTypePattern()); return p; } if (maybeEat("(")) { TypePattern p = parseTypePatte...
private TypePattern parseAtomicTypePattern() { if (maybeEat("!")) { //int startPos = tokenSource.peek(-1).getStart(); //??? we lose source location for true start of !type TypePattern p = new NotTypePattern(parseAtomicTypePattern()); return p; } if (maybeEat("(")) { TypePattern p = parseTypePat...
public boolean matches(TypeX[] tys, World world) { if (this == ANY) return true; //System.out.println("matching: " + this + " with " + Arrays.asList(tys)); ResolvedTypeX[] types = world.resolve(tys); int len = types.length; for (int j=0, lenj = required.size(); j < lenj; j++) { if (! matchesAny(requ...
public boolean matches(TypeX[] tys, World world) { if (this == ANY) return true; //System.out.println("matching: " + this + " with " + Arrays.asList(tys)); ResolvedTypeX[] types = world.resolve(tys); // int len = types.length; for (int j=0, lenj = required.size(); j < lenj; j++) { if (! matchesAny(r...
protected boolean matchesSubtypes(ResolvedTypeX type) { //System.out.println("matching: " + this + " to " + type); if (matchesExactly(type)) { //System.out.println(" true"); return true; } FuzzyBoolean ret = FuzzyBoolean.NO; // ??? -eh for (Iterator i = type.getDirectSupertypes(); i.hasNext(); ) ...
protected boolean matchesSubtypes(ResolvedTypeX type) { //System.out.println("matching: " + this + " to " + type); if (matchesExactly(type)) { //System.out.println(" true"); return true; } // FuzzyBoolean ret = FuzzyBoolean.NO; // ??? -eh for (Iterator i = type.getDirectSupertypes(); i.hasNext();...
private void init(){ try { bshInterpreter = new BeanShellInterpreter(INIT_FILE, log); } catch (ClassNotFoundException e) { log.error("Cannot find BeanShell: "+e.toString()); } }
private void init(){ try { bshInterpreter = new BeanShellInterpreter(JMeterUtils.getProperty(INIT_FILE), log); } catch (ClassNotFoundException e) { log.error("Cannot find BeanShell: "+e.toString()); } }
public synchronized void setParameters(Collection parameters) throws InvalidVariableException { values = parameters.toArray(); if (values.length < 1 || values.length > 2) { throw new InvalidVariableException("Expecting 1 or 2 parameters, but found " + values.length);//$NON-NLS-1$ } try { bshInterprete...
public synchronized void setParameters(Collection parameters) throws InvalidVariableException { values = parameters.toArray(); if (values.length < 1 || values.length > 2) { throw new InvalidVariableException("Expecting 1 or 2 parameters, but found " + values.length);//$NON-NLS-1$ } try { bshInterprete...
public BeanShellSampler() { try { bshInterpreter = new BeanShellInterpreter(INIT_FILE, log); } catch (ClassNotFoundException e) { log.error("Cannot find BeanShell: "+e.toString()); } }
public BeanShellSampler() { try { bshInterpreter = new BeanShellInterpreter(JMeterUtils.getProperty(INIT_FILE), log); } catch (ClassNotFoundException e) { log.error("Cannot find BeanShell: "+e.toString()); } }
public String getExampleID() { return "<protocol>://<machinename>:<port>/<servicename>"; }
public String getExampleID() { return "ecftcp://<server>:<port>/<groupname>"; }
private Object[] getPKValues(OpenJPAStateManager sm, JDBCStore store) { Object[] pks = null; Object oid = sm.getObjectId(); if (_mapping.getIdentityType() == ClassMapping.ID_APPLICATION) pks = ApplicationIds.toPKValues(oid, _mapping); Object[] val = new Object[_pkCol...
private Object[] getPKValues(OpenJPAStateManager sm, JDBCStore store) { Object[] pks = null; Object oid = sm.getObjectId(); if (_mapping.getIdentityType() == ClassMapping.ID_APPLICATION) pks = ApplicationIds.toPKValues(oid, _mapping); Object[] val = new Object[_pkCol...
protected Object nextInternal(JDBCStore store, ClassMapping mapping) throws SQLException { Connection conn = getConnection(store); try { return Numbers.valueOf(getSequence(conn)); } finally { closeConnection(conn); } }
protected Object nextInternal(JDBCStore store, ClassMapping mapping) throws SQLException { Connection conn = getConnection(store); try { return getSequence(conn); } finally { closeConnection(conn); } }
public Object toDataStoreValue(Select sel, ExpContext ctx, ExpState state, Object val) { // if datastore identity, try to convert to a long value ClassMapping mapping = _path.getClassMapping(state); if (mapping.getIdentityType() == mapping.ID_DATASTORE) { if (val instanc...
public Object toDataStoreValue(Select sel, ExpContext ctx, ExpState state, Object val) { // if datastore identity, try to convert to a long value ClassMapping mapping = _path.getClassMapping(state); if (mapping.getIdentityType() == mapping.ID_DATASTORE) { if (val instanc...
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws SQLException { Column col = cols[0]; if (fk != null) col = fk.getColumn(col); long id = res.getLong(col); if (id == 0 && res.wasNull()) ...
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws SQLException { Column col = cols[0]; if (fk != null) col = fk.getColumn(col); long id = res.getLong(col); if (id == 0 && res.wasNull()) ...
public void initialize() { if (_initials == null) { Column[] cols = vers.getColumns(); _initials = new Number[cols.length]; for (int i = 0; i < cols.length; i++) { _initials[i] = nextValue(Numbers.valueOf(0), getJavaType(i)); } } super.initialize(); }
public void initialize() { if (_initials == null) { Column[] cols = vers.getColumns(); _initials = new Number[cols.length]; for (int i = 0; i < cols.length; i++) { _initials[i] = nextValue(0, getJavaType(i)); } } super.initialize(); }
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws SQLException { ClassMapping relmapping = field.getTypeMapping(); if (relmapping.getIdentityType() == ClassMapping.ID_DATASTORE) { Column col = cols[0]; ...
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws SQLException { ClassMapping relmapping = field.getTypeMapping(); if (relmapping.getIdentityType() == ClassMapping.ID_DATASTORE) { Column col = cols[0]; ...
public String readSchemaColumn() throws SQLException { DBDictionary dict = _conf.getDBDictionaryInstance(); SQLBuffer sel = new SQLBuffer(dict).append(_schemaColumn); SQLBuffer where = new SQLBuffer(dict).append(_pkColumn).append(" = "). appendValue(Numbers.valueOf(1), _p...
public String readSchemaColumn() throws SQLException { DBDictionary dict = _conf.getDBDictionaryInstance(); SQLBuffer sel = new SQLBuffer(dict).append(_schemaColumn); SQLBuffer where = new SQLBuffer(dict).append(_pkColumn).append(" = "). appendValue(1, _pkColumn); ...
protected void setLockLevel(OpenJPAStateManager sm, int level) { sm.setLock(Numbers.valueOf(level)); }
protected void setLockLevel(OpenJPAStateManager sm, int level) { sm.setLock(level); }
protected Object operate(Collection os, Class c) { long count = 0; for (Iterator itr = os.iterator(); itr.hasNext();) if (itr.next() != null) count++; return Numbers.valueOf(count); }
protected Object operate(Collection os, Class c) { long count = 0; for (Iterator itr = os.iterator(); itr.hasNext();) if (itr.next() != null) count++; return count; }
protected Object eval(Object candidate, Object orig, StoreContext ctx, Object[] params) { Object str = _val.eval(candidate, orig, ctx, params); Object arg = _args.eval(candidate, orig, ctx, params); int idx; if (arg instanceof Object[]) { Object[] args = (Object[]...
protected Object eval(Object candidate, Object orig, StoreContext ctx, Object[] params) { Object str = _val.eval(candidate, orig, ctx, params); Object arg = _args.eval(candidate, orig, ctx, params); int idx; if (arg instanceof Object[]) { Object[] args = (Object[]...
protected Object operate(Collection os, Class c) { if (os.isEmpty()) return null; Class type = getType(c); Object sum = Filters.convert(Numbers.valueOf(0), type); Object cur; for (Iterator itr = os.iterator(); itr.hasNext();) { cur = itr.next(); ...
protected Object operate(Collection os, Class c) { if (os.isEmpty()) return null; Class type = getType(c); Object sum = Filters.convert(0, type); Object cur; for (Iterator itr = os.iterator(); itr.hasNext();) { cur = itr.next(); if (cur !=...
public Object getIdObject() { return Numbers.valueOf(_id); }
public Object getIdObject() { return _id; }
public Object getIdObject() { return Numbers.valueOf(key); }
public Object getIdObject() { return key; }
protected Object getInternal(int index) { if (_full != null) { if (index >= _full.length) return PAST_END; return _full[index]; } Integer i = Numbers.valueOf(index); Object ret = _rows.get(i); if (ret != null) { if (ret ins...
protected Object getInternal(int index) { if (_full != null) { if (index >= _full.length) return PAST_END; return _full[index]; } Integer i = index; Object ret = _rows.get(i); if (ret != null) { if (ret instanceof Null) ...
public Object toDataStoreValue(ValueMapping vm, Object val, JDBCStore store) { if (val == null) return null; Point p = (Point) val; return new Object[]{ Numbers.valueOf(p.x), Numbers.valueOf(p.y) }; }
public Object toDataStoreValue(ValueMapping vm, Object val, JDBCStore store) { if (val == null) return null; Point p = (Point) val; return new Object[]{ p.x, p.y }; }
public void store(OpenJPAStateManager sm) { _version = (Long) sm.getVersion(); // if the version has not been set in the state manager (only true // when the object is new), set the version number to 0 if (_version == null) _version = Numbers.valueOf(0L); // run...
public void store(OpenJPAStateManager sm) { _version = (Long) sm.getVersion(); // if the version has not been set in the state manager (only true // when the object is new), set the version number to 0 if (_version == null) _version = 0L; // run through each per...
private static void incrementVersion(OpenJPAStateManager sm) { long version = 0; if (sm.getVersion() != null) version = ((Long) sm.getVersion()).longValue() + 1; sm.setNextVersion(Numbers.valueOf(version)); }
private static void incrementVersion(OpenJPAStateManager sm) { long version = 0; if (sm.getVersion() != null) version = ((Long) sm.getVersion()).longValue() + 1; sm.setNextVersion(version); }
public Image(final String id, final String string) { this(id, new Model(string)); }
public Image(final String id, final String string) { this(id, new Model<String>(string)); }
public InvalidImageButtonPage() { add(new ImageButton("invalidImage", new Model("toto.gif"))); }
public InvalidImageButtonPage() { add(new ImageButton("invalidImage", new Model<String>("toto.gif"))); }
public InvalidImagePage() { add(new Image("invalidImage", new Model("toto.gif"))); }
public InvalidImagePage() { add(new Image("invalidImage", new Model<String>("toto.gif"))); }
public PanelWithAttributeModifier(final String id) { super(id); add(new AttributeModifier("class", true, new Model("test"))); }
public PanelWithAttributeModifier(final String id) { super(id); add(new AttributeModifier("class", true, new Model<String>("test"))); }
public SimplePage_2() { add(new Label("amount", new Model("$5.00")).setRenderBodyOnly(true)); add(new BookmarkablePageLink("link", SimplePage_1.class)); }
public SimplePage_2() { add(new Label("amount", new Model<String>("$5.00")).setRenderBodyOnly(true)); add(new BookmarkablePageLink("link", SimplePage_1.class)); }
public SimplePage_3() { ValueMap modelData = new ValueMap(); modelData.put("testData", "123456"); setDefaultModel(new Model(modelData)); }
public SimplePage_3() { ValueMap modelData = new ValueMap(); modelData.put("testData", "123456"); setDefaultModel(new Model<ValueMap>(modelData)); }
public void testExtDirs() throws Exception { final String DIR = AjdtAjcTests.TESTDATA_PATH; AjBuildConfig config = genBuildConfig(new String[] { "-extdirs", DIR }, messageWriter); assertTrue(config.getClasspath().toString(), config.getClasspath().contains( new File(DIR + File.separator + "testclasses....
public void testExtDirs() throws Exception { final String DIR = AjdtAjcTests.TESTDATA_PATH; AjBuildConfig config = genBuildConfig(new String[] { "-extdirs", DIR }, messageWriter); assertTrue(config.getClasspath().toString(), config.getClasspath().contains( new File(DIR + File.separator + "testclasses....
public Object getValueAt(int rowIndex, int columnIndex) { if(columnIndex == 0) { if((rowIndex >= 0) && (rowIndex < getSampleCount())) { return new Integer(rowIndex); } } else if(columnIndex == 1) { log.info("rowIndex = "+rowIndex); if((rowIndex >= 0) && (rowIndex < urlList.size())) { ...
public Object getValueAt(int rowIndex, int columnIndex) { if(columnIndex == 0) { if((rowIndex >= 0) && (rowIndex < getSampleCount())) { return new Integer(rowIndex+1); } } else if(columnIndex == 1) { log.info("rowIndex = "+rowIndex); if((rowIndex >= 0) && (rowIndex < urlList.size())) {...
private boolean validateText(Iterator expectedElements, HtmlDocumentParser parser) { boolean valid = true; if (expectedElements.hasNext()) { DocumentElement e = (DocumentElement) expectedElements.next(); if (e instanceof TextContent) { ...
private boolean validateText(Iterator expectedElements, HtmlDocumentParser parser) { boolean valid = true; if (expectedElements.hasNext()) { DocumentElement e = (DocumentElement) expectedElements.next(); if (e instanceof TextContent) { ...
public int hashCode() { if (isReference()) { return getCheckedRef().hashCode(); } String name = getName(); return MAGIC * (name == null ? name.hashCode() : NULL_NAME); }
public int hashCode() { if (isReference()) { return getCheckedRef().hashCode(); } String name = getName(); return MAGIC * (name == null ? NULL_NAME : name.hashCode()); }
public InputStream getInputStream() throws ResourceStreamNotFoundException { final ServletContext context = ((WebApplication)RequestCycle.get().getApplication()) .getServletContext(); in = context.getResourceAsStream(url); if (in == null) { throw new WicketRuntimeException("the requested resource was ...
public InputStream getInputStream() throws ResourceStreamNotFoundException { final ServletContext context = ((WebApplication)RequestCycle.get().getApplication()) .getServletContext(); in = context.getResourceAsStream(url); if (in == null) { throw new WicketRuntimeException("The requested resource was ...
private void regenerateSupportClasses(File descriptorFile) { Project project = ejbcTask.getProject(); String javaHome = System.getProperty("java.home"); String compiler = project.getProperty("build.compiler"); String[] args = null; if (compiler.equalsIgnoreCase("jik...
private void regenerateSupportClasses(File descriptorFile) { Project project = ejbcTask.getProject(); String javaHome = System.getProperty("java.home"); String compiler = project.getProperty("build.compiler"); String[] args = null; if (compiler != null && compiler.e...
public ExactAnnotationTypePattern(TypeX annotationType) { this.annotationType = annotationType; this.resolved = false; }
public ExactAnnotationTypePattern(TypeX annotationType) { this.annotationType = annotationType; this.resolved = (annotationType instanceof ResolvedTypeX); }
protected Object nativeToJava(TransferData transferData) { if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; IDataObject data = new IDataObject(transferData.pIDataObject); data.AddRef(); FORMATETC formatetc = transferData.formatetc; STGMEDIUM stgmedium = new STGMEDIUM(); stgmed...
protected Object nativeToJava(TransferData transferData) { if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; IDataObject data = new IDataObject(transferData.pIDataObject); data.AddRef(); FORMATETC formatetc = transferData.formatetc; STGMEDIUM stgmedium = new STGMEDIUM(); stgmed...
public Object nativeToJava(TransferData transferData) { if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; // get file names from IDataObject IDataObject dataObject = new IDataObject(transferData.pIDataObject); dataObject.AddRef(); FORMATETC formatetc = new FORMATETC(); formatet...
public Object nativeToJava(TransferData transferData) { if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; // get file names from IDataObject IDataObject dataObject = new IDataObject(transferData.pIDataObject); dataObject.AddRef(); FORMATETC formatetc = new FORMATETC(); formatet...
public Object nativeToJava(TransferData transferData){ if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; IDataObject data = new IDataObject(transferData.pIDataObject); data.AddRef(); STGMEDIUM stgmedium = new STGMEDIUM(); FORMATETC formatetc = transferData.formatetc; stgmedium.tym...
public Object nativeToJava(TransferData transferData){ if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; IDataObject data = new IDataObject(transferData.pIDataObject); data.AddRef(); STGMEDIUM stgmedium = new STGMEDIUM(); FORMATETC formatetc = transferData.formatetc; stgmedium.tym...
public Object nativeToJava(TransferData transferData) { if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; IDataObject dataObject = new IDataObject(transferData.pIDataObject); dataObject.AddRef(); FORMATETC formatetc = new FORMATETC(); formatetc.cfFormat = COM.CF_DIB; formatetc.ptd...
public Object nativeToJava(TransferData transferData) { if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; IDataObject dataObject = new IDataObject(transferData.pIDataObject); dataObject.AddRef(); FORMATETC formatetc = new FORMATETC(); formatetc.cfFormat = COM.CF_DIB; formatetc.ptd...
public Object nativeToJava(TransferData transferData){ if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; IDataObject data = new IDataObject(transferData.pIDataObject); data.AddRef(); STGMEDIUM stgmedium = new STGMEDIUM(); FORMATETC formatetc = transferData.formatetc; stgmedium.tym...
public Object nativeToJava(TransferData transferData){ if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; IDataObject data = new IDataObject(transferData.pIDataObject); data.AddRef(); STGMEDIUM stgmedium = new STGMEDIUM(); FORMATETC formatetc = transferData.formatetc; stgmedium.tym...
public Object nativeToJava(TransferData transferData){ if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; IDataObject data = new IDataObject(transferData.pIDataObject); data.AddRef(); FORMATETC formatetc = transferData.formatetc; STGMEDIUM stgmedium = new STGMEDIUM(); stgmedium.t...
public Object nativeToJava(TransferData transferData){ if (!isSupportedType(transferData) || transferData.pIDataObject == 0) return null; IDataObject data = new IDataObject(transferData.pIDataObject); data.AddRef(); FORMATETC formatetc = transferData.formatetc; STGMEDIUM stgmedium = new STGMEDIUM(); stgmedium.t...
public void dispose () { /* * Note: It is valid to attempt to dispose a widget * more than once. If this happens, fail silently. */ if (isDisposed ()) return; if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); release (true); } void doCommandBySelector (int /*long*/ id, int /*long*/ sel, int /*lo...
public void dispose () { /* * Note: It is valid to attempt to dispose a widget * more than once. If this happens, fail silently. */ if (isDisposed ()) return; if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); release (true); } void doCommandBySelector (int /*long*/ id, int /*long*/ sel, int /*lo...
private int normalizeWhitespace( String value, boolean collapse) { boolean skipSpace = collapse; boolean sawNonWS = false; int leading = 0; int trailing = 0; int c; int size = value.length(); fNormalizedStr.setLength(0); for (int i = 0; i < siz...
private int normalizeWhitespace( String value, boolean collapse) { boolean skipSpace = collapse; boolean sawNonWS = false; int leading = 0; int trailing = 0; int c; int size = value.length(); fNormalizedStr.setLength(0); for (int i = 0; i < siz...
public final void onResourceRequested() { // Get request cycle final RequestCycle cycle = RequestCycle.get(); // The cycle's page is set to null so that it won't be rendered back to // the client since the resource being requested has nothing to do with // pages cycle.setResponsePage((Page)null); // F...
public final void onResourceRequested() { // Get request cycle final RequestCycle cycle = RequestCycle.get(); // The cycle's page is set to null so that it won't be rendered back to // the client since the resource being requested has nothing to do with // pages cycle.setResponsePage((Page)null); // F...
protected void setUp() throws Exception { super.setUp(); container = getContainerFactory().createContainer(Generic.HOST_CONTAINER_TYPE); containerAdapter = (IRemoteServiceContainerAdapter) container.getAdapter(IRemoteServiceContainerAdapter.class); }
protected void setUp() throws Exception { super.setUp(); container = getContainerFactory().createContainer(Generic.CONSUMER_CONTAINER_TYPE); containerAdapter = (IRemoteServiceContainerAdapter) container.getAdapter(IRemoteServiceContainerAdapter.class); }
public void test() { String testLstFile = AjdeTests.TESTDATA_PATH + "/StructureModelRegressionTest/example.lst"; File f = new File(testLstFile); assertTrue(testLstFile, f.canRead()); // TODO: enable when model is verified. // assertTrue("saved model: " + testLstFile, verifyAgainstSaved...
public void test() { String testLstFile = AjdeTests.testDataPath("StructureModelRegressionTest/example.lst"); File f = new File(testLstFile); assertTrue(testLstFile, f.canRead()); // TODO: enable when model is verified. // assertTrue("saved model: " + testLstFile, verifyAgainstSavedMod...
public SortableContactDataProvider() { // set default sort addSort("firstName"); }
public SortableContactDataProvider() { // set default sort setSort("firstName", true); }
private PrintWriter createSourceFile(String metaClass, TypeElement e) throws IOException { Filer filer = processingEnv.getFiler(); JavaFileObject javaFile = filer.createSourceFile(metaClass, e); log(_loc.get("mmg-process", metaClass, javaFile.toUri()).getMessage()); OutputSt...
private PrintWriter createSourceFile(String metaClass, TypeElement e) throws IOException { Filer filer = processingEnv.getFiler(); JavaFileObject javaFile = filer.createSourceFile(metaClass, e); log(_loc.get("mmg-process", javaFile.toUri()).getMessage()); OutputStream out = ...
protected void layout (Composite composite, boolean flushCache) { Rectangle rect = composite.getClientArea (); int x = rect.x + marginLeft + marginWidth; int y = rect.y + marginTop + marginHeight; int width = Math.max (0, rect.width - marginLeft - 2 * marginWidth - marginRight); int height = Math.max (0, rect.heig...
protected void layout (Composite composite, boolean flushCache) { Rectangle rect = composite.getClientArea (); int x = rect.x + marginLeft + marginWidth; int y = rect.y + marginTop + marginHeight; int width = Math.max (0, rect.width - marginLeft - 2 * marginWidth - marginRight); int height = Math.max (0, rect.heig...
public int getTextLimit () { checkWidget (); return 0; }
public int getTextLimit () { checkWidget (); return LIMIT; }