This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 121512 - <java input="..."> does not work when run inside IDE
Summary: <java input="..."> does not work when run inside IDE
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker with 1 vote (vote)
Assignee: Jesse Glick
URL:
Keywords: REGRESSION
Depends on: 194151
Blocks: 112839
  Show dependency tree
 
Reported: 2007-11-08 20:47 UTC by maximvk
Modified: 2011-02-10 23:34 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maximvk 2007-11-08 20:47:10 UTC
Hello,
I've found the strange problem.
I am using netbeans 6.0 since rc10 is released.
The problem arrived in the beta 1 and exists in the beta 2
The problem description:
I use customized build script for building my development project.

Here is the part of build-impl xml that causes the error:
***************************************************************************
<echo message="java_cup.Main compiling yafv files in ${src.dir}/dir/ with input ${src.dir}/dir/yafv/dfa.cup"/>
        <java classname="java_cup.Main" 
                dir="${src.dir}/dir/yafv/" 
                fork="true" input="${src.dir}/psoft/yafv/dfa.cup">
            <arg line="-progress -package dir.yafv -symbols dfasym -parser DFAParser"/>
            
            <classpath>
                <pathelement path="${run.classpath}"/>
            </classpath>
        </java>

*********************************************************************************

The part of code added above is used to compile yafv files (for the client and server side validation on the web page)
For some reason compilation process hangs up on this stage.

**************NetBeans output:**************************************************
JFlex.Main compiling yafv files in /my/path/yafv/
Reading "dfa.flex"
Constructing NFA : 276 states in NFA
Converting NFA to DFA : 
................................................................................
90 states before minimization, 63 states in minimized DFA
Writing code to "DFALexer.java"
java_cup.Main compiling yafv files in /my/path/yafv/ with input /my/path/yafv/dfa.cup
Opening files...
Parsing specification from standard input...
********************************************************************************

The described above problem can be resolved by replacing ..../netbeans-6.0beta2/java1/ant/nblib/bridge.jar file with the
same file from the previous Netbeans version (RC10)
Comment 1 Jesse Glick 2007-11-12 18:22:28 UTC
Seems to be an unwanted side-effect of issue #112839, itself an emergency fix for a regression introduced by the fix of
issue #56341 (which did not break input). Trivial test case:

<project default="x">
  <target name="x">
    <echo file="${java.io.tmpdir}/X.java">
public class X {
  public static void main(String[] a) throws Exception {
    System.out.println("got: " + new java.io.BufferedReader(
      new java.io.InputStreamReader(System.in)).readLine());
  }
}
    </echo>
    <javac srcdir="${java.io.tmpdir}" destdir="${java.io.tmpdir}" includes="X.java"/>
    <java fork="true" classpath="${java.io.tmpdir}" classname="X" inputstring="some text"/>
  </target>
</project>
Comment 2 Jesse Glick 2007-11-12 18:26:54 UTC
Reproducible but I have no clue how to fix it without reverting issue #112839. Readding e.g.

in.close();
out.flush();

is not enough; really seem to need out.close() (why, I don't know).
Comment 3 Jesse Glick 2008-11-19 01:02:06 UTC
I think fixed in core-main #e19aa1d5af47.
Comment 4 Quality Engineering 2008-11-19 16:44:45 UTC
Integrated into 'main-golden', will be available in build *200811191401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/e19aa1d5af47
User: Jesse Glick <jglick@netbeans.org>
Log: #121512: handle input="..." or inputstring="..." on <java>.
Comment 5 Jesse Glick 2009-01-14 15:35:39 UTC
Reporter - if you have a moment to check whether the fix works for you (in a 7.0 development build, or 7.0 Milestone 1)
that would be great. Just mark VERIFIED (or reopen if it does not work). It might be a candidate for a 6.5 patch
release, though I have not heard any other reports of this problem (since the fix of issue #112839 in 6.0, which was the
likely cause).