Comments (4)
[Environment]
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)
Original comment by hh9527
on 22 Feb 2008 at 6:19
from infomancers-collections.
Just so I understand, can you post the entire output for both expected and
actual?
Original comment by [email protected]
on 22 Feb 2008 at 7:54
from infomancers-collections.
Another sample (simpler to explain)
-- motivation --
1. the 'test' method will yield 2 integers(1 and 2)
2. the 'main' method will call 'test' to got a generator, and visit each item
(1 and
2 in this case) in the generator.
-- code --
package com.bestsoft.testjyield;
import com.infomancers.collections.yield.Yielder;
public class Foo {
public static Iterable<Integer> test() {
return new Yielder<Integer>() {
public void yieldNextCore() {
System.out.println("Yielding 1");
yieldReturn(1);
System.out.println("Yielding 2");
yieldReturn(2);
}
};
}
public static void main(String[] args) {
System.out.println("[BEGIN]");
Iterable<Integer> iter = test();
for (Integer i : iter) {
System.out.println("Got " + i);
}
System.out.println("[DONE]");
}
}
-- expected output --
[BEGIN]
Yielding 1
Got 1
Yielding 2
Got 2
[DONE]
-- actually output --
[BEGIN]
Yielding 1
Yielding 2
Got 2
Yielding 1
Yielding 2
Got 2
Yielding 1
Yielding 2
Got 2
... (INFINITE LOOP)
Original comment by hh9527
on 25 Feb 2008 at 2:33
from infomancers-collections.
Sorry for the delay, it took a long time to get back to the yielder project.
This seems like a really odd bug. In any case, I rewrote the second example in
a unit test, see class Issue13 in
the trunk version. This works now.
Please verify that it does.
Original comment by [email protected]
on 8 Aug 2009 at 2:47
- Changed state: Fixed
from infomancers-collections.
Related Issues (16)
- ++ and -- operators crash the application HOT 2
- Boolean arrays not working properly HOT 1
- Cannot call instance methods of local variables HOT 4
- Exceptions not working HOT 2
- Boolean array set/get code generation not optimal
- Ant task for static compilation
- Suboptimal performance for recursive yielder
- STORE is not dealt correctly HOT 1
- Ant build not cross platform
- Stack is unstable after state switch HOT 2
- Nested loops don't work HOT 3
- Yielder doesn't work with eclipse compiler HOT 2
- Yielder fails when class debug information is not generated. HOT 7
- Cannot have a grandchild class of Yielder HOT 3
- Updated build file. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infomancers-collections.