buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public NSPrintOperation printOperationWithPrintInfo(NSPrintInfo printInfo) { int result = OS.objc_msgSend(this.id, OS.sel_printOperationWithPrintInfo_, printInfo != null ? printInfo.id : 0); return result != 0 ? new NSPrintOperation(result) : null; }
public NSPrintOperation printOperationWithPrintInfo(NSPrintInfo printInfo) { int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_printOperationWithPrintInfo_, printInfo != null ? printInfo.id : 0); return result != 0 ? new NSPrintOperation(result) : null; }
public static WebPreferences standardPreferences() { int result = OS.objc_msgSend(OS.class_WebPreferences, OS.sel_standardPreferences); return result != 0 ? new WebPreferences(result) : null; }
public static WebPreferences standardPreferences() { int /*long*/ result = OS.objc_msgSend(OS.class_WebPreferences, OS.sel_standardPreferences); return result != 0 ? new WebPreferences(result) : null; }
public Path (Device device, Path path, float flatness) { super(device); if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); flatness = Math.max(0, flatness); if (flatness == 0) { handle = new NSBezierPath(path.handle.copy().id); } else { double /...
public Path (Device device, Path path, float flatness) { super(device); if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); flatness = Math.max(0, flatness); if (flatness == 0) { handle = new NSBezierPath(path.handle.copy().id); } else { float /*...
public void layout (Control [] changed) { checkWidget (); if (changed == null) error (SWT.ERROR_INVALID_ARGUMENT); for (int i=0; i<changed.length; i++) { Control control = changed [i]; if (control == null) error (SWT.ERROR_INVALID_ARGUMENT); if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); bool...
public void layout (Control [] changed) { checkWidget (); if (changed == null) error (SWT.ERROR_INVALID_ARGUMENT); for (int i=0; i<changed.length; i++) { Control control = changed [i]; if (control == null) error (SWT.ERROR_INVALID_ARGUMENT); if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); bool...
public void removeTraverseListener(TraverseListener listener) { checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Traverse, listener); } void resized () { sendEvent (SWT.Resize); } boolean sendDragEvent (int button, int stateMask, int x, ...
public void removeTraverseListener(TraverseListener listener) { checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Traverse, listener); } void resized () { sendEvent (SWT.Resize); } boolean sendDragEvent (int button, int stateMask, int x, ...
* public void handleEvent(Event event) { * TreeItem item = (TreeItem)event.item; * TreeItem parentItem = item.getParentItem(); * String text = null; * if (parentItem == null) { * text = "node " + tree.indexOf(item); * } else { * text = ...
* public void handleEvent(Event event) { * TreeItem item = (TreeItem)event.item; * TreeItem parentItem = item.getParentItem(); * String text = null; * if (parentItem == null) { * text = "node " + tree.indexOf(item); * } else { * text = ...
private void flushInternal(RowImpl row) throws SQLException { // can't batch rows with auto-inc columns Column[] autoAssign = null; if (row.getAction() == Row.ACTION_INSERT) autoAssign = row.getTable().getAutoAssignedColumns(); // prepare statement String sql = r...
private void flushInternal(RowImpl row) throws SQLException { // can't batch rows with auto-inc columns Column[] autoAssign = null; if (row.getAction() == Row.ACTION_INSERT) autoAssign = row.getTable().getAutoAssignedColumns(); // prepare statement String sql = r...
private void allocateSequence(JDBCStore store, ClassMapping mapping, Status stat, int alloc, boolean updateStatSeq) { try { // if the update fails, probably because row doesn't exist yet if (!setSequence(mapping, stat, alloc, updateStatSeq, getConnection(store...
private void allocateSequence(JDBCStore store, ClassMapping mapping, Status stat, int alloc, boolean updateStatSeq) { try { // if the update fails, probably because row doesn't exist yet if (!setSequence(mapping, stat, alloc, updateStatSeq, getConnection(store...
protected Class getClass(Object val, JDBCStore store) throws ClassNotFoundException { ClassLoader loader = getClassLoader(store); return Class.forName((String) val, true, loader); } public void loadSubclasses(JDBCStore store) throws SQLException, ClassNotFoundException { ...
protected Class getClass(Object val, JDBCStore store) throws ClassNotFoundException { ClassLoader loader = getClassLoader(store); return Class.forName((String) val, true, loader); } public void loadSubclasses(JDBCStore store) throws SQLException, ClassNotFoundException { ...
protected Class getClass(Object val, JDBCStore store) throws ClassNotFoundException { if (_vals == null) { ClassMapping cls = disc.getClassMapping(); ClassMapping[] subs = cls.getJoinablePCSubclassMappings(); Map map = new HashMap((int) ((subs.length + 1) * 1.33 +...
protected Class getClass(Object val, JDBCStore store) throws ClassNotFoundException { if (_vals == null) { ClassMapping cls = disc.getClassMapping(); ClassMapping[] subs = cls.getJoinablePCSubclassMappings(); Map map = new HashMap((int) ((subs.length + 1) * 1.33 +...
private static final ProductDerivation[] _derivations; static { Class[] pdcls = Services.getImplementorClasses(ProductDerivation.class); List derivations = new ArrayList(pdcls.length); for (int i = 0; i < pdcls.length; i++) { try { derivations.add(pdcls[i].ne...
private static final ProductDerivation[] _derivations; static { Class[] pdcls = Services.getImplementorClasses(ProductDerivation.class); List derivations = new ArrayList(pdcls.length); for (int i = 0; i < pdcls.length; i++) { try { derivations.add(pdcls[i].ne...
conf.getLog(OpenJPAConfiguration.LOG_RUNTIME).warn(null, t); /* * Copyright 2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache....
conf.getLog(OpenJPAConfiguration.LOG_RUNTIME).warn(null, t); /* * Copyright 2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache....
public Object newInstance(Class cls) { assertOpen(); //### JDO2 if (cls.isInterface() || Modifier.isAbstract(cls.getModifiers())) throw new UnsupportedOperationException(_loc.get ("new-abstract", cls)); // 1.5 doesn't initialize classes without a true Cl...
public Object newInstance(Class cls) { assertOpen(); //### JDO2 if (cls.isInterface() || Modifier.isAbstract(cls.getModifiers())) throw new UnsupportedOperationException(_loc.get ("new-abstract", cls).getMessage()); // 1.5 doesn't initialize classes with...
public void accessingField(int idx) { if (!_access && !_loaded.get(idx)) throw new IllegalStateException(_loc.get("unloaded-detached", _pc)); }
public void accessingField(int idx) { if (!_access && !_loaded.get(idx)) throw new IllegalStateException(_loc.get("unloaded-detached", _pc).getMessage()); }
public static Object convert(Object o, Class type) { if (o == null) return null; if (o.getClass() == type) return o; type = wrap(type); if (type.isAssignableFrom(o.getClass())) return o; // the only non-numeric conversions we do are to st...
public static Object convert(Object o, Class type) { if (o == null) return null; if (o.getClass() == type) return o; type = wrap(type); if (type.isAssignableFrom(o.getClass())) return o; // the only non-numeric conversions we do are to st...
public void validateExtensionKeys() { if (_exts == null || _exts.isEmpty()) return; OpenJPAConfiguration conf = getRepository().getConfiguration(); Log log = conf.getLog(conf.LOG_METADATA); if (!log.isWarnEnabled()) return; Collection validNames = ne...
public void validateExtensionKeys() { if (_exts == null || _exts.isEmpty()) return; OpenJPAConfiguration conf = getRepository().getConfiguration(); Log log = conf.getLog(conf.LOG_METADATA); if (!log.isWarnEnabled()) return; Collection validNames = ne...
protected void assertFiles(String[] files) { if (files.length == 0) throw new BuildException(_loc.get("no-filesets")); }
protected void assertFiles(String[] files) { if (files.length == 0) throw new BuildException(_loc.get("no-filesets").getMessage()); }
protected void setInternalString(String str) { if (str == null) set(null); else throw new IllegalArgumentException(_loc.get("cant-set-string", getProperty())); }
protected void setInternalString(String str) { if (str == null) set(null); else throw new IllegalArgumentException(_loc.get("cant-set-string", getProperty()).getMessage()); }
public void set(Object obj, boolean derived) { if (!_singleton) throw new IllegalStateException(_loc.get("not-singleton", getProperty())); super.set(obj, derived); }
public void set(Object obj, boolean derived) { if (!_singleton) throw new IllegalStateException(_loc.get("not-singleton", getProperty()).getMessage()); super.set(obj, derived); }
protected String currentPackage() { return _package; } /** * Helper method to create the {@link Class} for the given name, * taking into account the package currently being parsed for relative * class names. */ protected Class classForName(String name, boolean resolve) ...
protected String currentPackage() { return _package; } /** * Helper method to create the {@link Class} for the given name, * taking into account the package currently being parsed for relative * class names. */ protected Class classForName(String name, boolean resolve) ...
private int scan(File file, MetaDataFilter filter, FileResource rsrc, Collection metas, int scanned) throws IOException { if (scanned > SCAN_LIMIT) throw new IllegalStateException(_loc.get("too-many-files", String.valueOf(SCAN_LIMIT))); scanned++; if (fil...
private int scan(File file, MetaDataFilter filter, FileResource rsrc, Collection metas, int scanned) throws IOException { if (scanned > SCAN_LIMIT) throw new IllegalStateException(_loc.get("too-many-files", String.valueOf(SCAN_LIMIT)).getMessage()); scanned++; ...
public static String getSourceLocationMessage(SourceTracker[] trackers) { StringBuffer buf = new StringBuffer(20 * (trackers.length + 1)); buf.append(_loc.get("source-trackers-location-header")).append(SEP); String sourceFilePath; for (int i = 0; i < trackers.length; i++) { ...
public static String getSourceLocationMessage(SourceTracker[] trackers) { StringBuffer buf = new StringBuffer(20 * (trackers.length + 1)); buf.append(_loc.get("source-trackers-location-header")).append(SEP); String sourceFilePath; for (int i = 0; i < trackers.length; i++) { ...
public RangeResultObjectProvider(ResultObjectProvider delegate, long startIdx, long endIdx) { // use Integer.MAX_VALUE for no limit internally if (endIdx == Long.MAX_VALUE) endIdx = Integer.MAX_VALUE; _delegate = delegate; if (startIdx > Integer.MAX_VALUE || endI...
public RangeResultObjectProvider(ResultObjectProvider delegate, long startIdx, long endIdx) { // use Integer.MAX_VALUE for no limit internally if (endIdx == Long.MAX_VALUE) endIdx = Integer.MAX_VALUE; _delegate = delegate; if (startIdx > Integer.MAX_VALUE || endI...
public Object next() { if (_rl.isClosed()) throw new NoSuchElementException(_loc.get("closed")); return _li.next(); }
public Object next() { if (_rl.isClosed()) throw new NoSuchElementException(_loc.get("closed").getMessage()); return _li.next(); }
public DuplicateKeyException(String key, Object firstVal, String secondVal) { super(_loc.get("dup-key", key, firstVal, secondVal)); } }
public DuplicateKeyException(String key, Object firstVal, String secondVal) { super(_loc.get("dup-key", key, firstVal, secondVal).getMessage()); } }
private Boolean load(String name, String rsrc, Map m, ClassLoader loader, boolean explicit) throws IOException { if (loader == null) loader = Thread.currentThread().getContextClassLoader(); Enumeration<URL> urls = loader.getResources(rsrc); if (!urls.hasMoreEleme...
private Boolean load(String name, String rsrc, Map m, ClassLoader loader, boolean explicit) throws IOException { if (loader == null) loader = Thread.currentThread().getContextClassLoader(); Enumeration<URL> urls = loader.getResources(rsrc); if (!urls.hasMoreEleme...
XMLDTDDescription desc = new XMLDTDDescription(publicId, systemId, baseSystemId, null, rootName); XMLInputSource source = fEntityManager.resolveEntity(desc); fDTDScanner.setInputSource(source); fDTDScanner.scanDTDExternalSubset(true); ...
XMLDTDDescription desc = new XMLDTDDescription(publicId, systemId, baseSystemId, null, rootName); XMLInputSource source = fEntityManager.resolveEntity(desc); fDTDScanner.setInputSource(source); fDTDScanner.scanDTDExternalSubset(true); ...
private synchronized static void populateElementTypes() { // This class looks like it is due to some strange // (read: inconsistent) JVM bugs. // Initially all this code was placed in the static constructor, // but that caused some early JVMs (1.1) to go mad, and if a // ...
private synchronized static void populateElementTypes() { // This class looks like it is due to some strange // (read: inconsistent) JVM bugs. // Initially all this code was placed in the static constructor, // but that caused some early JVMs (1.1) to go mad, and if a // ...
public boolean isConnected() { return true; }
public boolean isConnected() { return primary.isConnected(); }
public ValidationErrorMessage validate(final FormComponent component) { // Get component value final String value = component.getStringValue(); try { // Get long value final long longValue = Long.parseLong(value); // Check...
public ValidationErrorMessage validate(final FormComponent component) { // Get component value final String value = component.getRequestString(); try { // Get long value final long longValue = Long.parseLong(value); // Che...
public ValidationErrorMessage validate(final FormComponent component) { // Get component value final String value = component.getStringValue(); // Check length if ((checkMin && value.length() < min) || (checkMax && value.length() > max)) { ...
public ValidationErrorMessage validate(final FormComponent component) { // Get component value final String value = component.getRequestString(); // Check length if ((checkMin && value.length() < min) || (checkMax && value.length() > max)) { ...
public ValidationErrorMessage validate(final FormComponent component) { // Get component value final String value = component.getStringValue(); // Check value against pattern if (!pattern.matcher(value).matches()) { return errorMessage(value, componen...
public ValidationErrorMessage validate(final FormComponent component) { // Get component value final String value = component.getRequestString(); // Check value against pattern if (!pattern.matcher(value).matches()) { return errorMessage(value, compon...
public ValidationErrorMessage validate(final FormComponent component) { // Get component value final String value = component.getStringValue(); // Check value if (value == null || value.trim().equals("")) { return errorMessage(value, component); ...
public ValidationErrorMessage validate(final FormComponent component) { // Get component value final String value = component.getRequestString(); // Check value if (value == null || value.trim().equals("")) { return errorMessage(value, component); ...
public String getInput() { final Component reporter = getReporter(); if (reporter instanceof FormComponent) { return ((FormComponent)getReporter()).getStringValue(); } return null; }
public String getInput() { final Component reporter = getReporter(); if (reporter instanceof FormComponent) { return ((FormComponent)getReporter()).getRequestString(); } return null; }
public boolean isAnnotationWithRuntimeRetention() { if (!isAnnotation()) { return false; } else { return (binding.getAnnotationTagBits() & TagBits.AnnotationRuntimeRetention)!=0; } }
public boolean isAnnotationWithRuntimeRetention() { if (!isAnnotation()) { return false; } else { return (binding.getAnnotationTagBits() & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention; } }
public static String[] translateCommandline(String to_process) { if (to_process == null || to_process.length() == 0) { return new String[0]; } // parse with a simple finite state machine final int normal = 0; final int inQuote = 1; final int inDo...
public static String[] translateCommandline(String to_process) { if (to_process == null || to_process.length() == 0) { return new String[0]; } // parse with a simple finite state machine final int normal = 0; final int inQuote = 1; final int inDo...
public static final TimeZoneInfo[] TIMEZONES = { new TimeZoneInfo("GMT", "Greenwich Mean Time", "GMT", 0 * ONE_HOUR + 0 * THIRTY_MIN), // 0 new TimeZoneInfo("UTC", "Universal Coordinated Time", "GMT", 1 * ONE_HOUR + 0 * THIRTY_MIN), new TimeZoneInfo("ECT", "European Central Time", "GM...
public static final TimeZoneInfo[] TIMEZONES = { new TimeZoneInfo("GMT", "Greenwich Mean Time", "GMT", 0 * ONE_HOUR + 0 * THIRTY_MIN), // 0 new TimeZoneInfo("UTC", "Universal Coordinated Time", "GMT", 0 * ONE_HOUR + 0 * THIRTY_MIN), new TimeZoneInfo("ECT", "European Central Time", "GM...
protected void traverseLocal(XSParticleDecl particle, Element elmDecl, XSDocumentInfo schemaDoc, SchemaGrammar grammar, int allContextFlags, XSObject parent, String[] localNSDecls) { if (localNSDecls != null) { sche...
protected void traverseLocal(XSParticleDecl particle, Element elmDecl, XSDocumentInfo schemaDoc, SchemaGrammar grammar, int allContextFlags, XSObject parent, String[] localNSDecls) { if (localNSDecls != null) { sche...
public MarkupContainer(MarkupContainer parent, final String id, IModel<T> model) { super(parent, id, model); } /** * Adds a child component to this container. * <p> * Be careful when overriding this method, if not implemented properly it * may lead to a java component hierarchy which no longer matches th...
public MarkupContainer(MarkupContainer parent, final String id, IModel<T> model) { super(parent, id, model); } /** * Adds a child component to this container. * <p> * Be careful when overriding this method, if not implemented properly it * may lead to a java component hierarchy which no longer matches th...
public int hashCode() { int result = 17; result = 37*result + type.hashCode(); result = 37*result + formalIndex; return result; }
public int hashCode() { int result = 17; result = 37*result + super.hashCode(); result = 37*result + formalIndex; return result; }
public final boolean resolve(final MarkupContainer container, final MarkupStream markupStream, final ComponentTag tag) { // Delegate the request to the parent component final Component component = this.getParent().get(tag.getId()); if (component == null) { return false; } component.render...
public final boolean resolve(final MarkupContainer container, final MarkupStream markupStream, final ComponentTag tag) { // Delegate the request to the parent component final Component component = this.getParent().get(tag.getId()); if (component == null) { return false; } component.render...
private boolean validateDocument(String document, int expectedLinkClickCount) { HtmlDocumentValidator validator = new HtmlDocumentValidator(); Tag html = new Tag("html"); Tag head = new Tag("head"); html.addExpectedChild(head); Tag title = new Tag("title"); head.addEx...
private boolean validateDocument(String document, int expectedLinkClickCount) { HtmlDocumentValidator validator = new HtmlDocumentValidator(); Tag html = new Tag("html"); Tag head = new Tag("head"); html.addExpectedChild(head); Tag title = new Tag("title"); head.addEx...
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException { // get error reporter fXSIErrorReporter.reset((XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER)); fSchemaLoader.setProperty(ERROR_REPORTER, fXSIErrorReporter.fErrorReporter); // ...
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException { // get error reporter fXSIErrorReporter.reset((XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER)); fSchemaLoader.setProperty(ERROR_REPORTER, fXSIErrorReporter.fErrorReporter); // ...
public void addDeclare(Declare declare) { // this is not extensible, oh well if (declare instanceof DeclareErrorOrWarning) { ShadowMunger m = new Checker((DeclareErrorOrWarning)declare); addShadowMunger(m); } else if (declare instanceof DeclareDominates) { declareDominates.add(declare); } else if (dec...
public void addDeclare(Declare declare) { // this is not extensible, oh well if (declare instanceof DeclareErrorOrWarning) { ShadowMunger m = new Checker((DeclareErrorOrWarning)declare); addShadowMunger(m); } else if (declare instanceof DeclarePrecedence) { declareDominates.add(declare); } else if (de...
public int compareByDominates(ResolvedTypeX aspect1, ResolvedTypeX aspect2) { //System.out.println("dom compare: " + aspect1 + " with " + aspect2); //System.out.println(crosscuttingMembersSet.getDeclareDominates()); //??? We probably want to cache this result. This is order N where N is the //??? number of...
public int compareByDominates(ResolvedTypeX aspect1, ResolvedTypeX aspect2) { //System.out.println("dom compare: " + aspect1 + " with " + aspect2); //System.out.println(crosscuttingMembersSet.getDeclareDominates()); //??? We probably want to cache this result. This is order N where N is the //??? number of...
public static Declare read(DataInputStream s, ISourceContext context) throws IOException { byte kind = s.readByte(); switch (kind) { case ERROR_OR_WARNING: return DeclareErrorOrWarning.read(s, context); case DOMINATES: return DeclareDominates.read(s, context); case PARENTS: return DeclareParen...
public static Declare read(DataInputStream s, ISourceContext context) throws IOException { byte kind = s.readByte(); switch (kind) { case ERROR_OR_WARNING: return DeclareErrorOrWarning.read(s, context); case DOMINATES: return DeclarePrecedence.read(s, context); case PARENTS: return DeclarePare...
public boolean doGet(int logLevel, DownloadProgress progress) throws IOException { if (source == null) { throw new BuildException("src attribute is required", getLocation()); } if (dest == null) { throw new BuildException("dest attribute is required", get...
public boolean doGet(int logLevel, DownloadProgress progress) throws IOException { if (source == null) { throw new BuildException("src attribute is required", getLocation()); } if (dest == null) { throw new BuildException("dest attribute is required", get...
public void testMetaClassFieldsArePopulated() { EntityType<ImplicitFieldAccessSubclass> m = model.entity(ImplicitFieldAccessSubclass.class); assertNotNull(m); Class<?> mCls = m.getJavaType(); assertSame(ImplicitFieldAccessSubclass.class, mCls); Class<?> m2Cls = mode...
public void testMetaClassFieldsArePopulated() { EntityType<ImplicitFieldAccessSubclass> m = model.entity(ImplicitFieldAccessSubclass.class); assertNotNull(m); Class<?> mCls = m.getJavaType(); assertSame(ImplicitFieldAccessSubclass.class, mCls); Class<?> m2Cls = mode...
public Value toValue(ExpressionFactory factory, MetamodelImpl model, CriteriaQueryImpl<?> q) { Object value = arg; Class<?> literalClass = getJavaType(); if (arg instanceof ParameterExpressionImpl) { return ((ParameterExpressionImpl)arg).toValue(factory, model...
public Value toValue(ExpressionFactory factory, MetamodelImpl model, CriteriaQueryImpl<?> q) { Object value = arg; Class<?> literalClass = getJavaType(); if (arg instanceof ParameterExpressionImpl) { return ((ParameterExpressionImpl)arg).toValue(factory, model...
public Value toValue(ExpressionFactory factory, MetamodelImpl model, CriteriaQueryImpl<?> q) { if (q.isRegistered(this)) return q.getRegisteredValue(this); org.apache.openjpa.kernel.exps.Path path = null; SubqueryImpl<?> subquery = q.getDelegator(); boolean allowNull = _...
public Value toValue(ExpressionFactory factory, MetamodelImpl model, CriteriaQueryImpl<?> q) { if (q.isRegistered(this)) return q.getRegisteredValue(this); org.apache.openjpa.kernel.exps.Path path = null; SubqueryImpl<?> subquery = q.getDelegator(); boolean allowNull = _...
public static char[][] getCompoundName(String string) { return WildTypePattern.splitNames(string); }
public static char[][] getCompoundName(String string) { return WildTypePattern.splitNames(string,true); }
public UnresolvedType lookupType(String name, IHasPosition location) { char[][] splitName = WildTypePattern.splitNames(name); TypeBinding b = scope.getType(splitName,splitName.length); //FIXME ??? need reasonable error handling... if (!b.isValidBinding()) { return ResolvedType.MISSING; } //System.err...
public UnresolvedType lookupType(String name, IHasPosition location) { char[][] splitName = WildTypePattern.splitNames(name,true); TypeBinding b = scope.getType(splitName,splitName.length); //FIXME ??? need reasonable error handling... if (!b.isValidBinding()) { return ResolvedType.MISSING; } //Syste...
private static File getAntHomeDirectory() { final String antHome = System.getProperty( "ant.home" ); if( null == antHome ) { final String message = "Cannot locate antRun script: Property 'ant.home' not specified"; throw new IllegalStateException( m...
private static File getAntHomeDirectory() { final String antHome = System.getProperty( "myrmidon.home" ); if( null == antHome ) { final String message = "Cannot locate antRun script: Property 'ant.home' not specified"; throw new IllegalStateExcepti...
public void setVisibleItemCount (int count) { checkWidget (); if (count < 0) return; visibleCount = count; if ((style & SWT.DROP_DOWN) != 0) { forceResize (); RECT rect = new RECT (); OS.GetWindowRect (handle, rect); int flags = OS.SWP_NOMOVE | OS.SWP_NOZORDER | OS.SWP_DRAWFRAME | OS.SWP_NOACTIVATE; setBo...
public void setVisibleItemCount (int count) { checkWidget (); if (count < 0) return; visibleCount = count; if ((style & SWT.DROP_DOWN) != 0) { forceResize (); RECT rect = new RECT (); OS.GetWindowRect (handle, rect); int flags = OS.SWP_NOMOVE | OS.SWP_NOZORDER | OS.SWP_DRAWFRAME | OS.SWP_NOACTIVATE; setBo...
package wicket.application; /* * $Id$ * $Revision$ $Date$ * * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License...
package wicket.application; /* * $Id$ * $Revision$ $Date$ * * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License...
public static void main (String [] args) { File sourceDir = new File("src/org/eclipse/swt/snippets"); boolean hasSource = sourceDir.exists(); int count = 500; if (hasSource) { File [] files = sourceDir.listFiles(); if (files.length > 0) count = files.length; } for (int i = 1; i < count; i++) { if ...
public static void main (String [] args) { File sourceDir = new File("src/org/eclipse/swt/snippets"); boolean hasSource = sourceDir.exists(); int count = 500; if (hasSource) { File [] files = sourceDir.listFiles(); if (files.length > 0) count = files.length; } for (int i = 1; i < count; i++) { if ...
import org.apache.ant.tasklet.engine.DataTypeEngine; /* * 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....
import org.apache.ant.tasklet.engine.DataTypeEngine; /* * 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....
public static void main(String[] args) { try { C.main(null); } catch (ExceptionInInitializerError eiie) { System.err.println("EIIE="+eiie.toString()); System.err.println("CAUSE="+eiie.getCause().toString()); } }
public static void main(String[] args) { try { C.main(null); } catch (ExceptionInInitializerError eiie) { System.err.println("EIIE="+eiie.toString()); //System.err.println("CAUSE="+eiie.getCause().toString()); } }
private String getEnvironmentText() throws IOException, ExecException { final String[] command = getEnvCommand(); final File workingDirectory = new File( "." ); final ExecMetaData metaData = new ExecMetaData( command, null, workingDirectory, false ); final ByteArrayOutpu...
private String getEnvironmentText() throws IOException, ExecException { final String[] command = getEnvCommand(); final File workingDirectory = new File( "." ); final ExecMetaData metaData = new ExecMetaData( command, null, workingDirectory ); final ByteArrayOutputStream...
public void removeSelectionListener (SelectionListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); eventTable.unhook (SWT.DefaultSelection, listener); } String parse (String string) { int length =...
public void removeSelectionListener (SelectionListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); eventTable.unhook (SWT.DefaultSelection, listener); } String parse (String string) { int length =...
public void removeSelectionListener (SelectionListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); eventTable.unhook (SWT.DefaultSelection, listener); } String parse (String string) { int length = ...
public void removeSelectionListener (SelectionListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); eventTable.unhook (SWT.DefaultSelection, listener); } String parse (String string) { int length = ...
public String getText () { checkWidget (); return text; } void enableWidget (boolean enabled) { super.enableWidget (enabled); TextStyle linkStyle = new TextStyle (null, enabled ? linkColor : linkDisabledColor, null); linkStyle.underline = true; for (int i = 0; i < offsets.length; i++) { Point point = offsets [...
public String getText () { checkWidget (); return text; } void enableWidget (boolean enabled) { super.enableWidget (enabled); TextStyle linkStyle = new TextStyle (null, enabled ? linkColor : linkDisabledColor, null); linkStyle.underline = true; for (int i = 0; i < offsets.length; i++) { Point point = offsets [...
public String getText () { checkWidget (); return text; } String parse (String string) { int length = string.length (); offsets = new Point [length / 4]; ids = new String [length / 4]; mnemonics = new int [length / 4]; StringBuffer result = new StringBuffer (); char [] buffer = new char [length]; string.getCh...
public String getText () { checkWidget (); return text; } String parse (String string) { int length = string.length (); offsets = new Point [length / 4]; ids = new String [length / 4]; mnemonics = new int [length / 4 + 1]; StringBuffer result = new StringBuffer (); char [] buffer = new char [length]; string.g...
public void deselectAll () { checkWidget (); NSTableView widget = (NSTableView)view; ignoreSelect = true; widget.deselectAll(null); ignoreSelect = false; } void destroyItem (TableColumn column) { int index = 0; while (index < columnCount) { if (columns [index] == column) break; index++; } for (int i=0; i<...
public void deselectAll () { checkWidget (); NSTableView widget = (NSTableView)view; ignoreSelect = true; widget.deselectAll(null); ignoreSelect = false; } void destroyItem (TableColumn column) { int index = 0; while (index < columnCount) { if (columns [index] == column) break; index++; } for (int i=0; i<...
public void deselect (TreeItem item) { checkWidget (); if (item == null) error (SWT.ERROR_NULL_ARGUMENT); if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); NSOutlineView widget = (NSOutlineView)view; int /*long*/ row = widget.rowForItem(item.handle); ignoreSelect = true; widget.deselectRow (row); igno...
public void deselect (TreeItem item) { checkWidget (); if (item == null) error (SWT.ERROR_NULL_ARGUMENT); if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); NSOutlineView widget = (NSOutlineView)view; int /*long*/ row = widget.rowForItem(item.handle); ignoreSelect = true; widget.deselectRow (row); igno...
public String getInputName() { String id = getId(); final PrependingStringBuffer inputName = new PrependingStringBuffer(id.length()); Component c = this; while (true) { inputName.prepend(id); c = c.getParent(); if (c == null || c instanceof Form || c instanceof Page) { break; } inputNa...
public String getInputName() { String id = getId(); final PrependingStringBuffer inputName = new PrependingStringBuffer(id.length()); Component c = this; while (true) { inputName.prepend(id); c = c.getParent(); if (c == null || (c instanceof Form && ((Form)c).isRootForm()) || c instanceof Page) ...
protected void onSubmit(AjaxRequestTarget target) { // add the list of components that need to be updated target.addComponent(comments); target.addComponent(text); // focus the textarea again target.addJavascript("document.getElementById('" + text.getMarkupId() + "').focus();"); } ...
protected void onSubmit(AjaxRequestTarget target) { // add the list of components that need to be updated target.addComponent(comments); target.addComponent(text); // focus the textarea again target.appendJavascript("document.getElementById('" + text.getMarkupId() + "').focus();"); }...
public static String toString(final Component component, final Throwable location) { Class componentClass = component.getClass(); // try to find the component type, if it is an inner element, then get // the parent component. String componentType = componentClass.getName(); if (componentType.indexOf('$') >...
public static String toString(final Component component, final Throwable location) { Class componentClass = component.getClass(); // try to find the component type, if it is an inner element, then get // the parent component. String componentType = componentClass.getName(); if (componentType.indexOf('$') >...
private void startConnection(ConnectionDetails details) throws Exception { CollabClient client = new CollabClient(); System.out.println("Autostarting ECF containerType="+details.getContainerType()+",uri="+details.getTargetURI()+",nickname="+details.getNickname()+",password="+details.getPassword()); client.create...
private void startConnection(ConnectionDetails details) throws Exception { CollabClient client = new CollabClient(); ClientPlugin.log("ECF: Autostarting containerType="+details.getContainerType()+",uri="+details.getTargetURI()+",nickname="+details.getNickname()); client.createAndConnectClient(details.getContaine...
public Component setModel(final IModel<T> model) { // Detach current model if (this.model != null) { this.model.detach(); } IModel prevModel = this.model; // TODO really need such a check? Can we just store the wrapper in the // state change? if (prevModel instanceof IWrapModel) { prevModel =...
public Component setModel(final IModel<T> model) { // Detach current model if (this.model != null) { this.model.detach(); } IModel prevModel = this.model; // TODO really need such a check? Can we just store the wrapper in the // state change? if (prevModel instanceof IWrapModel) { prevModel =...
public int /*long*/ method4 (int /*long*/[] args) {return PromptForSaveToFile (args[0], args[1], args[2], args[3], args[4]);} }; } void disposeCOMInterfaces () { if (supports != null) { supports.dispose (); supports = null; } if (helperAppLauncherDialog != null) { helperAppLauncherDialog.dispose (); h...
public int /*long*/ method4 (int /*long*/[] args) {return PromptForSaveToFile (args[0], args[1], args[2], args[3], args[4]);} }; } void disposeCOMInterfaces () { if (supports != null) { supports.dispose (); supports = null; } if (helperAppLauncherDialog != null) { helperAppLauncherDialog.dispose (); h...
public boolean Equals(nsID other) { int /*long*/ ptr = XPCOM.nsID_new(); XPCOM.memmove(ptr, this, nsID.sizeof); int /*long*/ otherPtr = XPCOM.nsID_new(); XPCOM.memmove(otherPtr, other, nsID.sizeof); boolean result = XPCOM.nsID_Equals(ptr, otherPtr); XPCOM.nsID_delete(ptr); XPCOM.nsID_delete(otherPtr); return re...
public boolean Equals(nsID other) { int /*long*/ ptr = XPCOM.nsID_new(); XPCOM.memmove(ptr, this, nsID.sizeof); int /*long*/ otherPtr = XPCOM.nsID_new(); XPCOM.memmove(otherPtr, other, nsID.sizeof); boolean result = XPCOM.nsID_Equals(ptr, otherPtr) != 0; XPCOM.nsID_delete(ptr); XPCOM.nsID_delete(otherPtr); retu...
public void testIncrementalSuite() { if (!eclipseAvailable()) { System.err.println("skipping test - eclipse classes not available"); return; } String[] options = new String[] { "!verbose", "!eclipse", }; Exp exp = new Exp(8, 8, 0, 8, 0...
public void testIncrementalSuite() { if (!eclipseAvailable()) { System.err.println("skipping test - eclipse classes not available"); return; } String[] options = new String[] { "!verbose", "!eclipse", }; Exp exp = new Exp(7, 7, 0, 7, 0...
public Path createClasspath() throws TaskException { if( m_classpath == null ) { m_classpath = new Path( getProject() ); } return m_classpath.createPath(); }
public Path createClasspath() throws TaskException { if( m_classpath == null ) { m_classpath = new Path(); } return m_classpath.createPath(); }
public String getInputName() { String id = getId(); final PrependingStringBuffer inputName = new PrependingStringBuffer(id.length()); Component c = this; while (true) { inputName.prepend(id); c = c.getParent(); if (c == null || c instanceof Form || c instanceof Page) { break; } inputNa...
public String getInputName() { String id = getId(); final PrependingStringBuffer inputName = new PrependingStringBuffer(id.length()); Component c = this; while (true) { inputName.prepend(id); c = c.getParent(); if (c == null || (c instanceof Form && ((Form)c).isRootForm()) || c instanceof Page) ...
public void testRender_2() { application.startPage(MockFormAndButtonPage.class); application.assertContains("<input name=\"button\" type=\"submit\" wicket:id=\"button\"/>"); String doc = application.getServletResponse().getDocument(); boolean contains = doc.contains("<input onclick=\"var e=document.getElemen...
public void testRender_2() { application.startPage(MockFormAndButtonPage.class); application.assertContains("<input name=\"button\" type=\"submit\" wicket:id=\"button\"/>"); String doc = application.getServletResponse().getDocument(); boolean contains = doc.contains("<input onclick=\"var e=document.getElemen...
private void setReference( final ConfigurationState state, final String refName, final String unresolvedId, final Context context ) throws Exception { // Adjust the name final String name = refNa...
private void setReference( final ConfigurationState state, final String refName, final String unresolvedId, final Context context ) throws Exception { // Adjust the name final String name = refNa...
public void testDoubleEntry() { CompilationAndWeavingContext.enteringPhase(1,"XYZ"); CompilationAndWeavingContext.enteringPhase(2, "ABC"); assertEquals("when fiddling XYZ\nwhen mucking about with ABC\n",CompilationAndWeavingContext.getCurrentContext()); }
public void testDoubleEntry() { CompilationAndWeavingContext.enteringPhase(1,"XYZ"); CompilationAndWeavingContext.enteringPhase(2, "ABC"); assertEquals("when mucking about with ABC\nwhen fiddling XYZ\n",CompilationAndWeavingContext.getCurrentContext()); }
public static String renderExceptionForUser(Throwable thrown) { String m = thrown.getMessage(); return THROWN_PREFIX + (null != m ? m + "\n": "") + CompilationAndWeavingContext.getCurrentContext() + LangUtil.renderException(thrown, true); }
public static String renderExceptionForUser(Throwable thrown) { String m = thrown.getMessage(); return THROWN_PREFIX + (null != m ? m + "\n": "") + "\n" + CompilationAndWeavingContext.getCurrentContext() + LangUtil.renderException(thrown, true); }
public void showSelection () { checkWidget (); int index = OS.SendMessage (handle, OS.LVM_GETNEXTITEM, -1, OS.LVNI_SELECTED); if (index != -1) showItem (index); } void subclass () { super.subclass (); if (HeaderProc != 0) { int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); OS.SetWindowLong (h...
public void showSelection () { checkWidget (); int index = OS.SendMessage (handle, OS.LVM_GETNEXTITEM, -1, OS.LVNI_SELECTED); if (index != -1) showItem (index); } void subclass () { super.subclass (); if (HeaderProc != 0) { int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); OS.SetWindowLong (h...
public void showSelection () { checkWidget (); int hItem = 0; if ((style & SWT.SINGLE) != 0) { hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CARET, 0); if (hItem == 0) return; int state = 0; if (OS.IsWinCE) { TVITEM tvItem = new TVITEM (); tvItem.hItem = hItem; tvItem.mask = OS.TVIF_S...
public void showSelection () { checkWidget (); int hItem = 0; if ((style & SWT.SINGLE) != 0) { hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CARET, 0); if (hItem == 0) return; int state = 0; if (OS.IsWinCE) { TVITEM tvItem = new TVITEM (); tvItem.hItem = hItem; tvItem.mask = OS.TVIF_S...
private void processFile( String file ) throws TaskException { File srcFile = new File( srcDir, file ); File destD = destDir == null ? srcDir : destDir; File tmpFile = null; BufferedWriter outWriter; OneLiner.BufferLine line; // read the contents of the f...
private void processFile( String file ) throws TaskException { File srcFile = new File( srcDir, file ); File destD = destDir == null ? srcDir : destDir; File tmpFile = null; BufferedWriter outWriter; OneLiner.BufferLine line; // read the contents of the f...
private void moveGeneratedFile( File baseDir, File sourceBaseFile, String classname, RmicAdapter adapter ) throws TaskException { String classFileName = classname.replace( '.', File.separatorChar ) + ".class"; ...
private void moveGeneratedFile( File baseDir, File sourceBaseFile, String classname, RmicAdapter adapter ) throws TaskException { String classFileName = classname.replace( '.', File.separatorChar ) + ".class"; ...
protected void doFileOperations() throws TaskException { if( m_fileCopyMap.size() > 0 ) { getLogger().info( "Copying " + m_fileCopyMap.size() + " file" + ( m_fileCopyMap.size() == 1 ? "" : "s" ) + " to " + m_destDir....
protected void doFileOperations() throws TaskException { if( m_fileCopyMap.size() > 0 ) { getLogger().info( "Copying " + m_fileCopyMap.size() + " file" + ( m_fileCopyMap.size() == 1 ? "" : "s" ) + " to " + m_destDir....
protected void doFileOperations() throws TaskException { //Attempt complete directory renames, if any, first. if( getCompleteDirMap().size() > 0 ) { Enumeration e = getCompleteDirMap().keys(); while( e.hasMoreElements() ) { File...
protected void doFileOperations() throws TaskException { //Attempt complete directory renames, if any, first. if( getCompleteDirMap().size() > 0 ) { Enumeration e = getCompleteDirMap().keys(); while( e.hasMoreElements() ) { File...
public ID makeInstance(Namespace ns, Class[] argTypes, Object[] args) throws IDInstantiationException { return new StringID(ns, (String) args[0]); }
public ID makeInstance(Namespace ns, Class[] argTypes, Object[] args) throws IDInstantiationException { return new LongID(ns, (Long) args[0]); }
// 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...
public Class[][] getSupportedParameterTypes() { return new Class[][] { { String.class }, { String.class, String.class } }; }
public Class[][] getSupportedParameterTypes() { return new Class[][] { { String.class } }; }
public static Process launch(Project project, String[] command, String[] env, File dir, boolean useVM) throws IOException { CommandLauncher launcher = vmLauncher != null ? vmLauncher : shellLauncher; if (!useVM) { launcher = shellLaunc...
public static Process launch(Project project, String[] command, String[] env, File dir, boolean useVM) throws IOException { CommandLauncher launcher = vmLauncher != null ? vmLauncher : shellLauncher; if (!useVM) { launcher = shellLaunc...
public XPath(String xpath, StringPool stringPool, NamespacesScope context) throws XPathException { // NOTE: We have to prefix the selector XPath with "./" in // order to handle selectors such as "." that select // the element container becaus...
public XPath(String xpath, StringPool stringPool, NamespacesScope context) throws XPathException { // NOTE: We have to prefix the selector XPath with "./" in // order to handle selectors such as "." that select // the element container becaus...
public void showSelection() { checkWidget(); // is selection from right-to-left? boolean rightToLeft = caretOffset == selection.x; int startOffset, endOffset; if (rightToLeft) { startOffset = selection.y; endOffset = selection.x; } else { startOffset = selection.x; endOffset = selection.y; } Rectangle...
public void showSelection() { checkWidget(); // is selection from right-to-left? boolean rightToLeft = caretOffset == selection.x; int startOffset, endOffset; if (rightToLeft) { startOffset = selection.y; endOffset = selection.x; } else { startOffset = selection.x; endOffset = selection.y; } Rectangle...
public BuildException(Exception cause) { super(); this.cause = cause; }
public BuildException(Exception cause) { super(cause.toString()); this.cause = cause; }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { super.calculateValue(sel, ctx, state, other, otherState); ParamExpState pstate = (ParamExpState) state; Object value = getValue(ctx.params); if (!(value instanceof Colle...
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { super.calculateValue(sel, ctx, state, other, otherState); ParamExpState pstate = (ParamExpState) state; Object value = getValue(ctx.params); if (!(value instanceof Colle...
throw new WicketRuntimeException("Unable to load class with name: " + classname, ex); /* * 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 licen...
throw new WicketRuntimeException("Unable to load class with name: " + classname, ex); /* * 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 licen...
protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) { replaceComponentTagBody(markupStream, openTag, getDefaultModelObjectAsString()); } }
public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) { replaceComponentTagBody(markupStream, openTag, getDefaultModelObjectAsString()); } }
protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) { } }
public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) { } }
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { replaceComponentTagBody(markupStream, openTag, markup); } }
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { replaceComponentTagBody(markupStream, openTag, markup); } }
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { HeaderResponseContainerFilteringHeaderResponse response = HeaderResponseContainerFilteringHeaderResponse.get(); if (!response.isClosed()) { throw new RuntimeException( "there was an error processing the header response -...
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { HeaderResponseContainerFilteringHeaderResponse response = HeaderResponseContainerFilteringHeaderResponse.get(); if (!response.isClosed()) { throw new RuntimeException( "there was an error processing the header response - yo...
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { replaceComponentTagBody(markupStream, openTag, "body"); } }); } }
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { replaceComponentTagBody(markupStream, openTag, "body"); } }); } }
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { StringBuilder str = new StringBuilder(); str.append("intParam: ").append(intParam).append("<br/>"); str.append("integerParam: ").append(integerParam.toString()).append("<br/>"); str.append("long1Param: ").append(long1Param)....
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { StringBuilder str = new StringBuilder(); str.append("intParam: ").append(intParam).append("<br/>"); str.append("integerParam: ").append(integerParam.toString()).append("<br/>"); str.append("long1Param: ").append(long1Param).app...