import java.util.LinkedList;
import java.util.Locale;
import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import com.vaadin.service.ApplicationContext;
import com.vaadin.terminal.ApplicationResource;
public abstract class Application implements URIHandler,
Terminal.ErrorListener, Serializable {
+ private final static Logger logger = Logger.getLogger(Application.class
+ .getName());
+
/**
* Id use for the next window that is opened. Access to this must be
* synchronized.
final Throwable t = event.getThrowable();
if (t instanceof SocketException) {
// Most likely client browser closed socket
- System.err
- .println("Warning: SocketException in CommunicationManager."
- + " Most likely client (browser) closed socket.");
+ logger.warning("SocketException in CommunicationManager."
+ + " Most likely client (browser) closed socket.");
return;
}
}
// also print the error on console
- t.printStackTrace();
+ logger.log(Level.SEVERE, "Terminal error:", t);
}
/**
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.LinkedList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import com.vaadin.data.Property;
import com.vaadin.util.SerializerHelper;
public class MethodProperty<T> implements Property,
Property.ValueChangeNotifier, Property.ReadOnlyStatusChangeNotifier {
+ private static final Logger logger = Logger.getLogger(MethodProperty.class
+ .getName());
/**
* The object that includes the property the MethodProperty is bound to.
*/
getMethod = null;
}
} catch (SecurityException e) {
- System.err.println("Internal deserialization error");
- e.printStackTrace();
+ logger.log(Level.SEVERE, "Internal deserialization error", e);
} catch (NoSuchMethodException e) {
- System.err.println("Internal deserialization error");
- e.printStackTrace();
+ logger.log(Level.SEVERE, "Internal deserialization error", e);
}
};
import java.util.Arrays;
import java.util.EventListener;
import java.util.EventObject;
+import java.util.logging.Level;
+import java.util.logging.Logger;
/**
* <p>
@SuppressWarnings("serial")
public class ListenerMethod implements EventListener, Serializable {
+ private static final Logger logger = Logger.getLogger(ListenerMethod.class
+ .getName());
+
/**
* Type of the event that should trigger this listener. Also the subclasses
* of this class are accepted to trigger the listener.
/**
* The object containing the trigger method.
*/
- private Object object;
+ private final Object object;
/**
* The trigger method to call when an event passing the given criteria
out.writeObject(name);
out.writeObject(paramTypes);
} catch (NotSerializableException e) {
- System.err
- .println("Fatal error in serialization of the application: Class "
- + object.getClass().getName()
- + " must implement serialization.");
+ logger.severe("Fatal error in serialization of the application: Class "
+ + object.getClass().getName()
+ + " must implement serialization.");
throw e;
}
// inner classes
method = findHighestMethod(object.getClass(), name, paramTypes);
} catch (SecurityException e) {
- System.err.println("Internal deserialization error");
- e.printStackTrace();
+ logger.log(Level.SEVERE, "Internal deserialization error", e);
}
};
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
public abstract class AbstractApplicationPortlet extends GenericPortlet
implements Constants {
+ private static final Logger logger = Logger
+ .getLogger(AbstractApplicationPortlet.class.getName());
+
/**
* This portlet parameter is used to add styles to the main element. E.g
* "height:500px" generates a style="height:500px" to the main element.
* Print an information/warning message about running with xsrf
* protection disabled
*/
- System.err.println(WARNING_XSRF_PROTECTION_DISABLED);
+ logger.warning(WARNING_XSRF_PROTECTION_DISABLED);
}
}
if (!productionMode) {
/* Print an information/warning message about running in debug mode */
// TODO Maybe we need a different message for portlets?
- System.err.println(NOT_PRODUCTION_MODE_INFO);
+ logger.warning(NOT_PRODUCTION_MODE_INFO);
}
}
} catch (final SessionExpiredException e) {
// TODO Figure out a better way to deal with
// SessionExpiredExceptions
- System.err.println("Session has expired");
- e.printStackTrace(System.err);
+ logger.finest("A user session has expired");
} catch (final GeneralSecurityException e) {
// TODO Figure out a better way to deal with
// GeneralSecurityExceptions
- System.err
- .println("General security exception, should never happen");
- e.printStackTrace(System.err);
+ logger.finest("General security exception, the security key was probably incorrect.");
} catch (final Throwable e) {
handleServiceException(request, response, application, e);
} finally {
private void handleUnknownRequest(PortletRequest request,
PortletResponse response) {
- System.err.println("Unknown request type");
+ logger.warning("Unknown request type");
}
/**
os.write(buffer, 0, bytes);
}
} else {
- System.err.println("Requested resource [" + resourceID
+ logger.warning("Requested resource [" + resourceID
+ "] could not be found");
response.setProperty(ResourceResponse.HTTP_STATUS_CODE,
Integer.toString(HttpServletResponse.SC_NOT_FOUND));
appClass += getApplicationClass().getSimpleName();
} catch (ClassNotFoundException e) {
appClass += "unknown";
- e.printStackTrace();
+ logger.log(Level.SEVERE, "Could not find application class", e);
}
String themeClass = "v-theme-"
+ themeName.replaceAll("[^a-zA-Z0-9]", "");
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
// TODO Move some (all?) of the constants to a separate interface (shared
// with portlet)
+ private static final Logger logger = Logger
+ .getLogger(AbstractApplicationServlet.class.getName());
+
/**
* The version number of this release. For example "6.2.0". Always in the
* format "major.minor.revision[.build]". The build part is optional. All of
* Print an information/warning message about running with xsrf
* protection disabled
*/
- System.err.println(WARNING_XSRF_PROTECTION_DISABLED);
+ logger.warning(WARNING_XSRF_PROTECTION_DISABLED);
}
}
if (!productionMode) {
/* Print an information/warning message about running in debug mode */
- System.err.println(NOT_PRODUCTION_MODE_INFO);
+ logger.warning(NOT_PRODUCTION_MODE_INFO);
}
}
} catch (NumberFormatException nfe) {
// Default is 1h
resourceCacheTime = 3600;
- System.err.println(WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC);
+ logger.warning(WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC);
}
}
resultPath = url.getFile();
} catch (final Exception e) {
// FIXME: Handle exception
- e.printStackTrace();
+ logger.log(Level.WARNING, "Could not find resource path "
+ + path, e);
}
}
return resultPath;
if (resourceUrl == null) {
// cannot serve requested file
- System.err
- .println("Requested resource ["
- + filename
- + "] not found from filesystem or through class loader."
- + " Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.");
+ logger.severe("Requested resource ["
+ + filename
+ + "] not found from filesystem or through class loader."
+ + " Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.");
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
}
} catch (Exception e) {
// Failed to find out last modified timestamp. Continue without it.
- e.printStackTrace();
+ logger.log(
+ Level.FINEST,
+ "Failed to find out last modified timestamp. Continuing without it.",
+ e);
}
// Set type mime type if we can determine it based on the filename
try {
return getApplicationClass().getSimpleName();
} catch (ClassNotFoundException e) {
- e.printStackTrace();
+ logger.log(Level.FINER, "getApplicationCSSClassName failed", e);
return "unknown";
}
}
import java.util.Set;
import java.util.StringTokenizer;
import java.util.UUID;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
public abstract class AbstractCommunicationManager implements
Paintable.RepaintRequestListener, Serializable {
+ private static final Logger logger = Logger
+ .getLogger(AbstractCommunicationManager.class.getName());
+
/**
* Generic interface of a (HTTP or Portlet) request to the application.
*
if (window == null) {
// This should not happen, no windows exists but
// application is still open.
- System.err
- .println("Warning, could not get window for application with request ID "
- + request.getRequestID());
+ logger.severe("Warning, could not get window for application with request ID "
+ + request.getRequestID());
return;
}
} else {
// FIXME: Handle exception
// Not critical, but something is still wrong; print
// stacktrace
- e2.printStackTrace();
+ logger.log(Level.WARNING,
+ "getSystemMessages() failed - continuing", e2);
}
if (ci != null) {
String msg = ci.getOutOfSyncMessage();
"getSystemMessages", (Class[]) null);
ci = (Application.SystemMessages) m.invoke(null,
(Object[]) null);
- } catch (NoSuchMethodException e1) {
- e1.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ logger.log(Level.WARNING,
+ "getSystemMessages() failed - continuing", e);
} catch (IllegalArgumentException e) {
- e.printStackTrace();
+ logger.log(Level.WARNING,
+ "getSystemMessages() failed - continuing", e);
} catch (IllegalAccessException e) {
- e.printStackTrace();
+ logger.log(Level.WARNING,
+ "getSystemMessages() failed - continuing", e);
} catch (InvocationTargetException e) {
- e.printStackTrace();
+ logger.log(Level.WARNING,
+ "getSystemMessages() failed - continuing", e);
}
// meta instruction for client to enable auto-forward to
is = callback.getThemeResourceAsStream(themeName, resource);
} catch (final Exception e) {
// FIXME: Handle exception
- e.printStackTrace();
+ logger.log(Level.FINER,
+ "Failed to get theme resource stream.", e);
}
if (is != null) {
r.close();
} catch (final java.io.IOException e) {
// FIXME: Handle exception
- System.err.println("Resource transfer failed: "
- + request.getRequestID() + ". ("
- + e.getMessage() + ")");
+ logger.log(Level.SEVERE, "Resource transfer failed: "
+ + request.getRequestID() + ".", e);
}
outWriter.print("\""
+ JsonPaintTarget.escapeJSON(layout.toString())
+ "\"");
} else {
// FIXME: Handle exception
- System.err.println("CustomLayout not found: " + resource);
+ logger.severe("CustomLayout not found: " + resource);
}
}
outWriter.print("}");
+ variable[VAR_PID];
success = false;
}
- System.err.println(msg);
+ logger.warning(msg);
continue;
}
}
DateFormat dateFormat = DateFormat.getDateTimeInstance(
DateFormat.SHORT, DateFormat.SHORT, l);
if (!(dateFormat instanceof SimpleDateFormat)) {
- System.err
- .println("Unable to get default date pattern for locale "
- + l.toString());
+ logger.warning("Unable to get default date pattern for locale "
+ + l.toString());
dateFormat = new SimpleDateFormat();
}
final String df = ((SimpleDateFormat) dateFormat).toPattern();
}
}
- private HashMap<Class<? extends Paintable>, Integer> typeToKey = new HashMap<Class<? extends Paintable>, Integer>();
+ private final HashMap<Class<? extends Paintable>, Integer> typeToKey = new HashMap<Class<? extends Paintable>, Integer>();
private int nextTypeKey = 0;
String getTagForType(Class<? extends Paintable> class1) {
*/
class OpenWindowCache implements Serializable {
- private Set<Object> res = new HashSet<Object>();
+ private final Set<Object> res = new HashSet<Object>();
/**
*
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
public abstract class AbstractWebApplicationContext implements
ApplicationContext, HttpSessionBindingListener, Serializable {
+ private static final Logger logger = Logger
+ .getLogger(AbstractWebApplicationContext.class.getName());
+
protected Collection<TransactionListener> listeners = Collections
.synchronizedList(new LinkedList<TransactionListener>());
// remove same application here. Possible if you got e.g. session
// lifetime 1 min but socket write may take longer than 1 min.
// FIXME: Handle exception
- System.err.println("Could not remove application, leaking memory.");
- e.printStackTrace();
+ logger.log(Level.SEVERE,
+ "Could not remove application, leaking memory.", e);
}
}
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
@SuppressWarnings("serial")
public class ApplicationRunnerServlet extends AbstractApplicationServlet {
+ private static final Logger logger = Logger
+ .getLogger(ApplicationRunnerServlet.class.getName());
+
/**
* The name of the application class currently used. Only valid within one
* request.
*/
private String[] defaultPackages;
- private ThreadLocal<HttpServletRequest> request = new ThreadLocal<HttpServletRequest>();
+ private final ThreadLocal<HttpServletRequest> request = new ThreadLocal<HttpServletRequest>();
@Override
public void init(ServletConfig servletConfig) throws ServletException {
// Ignore as this is expected for many packages
} catch (Exception e2) {
// TODO: handle exception
- e2.printStackTrace();
+ logger.log(
+ Level.FINER,
+ "Failed to find application class in the default package.",
+ e2);
}
if (appClass != null) {
return appClass;
import java.util.Map;
import java.util.Stack;
import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.AbstractOrderedLayout;
@SuppressWarnings({ "serial", "deprecation" })
public class ComponentSizeValidator implements Serializable {
+ private final static Logger logger = Logger
+ .getLogger(ComponentSizeValidator.class.getName());
+
private final static int LAYERS_SHOWN = 4;
/**
return parentCanDefineHeight(component);
} catch (Exception e) {
- e.printStackTrace();
+ logger.log(Level.FINER,
+ "An exception occurred while validating sizes.", e);
return true;
}
}
return parentCanDefineWidth(component);
} catch (Exception e) {
- e.printStackTrace();
+ logger.log(Level.FINER,
+ "An exception occurred while validating sizes.", e);
return true;
}
}
public static class InvalidLayout implements Serializable {
- private Component component;
+ private final Component component;
- private boolean invalidHeight;
- private boolean invalidWidth;
+ private final boolean invalidHeight;
+ private final boolean invalidWidth;
- private Vector<InvalidLayout> subErrors = new Vector<InvalidLayout>();
+ private final Vector<InvalidLayout> subErrors = new Vector<InvalidLayout>();
public InvalidLayout(Component component, boolean height, boolean width) {
this.component = component;
return;
} catch (Exception e) {
// TODO Auto-generated catch block
- e.printStackTrace();
+ logger.log(Level.FINER,
+ "An exception occurred while validating sizes.", e);
}
}
*/
public interface Constants {
- static final String NOT_PRODUCTION_MODE_INFO = ""
+ static final String NOT_PRODUCTION_MODE_INFO = "\n"
+ "=================================================================\n"
+ "Vaadin is running in DEBUG MODE.\nAdd productionMode=true to web.xml "
+ "to disable debug features.\nTo show debug window, add ?debug to "
+ "your application URL.\n"
+ "=================================================================";
- static final String WARNING_XSRF_PROTECTION_DISABLED = ""
+ static final String WARNING_XSRF_PROTECTION_DISABLED = "\n"
+ "===========================================================\n"
+ "WARNING: Cross-site request forgery protection is disabled!\n"
+ "===========================================================";
- static final String WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC = ""
+ static final String WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC = "\n"
+ "===========================================================\n"
+ "WARNING: resourceCacheTime has been set to a non integer value "
+ "in web.xml. The default of 1h will be used.\n"
import java.io.PrintWriter;
import java.util.Map;
+import java.util.logging.Logger;
import com.vaadin.event.Transferable;
import com.vaadin.event.TransferableImpl;
public class DragAndDropService implements VariableOwner {
+ private static final Logger logger = Logger
+ .getLogger(DragAndDropService.class.getName());
+
private int lastVisitId;
private boolean lastVisitAccepted = false;
// Validate drop handler owner
if (!(owner instanceof DropTarget)) {
- System.err.println("DropHandler owner " + owner
+ logger.severe("DropHandler owner " + owner
+ " must implement DropTarget");
return;
}
DropHandler dropHandler = (dropTarget).getDropHandler();
if (dropHandler == null) {
// No dropHandler returned so no drop can be performed.
- System.err
- .println("DropTarget.getDropHandler() returned null for owner: "
- + dropTarget);
+ logger.fine("DropTarget.getDropHandler() returned null for owner: "
+ + dropTarget);
return;
}
import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
log.severe("DeadlineExceeded for " + session.getId());
sendDeadlineExceededNotification(request, response);
} catch (NotSerializableException e) {
- log.severe("NotSerializableException: " + getStackTraceAsString(e));
+ log.log(Level.SEVERE, "Not serializable!", e);
// TODO this notification is usually not shown - should we redirect
// in some other way - can we?
sendNotSerializableNotification(request, response);
} catch (Exception e) {
- log.severe(e + ": " + getStackTraceAsString(e));
+ log.log(Level.SEVERE,
+ "An exception occurred while servicing request.", e);
sendCriticalErrorNotification(request, response);
} finally {
session.setAttribute(WebApplicationContext.class.getName(),
applicationContext);
} catch (IOException e) {
- log.warning("Could not de-serialize ApplicationContext for "
- + session.getId() + " A new one will be created. "
- + getStackTraceAsString(e));
+ log.log(Level.WARNING,
+ "Could not de-serialize ApplicationContext for "
+ + session.getId()
+ + " A new one will be created. ", e);
} catch (ClassNotFoundException e) {
- log.warning("Could not de-serialize ApplicationContext for "
- + session.getId() + " A new one will be created. "
- + getStackTraceAsString(e));
+ log.log(Level.WARNING,
+ "Could not de-serialize ApplicationContext for "
+ + session.getId()
+ + " A new one will be created. ", e);
}
}
// will create new context if the above did not
}
}
} catch (Exception e) {
- log.warning("Exception while cleaning: " + getStackTraceAsString(e));
+ log.log(Level.WARNING, "Exception while cleaning.", e);
}
}
-
- private String getStackTraceAsString(Throwable t) {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- t.printStackTrace(pw);
- return sw.toString();
- }
-
}
import java.util.Set;
import java.util.Stack;
import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import com.vaadin.Application;
import com.vaadin.terminal.ApplicationResource;
@SuppressWarnings("serial")
public class JsonPaintTarget implements PaintTarget {
+ private static final Logger logger = Logger.getLogger(JsonPaintTarget.class
+ .getName());
+
/* Document type declarations */
private final static String UIDL_ARG_NAME = "name";
private int changes = 0;
- private Set<Object> usedResources = new HashSet<Object>();
+ private final Set<Object> usedResources = new HashSet<Object>();
private boolean customLayoutArgumentsOpen = false;
private boolean cacheEnabled = false;
- private Collection<Paintable> paintedComponents = new HashSet<Paintable>();
+ private final Collection<Paintable> paintedComponents = new HashSet<Paintable>();
private Collection<Paintable> identifiersCreatedDueRefPaint;
- private Collection<Class<? extends Paintable>> usedPaintableTypes = new LinkedList<Class<? extends Paintable>>();
+ private final Collection<Class<? extends Paintable>> usedPaintableTypes = new LinkedList<Class<? extends Paintable>>();
/**
* Creates a new XMLPrintWriter, without automatic line flushing.
&& Paintable.class.isAssignableFrom(superclass)) {
class1 = (Class<? extends Paintable>) superclass;
} else {
- System.out
- .append("Warning: no superclass of "
- + paintable.getClass().getName()
- + " has a @ClientWidget"
- + " annotation. Component will not be mapped correctly on client side.");
+ logger.warning("No superclass of "
+ + paintable.getClass().getName()
+ + " has a @ClientWidget"
+ + " annotation. Component will not be mapped correctly on client side.");
break;
}
}
// TODO could optize to quit at the end attribute
}
} catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
+ logger.log(
+ Level.SEVERE,
+ "An error occurred while finding widget mapping.",
+ e1);
} finally {
try {
bufferedReader.close();
} catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
+ logger.log(Level.SEVERE, "Could not close reader.",
+ e1);
}
}
} catch (Throwable e2) {
- // TODO Auto-generated catch block
- e2.printStackTrace();
+ logger.log(Level.SEVERE,
+ "An error occurred while finding widget mapping.",
+ e2);
}
return false;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
@SuppressWarnings("serial")
public class PortletApplicationContext2 extends AbstractWebApplicationContext {
+ private static final Logger logger = Logger
+ .getLogger(PortletApplicationContext2.class.getName());
+
protected Map<Application, Set<PortletListener>> portletListeners = new HashMap<Application, Set<PortletListener>>();
protected transient PortletSession session;
private PortletResponse response;
- private Map<String, QName> eventActionDestinationMap = new HashMap<String, QName>();
- private Map<String, Serializable> eventActionValueMap = new HashMap<String, Serializable>();
+ private final Map<String, QName> eventActionDestinationMap = new HashMap<String, QName>();
+ private final Map<String, Serializable> eventActionValueMap = new HashMap<String, Serializable>();
- private Map<String, String> sharedParameterActionNameMap = new HashMap<String, String>();
- private Map<String, String> sharedParameterActionValueMap = new HashMap<String, String>();
+ private final Map<String, String> sharedParameterActionNameMap = new HashMap<String, String>();
+ private final Map<String, String> sharedParameterActionValueMap = new HashMap<String, String>();
public File getBaseDirectory() {
String resultPath = session.getPortletContext().getRealPath("/");
return new File(url.getFile());
} catch (final Exception e) {
// FIXME: Handle exception
- e.printStackTrace();
+ logger.log(
+ Level.FINE,
+ "Cannot access base directory, possible security issue "
+ + "with Application Server or Servlet Container",
+ e);
}
}
return null;
} catch (MalformedURLException e) {
// should never happen as based on an existing URL,
// only changing end of file name/path part
- e.printStackTrace();
+ logger.log(Level.SEVERE,
+ "This should never happen!", e);
}
}
}
}
}
} catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ logger.log(Level.FINEST, "Failed to inspect JAR file", e);
} catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ logger.log(Level.FINEST, "Failed to inspect JAR file", e);
}
return false;
} catch (LinkageError e) {
// NOP
} catch (Exception e) {
- e.printStackTrace();
+ logger.log(Level.FINEST, "Could not add class: " + fullclassName, e);
}
}
try {
return new URL("file://" + directory.getCanonicalPath());
} catch (MalformedURLException e) {
- e.printStackTrace();
+ logger.log(Level.FINEST, "Ignoring exception", e);
// ignore: continue to the next classpath entry
} catch (IOException e) {
- e.printStackTrace();
+ logger.log(Level.FINEST, "Ignoring exception", e);
// ignore: continue to the next classpath entry
}
}
package com.vaadin.tools;
import java.lang.reflect.Method;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder;
*/
public class WidgetsetCompiler {
+ private static final Logger logger = Logger
+ .getLogger(WidgetsetCompiler.class.getName());
+
/**
* @param args
* same arguments as for com.google.gwt.dev.Compiler
String[].class);
method.invoke(null, new Object[] { args });
} catch (Throwable thr) {
- thr.printStackTrace();
+ logger.log(Level.SEVERE,
+ "Widgetset compilation failed", thr);
}
}
};
runThread.join();
System.out.println("Widgetset compilation finished");
} catch (Throwable thr) {
- thr.printStackTrace();
+ logger.log(Level.SEVERE, "Widgetset compilation failed", thr);
}
}
}
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import com.vaadin.data.Container;
import com.vaadin.data.Item;
Container.Ordered, Container.Sortable, ItemClickSource, DragSource,
DropTarget {
+ private static final Logger logger = Logger
+ .getLogger(Table.class.getName());
+
/**
* Modes that Table support as drag sourse.
*/
.get("lastToBeRendered")).intValue();
} catch (Exception e) {
// FIXME: Handle exception
- e.printStackTrace();
+ logger.log(Level.FINER,
+ "Could not parse the first and/or last rows.", e);
}
// respect suggested rows only if table is not otherwise updated
}
} catch (final Exception e) {
// FIXME: Handle exception
- e.printStackTrace();
+ logger.log(Level.FINER,
+ "Could not determine column collapsing state", e);
}
clientNeedsContentRefresh = true;
}
setColumnOrder(idsTemp);
} catch (final Exception e) {
// FIXME: Handle exception
- e.printStackTrace();
-
+ logger.log(Level.FINER,
+ "Could not determine column reordering state", e);
}
clientNeedsContentRefresh = true;
}
}
// The property id of the column which header was pressed
- private Object columnPropertyId;
+ private final Object columnPropertyId;
public HeaderClickEvent(Component source, Object propertyId,
MouseEventDetails details) {
}
// The property id of the column which header was pressed
- private Object columnPropertyId;
+ private final Object columnPropertyId;
/**
* Constructor