1<!DOCTYPE html> 2<html lang="en"> 3<head> 4<meta charset="UTF-8"> 5<title>sampleFile - OpenGrok cross reference for /sampleFile</title></head><body> 6<script type="text/javascript">/* <![CDATA[ */ 7function get_sym_list(){return [["Class","xc",[["InnerClass",47],["Sample",25]]],["Package","xp",[["org.opensolaris.opengrok.analysis.java",23]]],["Method","xmt",[["AbstractMethod",43],["InnerMethod",49],["Method",33],["Sample",29],["main",62]]]];} /* ]]> */</script><a class="l" name="1" href="#1">1</a><span class='fold-space'> </span><span class="c">/* 8<a class="l" name="2" href="#2">2</a><span class='fold-space'> </span> * CDDL HEADER START 9<a class="l" name="3" href="#3">3</a><span class='fold-space'> </span> * 10<a class="l" name="4" href="#4">4</a><span class='fold-space'> </span> * The contents of this file are subject to the terms of the 11<a class="l" name="5" href="#5">5</a><span class='fold-space'> </span> * Common Development and Distribution License (the "License"). 12<a class="l" name="6" href="#6">6</a><span class='fold-space'> </span> * You may not use this file except in compliance with the License. 13<a class="l" name="7" href="#7">7</a><span class='fold-space'> </span> * 14<a class="l" name="8" href="#8">8</a><span class='fold-space'> </span> * See <a href="/source/s?path=LICENSE.txt">LICENSE.txt</a> included in this distribution for the specific 15<a class="l" name="9" href="#9">9</a><span class='fold-space'> </span> * language governing permissions and limitations under the License. 16<a class="hl" name="10" href="#10">10</a><span class='fold-space'> </span> * 17<a class="l" name="11" href="#11">11</a><span class='fold-space'> </span> * When distributing Covered Code, include this CDDL HEADER in each 18<a class="l" name="12" href="#12">12</a><span class='fold-space'> </span> * file and include the License file at <a href="/source/s?path=LICENSE.txt">LICENSE.txt</a>. 19<a class="l" name="13" href="#13">13</a><span class='fold-space'> </span> * If applicable, add the following below this CDDL HEADER, with the 20<a class="l" name="14" href="#14">14</a><span class='fold-space'> </span> * fields enclosed by brackets "[]" replaced with your own identifying 21<a class="l" name="15" href="#15">15</a><span class='fold-space'> </span> * information: Portions Copyright [yyyy] [name of copyright owner] 22<a class="l" name="16" href="#16">16</a><span class='fold-space'> </span> * 23<a class="l" name="17" href="#17">17</a><span class='fold-space'> </span> * CDDL HEADER END 24<a class="l" name="18" href="#18">18</a><span class='fold-space'> </span> */</span> 25<a class="l" name="19" href="#19">19</a><span class='fold-space'> </span> 26<a class="hl" name="20" href="#20">20</a><span class='fold-space'> </span><span class="c">/* 27<a class="l" name="21" href="#21">21</a><span class='fold-space'> </span> * Copyright (c) 2017, Oracle <a href="/source/s?path=and/">and</a>/<a href="/source/s?path=and/or">or</a> its affiliates. All rights reserved. 28<a class="l" name="22" href="#22">22</a><span class='fold-space'> </span> */</span> 29<a class="l" name="23" href="#23">23</a><span class='fold-space'> </span><b>package</b> <a href="/source/s?defs=org" class="intelliWindow-symbol" data-definition-place="undefined-in-file">org</a>.<a href="/source/s?defs=opensolaris" class="intelliWindow-symbol" data-definition-place="undefined-in-file">opensolaris</a>.<a href="/source/s?defs=opengrok" class="intelliWindow-symbol" data-definition-place="undefined-in-file">opengrok</a>.<a href="/source/s?defs=analysis" class="intelliWindow-symbol" data-definition-place="undefined-in-file">analysis</a>.<a href="/source/s?defs=java" class="intelliWindow-symbol" data-definition-place="undefined-in-file">java</a>; 30<a class="l" name="24" href="#24">24</a><span class='fold-space'> </span> 31<a class="l" name="25" href="#25">25</a><span class='fold-space'> </span><b>public</b> <b>class</b> <a class="xc" name="Sample"/><a href="/source/s?refs=Sample" class="xc intelliWindow-symbol" data-definition-place="def">Sample</a> { 32<a class="l" name="26" href="#26">26</a><span class='fold-space'> </span> 33<a class="l" name="27" href="#27">27</a><span class='fold-space'> </span> <b>static</b> <b>private</b> <a href="/source/s?defs=String" class="intelliWindow-symbol" data-definition-place="undefined-in-file">String</a> <a class="xfld" name="MY_MEMBER"/><a href="/source/s?refs=MY_MEMBER" class="xfld intelliWindow-symbol" data-definition-place="def">MY_MEMBER</a> = <span class="s">"value"</span>; 34<a class="l" name="28" href="#28">28</a><span class='fold-space'> </span> 35<span id='scope_id_332feb92' class='scope-head'><span class='scope-signature'>Sample()</span><a class="l" name="29" href="#29">29</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_332feb92_fold_icon'><span class='fold-icon'> </span></a> <b>public</b> <a class="xmt" name="Sample"/><a href="/source/s?refs=Sample" class="xmt intelliWindow-symbol" data-definition-place="def">Sample</a>() {</span> 36<span id='scope_id_332feb92_fold' class='scope-body'><a class="hl" name="30" href="#30">30</a><span class='fold-space'> </span> 37<a class="l" name="31" href="#31">31</a><span class='fold-space'> </span> } 38</span><a class="l" name="32" href="#32">32</a><span class='fold-space'> </span> 39<span id='scope_id_9da6e00b' class='scope-head'><span class='scope-signature'>Method(int arg)</span><a class="l" name="33" href="#33">33</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_9da6e00b_fold_icon'><span class='fold-icon'> </span></a> <b>public</b> <b>int</b> <a class="xmt" name="Method"/><a href="/source/s?refs=Method" class="xmt intelliWindow-symbol" data-definition-place="def">Method</a>(<b>int</b> <a class="xa" name="arg"/><a href="/source/s?refs=arg" class="xa intelliWindow-symbol" data-definition-place="def">arg</a>) {</span> 40<span id='scope_id_9da6e00b_fold' class='scope-body'><a class="l" name="34" href="#34">34</a><span class='fold-space'> </span> <b>int</b> <a class="xl" name="res"/><a href="/source/s?refs=res" class="xl intelliWindow-symbol" data-definition-place="def">res</a> = <span class="n">5</span>; 41<a class="l" name="35" href="#35">35</a><span class='fold-space'> </span> 42<a class="l" name="36" href="#36">36</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#res" data-definition-place="defined-in-file">res</a> += <a class="d intelliWindow-symbol" href="#arg" data-definition-place="defined-in-file">arg</a>; 43<a class="l" name="37" href="#37">37</a><span class='fold-space'> </span> 44<a class="l" name="38" href="#38">38</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#InnerClass" data-definition-place="defined-in-file">InnerClass</a> <a class="xl" name="i"/><a href="/source/s?refs=i" class="xl intelliWindow-symbol" data-definition-place="def">i</a> = <b>new</b> <a class="d intelliWindow-symbol" href="#InnerClass" data-definition-place="defined-in-file">InnerClass</a>(); 45<a class="l" name="39" href="#39">39</a><span class='fold-space'> </span> 46<a class="hl" name="40" href="#40">40</a><span class='fold-space'> </span> <b>return</b> <a class="d intelliWindow-symbol" href="#i" data-definition-place="defined-in-file">i</a>.<a class="d intelliWindow-symbol" href="#InnerMethod" data-definition-place="defined-in-file">InnerMethod</a>().<a href="/source/s?defs=length" class="intelliWindow-symbol" data-definition-place="undefined-in-file">length</a>() * <a class="d intelliWindow-symbol" href="#res" data-definition-place="defined-in-file">res</a>; 47<a class="l" name="41" href="#41">41</a><span class='fold-space'> </span> } 48</span><a class="l" name="42" href="#42">42</a><span class='fold-space'> </span> 49<span id='scope_id_bedfb0c0' class='scope-head'><span class='scope-signature'>AbstractMethod(int test)</span><a class="l" name="43" href="#43">43</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_bedfb0c0_fold_icon'><span class='fold-icon'> </span></a> <b>public</b> <b>int</b> <a class="xmt" name="AbstractMethod"/><a href="/source/s?refs=AbstractMethod" class="xmt intelliWindow-symbol" data-definition-place="def">AbstractMethod</a>(<b>int</b> <a class="xa" name="test"/><a href="/source/s?refs=test" class="xa intelliWindow-symbol" data-definition-place="def">test</a>) {</span> 50<span id='scope_id_bedfb0c0_fold' class='scope-body'><a class="l" name="44" href="#44">44</a><span class='fold-space'> </span> <b>return</b> <span class="n">0</span>; 51<a class="l" name="45" href="#45">45</a><span class='fold-space'> </span> } 52</span><a class="l" name="46" href="#46">46</a><span class='fold-space'> </span> 53<a class="l" name="47" href="#47">47</a><span class='fold-space'> </span> <b>private</b> <b>class</b> <a class="xc" name="InnerClass"/><a href="/source/s?refs=InnerClass" class="xc intelliWindow-symbol" data-definition-place="def">InnerClass</a> { 54<a class="l" name="48" href="#48">48</a><span class='fold-space'> </span> 55<span id='scope_id_27ccc793' class='scope-head'><span class='scope-signature'>InnerMethod()</span><a class="l" name="49" href="#49">49</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_27ccc793_fold_icon'><span class='fold-icon'> </span></a> <b>public</b> <a href="/source/s?defs=String" class="intelliWindow-symbol" data-definition-place="undefined-in-file">String</a> <a class="xmt" name="InnerMethod"/><a href="/source/s?refs=InnerMethod" class="xmt intelliWindow-symbol" data-definition-place="def">InnerMethod</a>() {</span> 56<span id='scope_id_27ccc793_fold' class='scope-body'><a class="hl" name="50" href="#50">50</a><span class='fold-space'> </span> <span class="c">// somthing } */</span> 57<a class="l" name="51" href="#51">51</a><span class='fold-space'> </span> <span class="c">/* }}} 58<a class="l" name="52" href="#52">52</a><span class='fold-space'> </span> multi-line comment }{} 59<a class="l" name="53" href="#53">53</a><span class='fold-space'> </span> */</span> 60<a class="l" name="54" href="#54">54</a><span class='fold-space'> </span> 61<a class="l" name="55" href="#55">55</a><span class='fold-space'> </span> <a href="/source/s?defs=System" class="intelliWindow-symbol" data-definition-place="undefined-in-file">System</a>.<a href="/source/s?defs=out" class="intelliWindow-symbol" data-definition-place="undefined-in-file">out</a>.<a href="/source/s?defs=print" class="intelliWindow-symbol" data-definition-place="undefined-in-file">print</a>(<span class="s">"I'm so useless"</span>); 62<a class="l" name="56" href="#56">56</a><span class='fold-space'> </span> 63<a class="l" name="57" href="#57">57</a><span class='fold-space'> </span> <b>return</b> <span class="s">"Why do robots need to drink?"</span>; 64<a class="l" name="58" href="#58">58</a><span class='fold-space'> </span> } 65</span><a class="l" name="59" href="#59">59</a><span class='fold-space'> </span> 66<a class="hl" name="60" href="#60">60</a><span class='fold-space'> </span> } 67<a class="l" name="61" href="#61">61</a><span class='fold-space'> </span> 68<span id='scope_id_3b67212e' class='scope-head'><span class='scope-signature'>main(String args[])</span><a class="l" name="62" href="#62">62</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_3b67212e_fold_icon'><span class='fold-icon'> </span></a> <b>public</b> <b>static</b> <b>void</b> <a class="xmt" name="main"/><a href="/source/s?refs=main" class="xmt intelliWindow-symbol" data-definition-place="def">main</a>(<a href="/source/s?defs=String" class="intelliWindow-symbol" data-definition-place="undefined-in-file">String</a> <a class="xa" name="args"/><a href="/source/s?refs=args" class="xa intelliWindow-symbol" data-definition-place="def">args</a>[]) {</span> 69<span id='scope_id_3b67212e_fold' class='scope-body'><a class="l" name="63" href="#63">63</a><span class='fold-space'> </span> <b>int</b> <a class="xl" name="num1"/><a href="/source/s?refs=num1" class="xl intelliWindow-symbol" data-definition-place="def">num1</a>, <a class="xl" name="num2"/><a href="/source/s?refs=num2" class="xl intelliWindow-symbol" data-definition-place="def">num2</a>; 70<a class="l" name="64" href="#64">64</a><span class='fold-space'> </span> <b>try</b> { 71<a class="l" name="65" href="#65">65</a><span class='fold-space'> </span> <span class="c">// Try block to handle code that may cause exception</span> 72<a class="l" name="66" href="#66">66</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#num1" data-definition-place="defined-in-file">num1</a> = <span class="n">0</span>; 73<a class="l" name="67" href="#67">67</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#num2" data-definition-place="defined-in-file">num2</a> = <span class="n">62</span> * <span class="n">0xFFFF</span> / <a class="d intelliWindow-symbol" href="#num1" data-definition-place="defined-in-file">num1</a>; 74<a class="l" name="68" href="#68">68</a><span class='fold-space'> </span> <a href="/source/s?defs=System" class="intelliWindow-symbol" data-definition-place="undefined-in-file">System</a>.<a href="/source/s?defs=out" class="intelliWindow-symbol" data-definition-place="undefined-in-file">out</a>.<a href="/source/s?defs=println" class="intelliWindow-symbol" data-definition-place="undefined-in-file">println</a>(<span class="s">"Try block message"</span>); 75<a class="l" name="69" href="#69">69</a><span class='fold-space'> </span> } <b>catch</b> (<a href="/source/s?defs=ArithmeticException" class="intelliWindow-symbol" data-definition-place="undefined-in-file">ArithmeticException</a> <a href="/source/s?defs=e" class="intelliWindow-symbol" data-definition-place="undefined-in-file">e</a>) { 76<a class="hl" name="70" href="#70">70</a><span class='fold-space'> </span> <span class="c">// This block is to catch divide-by-zero error</span> 77<a class="l" name="71" href="#71">71</a><span class='fold-space'> </span> <a href="/source/s?defs=System" class="intelliWindow-symbol" data-definition-place="undefined-in-file">System</a>.<a href="/source/s?defs=out" class="intelliWindow-symbol" data-definition-place="undefined-in-file">out</a>.<a href="/source/s?defs=println" class="intelliWindow-symbol" data-definition-place="undefined-in-file">println</a>(<span class="s">"Error: Don't divide a number by zero"</span>); 78<a class="l" name="72" href="#72">72</a><span class='fold-space'> </span> } 79<a class="l" name="73" href="#73">73</a><span class='fold-space'> </span> <a href="/source/s?defs=System" class="intelliWindow-symbol" data-definition-place="undefined-in-file">System</a>.<a href="/source/s?defs=out" class="intelliWindow-symbol" data-definition-place="undefined-in-file">out</a>.<a href="/source/s?defs=println" class="intelliWindow-symbol" data-definition-place="undefined-in-file">println</a>(<span class="s">"I'm out of try-catch block in Java."</span>); 80<a class="l" name="74" href="#74">74</a><span class='fold-space'> </span> } 81</span><a class="l" name="75" href="#75">75</a><span class='fold-space'> </span> 82<a class="l" name="76" href="#76">76</a><span class='fold-space'> </span>} 83<a class="l" name="77" href="#77">77</a><span class='fold-space'> </span><span class="c">/*<a href="http://example.com">http://example.com</a>*/</span> 84<a class="l" name="78" href="#78">78</a><span class='fold-space'> </span></body> 85</html> 86