mediumone / checkthread Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/checkthread
Automatically exported from code.google.com/p/checkthread
What steps will reproduce the problem?
Imagine the following setup for a Swing status bar:
@ThreadConfined(ThreadName.EDT)
private void addString(final String message) {
// add the string to a component displaying whatever information
}
// following method is intended to be invoked by
// non-EDT threads, too, since I have threads other
// than EDT which shall be able to display such a GUI
// notification in the status bar
@ThreadSafe
public void append(final String message) {
if (SwingUtilities.isEventDispatchThread()) {
addString(message);
} else {
SwingUtilities.invokeLater(new Runnable() {
@Override
@ThreadConfined(ThreadName.EDT)
public void run() {
addString(message);
}
});
}
}
What is the expected output? What do you see instead?
Nice would be, if CheckThread automatically recognizes
if (SwingUtilities.isEventDispatchThread())
because there are errors writing the CheckThread
annotation directly IN the method body in the if block.
A workaround, of course, is to invoke this method from
non EDT threads with SwingUtilities.invokeXY I have done this
before but the code then was really boilerplate.
What version of the product are you using? On what operating system?
Eclipse SDK Version: 3.5.1
x86_64 GNU/Linux
checkthread-eclipse-plugin-1.0.9
Please provide any additional information below.
-
Original issue reported on code.google.com by [email protected]
on 30 Apr 2010 at 1:59
The following was reported on the checkthread email list.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[checkthread] EXCEPTION: java.lang.NoSuchMethodException:
java.lang.reflect.Type.getRawType()
[checkthread] EXCEPTION: java.lang.NoSuchMethodException:
java.lang.reflect.Type.getActualTypeArguments()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CheckThread Discussion Forum" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/checkthread-discussion-forum?hl=en
-~----------~----~----~----~------~----~------~--~---
Original issue reported on code.google.com by [email protected]
on 23 Apr 2009 at 2:18
What steps will reproduce the problem?
1. I am using the (for this issue very reduced) class which I provided as
an attachment.
2. I have implemented a simple "Initialization on demand holder idiom"
since I only need one status bar which this class is for. The getter method
is intended to be invoked by Swings EDT - hence ThreadConfined.
3. Running CheckThread on my project gave me the error below.
What is the expected output? What do you see instead?
Expected is that everything works just fine since getSingleton() is invoked
by the EDT and the output in the constructor prints "true".
Instead I get:
The method Static block has a 'MAIN' thread policy, but the invoked method
'test.CustomPanel' has a 'EDT' thread policy. (line 14 is marked)
What version of the product are you using? On what operating system?
Eclipse SDK Version: 3.5.1
x86_64 GNU/Linux
checkthread-eclipse-plugin-1.0.9
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 23 Apr 2010 at 11:48
Attachments:
We have:
package resto.db;
import resto.utils.ReflectionUtil;
public interface EntityLookup
{
EntityLookup INSTANCE = ReflectionUtil.createImpl
("resto.db.EntityLookupImpl");
EntityManager getEntityManager();
}
that raises
[checkthread] EXCEPTION: java.lang.NoSuchMethodException:
resto.db.EntityLookup.<clinit>()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CheckThread Discussion Forum" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/checkthread-discussion-forum?hl=en
-~----------~----~----~----~------~----~------~--~---
.
Original issue reported on code.google.com by [email protected]
on 23 Apr 2009 at 2:17
What steps will reproduce the problem?
1. Load Eclipse with multiple projects.
2. In a project other than the last one listed, add a threading error.
3. Run CheckThread, note that errors are reported on the console.
4. Check "Problems" too see that the errors are not listed.
What version of the product are you using? On what operating system?
Windows Eclipse Galileo
Please provide any additional information below.
Renaming a project "zzz" and rerunning the check made the problems appear.
Original issue reported on code.google.com by [email protected]
on 12 Oct 2009 at 6:23
What steps will reproduce the problem?
1. I downloaded eclipse version : 3.3.2
2. I downladed the eclipse plugin jar and copy tht jar in the plugin folder
of eclipse
3. I opened the eclipse i could not find the ICon to run that Thread Check.
What is the expected output? What do you see instead?
Icon should be there to run thread check
What version of the product are you using? On what operating system?
Version :3.3.2 OS:XP
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 25 Nov 2008 at 1:51
What steps will reproduce the problem?
1. Download, install eclipse plugin with assosiated libs.
2. Run simple example from http://checkthread.org/example-threadsafe.html
3. After some works... no error found
What is the expected output? What do you see instead?
- I expected appropriate error.
I do new test project "Zzzzz" so it will be last (as in other issue)
ok, logs say that "1 error found, see in problem/warning window", but one
is empty..
I try even via Ant lib, but got various errors and could not clean them.
------
In sum, I lost about one hour and a half without result (and i think many
other people too).
Original issue reported on code.google.com by [email protected]
on 9 Dec 2009 at 1:41
What steps will reproduce the problem?
1. Create Interface that has a method that takes a generic parameter
2. Create class implemented the interface.
3. Run checkthread. It will fail, complains: "The method doNothing must have
thesame CheckThread annotation as its superclass."
Source:
import org.checkthread.annotations.ThreadSafe;
public interface SomeInterface<T> {
@ThreadSafe
void doNothing(T obj);
}
class SomeImplementation implements SomeInterface<String> {
@ThreadSafe
public void doNothing(String obj){
System.out.println("nothing");
}
}
What is the expected output? What do you see instead?
Expect no errors to show when running checkthreads.
What version of the product are you using? On what operating system?
checkthreads 1.0.9, Eclipse 3.6, OS X 10.6.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 10 Jan 2011 at 2:30
Attachments:
Any possibility of maven support ?
Original issue reported on code.google.com by [email protected]
on 21 Nov 2008 at 6:07
The following was reported on checkthread email list...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
We have:
package resto.tool.classconverter;
public enum AccessModifier
{
PUBLIC("public"),
PRIVATE("private"),
INTERNAL("internal"),
DEFAULT("");
private final String name;
AccessModifier(String name)
{
this.name = name;
}
/**
* @return имя модификатора доступа
*/
public String getName()
{
return name;
}
@Override
public String toString()
{
return getName();
}
}
that raises
D:\svn\trunk\BuildScripts>ant classconverter-build
Buildfile: build.xml
[javac] Compiling 5 source files to D:\svn\trunk\dev\Server
\ClassConverter\build\classes
[javac] Note: D:\svn\trunk\dev\Server\ClassConverter\src\resto\tool
\classconverter\ClassConverter.java uses unchecked or unsafe
operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[checkthread] 22.04.2009 19:17:10 org.checkthread.config.Log
reportException
[checkthread] SEVERE: exception: java.lang.ClassNotFoundException:
resto.tool.classconverter.AccessModifier
[checkthread] severe: Invalid class name:
[Lresto.tool.classconverter.AccessModifier;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CheckThread Discussion Forum" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/checkthread-discussion-forum?hl=en
-~----------~----~----~----~------~----~------~--~---
Original issue reported on code.google.com by [email protected]
on 23 Apr 2009 at 2:16
What steps will reproduce the problem?
1. Download and install CheckThread Plugin
2. Open a project that references another project
3. Click on the CheckThread button
What is the expected output? What do you see instead?
CheckThread should run, instead the entire Eclipse IDE vanishes!
What version of the product are you using? On what operating system?
CheckThread 1.0.7
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 10 Sep 2008 at 9:09
This request came from the checkthread email list
>>>>>>>>>>>>>>>>>>>>>>>>>
In writing Swing apps, @ThreadConfined is great to make sure some
method is running on the EDT. But the inverse is equally important to
me: there are lots of methods that should _not_ run on the EDT, but I
don't care what thread they do run on. In many cases I can't know the
thread name at compile time, because tasks are assigned to some thread
pool either via SwingWorker or some Executor.
So: would it be possible to add an inverse test, e.g. @ThreadConfined
(ThreadName.EDT, inverse=true) or maybe @ThreadAvoided
(ThreadName.EDT)?
Thanks,
-ds
Original issue reported on code.google.com by [email protected]
on 27 Apr 2009 at 1:14
Error during dispatching of
java.awt.event.MouseEvent[MOUSE_RELEASED,(848,74),absolute(844,70),button=1
,modifiers=Button1,clickCount=1] on frame0:
com.intellij.openapi.roots.ModuleRootManager.getCompilerOutputPath()Lcom/in
tellij/openapi/vfs/VirtualFile;
java.lang.NoSuchMethodError:
com.intellij.openapi.roots.ModuleRootManager.getCompilerOutputPath()Lcom/in
tellij/openapi/vfs/VirtualFile;
at
org.checkthread.plugin.intellij.CheckThreadRunner.init(CheckThreadRunner.ja
va:95)
at
org.checkthread.plugin.intellij.CheckThreadToggleActionSimple.setSelected(C
heckThreadToggleActionSimple.java:47)
at
com.intellij.openapi.actionSystem.ToggleAction.actionPerformed(ToggleAction
.java:39)
at
com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:61)
at
com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:89)
at
com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(Actio
nButton.java:23)
at java.awt.Component.processEvent(Component.java:5981)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4583)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4413)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)
at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:35)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:223)
at
com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:217)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.jav
a:269)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:1
84)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.jav
a:174)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Original issue reported on code.google.com by [email protected]
on 21 Apr 2009 at 4:11
The checkthread ant task will throw ugly exceptions if the classpath is
missing java classes needed to perform the analysis.
Original issue reported on code.google.com by [email protected]
on 29 Apr 2009 at 11:29
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.checkthread.annotations.ThreadSafe;
public class SomeClass {
private final List<String> list = new ArrayList<String>();
private final ReadWriteLock lock = new ReentrantReadWriteLock();
@ThreadSafe
public void add(String obj){
lock.writeLock().lock();
list.add(obj);
lock.writeLock().unlock();
}
}
This should generate a warning that the unlock isn't in a finally:
@ThreadSafe
public void add(String obj){
lock.writeLock().lock();
try {
list.add(obj);
} finally {
lock.writeLock().unlock();
}
}
Original issue reported on code.google.com by [email protected]
on 10 Jan 2011 at 2:41
What steps will reproduce the problem?
1. Install plugin with IntelliJ 10
2. Attempt to run CheckThread
3. IntelliJ reports an error that this version of IntelliJ is not supported.
Original issue reported on code.google.com by [email protected]
on 27 Apr 2011 at 5:42
What steps will reproduce the problem?
1. Start with the original "HelloWorldThreadWithBug.java" file provided as
an example.
2. Verify that running CheckThread reports a threading error.
3. Update the file to include an anonymous inner class.
4. Rerun CheckThread and the original threading error is no longer
reported.
What version of the product are you using? On what operating system?
Windows Eclipse Galileo
Please provide any additional information below.
I haven't been able to identify what aspect of the anonymous inner class
causes the problem. Using "new MouseListener() {...}" didn't cause a
problem, but "new CanvasState() {...}" did consistently hide the threading
error.
Original issue reported on code.google.com by [email protected]
on 12 Oct 2009 at 6:32
Attachments:
What steps will reproduce the problem?
1. Using the attached analyze.xml
2. I get all the errors reported in the attached results file.
3. Basically every class that I have in the directory is reported as class not
found by the class loader.
4. I'm using the following command line:
C:\development\apps\apache-ant-1.7.0\bin\ant -f analyze.xml -lib ../dist -lib
../lib > results
In the C:\checkthread-1.0\examples> directory.
I know the check thread class are found because I can run the example.
What is the expected output? What do you see instead?
I would like a report of threading issues. Instead I see a long list of class
loader exceptions.
What version of the product are you using? On what operating system?
1.0.9 from the Windows command prompt
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 24 Jun 2010 at 1:23
Attachments:
analyze:
[checkthread] severe: java.lang.ArrayIndexOutOfBoundsException: -1
[checkthread] java.lang.ArrayIndexOutOfBoundsException: -1
[checkthread] at java.util.ArrayList.elementData(ArrayList.java:371)
[checkthread] at java.util.ArrayList.remove(ArrayList.java:448)
[checkthread] at
org.apache.bcel.verifier.structurals.OperandStack.pop(OperandStack.java:135)
[checkthread] at
org.apache.bcel.verifier.structurals.OperandStack.pop(OperandStack.java:144)
[checkthread] at
org.checkthread.parser.bcel.ProcessInstruction.processInstruction(ProcessInstruc
tion.java:718)
[checkthread] at
org.checkthread.parser.bcel.ProcessMethod.inspectCodeRecurse(ProcessMethod.java:
247)
[checkthread] at
org.checkthread.parser.bcel.ProcessMethod.inspectCode(ProcessMethod.java:171)
...
This happens when I invoke:
ant -f ct.xml -lib checkthread-1.0/dist/ -lib checkthread-1.0/lib/
with ct.xml being:
<?xml version="1.0" ?>
<!--
This ant file runs CheckThread static analysis on the example
class files generated from the ant build.xml.
You will need to use the -lib flag when calling ant:
ant -f analyze.xml -lib ../dist -lib ../lib
-->
<project name="CheckThread Analyze Example" default="analyze" basedir=".">
<!-- DEFINE ANT TASK -->
<taskdef name="checkthread"
classname="org.checkthread.anttask.CheckThreadTask" />
<!-- DEFINE PROPERTIES -->
<target name="init">
<property name="rootDir" value="${basedir}"/>
<property name="classDir" value="${rootDir}/class"/>
</target>
<!-- RUN CHECKTHREAD -->
<target name="analyze" depends="init">
<checkthread
targetpath="/home/folkert/pos/branches/bruteforce_ab/trunk"
classpath="/home/folkert/pos/branches/bruteforce_ab/trunk/build"
verbose="false"/>
</target>
</project>
Original issue reported on code.google.com by [email protected]
on 30 Sep 2013 at 8:37
What steps will reproduce the problem?
1. Import attached archive
2. Build/auto build. Note the errors and warnings in the problems pane.
3. Activate CheckThread
Results:
The new problems generated by CheckThread appear in the problems pane, all
of the old problems are gone.
I would expect all non-CheckThread problem markers to remain intact.
Original issue reported on code.google.com by [email protected]
on 26 Mar 2009 at 12:19
Attachments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.