开发者

why eclipse sometimes auto adds "*/"?

开发者 https://www.devze.com 2023-04-11 16:37 出处:网络
I\'m a new user of eclipse 3.7 and dont know why eclipse always auto adds \"*/\" when I didnt notice. So I\'m wondering why this happened? I haven\'t catch when it happens since when I write the same

I'm a new user of eclipse 3.7 and dont know why eclipse always auto adds "*/" when I didnt notice. So I'm wondering why this happened? I haven't catch when it happens since when I write the same pieces of the code the second time the problem disapears.Can someone tell me how to solve it? for example,this following really annoys me

public void addBall()
{
    try
    {
        Ball ball = new Ball();
        comp.add(ball);

        for (int i = 1; i <= STEPS; i++)
        {
            ball.move(comp.getBounds());
            comp.paint(comp.getGraphics());
            Thread.sleep(DELAY);
        }
    }
   */
    catch (InterruptedException e)
    {
    }
}

The problem occurred when I press "{" following the word try. It s开发者_如何学Ceems only happens when the corresponding "}" is out of current view, however I'm not really sure.Plus,the compiler didnt give me any warnings.


I'd look at the Java code templates - possibly you triggered something there. The defined templates can be found in Preferences, the Java/Editor/Templates page.

At first look at the try template whether it contains the */; or look for similar patterns as well.


By default, Eclipse automatically adds "*/" when you input "/*" and hit Enter, the same way as it automatically adds closing parenthesis.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号