bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
---|---|---|
remove(MenuComponent menu){ int index = menus.indexOf(menu); if (index == -1) return; remove(index);}
|
remove(MenuComponent menu){ int index = menus.indexOf(menu); if (index == -1) return; remove(index);}
| 768 |
remove(MenuComponent menu){ int index = menus.indexOf(menu); if (index == -1) return; remove(index);}
|
remove(MenuComponent menu){ int index = menus.indexOf(menu); if (index == -1) return; remove(index);}
| 769 |
removeNotify(){ Enumeration e = menus.elements(); while (e.hasMoreElements()) { Menu mi = (Menu) e.nextElement(); mi.removeNotify(); } super.removeNotify();}
|
removeNotify(){ Enumeration e = menus.elements(); while (e.hasMoreElements()) { Menu mi = (Menu) e.nextElement(); mi.removeNotify(); } super.removeNotify();}
| 770 |
public static POA read(InputStream input) { throw new MARSHAL("Not applicable"); }
|
public static POA read(InputStream input) { MARSHAL m = new MARSHAL("Inappropriate"); m.minor = Minor.Inappropriate; throw m; }
| 771 |
public static void write(OutputStream output, POA value) { throw new MARSHAL("Not applicable"); }
|
public static void write(OutputStream output, POA value) { MARSHAL m = new MARSHAL("Inappropriate"); m.minor = Minor.Inappropriate; throw m; }
| 772 |
public static Border getButtonBorder() { Border outer = new MetalButtonBorder(); Border inner = getMarginBorder(); return new BorderUIResource.CompoundBorderUIResource(outer, inner); }
|
public static Border getButtonBorder() { Border outer = new MetalButtonBorder(); Border inner = getMarginBorder(); buttonBorder = new BorderUIResource.CompoundBorderUIResource (outer, inner); } return buttonBorder; }
| 773 |
static Border getMarginBorder() // intentionally not public { /* Swing is not designed to be thread-safe, so there is no * need to synchronize the access to the global variable. */ if (sharedMarginBorder == null) sharedMarginBorder = new BasicBorders.MarginBorder(); return sharedMarginBorder; }
|
static Border getMarginBorder() // intentionally not public { /* Swing is not designed to be thread-safe, so there is no * need to synchronize the access to the global variable. */ if (sharedMarginBorder == null) sharedMarginBorder = new BasicBorders.MarginBorder(); return sharedMarginBorder; }
| 774 |
public JarFile(File file) throws FileNotFoundException, IOException { this(file, true); }
|
public JarFile(String fileName) throws FileNotFoundException, IOException { this(file, true); }
| 775 |
public JarFile(File file) throws FileNotFoundException, IOException { this(file, true); }
|
public JarFile(File file) throws FileNotFoundException, IOException { this(fileName, true); }
| 776 |
public void connect() { String proxyPort = "1080"; // default socks proxy port boolean enhanced = false; boolean support132 = false; int port = 23; // default telnet port enhanced = sesProps.containsKey(SESSION_TN_ENHANCED); if (sesProps.containsKey(SESSION_SCREEN_SIZE)) if (((String)sesProps.getProperty(SESSION_SCREEN_SIZE)).equals(SCREEN_SIZE_27X132_STR)) support132 = true; final tnvt vt = new tnvt(screen,enhanced,support132); setVT(vt); vt.setController(this); if (sesProps.containsKey(SESSION_PROXY_PORT)) proxyPort = (String)sesProps.getProperty(SESSION_PROXY_PORT); if (sesProps.containsKey(SESSION_PROXY_HOST)) vt.setProxy((String)sesProps.getProperty(SESSION_PROXY_HOST), proxyPort); if (sesProps.containsKey(org.tn5250j.transport.SSLConstants.SSL_TYPE)) { sslType = (String)sesProps.getProperty(org.tn5250j.transport.SSLConstants.SSL_TYPE); } else { // set default to none sslType = org.tn5250j.transport.SSLConstants.SSL_TYPE_NONE; } vt.setSSLType(sslType); if (sesProps.containsKey(SESSION_CODE_PAGE)) vt.setCodePage((String)sesProps.getProperty(SESSION_CODE_PAGE)); if (sesProps.containsKey(SESSION_DEVICE_NAME)) vt.setDeviceName((String)sesProps.getProperty(SESSION_DEVICE_NAME)); if (sesProps.containsKey(SESSION_HOST_PORT)) { port = Integer.parseInt((String)sesProps.getProperty(SESSION_HOST_PORT)); } else { // set to default 23 of telnet port = 23; } final String ses = (String)sesProps.getProperty(SESSION_HOST); final int portp = port; // lets set this puppy up to connect within its own thread Runnable connectIt = new Runnable() { public void run() { vt.connect(ses,portp); } }; // now lets set it to connect within its own daemon thread // this seems to work better and is more responsive than using // swingutilities's invokelater Thread ct = new Thread(connectIt); ct.setDaemon(true); ct.start(); addSessionListener(this); }
|
public void connect() { String proxyPort = "1080"; // default socks proxy port boolean enhanced = false; boolean support132 = false; int port = 23; // default telnet port enhanced = sesProps.containsKey(SESSION_TN_ENHANCED); if (sesProps.containsKey(SESSION_SCREEN_SIZE)) if (((String)sesProps.getProperty(SESSION_SCREEN_SIZE)).equals(SCREEN_SIZE_27X132_STR)) support132 = true; final tnvt vt = new tnvt(screen,enhanced,support132); setVT(vt); vt.setController(this); if (sesProps.containsKey(SESSION_PROXY_PORT)) proxyPort = (String)sesProps.getProperty(SESSION_PROXY_PORT); if (sesProps.containsKey(SESSION_PROXY_HOST)) vt.setProxy((String)sesProps.getProperty(SESSION_PROXY_HOST), proxyPort); if (sesProps.containsKey(org.tn5250j.transport.SSLConstants.SSL_TYPE)) { sslType = (String)sesProps.getProperty(org.tn5250j.transport.SSLConstants.SSL_TYPE); } // set default to none sslType = org.tn5250j.transport.SSLConstants.SSL_TYPE_NONE; } vt.setSSLType(sslType); if (sesProps.containsKey(SESSION_CODE_PAGE)) vt.setCodePage((String)sesProps.getProperty(SESSION_CODE_PAGE)); if (sesProps.containsKey(SESSION_DEVICE_NAME)) vt.setDeviceName((String)sesProps.getProperty(SESSION_DEVICE_NAME)); if (sesProps.containsKey(SESSION_HOST_PORT)) { port = Integer.parseInt((String)sesProps.getProperty(SESSION_HOST_PORT)); } // set to default 23 of telnet port = 23; } final String ses = (String)sesProps.getProperty(SESSION_HOST); final int portp = port; // lets set this puppy up to connect within its own thread Runnable connectIt = new Runnable() { public void run() { vt.connect(ses,portp); } }; // now lets set it to connect within its own daemon thread // this seems to work better and is more responsive than using // swingutilities's invokelater Thread ct = new Thread(connectIt); ct.setDaemon(true); ct.start(); addSessionListener(this); }
| 777 |
public void connect() { String proxyPort = "1080"; // default socks proxy port boolean enhanced = false; boolean support132 = false; int port = 23; // default telnet port enhanced = sesProps.containsKey(SESSION_TN_ENHANCED); if (sesProps.containsKey(SESSION_SCREEN_SIZE)) if (((String)sesProps.getProperty(SESSION_SCREEN_SIZE)).equals(SCREEN_SIZE_27X132_STR)) support132 = true; final tnvt vt = new tnvt(screen,enhanced,support132); setVT(vt); vt.setController(this); if (sesProps.containsKey(SESSION_PROXY_PORT)) proxyPort = (String)sesProps.getProperty(SESSION_PROXY_PORT); if (sesProps.containsKey(SESSION_PROXY_HOST)) vt.setProxy((String)sesProps.getProperty(SESSION_PROXY_HOST), proxyPort); if (sesProps.containsKey(org.tn5250j.transport.SSLConstants.SSL_TYPE)) { sslType = (String)sesProps.getProperty(org.tn5250j.transport.SSLConstants.SSL_TYPE); } else { // set default to none sslType = org.tn5250j.transport.SSLConstants.SSL_TYPE_NONE; } vt.setSSLType(sslType); if (sesProps.containsKey(SESSION_CODE_PAGE)) vt.setCodePage((String)sesProps.getProperty(SESSION_CODE_PAGE)); if (sesProps.containsKey(SESSION_DEVICE_NAME)) vt.setDeviceName((String)sesProps.getProperty(SESSION_DEVICE_NAME)); if (sesProps.containsKey(SESSION_HOST_PORT)) { port = Integer.parseInt((String)sesProps.getProperty(SESSION_HOST_PORT)); } else { // set to default 23 of telnet port = 23; } final String ses = (String)sesProps.getProperty(SESSION_HOST); final int portp = port; // lets set this puppy up to connect within its own thread Runnable connectIt = new Runnable() { public void run() { vt.connect(ses,portp); } }; // now lets set it to connect within its own daemon thread // this seems to work better and is more responsive than using // swingutilities's invokelater Thread ct = new Thread(connectIt); ct.setDaemon(true); ct.start(); addSessionListener(this); }
|
public void connect() { String proxyPort = "1080"; // default socks proxy port boolean enhanced = false; boolean support132 = false; int port = 23; // default telnet port enhanced = sesProps.containsKey(SESSION_TN_ENHANCED); if (sesProps.containsKey(SESSION_SCREEN_SIZE)) if (((String)sesProps.getProperty(SESSION_SCREEN_SIZE)).equals(SCREEN_SIZE_27X132_STR)) support132 = true; final tnvt vt = new tnvt(screen,enhanced,support132); setVT(vt); vt.setController(this); if (sesProps.containsKey(SESSION_PROXY_PORT)) proxyPort = (String)sesProps.getProperty(SESSION_PROXY_PORT); if (sesProps.containsKey(SESSION_PROXY_HOST)) vt.setProxy((String)sesProps.getProperty(SESSION_PROXY_HOST), proxyPort); if (sesProps.containsKey(org.tn5250j.transport.SSLConstants.SSL_TYPE)) { sslType = (String)sesProps.getProperty(org.tn5250j.transport.SSLConstants.SSL_TYPE); } else { // set default to none sslType = org.tn5250j.transport.SSLConstants.SSL_TYPE_NONE; } vt.setSSLType(sslType); if (sesProps.containsKey(SESSION_CODE_PAGE)) vt.setCodePage((String)sesProps.getProperty(SESSION_CODE_PAGE)); if (sesProps.containsKey(SESSION_DEVICE_NAME)) vt.setDeviceName((String)sesProps.getProperty(SESSION_DEVICE_NAME)); if (sesProps.containsKey(SESSION_HOST_PORT)) { port = Integer.parseInt((String)sesProps.getProperty(SESSION_HOST_PORT)); } else { // set to default 23 of telnet port = 23; } final String ses = (String)sesProps.getProperty(SESSION_HOST); final int portp = port; // lets set this puppy up to connect within its own thread Runnable connectIt = new Runnable() { public void run() { vt.connect(ses,portp); } }; // now lets set it to connect within its own daemon thread // this seems to work better and is more responsive than using // swingutilities's invokelater Thread ct = new Thread(connectIt); ct.setDaemon(true); ct.start(); addSessionListener(this); }
| 778 |
private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false); setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(true); loadProps(); screen = new Screen5250(this,defaultProps); this.addComponentListener(this); if (!defaultProps.containsKey("width") || !defaultProps.containsKey("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(Integer.parseInt((String)defaultProps.get("width")), Integer.parseInt((String)defaultProps.get("height")) ); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) {// if (e.getClickCount() == 2) {//// screen.sendKeys("[enter]");// }// else { screen.moveCursor(e); repaint(); getFocusForMe();// } } }); addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { processVTKeyTyped(e); } public void keyPressed(KeyEvent ke) { processVTKeyPressed(ke); } public void keyReleased(KeyEvent e) { processVTKeyReleased(e); } }); keyMap = new KeyMapper(); keyMap.init(); jumpn = keyMap.isKeyStrokeDefined("[jumpnext]"); jumpp = keyMap.isKeyStrokeDefined("[jumpprev]"); keyMap.addKeyChangeListener(this); /** * this is taken out right now look at the method for description */ initKeyBindings(); macros = new Macronizer(); macros.init(); keyPad.addActionListener(this); if (getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); }
|
private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false); setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(true); loadProps(); screen = new Screen5250(this,defaultProps); this.addComponentListener(this); if (!defaultProps.containsKey("width") || !defaultProps.containsKey("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(Integer.parseInt((String)defaultProps.get("width")), Integer.parseInt((String)defaultProps.get("height")) ); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) {// if (e.getClickCount() == 2) {//// screen.sendKeys("[enter]");// }// else { screen.moveCursor(e); repaint(); getFocusForMe();// } } }); addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { processVTKeyTyped(e); } public void keyPressed(KeyEvent ke) { processVTKeyPressed(ke); } public void keyReleased(KeyEvent e) { processVTKeyReleased(e); } }); keyMap = new KeyMapper(); keyMap.init(); jumpn = keyMap.isKeyStrokeDefined("[jumpnext]"); jumpp = keyMap.isKeyStrokeDefined("[jumpprev]"); keyMap.addKeyChangeListener(this); /** * this is taken out right now look at the method for description */ initKeyBindings(); macros = new Macronizer(); macros.init(); keyPad.addActionListener(this); if (getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); }
| 781 |
public void requestFocus () { if (isDisplayable () && isShowing () && isFocusable ()) { synchronized (getTreeLock ()) { // Find this Component's top-level ancestor. Container parent = getParent (); while (parent != null && !(parent instanceof Window)) parent = parent.getParent (); Window toplevel = (Window) parent; if (toplevel.isFocusableWindow ()) { if (peer != null) // This call will cause a FOCUS_GAINED event to be // posted to the system event queue if the native // windowing system grants the focus request. peer.requestFocus (); else { // Either our peer hasn't been created yet or we're a // lightweight component. In either case we want to // post a FOCUS_GAINED event. EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue (); eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED)); } } else pendingFocusRequest = new FocusEvent(this, FocusEvent.FOCUS_GAINED); } } }
|
public void requestFocus () { if (isDisplayable () && isShowing () && isFocusable ()) { synchronized (getTreeLock ()) { // Find this Component's top-level ancestor. Container parent = getParent (); while (parent != null && !(parent instanceof Window)) parent = parent.getParent (); Window toplevel = (Window) parent; if (toplevel.isFocusableWindow ()) { if (peer != null && !isLightweight()) // This call will cause a FOCUS_GAINED event to be // posted to the system event queue if the native // windowing system grants the focus request. peer.requestFocus (); else { // Either our peer hasn't been created yet or we're a // lightweight component. In either case we want to // post a FOCUS_GAINED event. EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue (); eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED)); } } else pendingFocusRequest = new FocusEvent(this, FocusEvent.FOCUS_GAINED); } } }
| 782 |
public void requestFocus () { if (isDisplayable () && isShowing () && isFocusable ()) { synchronized (getTreeLock ()) { // Find this Component's top-level ancestor. Container parent = getParent (); while (parent != null && !(parent instanceof Window)) parent = parent.getParent (); Window toplevel = (Window) parent; if (toplevel.isFocusableWindow ()) { if (peer != null) // This call will cause a FOCUS_GAINED event to be // posted to the system event queue if the native // windowing system grants the focus request. peer.requestFocus (); else { // Either our peer hasn't been created yet or we're a // lightweight component. In either case we want to // post a FOCUS_GAINED event. EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue (); eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED)); } } else pendingFocusRequest = new FocusEvent(this, FocusEvent.FOCUS_GAINED); } } }
|
public void requestFocus () { if (isDisplayable () && isShowing () && isFocusable ()) { synchronized (getTreeLock ()) { // Find this Component's top-level ancestor. Container parent = getParent (); while (parent != null && !(parent instanceof Window)) parent = parent.getParent (); Window toplevel = (Window) parent; if (toplevel.isFocusableWindow ()) { if (peer != null) // This call will cause a FOCUS_GAINED event to be // posted to the system event queue if the native // windowing system grants the focus request. peer.requestFocus (); else { // Either our peer hasn't been created yet or we're a // lightweight component. In either case we want to // post a FOCUS_GAINED event. EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue (); synchronized (eq) { KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); Component currentFocusOwner = manager.getGlobalPermanentFocusOwner (); if (currentFocusOwner != null) { eq.postEvent (new FocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST, false, this)); eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED, false, currentFocusOwner)); } else eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED, false)); } } } else pendingFocusRequest = new FocusEvent(this, FocusEvent.FOCUS_GAINED); } } }
| 783 |
public void setLayer(Component c, int layer, int position) { remove(c); add(c, getObjectForLayer (layer)); setPosition(c, position); revalidate(); repaint(); }
|
public void setLayer(Component c, int layer, int position) { remove(c); add(c, getObjectForLayer (layer)); setPosition(c, position); revalidate(); repaint(); }
| 784 |
public void setLayer(Component c, int layer, int position) { remove(c); add(c, getObjectForLayer (layer)); setPosition(c, position); revalidate(); repaint(); }
|
public void setLayer(Component c, int layer, int position) { remove(c); add(c, getObjectForLayer (layer)); setPosition(c, position); revalidate(); repaint(); }
| 785 |
protected HttpsURLConnection(URL url) throws IOException { super(url); hostnameVerifier = defaultVerifier; factory = defaultFactory; }
|
protected HttpsURLConnection(URL url) throws IOException { super(url); hostnameVerifier = defaultVerifier; factory = defaultFactory; }
| 788 |
public HTTPConnection(String hostname, int port, boolean secure) { this(hostname, port, secure, 0, 0); }
|
public HTTPConnection(String hostname) { this(hostname, port, secure, 0, 0); }
| 791 |
public HTTPConnection(String hostname, int port, boolean secure) { this(hostname, port, secure, 0, 0); }
|
public HTTPConnection(String hostname, int port, boolean secure) { this(hostname, HTTP_PORT, false, 0, 0); }
| 792 |
public String toUpperCase() { return toUpperCase(Locale.getDefault()); }
|
public String toUpperCase(Locale loc) { return toUpperCase(Locale.getDefault()); }
| 793 |
public String toUpperCase() { return toUpperCase(Locale.getDefault()); }
|
public String toUpperCase() { boolean turkish = "tr".equals(loc.getLanguage()); int expand = 0; boolean unchanged = true; int i = count; int x = i + offset; while (--i >= 0) { char ch = value[--x]; expand += upperCaseExpansion(ch); unchanged = (unchanged && expand == 0 && ! (turkish && ch == '\u0069') && ch == Character.toUpperCase(ch)); } if (unchanged) return this; i = count; if (expand == 0) { char[] newStr = (char[]) value.clone(); while (--i >= 0) { char ch = value[x]; newStr[x++] = (turkish && ch == '\u0069') ? '\u0130' : Character.toUpperCase(ch); } return new String(newStr, offset, count, true); } char[] newStr = new char[count + expand]; int j = 0; while (--i >= 0) { char ch = value[x++]; if (turkish && ch == '\u0069') { newStr[j++] = '\u0130'; continue; } expand = upperCaseExpansion(ch); if (expand > 0) { int index = upperCaseIndex(ch); while (expand-- >= 0) newStr[j++] = upperExpand[index++]; } else newStr[j++] = Character.toUpperCase(ch); } return new String(newStr, 0, newStr.length, true); }
| 794 |
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(My5250.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(My5250.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); } LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null;// } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs == null && sessions.containsKey("emul.view") && sessions.containsKey("emul.startLastView")) { String[] sargs = new String[NUM_PARMS]; parseArgs(sessions.getProperty("emul.view"), sargs); m.sessionArgs = sargs; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < m.sessionArgs.length; x++) { if (m.sessionArgs[x] != null) { if (m.sessionArgs[x].equals("-s")) { x++; if (m.sessionArgs[x] != null && sessions.containsKey(m.sessionArgs[x])) { os400_sessions.addElement(m.sessionArgs[x]); }else{ x--; session_params.addElement(m.sessionArgs[x]); } }else{ session_params.addElement(m.sessionArgs[x]); } } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.splash.setVisible(false); m.frame1.setVisible(true); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(My5250.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(My5250.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); } LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null;// } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs == null && sessions.containsKey("emul.view") && sessions.containsKey("emul.startLastView")) { String[] sargs = new String[NUM_PARMS]; parseArgs(sessions.getProperty("emul.view"), sargs); m.sessionArgs = sargs; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < m.sessionArgs.length; x++) { if (m.sessionArgs[x] != null) { if (m.sessionArgs[x].equals("-s")) { x++; if (m.sessionArgs[x] != null && sessions.containsKey(m.sessionArgs[x])) { os400_sessions.addElement(m.sessionArgs[x]); }else{ x--; session_params.addElement(m.sessionArgs[x]); } }else{ session_params.addElement(m.sessionArgs[x]); } } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.splash.setVisible(false); m.frame1.setVisible(true); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
| 796 |
public Socket(String host, int port) throws UnknownHostException, IOException { this(InetAddress.getByName(host), port, null, 0, true); }
|
public Socket(String host, int port) throws UnknownHostException, IOException { this(InetAddress.getByName(host), port, null, 0, true); }
| 798 |
public Socket(String host, int port) throws UnknownHostException, IOException { this(InetAddress.getByName(host), port, null, 0, true); }
|
public Socket(String host, int port) throws UnknownHostException, IOException { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); }
| 799 |
public static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { Class c = Class.forName(className); LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception setLookAndFeel(a); }
|
public static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { Class c = Class.forName(className); LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception setLookAndFeel(a); }
| 800 |
public static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { Class c = Class.forName(className); LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception setLookAndFeel(a); }
|
public static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { Class c = Class.forName(className); LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception setLookAndFeel(a); }
| 801 |
public Locale(String language, String country, String variant) { // During bootstrap, we already know the strings being passed in are // the correct capitalization, and not null. We can't call // String.toUpperCase during this time, since that depends on the // default locale. if (defaultLocale != null) { language = convertLanguage(language).intern(); country = country.toUpperCase().intern(); variant = variant.toUpperCase().intern(); } this.language = language; this.country = country; this.variant = variant; hashcode = language.hashCode() ^ country.hashCode() ^ variant.hashCode(); }
|
public Locale(String language, String country, String variant) { // During bootstrap, we already know the strings being passed in are // the correct capitalization, and not null. We can't call // String.toUpperCase during this time, since that depends on the // default locale. if (defaultLocale != null) { language = convertLanguage(language).intern(); country = country.toUpperCase().intern(); variant = variant.intern(); } this.language = language; this.country = country; this.variant = variant; hashcode = language.hashCode() ^ country.hashCode() ^ variant.hashCode(); }
| 803 |
public org.omg.CORBA.portable.OutputStream _request(String method, boolean response_expected ) { return delegate.request(this, method, response_expected); }
|
public org.omg.CORBA.portable.OutputStream _request(String method, boolean response_expected ) { return delegate.request(this, method, response_expected); }
| 805 |
public org.omg.CORBA.portable.OutputStream _request(String method, boolean response_expected ) { return delegate.request(this, method, response_expected); }
|
public org.omg.CORBA.portable.OutputStream _request(String method, boolean response_expected ) { return delegate.request(this, method); }
| 806 |
public int getHighlightedAttr(){ return fcw2 | 0x20; }
|
public int getHighlightedAttr(){ return (fcw2 & 0x0f) | 0x20; }
| 808 |
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes/* if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); }*/ // 1. open this node, print its simple XML attributes if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\"/>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes/* if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); }*/ // 1. open this node, print its simple XML attributes if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""); writeOutAttribute(outputstream, axisIdRef); writeOut(outputstream, "\"/>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); }
| 809 |
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean writeHrefAttribute = false; boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; String nodeName = getClassXDFNodeName(); if (defined newNodeNameString) nodeName = newNodeNameString; // indent up one indent = indent + strIndent; //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); Href hrefObj = getHref(); //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream = outputstream; if (hrefObj !=null) { //write out to another file, String fileName = hrefObj.getSysId(); String hrefName = hrefObj.getName(); if(hrefName == null) { Log.errorln("Error: href object in dataCube lacks name. Data being written into metadata instead.\n"); } else if (fileName != null) { writeHrefAttribute = true; try { dataOutputStream = new FileOutputStream(hrefObj.getSysId()); } catch (IOException e) { //oops, something. is wrong, writ out to the passed in OutputStream Log.warnln("Error: cannot open file:"+fileName+" for writing. Data being written into metadata.\n"); writeHrefAttribute = false; } } else { Log.warnln("Error: href:"+hrefName+" lacks systemId, cannot write data to a separate file."); Log.warnln("Data are being written into metadata instead.\n"); writeHrefAttribute = false; } } else { // no *href* attribute specified, write out to the passed in OutputStream // dataOutputStream = outputstream; // not needed now } // write data node attributes if (writeHrefAttribute) { writeOut(outputstream, " "+HREF_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputstream, hrefObj.getName()); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " "+CHECKSUM_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } String encoding = getEncoding(); if (encoding!= null) { writeOut(outputstream, " "+ENCODING_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputstream, encoding.toString()); writeOut(outputstream, "\""); } String compress = getCompression(); if (compress != null) { writeOut(outputstream, " "+COMPRESSION_TYPE_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputstream, compress.toString()); writeOut(outputstream, "\""); } if (writeHrefAttribute) writeOut(outputstream, "/>"); //we just close the data node now else writeOut(outputstream, ">"); //end of opening code Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String[] NoDataValues; if (parentArray.hasFieldAxis()) { NoDataValues = new String[fastestAxis.getLength()]; DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { NoDataValues = new String[1]; NoDataValues[0] = parentArray.getNoDataValue();/* // what tis this?? If there is no fieldAxis, then no fields, // and hence, only ONE noDataValue. DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); }*/ } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues, writeHrefAttribute ? false : true ); } else { writeFormattedData( dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues, writeHrefAttribute ? false : true ); } } //close the data section appropriately if (!writeHrefAttribute && niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } // If we didnt write Href attribute, then means that data // were put into document. We need to close the open data // node appropriately. if (!writeHrefAttribute) writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean writeHrefAttribute = false; boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; String nodeName = getClassXDFNodeName(); if (newNodeNameString != null) nodeName = newNodeNameString; // indent up one indent = indent + strIndent; //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); Href hrefObj = getHref(); //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream = outputstream; if (hrefObj !=null) { //write out to another file, String fileName = hrefObj.getSysId(); String hrefName = hrefObj.getName(); if(hrefName == null) { Log.errorln("Error: href object in dataCube lacks name. Data being written into metadata instead.\n"); } else if (fileName != null) { writeHrefAttribute = true; try { dataOutputStream = new FileOutputStream(hrefObj.getSysId()); } catch (IOException e) { //oops, something. is wrong, writ out to the passed in OutputStream Log.warnln("Error: cannot open file:"+fileName+" for writing. Data being written into metadata.\n"); writeHrefAttribute = false; } } else { Log.warnln("Error: href:"+hrefName+" lacks systemId, cannot write data to a separate file."); Log.warnln("Data are being written into metadata instead.\n"); writeHrefAttribute = false; } } else { // no *href* attribute specified, write out to the passed in OutputStream // dataOutputStream = outputstream; // not needed now } // write data node attributes if (writeHrefAttribute) { writeOut(outputstream, " "+HREF_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputstream, hrefObj.getName()); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " "+CHECKSUM_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } String encoding = getEncoding(); if (encoding!= null) { writeOut(outputstream, " "+ENCODING_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputstream, encoding.toString()); writeOut(outputstream, "\""); } String compress = getCompression(); if (compress != null) { writeOut(outputstream, " "+COMPRESSION_TYPE_XML_ATTRIBUTE_NAME+"=\""); writeOutAttribute(outputstream, compress.toString()); writeOut(outputstream, "\""); } if (writeHrefAttribute) writeOut(outputstream, "/>"); //we just close the data node now else writeOut(outputstream, ">"); //end of opening code Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String[] NoDataValues; if (parentArray.hasFieldAxis()) { NoDataValues = new String[fastestAxis.getLength()]; DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { NoDataValues = new String[1]; NoDataValues[0] = parentArray.getNoDataValue();/* // what tis this?? If there is no fieldAxis, then no fields, // and hence, only ONE noDataValue. DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); }*/ } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues, writeHrefAttribute ? false : true ); } else { writeFormattedData( dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues, writeHrefAttribute ? false : true ); } } //close the data section appropriately if (!writeHrefAttribute && niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } // If we didnt write Href attribute, then means that data // were put into document. We need to close the open data // node appropriately. if (!writeHrefAttribute) writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 810 |
public static ComponentUI createUI(JComponent component) { if (instance == null) instance = new MetalProgressBarUI(); return instance; }
|
public static ComponentUI createUI(JComponent component) { if (instance == null) instance = new MetalProgressBarUI(); return instance; }
| 814 |
private void copyStaticField(VmType type, VmField f, Field jf, VmStatics statics, NativeStream os, ObjectEmitter emitter) throws IllegalAccessException { jf.setAccessible(true); final Object val = jf.get(null); final int fType = JvmType.SignatureToType(f.getSignature()); final int idx = ((VmStaticField)f).getStaticsIndex(); if (f.isPrimitive()) { if (f.isWide()) { final long lval; switch (fType) { case JvmType.LONG: lval = ((Long) val).longValue(); break; case JvmType.DOUBLE: lval = Double.doubleToRawLongBits(((Double) val) .doubleValue()); break; default: throw new IllegalArgumentException("Unknown wide type " + fType); } statics.setLong(idx, lval); } else { final int ival; final Class jfType = jf.getType(); if (jfType == boolean.class) { ival = ((Boolean) val).booleanValue() ? 1 : 0; } else if (jfType == byte.class) { ival = ((Byte) val).byteValue(); } else if (jfType == char.class) { ival = ((Character) val).charValue(); } else if (jfType == short.class) { ival = ((Short) val).shortValue(); } else if (jfType == int.class) { ival = ((Number) val).intValue(); } else if (jfType == float.class) { ival = Float.floatToRawIntBits(((Float) val).floatValue()); } else { throw new IllegalArgumentException("Unknown wide type " + fType); } statics.setInt(idx, ival); } } else { if (!Modifier.isAddressType(f.getSignature())) { if (val != null) { emitter.testForValidEmit(val, type.getName()); os.getObjectRef(val); } statics.setObject(idx, val); } } }
|
private void copyStaticField(VmType type, VmField f, Field jf, VmStatics statics, NativeStream os, ObjectEmitter emitter) throws IllegalAccessException, JNodeClassNotFoundException { jf.setAccessible(true); final Object val = jf.get(null); final int fType = JvmType.SignatureToType(f.getSignature()); final int idx = ((VmStaticField)f).getStaticsIndex(); if (f.isPrimitive()) { if (f.isWide()) { final long lval; switch (fType) { case JvmType.LONG: lval = ((Long) val).longValue(); break; case JvmType.DOUBLE: lval = Double.doubleToRawLongBits(((Double) val) .doubleValue()); break; default: throw new IllegalArgumentException("Unknown wide type " + fType); } statics.setLong(idx, lval); } else { final int ival; final Class jfType = jf.getType(); if (jfType == boolean.class) { ival = ((Boolean) val).booleanValue() ? 1 : 0; } else if (jfType == byte.class) { ival = ((Byte) val).byteValue(); } else if (jfType == char.class) { ival = ((Character) val).charValue(); } else if (jfType == short.class) { ival = ((Short) val).shortValue(); } else if (jfType == int.class) { ival = ((Number) val).intValue(); } else if (jfType == float.class) { ival = Float.floatToRawIntBits(((Float) val).floatValue()); } else { throw new IllegalArgumentException("Unknown wide type " + fType); } statics.setInt(idx, ival); } } else { if (!Modifier.isAddressType(f.getSignature())) { if (val != null) { emitter.testForValidEmit(val, type.getName()); os.getObjectRef(val); } statics.setObject(idx, val); } } }
| 815 |
protected void copyStaticFields(VmSystemClassLoader cl, VmStatics statics, NativeStream os, ObjectEmitter emitter) throws ClassNotFoundException { for (Iterator i = cl.getLoadedClasses().iterator(); i.hasNext();) { final VmType type = (VmType) i.next(); final String name = type.getName(); final int cnt = type.getNoDeclaredFields(); if ((cnt > 0) && !name.startsWith("java.")){ final Class javaType = Class.forName(type.getName()); final FieldInfo fieldInfo = emitter.getFieldInfo(javaType); final Field[] jdkFields = fieldInfo.getJdkStaticFields(); final int max = jdkFields.length; for (int k = 0; k < max; k++) { final Field jdkField = jdkFields[k]; if (jdkField != null) { final VmField f = fieldInfo.getJNodeStaticField(k); if (!f.isTransient()) { try { copyStaticField(type, f, jdkField, statics, os, emitter); } catch (IllegalAccessException ex) { throw new BuildException(ex); } } } } } } }
|
protected void copyStaticFields(VmSystemClassLoader cl, VmStatics statics, NativeStream os, ObjectEmitter emitter) throws ClassNotFoundException { for (Iterator i = cl.getLoadedClasses().iterator(); i.hasNext();) { final VmType type = (VmType) i.next(); final String name = type.getName(); final int cnt = type.getNoDeclaredFields(); if ((cnt > 0) && !name.startsWith("java.")){ final Class javaType = Class.forName(type.getName()); final FieldInfo fieldInfo = emitter.getFieldInfo(javaType); final Field[] jdkFields = fieldInfo.getJdkStaticFields(); final int max = jdkFields.length; for (int k = 0; k < max; k++) { final Field jdkField = jdkFields[k]; if (jdkField != null) { final VmField f = fieldInfo.getJNodeStaticField(k); if (!f.isTransient()) { try { copyStaticField(type, f, jdkField, statics, os, emitter); } catch (IllegalAccessException ex) { throw new BuildException(ex); } } } } } } }
| 816 |
public final void resolveCpRefs(VmClassLoader clc) { if (!resolvedCpRefs) { prepare(); if (superClass != null) { superClass.resolveCpRefs(clc); } /** * Step 2b: Load the classes of my fields */ final int fcnt = getNoDeclaredFields(); for (int i = 0; i < fcnt; i++) { final VmField fs = fieldTable[i]; fs.resolve(clc); } /** * Step 2c: Load the classes of my methods */ final int mcnt = getNoDeclaredMethods(); for (int i = 0; i < mcnt; i++) { final VmMethod mts = methodTable[i]; mts.resolve(clc); } VmCP cp = this.cp; if (cp != null) { for (int i = 0; i < cp.getLength(); i++) { Object obj = cp.getAny(i); if (obj instanceof VmConstObject) { ((VmConstObject) obj).resolve(clc); } } } resolvedCpRefs = true; } }
|
public final void resolveCpRefs(VmClassLoader clc) { if (!resolvedCpRefs) { prepare(); if (superClass != null) { superClass.resolveCpRefs(clc); } /** * Step 2b: Load the classes of my fields */ final int fcnt = getNoDeclaredFields(); for (int i = 0; i < fcnt; i++) { final VmField fs = fieldTable[i]; fs.resolve(clc); } /** * Step 2c: Load the classes of my methods */ final int mcnt = getNoDeclaredMethods(); for (int i = 0; i < mcnt; i++) { final VmMethod mts = methodTable[i]; mts.resolve(clc); } VmCP cp = this.cp; if (cp != null) { for (int i = 0; i < cp.getLength(); i++) { Object obj = cp.getAny(i); if (obj instanceof VmConstObject) { ((VmConstObject) obj).resolve(clc); } } } resolvedCpRefs = true; } }
| 818 |
public void setAccessible(boolean flag) { checkPermission(); secureSetAccessible(flag); }
|
public static void setAccessible(AccessibleObject[] array, boolean flag) { checkPermission(); secureSetAccessible(flag); }
| 819 |
public void setAccessible(boolean flag) { checkPermission(); secureSetAccessible(flag); }
|
public void setAccessible(boolean flag) { checkPermission(); secureSetAccessible(flag); }
| 820 |
public BuildObjectResolver(NativeStream os, AbstractBootImageBuilder builder) { this.os = os; this.builder = builder; }
|
public BuildObjectResolver(NativeStream os, AbstractBootImageBuilder builder) { this.os = os; }
| 821 |
public DefaultHeapManager(VmClassLoader loader, HeapHelper helper, VmStatics statics) throws ClassNotFoundException { super(helper); //this.writeBarrier = new DefaultWriteBarrier(helper); this.writeBarrier = null; this.firstHeap = new VmDefaultHeap(this); this.currentHeap = firstHeap; this.defaultHeapClass = (VmNormalClass)loader.loadClass(VmDefaultHeap.class.getName(), true); this.statics = statics; }
|
public DefaultHeapManager(VmClassLoader loader, HeapHelper helper, VmStatics statics) throws ClassNotFoundException { super(helper); //this.writeBarrier = new DefaultWriteBarrier(helper); this.writeBarrier = null; this.firstHeap = new VmDefaultHeap(this); this.currentHeap = firstHeap; this.defaultHeapClass = (VmNormalClass)loader.loadClass(VmDefaultHeap.class.getName(), true); this.statics = statics; }
| 822 |
public Vm(VmArchitecture arch, VmHeapManager heapManager, VmStatics statics, boolean debugMode) { instance = this; this.debugMode = debugMode; this.bootstrap = true; this.arch = arch; this.heapManager = heapManager; this.statics = statics; }
|
public Vm(String version, VmArchitecture arch, VmHeapManager heapManager, VmStatics statics, boolean debugMode) { instance = this; this.debugMode = debugMode; this.bootstrap = true; this.arch = arch; this.heapManager = heapManager; this.statics = statics; }
| 823 |
public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { next.get(dst, dstOffset, index - size, length); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // All bytes are within my data System.arraycopy(data, start + index, dst, dstOffset, length); } else { // First byte is within my data, last is not if (next != null) { final int myLength = size - index; System.arraycopy(data, start + index, dst, dstOffset, myLength); next.get(dst, dstOffset + myLength, Math.max(0, index - myLength), length - myLength); } else { throw new IndexOutOfBoundsException("at index " + index); } } } catch (IndexOutOfBoundsException ex) { log.debug("get(dst, " + dstOffset + ", " + index + ", " + length + ") start=" + start + ", size=" + size); throw new IndexOutOfBoundsException(ex.getMessage()); } }
|
public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { next.get(dst, dstOffset, index - size, length); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // All bytes are within my data System.arraycopy(data, start + index, dst, dstOffset, length); } else { // First byte is within my data, last is not if (next != null) { final int myLength = size - index; System.arraycopy(data, start + index, dst, dstOffset, myLength); next.get(dst, dstOffset + myLength, Math.max(0, index - myLength), length - myLength); } else { throw new IndexOutOfBoundsException("at index " + index); } } } catch (IndexOutOfBoundsException ex) { log.debug("get(dst, " + dstOffset + ", " + index + ", " + length + ") start=" + start + ", size=" + size); throw new IndexOutOfBoundsException(ex.getMessage()); } }
| 825 |
public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { next.get(dst, dstOffset, index - size, length); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // All bytes are within my data System.arraycopy(data, start + index, dst, dstOffset, length); } else { // First byte is within my data, last is not if (next != null) { final int myLength = size - index; System.arraycopy(data, start + index, dst, dstOffset, myLength); next.get(dst, dstOffset + myLength, Math.max(0, index - myLength), length - myLength); } else { throw new IndexOutOfBoundsException("at index " + index); } } } catch (IndexOutOfBoundsException ex) { log.debug("get(dst, " + dstOffset + ", " + index + ", " + length + ") start=" + start + ", size=" + size); throw new IndexOutOfBoundsException(ex.getMessage()); } }
|
public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { return next.get(index - size); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // All bytes are within my data System.arraycopy(data, start + index, dst, dstOffset, length); } else { // First byte is within my data, last is not if (next != null) { final int myLength = size - index; System.arraycopy(data, start + index, dst, dstOffset, myLength); next.get(dst, dstOffset + myLength, Math.max(0, index - myLength), length - myLength); } else { throw new IndexOutOfBoundsException("at index " + index); } } } catch (IndexOutOfBoundsException ex) { log.debug("get(dst, " + dstOffset + ", " + index + ", " + length + ") start=" + start + ", size=" + size); throw new IndexOutOfBoundsException(ex.getMessage()); } }
| 826 |
public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { next.get(dst, dstOffset, index - size, length); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // All bytes are within my data System.arraycopy(data, start + index, dst, dstOffset, length); } else { // First byte is within my data, last is not if (next != null) { final int myLength = size - index; System.arraycopy(data, start + index, dst, dstOffset, myLength); next.get(dst, dstOffset + myLength, Math.max(0, index - myLength), length - myLength); } else { throw new IndexOutOfBoundsException("at index " + index); } } } catch (IndexOutOfBoundsException ex) { log.debug("get(dst, " + dstOffset + ", " + index + ", " + length + ") start=" + start + ", size=" + size); throw new IndexOutOfBoundsException(ex.getMessage()); } }
|
public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { next.get(dst, dstOffset, index - size, length); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // All bytes are within my data System.arraycopy(data, start + index, dst, dstOffset, length); } else { // First byte is within my data, last is not if (next != null) { final int myLength = size - index; System.arraycopy(data, start + index, dst, dstOffset, myLength); next.get(dst, dstOffset + myLength, Math.max(0, index - myLength), length - myLength); } else { throw new IndexOutOfBoundsException("at index " + index); } } } catch (IndexOutOfBoundsException ex) { log.debug("get(dst, " + dstOffset + ", " + index + ", " + length + ") start=" + start + ", size=" + size); throw new IndexOutOfBoundsException(ex.getMessage()); } }
| 827 |
public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { next.get(dst, dstOffset, index - size, length); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // All bytes are within my data System.arraycopy(data, start + index, dst, dstOffset, length); } else { // First byte is within my data, last is not if (next != null) { final int myLength = size - index; System.arraycopy(data, start + index, dst, dstOffset, myLength); next.get(dst, dstOffset + myLength, Math.max(0, index - myLength), length - myLength); } else { throw new IndexOutOfBoundsException("at index " + index); } } } catch (IndexOutOfBoundsException ex) { log.debug("get(dst, " + dstOffset + ", " + index + ", " + length + ") start=" + start + ", size=" + size); throw new IndexOutOfBoundsException(ex.getMessage()); } }
|
public void get(byte[] dst, int dstOffset, int index, int length) { try { if (index >= size) { // Index is beyond my data if (next != null) { next.get(dst, dstOffset, index - size, length); } else { throw new IndexOutOfBoundsException("at index " + index); } } else if (index + length <= size) { // All bytes are within my data System.arraycopy(data, start + index, dst, dstOffset, length); } else { // First byte is within my data, last is not if (next != null) { final int myLength = size - index; System.arraycopy(data, start + index, dst, dstOffset, myLength); next.get(dst, dstOffset + myLength, Math.max(0, index - myLength), length - myLength); } else { throw new IndexOutOfBoundsException("at index " + index); } } } catch (IndexOutOfBoundsException ex) { log.debug("get(dst, " + dstOffset + ", " + index + ", " + length + ") start=" + start + ", size=" + size); throw new IndexOutOfBoundsException(ex.getMessage()); } }
| 828 |
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY1() - y; a2 = getCtrlY2() - y; a3 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX1() - x; b2 = getCtrlX2() - x; b3 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX1() - x; a2 = getCtrlX2() - x; a3 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY1() - y; b2 = getCtrlY2() - y; b3 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done, bad behaviour may result for points on that axis.*/ if (a0 == 0.0 || a3 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a3 == 0.0) a3 += small; } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b3, a3, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, 0.0, 0.0, distance)) nCrossings++; } r[0] = a0; r[1] = 3 * (a1 - a0); r[2] = 3 * (a2 + a0 - 2 * a1); r[3] = a3 - 3 * a2 + 3 * a1 - a0; if ((nRoots = solveCubic(r)) != 0) for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = -(t * t * t) * (b0 - 3 * b1 + 3 * b2 - b3) + 3 * t * t * (b0 - 2 * b1 + b2) + 3 * t * (b1 - b0) + b0; if (crossing > 0.0 && crossing <= distance) nCrossings++; } } return (nCrossings); }
|
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY1() - y; a2 = getCtrlY2() - y; a3 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX1() - x; b2 = getCtrlX2() - x; b3 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX1() - x; a2 = getCtrlX2() - x; a3 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY1() - y; b2 = getCtrlY2() - y; b3 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done, bad behaviour may result for points on that axis.*/ if (a0 == 0.0 || a3 == 0.0) { double small = getFlatness() * EPSILON; if (a0 == 0.0) a0 += small; if (a3 == 0.0) a3 += small; } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b3, a3, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, 0.0, 0.0, distance)) nCrossings++; } r[0] = a0; r[1] = 3 * (a1 - a0); r[2] = 3 * (a2 + a0 - 2 * a1); r[3] = a3 - 3 * a2 + 3 * a1 - a0; if ((nRoots = solveCubic(r)) != 0) for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = -(t * t * t) * (b0 - 3 * b1 + 3 * b2 - b3) + 3 * t * t * (b0 - 2 * b1 + b2) + 3 * t * (b1 - b0) + b0; if (crossing > 0.0 && crossing <= distance) nCrossings++; } } return (nCrossings); }
| 829 |
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY1() - y; a2 = getCtrlY2() - y; a3 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX1() - x; b2 = getCtrlX2() - x; b3 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX1() - x; a2 = getCtrlX2() - x; a3 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY1() - y; b2 = getCtrlY2() - y; b3 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done, bad behaviour may result for points on that axis.*/ if (a0 == 0.0 || a3 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a3 == 0.0) a3 += small; } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b3, a3, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, 0.0, 0.0, distance)) nCrossings++; } r[0] = a0; r[1] = 3 * (a1 - a0); r[2] = 3 * (a2 + a0 - 2 * a1); r[3] = a3 - 3 * a2 + 3 * a1 - a0; if ((nRoots = solveCubic(r)) != 0) for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = -(t * t * t) * (b0 - 3 * b1 + 3 * b2 - b3) + 3 * t * t * (b0 - 2 * b1 + b2) + 3 * t * (b1 - b0) + b0; if (crossing > 0.0 && crossing <= distance) nCrossings++; } } return (nCrossings); }
|
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY1() - y; a2 = getCtrlY2() - y; a3 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX1() - x; b2 = getCtrlX2() - x; b3 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX1() - x; a2 = getCtrlX2() - x; a3 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY1() - y; b2 = getCtrlY2() - y; b3 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done, bad behaviour may result for points on that axis.*/ if (a0 == 0.0 || a3 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 -= small; if (a3 == 0.0) a3 += small; } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b3, a3, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, 0.0, 0.0, distance)) nCrossings++; } r[0] = a0; r[1] = 3 * (a1 - a0); r[2] = 3 * (a2 + a0 - 2 * a1); r[3] = a3 - 3 * a2 + 3 * a1 - a0; if ((nRoots = solveCubic(r)) != 0) for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = -(t * t * t) * (b0 - 3 * b1 + 3 * b2 - b3) + 3 * t * t * (b0 - 2 * b1 + b2) + 3 * t * (b1 - b0) + b0; if (crossing > 0.0 && crossing <= distance) nCrossings++; } } return (nCrossings); }
| 830 |
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY1() - y; a2 = getCtrlY2() - y; a3 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX1() - x; b2 = getCtrlX2() - x; b3 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX1() - x; a2 = getCtrlX2() - x; a3 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY1() - y; b2 = getCtrlY2() - y; b3 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done, bad behaviour may result for points on that axis.*/ if (a0 == 0.0 || a3 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a3 == 0.0) a3 += small; } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b3, a3, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, 0.0, 0.0, distance)) nCrossings++; } r[0] = a0; r[1] = 3 * (a1 - a0); r[2] = 3 * (a2 + a0 - 2 * a1); r[3] = a3 - 3 * a2 + 3 * a1 - a0; if ((nRoots = solveCubic(r)) != 0) for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = -(t * t * t) * (b0 - 3 * b1 + 3 * b2 - b3) + 3 * t * t * (b0 - 2 * b1 + b2) + 3 * t * (b1 - b0) + b0; if (crossing > 0.0 && crossing <= distance) nCrossings++; } } return (nCrossings); }
|
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY1() - y; a2 = getCtrlY2() - y; a3 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX1() - x; b2 = getCtrlX2() - x; b3 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX1() - x; a2 = getCtrlX2() - x; a3 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY1() - y; b2 = getCtrlY2() - y; b3 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done, bad behaviour may result for points on that axis.*/ if (a0 == 0.0 || a3 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a3 == 0.0) a3 -= small; } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b3, a3, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, 0.0, 0.0, distance)) nCrossings++; } r[0] = a0; r[1] = 3 * (a1 - a0); r[2] = 3 * (a2 + a0 - 2 * a1); r[3] = a3 - 3 * a2 + 3 * a1 - a0; if ((nRoots = solveCubic(r)) != 0) for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = -(t * t * t) * (b0 - 3 * b1 + 3 * b2 - b3) + 3 * t * t * (b0 - 2 * b1 + b2) + 3 * t * (b1 - b0) + b0; if (crossing > 0.0 && crossing <= distance) nCrossings++; } } return (nCrossings); }
| 831 |
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY1() - y; a2 = getCtrlY2() - y; a3 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX1() - x; b2 = getCtrlX2() - x; b3 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX1() - x; a2 = getCtrlX2() - x; a3 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY1() - y; b2 = getCtrlY2() - y; b3 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done, bad behaviour may result for points on that axis.*/ if (a0 == 0.0 || a3 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a3 == 0.0) a3 += small; } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b3, a3, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, 0.0, 0.0, distance)) nCrossings++; } r[0] = a0; r[1] = 3 * (a1 - a0); r[2] = 3 * (a2 + a0 - 2 * a1); r[3] = a3 - 3 * a2 + 3 * a1 - a0; if ((nRoots = solveCubic(r)) != 0) for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = -(t * t * t) * (b0 - 3 * b1 + 3 * b2 - b3) + 3 * t * t * (b0 - 2 * b1 + b2) + 3 * t * (b1 - b0) + b0; if (crossing > 0.0 && crossing <= distance) nCrossings++; } } return (nCrossings); }
|
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY1() - y; a2 = getCtrlY2() - y; a3 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX1() - x; b2 = getCtrlX2() - x; b3 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX1() - x; a2 = getCtrlX2() - x; a3 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY1() - y; b2 = getCtrlY2() - y; b3 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done, bad behaviour may result for points on that axis.*/ if (a0 == 0.0 || a3 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a3 == 0.0) a3 += small; } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b3, a3, EPSILON, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, 0.0, 0.0, distance)) nCrossings++; } r[0] = a0; r[1] = 3 * (a1 - a0); r[2] = 3 * (a2 + a0 - 2 * a1); r[3] = a3 - 3 * a2 + 3 * a1 - a0; if ((nRoots = solveCubic(r)) != 0) for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = -(t * t * t) * (b0 - 3 * b1 + 3 * b2 - b3) + 3 * t * t * (b0 - 2 * b1 + b2) + 3 * t * (b1 - b0) + b0; if (crossing > 0.0 && crossing <= distance) nCrossings++; } } return (nCrossings); }
| 832 |
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY1() - y; a2 = getCtrlY2() - y; a3 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX1() - x; b2 = getCtrlX2() - x; b3 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX1() - x; a2 = getCtrlX2() - x; a3 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY1() - y; b2 = getCtrlY2() - y; b3 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done, bad behaviour may result for points on that axis.*/ if (a0 == 0.0 || a3 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a3 == 0.0) a3 += small; } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b3, a3, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, 0.0, 0.0, distance)) nCrossings++; } r[0] = a0; r[1] = 3 * (a1 - a0); r[2] = 3 * (a2 + a0 - 2 * a1); r[3] = a3 - 3 * a2 + 3 * a1 - a0; if ((nRoots = solveCubic(r)) != 0) for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = -(t * t * t) * (b0 - 3 * b1 + 3 * b2 - b3) + 3 * t * t * (b0 - 2 * b1 + b2) + 3 * t * (b1 - b0) + b0; if (crossing > 0.0 && crossing <= distance) nCrossings++; } } return (nCrossings); }
|
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double a3; double b0; double b1; double b2; double b3; double[] r = new double[4]; int nRoots; a0 = a3 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY1() - y; a2 = getCtrlY2() - y; a3 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX1() - x; b2 = getCtrlX2() - x; b3 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX1() - x; a2 = getCtrlX2() - x; a3 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY1() - y; b2 = getCtrlY2() - y; b3 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done, bad behaviour may result for points on that axis.*/ if (a0 == 0.0 || a3 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a3 == 0.0) a3 += small; } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b3, a3, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a3, b3, 0.0, EPSILON, 0.0, distance)) nCrossings++; } r[0] = a0; r[1] = 3 * (a1 - a0); r[2] = 3 * (a2 + a0 - 2 * a1); r[3] = a3 - 3 * a2 + 3 * a1 - a0; if ((nRoots = solveCubic(r)) != 0) for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = -(t * t * t) * (b0 - 3 * b1 + 3 * b2 - b3) + 3 * t * t * (b0 - 2 * b1 + b2) + 3 * t * (b1 - b0) + b0; if (crossing > 0.0 && crossing <= distance) nCrossings++; } } return (nCrossings); }
| 833 |
public char setIndex(int position) { if (position < getBeginIndex() || position > getEndIndex()) throw new IllegalArgumentException(); current = position; if (position == getEndIndex()) return DONE; return array[current]; }
|
public char setIndex(int position) { if (position < getBeginIndex() || position > getEndIndex()) throw new IllegalArgumentException("position: " + position + ", beginIndex: " + getBeginIndex() + ", endIndex: " + getEndIndex()); current = position; if (position == getEndIndex()) return DONE; return array[current]; }
| 834 |
public static String getenv(String name) { throw new Error("getenv no longer supported, use properties instead: " + name); }
|
public static String getenv(String name) { throw new Error("getenv no longer supported, use properties instead: " + name); }
| 837 |
public KeyPair generate() { BigInteger p, q, n, d; // 1. Generate a prime p in the interval [2**(M-1), 2**M - 1], where // M = CEILING(L/2), and such that GCD(p, e) = 1 int M = (L + 1) / 2; BigInteger lower = TWO.pow(M - 1); BigInteger upper = TWO.pow(M).subtract(ONE); byte[] kb = new byte[(M + 7) / 8]; // enough bytes to frame M bits step1: while (true) { nextRandomBytes(kb); p = new BigInteger(1, kb).setBit(0); if (p.compareTo(lower) >= 0 && p.compareTo(upper) <= 0 && Prime2.isProbablePrime(p) && p.gcd(e).equals(ONE)) { break step1; } } // 2. Generate a prime q such that the product of p and q is an L-bit // number, and such that GCD(q, e) = 1 step2: while (true) { nextRandomBytes(kb); q = new BigInteger(1, kb).setBit(0); n = p.multiply(q); if (n.bitLength() == L && Prime2.isProbablePrime(q) && q.gcd(e).equals(ONE)) { break step2; } // TODO: test for p != q } // TODO: ensure p < q // 3. Put n = pq. The public key is (n, e). // 4. Compute the parameters necessary for the private key K (see // Section 2.2). BigInteger phi = p.subtract(ONE).multiply(q.subtract(ONE)); d = e.modInverse(phi); // 5. Output the public key and the private key. PublicKey pubK = new GnuRSAPublicKey(n, e); PrivateKey secK = new GnuRSAPrivateKey(p, q, e, d); return new KeyPair(pubK, secK); }
|
public KeyPair generate() { BigInteger p, q, n, d; // 1. Generate a prime p in the interval [2**(M-1), 2**M - 1], where // M = CEILING(L/2), and such that GCD(p, e) = 1 int M = (L + 1) / 2; BigInteger lower = TWO.pow(M - 1); BigInteger upper = TWO.pow(M).subtract(ONE); byte[] kb = new byte[(M + 7) / 8]; // enough bytes to frame M bits step1: while (true) { nextRandomBytes(kb); p = new BigInteger(1, kb).setBit(0); if (p.compareTo(lower) >= 0 && p.compareTo(upper) <= 0 && Prime2.isProbablePrime(p) && p.gcd(e).equals(ONE)) { break step1; } } // 2. Generate a prime q such that the product of p and q is an L-bit // number, and such that GCD(q, e) = 1 step2: while (true) { nextRandomBytes(kb); q = new BigInteger(1, kb).setBit(0); n = p.multiply(q); if (n.bitLength() == L && Prime2.isProbablePrime(q) && q.gcd(e).equals(ONE)) { break step2; } // TODO: test for p != q } // TODO: ensure p < q // 3. Put n = pq. The public key is (n, e). // 4. Compute the parameters necessary for the private key K (see // Section 2.2). BigInteger phi = p.subtract(ONE).multiply(q.subtract(ONE)); d = e.modInverse(phi); // 5. Output the public key and the private key. PublicKey pubK = new GnuRSAPublicKey(n, e); PrivateKey secK = new GnuRSAPrivateKey(p, q, e, d); return new KeyPair(pubK, secK); }
| 838 |
public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return valueOf(gcd(xval, yval)); } xval = 1; } if (y.words == null) { if (yval == 0) return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; result.words = xwords; return result.canonicalize(); }
|
private static int gcd(int a, int b) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return valueOf(gcd(xval, yval)); } xval = 1; } if (y.words == null) { if (yval == 0) return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; result.words = xwords; return result.canonicalize(); }
| 840 |
public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return valueOf(gcd(xval, yval)); } xval = 1; } if (y.words == null) { if (yval == 0) return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; result.words = xwords; return result.canonicalize(); }
|
public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return valueOf(gcd(xval, yval)); } xval = 1; } if (y.words == null) { if (yval == 0) return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; result.words = xwords; return result.canonicalize(); }
| 841 |
public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return valueOf(gcd(xval, yval)); } xval = 1; } if (y.words == null) { if (yval == 0) return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; result.words = xwords; return result.canonicalize(); }
|
public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return valueOf(gcd(xval, yval)); } xval = 1; } if (y.words == null) { if (yval == 0) return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; result.words = xwords; return result.canonicalize(); }
| 842 |
public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return valueOf(gcd(xval, yval)); } xval = 1; } if (y.words == null) { if (yval == 0) return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; result.words = xwords; return result.canonicalize(); }
|
public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return valueOf(gcd(xval, yval)); } } if (y.words == null) { if (yval == 0) return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; result.words = xwords; return result.canonicalize(); }
| 843 |
public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return valueOf(gcd(xval, yval)); } xval = 1; } if (y.words == null) { if (yval == 0) return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; result.words = xwords; return result.canonicalize(); }
|
public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return valueOf(gcd(xval, yval)); } xval = 1; } if (y.words == null) { if (yval == 0) return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; result.words = xwords; return result.canonicalize(); }
| 844 |
public JRootPane createRootPane() { return new JRootPane(); }
|
protected JRootPane createRootPane() { return new JRootPane(); }
| 845 |
public void setRootPane(JRootPane root) { if (rootPane != null) remove(rootPane); rootPane = root; add(rootPane, BorderLayout.CENTER); }
|
protected void setRootPane(JRootPane root) { if (rootPane != null) remove(rootPane); rootPane = root; add(rootPane, BorderLayout.CENTER); }
| 846 |
Frame(String title){ super(); this.title = title; // Top-level frames are initially invisible. visible = false; noteFrame(this);}
|
Frame(String title){ super(); this.title = title; // Top-level frames are initially invisible. visible = false; noteFrame(this);}
| 847 |
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
|
public static synchronized Object getInstance(String type) throws GetDelegateInstanceException { Object r = cache.get(type); if (r != null) return r; String dcname = System.getProperty("javax.rmi.CORBA." + type + "Class"); if (dcname == null) { //throw new DelegateException // ("no javax.rmi.CORBA.XXXClass property sepcified."); dcname = "gnu.javax.rmi.CORBA." + type + "DelegateImpl"; } try { Class dclass = Class.forName(dcname, true, Thread.currentThread().getContextClassLoader()); r = dclass.newInstance(); cache.put(type, r); return r; } catch(Exception e) { throw new GetDelegateInstanceException ("Exception when trying to get delegate instance:" + dcname, e); } }
| 848 |
public AbstractElement(Element p, AttributeSet s) { element_parent = p; AttributeContext ctx = getAttributeContext(); attributes = ctx.getEmptySet(); if (s != null) attributes = ctx.addAttributes(attributes, s); }
|
public AbstractElement(Element p, AttributeSet s) { element_parent = p; AttributeContext ctx = getAttributeContext(); attributes = ctx.getEmptySet(); if (s != null) addAttributes(s); }
| 849 |
public String getName() { return (String) getAttribute(NameAttribute); }
|
public String getName() { return (String) attributes.getAttribute(ElementNameAttribute); }
| 851 |
public BranchElement(Element parent, AttributeSet attributes) { super(parent, attributes); startOffset = -1; endOffset = -1; }
|
public BranchElement(Element parent, AttributeSet attributes) { super(parent, attributes); startOffset = -1; endOffset = -1; }
| 852 |
public Enumeration children() { if (children.length == 0) return null; Vector tmp = new Vector(); for (int index = 0; index < children.length; ++index) tmp.add(children[index]); return tmp.elements(); }
|
public Enumeration children() { if (numChildren == 0) return null; Vector tmp = new Vector(); for (int index = 0; index < children.length; ++index) tmp.add(children[index]); return tmp.elements(); }
| 853 |
public Enumeration children() { if (children.length == 0) return null; Vector tmp = new Vector(); for (int index = 0; index < children.length; ++index) tmp.add(children[index]); return tmp.elements(); }
|
public Enumeration children() { if (children.length == 0) return null; Vector tmp = new Vector(); for (int index = 0; index < numChildren; ++index) tmp.add(children[index]); return tmp.elements(); }
| 854 |
public Element getElement(int index) { if (index < 0 || index >= children.length) return null; return children[index]; }
|
public Element getElement(int index) { if (index < 0 || index >= numChildren) return null; return children[index]; }
| 855 |
public int getElementCount() { return children.length; }
|
public int getElementCount() { return numChildren; }
| 856 |
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. return getElementCount() - 1; }
|
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. return getElementCount() - 1; }
| 857 |
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. return getElementCount() - 1; }
|
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { if (lastIndex >= i0 && lastIndex <= i1) { Element last = getElement(lastIndex); p0 = last.getStartOffset(); p1 = last.getEndOffset(); if (offset >= p0 && offset < p1) index = lastIndex; else { if (offset < p0) i1 = lastIndex; else i0 = lastIndex; } } int i = 0; while (i0 <= i1 && index == -1) { i = i0 + (i1 - i0) / 2; Element el = getElement(i); p0 = el.getStartOffset(); p1 = el.getEndOffset(); if (offset >= p0 && offset < p1) { index = i; } else if (offset < p0) i1 = i - 1; else i0 = i + 1; } if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. return getElementCount() - 1; }
| 858 |
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. return getElementCount() - 1; }
|
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. return getElementCount() - 1; }
| 859 |
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. return getElementCount() - 1; }
|
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. return getElementCount() - 1; }
| 860 |
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. return getElementCount() - 1; }
|
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. return getElementCount() - 1; }
| 861 |
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. return getElementCount() - 1; }
|
public int getElementIndex(int offset) { // If offset is less than the start offset of our first child, // return 0 if (offset < getStartOffset()) return 0; // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length - 1; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; // If the next element's start offset is greater than offset // then we have to return the closest Element, since no Elements // will contain the offset if (children[index + 1].getStartOffset() > offset) { if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset)) return index + 1; else return index; } } // If offset is greater than the index of the last element, return // the index of the last element. lastIndex = index; } return index; }
| 862 |
public int getEndOffset() { if (children.length == 0) { if (endOffset == -1) throw new NullPointerException("BranchElement has no children."); } else endOffset = children[children.length - 1].getEndOffset(); return endOffset; }
|
public int getEndOffset() { if (children.length == 0) { if (endOffset == -1) throw new NullPointerException("BranchElement has no children."); } else endOffset = children[children.length - 1].getEndOffset(); return endOffset; }
| 863 |
public int getStartOffset() { if (children.length == 0) { if (startOffset == -1) throw new NullPointerException("BranchElement has no children."); } else startOffset = children[0].getStartOffset(); return startOffset; }
|
public int getStartOffset() { if (children.length == 0) { if (startOffset == -1) throw new NullPointerException("BranchElement has no children."); } else startOffset = children[0].getStartOffset(); return startOffset; }
| 864 |
public Element positionToElement(int position) { // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.length; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= position) && (position < elem.getEndOffset())) return elem; } return null; }
|
public Element positionToElement(int position) { // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < numChildren; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= position) && (position < elem.getEndOffset())) return elem; } return null; }
| 865 |
public void replace(int offset, int length, Element[] elements) { Element[] target = new Element[children.length - length + elements.length]; System.arraycopy(children, 0, target, 0, offset); System.arraycopy(elements, 0, target, offset, elements.length); System.arraycopy(children, offset + length, target, offset + elements.length, children.length - offset - length); children = target; }
|
public void replace(int offset, int length, Element[] elements) { Element[] target = new Element[children.length - length + elements.length]; System.arraycopy(children, 0, target, 0, offset); System.arraycopy(elements, 0, target, offset, elements.length); System.arraycopy(children, offset + length, target, offset + elements.length, children.length - offset - length); children = target; }
| 866 |
public void replace(int offset, int length, Element[] elements) { Element[] target = new Element[children.length - length + elements.length]; System.arraycopy(children, 0, target, 0, offset); System.arraycopy(elements, 0, target, offset, elements.length); System.arraycopy(children, offset + length, target, offset + elements.length, children.length - offset - length); children = target; }
|
public void replace(int offset, int length, Element[] elements) { Element[] target = new Element[children.length - length + elements.length]; System.arraycopy(children, 0, target, 0, offset); System.arraycopy(elements, 0, target, offset, elements.length); System.arraycopy(children, offset + length, target, offset + elements.length, children.length - offset - length); children = target; }
| 867 |
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; try { startPos = createPosition(start - startDelta); endPos = createPosition(end - endDelta); } catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } }
|
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; try { startPos = createPosition(start - startDelta); endPos = createPosition(end - endDelta); } catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } }
| 869 |
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; try { startPos = createPosition(start - startDelta); endPos = createPosition(end - endDelta); } catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } }
|
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; try { startPos = createPosition(start - startDelta); endPos = createPosition(end - endDelta); } catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } }
| 870 |
public int getEndOffset() { return endPos.getOffset() + endDelta; }
|
public int getEndOffset() { return endPos.getOffset(); }
| 871 |
public int getStartOffset() { return startPos.getOffset() + startDelta; }
|
public int getStartOffset() { return startPos.getOffset(); }
| 872 |
public int getAsynchronousLoadPriority() { return 0; }
|
public int getAsynchronousLoadPriority() { Object val = getProperty(AsyncLoadPriority); int prio = -1; if (val != null) prio = ((Integer) val).intValue(); return prio; }
| 874 |
public Element getBidiRootElement() { return null; }
|
public Element getBidiRootElement() { return bidiRoot; }
| 875 |
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; }
|
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). Position p; try { public int getOffset() { return getLength(); } }; }
| 876 |
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; }
|
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { p = createPosition(content.length()); } catch (BadLocationException ex) { return getLength(); } }; }
| 877 |
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; }
|
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { p = null; } }; }
| 878 |
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } }; }
|
public final Position getEndPosition() { // FIXME: Properly implement this by calling Content.createPosition(). return new Position() { public int getOffset() { return getLength(); } return p; }
| 879 |
public Element[] getRootElements() { Element[] elements = new Element[1]; elements[0] = getDefaultRootElement(); return elements; }
|
public Element[] getRootElements() { Element[] elements = new Element[2]; elements[0] = getDefaultRootElement(); return elements; }
| 880 |
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; }
|
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). Position p; try { public int getOffset() { return 0; } }; }
| 882 |
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; }
|
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { p = createPosition(0); } catch (BadLocationException ex) { return 0; } }; }
| 883 |
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; }
|
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { p = null; } }; }
| 884 |
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } }; }
|
public final Position getStartPosition() { // FIXME: Properly implement this using Content.createPosition(). return new Position() { public int getOffset() { return 0; } return p; }
| 885 |
void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); try { writeLock(); UndoableEdit undo = content.insertString(offset, text); if (undo != null) event.addEdit(undo); insertUpdate(event, attributes); fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); } finally { writeUnlock(); } }
|
void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); try { writeLock(); UndoableEdit undo = content.insertString(offset, text); if (undo != null) event.addEdit(undo); insertUpdate(event, attributes); fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); } finally { writeUnlock(); } }
| 887 |
void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); try { writeLock(); UndoableEdit undo = content.insertString(offset, text); if (undo != null) event.addEdit(undo); insertUpdate(event, attributes); fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); } finally { writeUnlock(); } }
|
void insertStringImpl(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); try { writeLock(); UndoableEdit undo = content.insertString(offset, text); if (undo != null) event.addEdit(undo); insertUpdate(event, attributes); fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); } finally { writeUnlock(); } }
| 888 |
void removeImpl(int offset, int length) throws BadLocationException { // Prevent some unneccessary method invocation (observed in the RI). if (length <= 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); try { writeLock(); // The order of the operations below is critical! removeUpdate(event); UndoableEdit temp = content.remove(offset, length); postRemoveUpdate(event); fireRemoveUpdate(event); } finally { writeUnlock(); } }
|
void removeImpl(int offset, int length) throws BadLocationException { // Prevent some unneccessary method invocation (observed in the RI). if (length <= 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); try { writeLock(); // The order of the operations below is critical! removeUpdate(event); UndoableEdit temp = content.remove(offset, length); postRemoveUpdate(event); fireRemoveUpdate(event); } finally { writeUnlock(); } }
| 892 |
public PrincipalHolder(Principal initial_value) { value = initial_value; }
|
public PrincipalHolder() { value = initial_value; }
| 896 |
public PrincipalHolder(Principal initial_value) { value = initial_value; }
|
public PrincipalHolder(Principal initial_value) { }
| 897 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.