rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
kc = new KeyConfigure(me.getParentView((Session)this),null,vt.getCodePage()); | kc = new KeyConfigure(parent,null,vt.getCodePage()); | private void mapMeKeys() { KeyConfigure kc; if (macros.isMacrosExist()) { String[] macrosList = macros.getMacroList(); kc = new KeyConfigure(me.getParentView((Session)this),macrosList,vt.getCodePage()); } else kc = new KeyConfigure(me.getParentView((Session)this),null,vt.getCodePage()); } |
me.getParentView((Session)this), | parent, | private void showHexMap() { JPanel srp = new JPanel(); srp.setLayout(new BorderLayout()); DefaultListModel listModel = new DefaultListModel(); StringBuffer sb = new StringBuffer(); // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = vt.ebcdic2uni(x); char ac = vt.getASCIIChar(x); if (!Character.isISOControl(ac)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); listModel.addElement(keyc.getSourceString()); } //Create the list and put it in a scroll pane JList hm = new JList(listModel); hm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); hm.setSelectedIndex(0); JScrollPane listScrollPane = new JScrollPane(hm); listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); listScrollPane.setSize(40,100); srp.add(listScrollPane,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = srp; String[] options = {LangTool.getString("hm.optInsert"), LangTool.getString("hm.optCancel")}; int result = 0; result = JOptionPane.showOptionDialog( me.getParentView((Session)this), // the parent that the dialog blocks message, // the dialog message array LangTool.getString("hm.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.INFORMATION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Insert character String k = ""; k += ((String)hm.getSelectedValue()).charAt(7); screen.sendKeys(k); break; case 1: // Cancel// System.out.println("Cancel"); break; default: break; } } |
if (tree.getLeadSelectionPath() == null || (tree.getLeadSelectionPath().getLastPathComponent()).equals(val)) | if (hasFocus) | public Component getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { if (leaf) setIcon(getLeafIcon()); else if (expanded) setIcon(getOpenIcon()); else setIcon(getClosedIcon()); setText(val.toString()); this.selected = selected; this.hasFocus = hasFocus; setHorizontalAlignment(LEFT); setOpaque(false); setVerticalAlignment(TOP); setEnabled(true); super.setFont(UIManager.getLookAndFeelDefaults().getFont("Tree.font")); if (selected) { super.setBackground(getBackgroundSelectionColor()); setForeground(getTextSelectionColor()); if (tree.getLeadSelectionPath() == null || (tree.getLeadSelectionPath().getLastPathComponent()).equals(val)) setBorderSelectionColor(UIManager.getLookAndFeelDefaults(). getColor("Tree.selectionBorderColor")); else setBorderSelectionColor(null); } else { super.setBackground(getBackgroundNonSelectionColor()); setForeground(getTextNonSelectionColor()); setBorderSelectionColor(null); } return this; } |
MenuBar() { | public MenuBar() { | MenuBar(){ if (GraphicsEnvironment.isHeadless()) throw new HeadlessException ();} |
add(Menu menu) { | public synchronized Menu add(Menu menu) { | add(Menu menu){ if (menu.parent != null) menu.parent.remove (menu); menu.parent = this; menus.addElement(menu); if (peer != null) { menu.addNotify(); } return(menu);} |
{ | add(Menu menu){ if (menu.parent != null) menu.parent.remove (menu); menu.parent = this; menus.addElement(menu); if (peer != null) { menu.addNotify(); } return(menu);} |
|
} | add(Menu menu){ if (menu.parent != null) menu.parent.remove (menu); menu.parent = this; menus.addElement(menu); if (peer != null) { menu.addNotify(); } return(menu);} |
|
return(menu); } | return menu; } | add(Menu menu){ if (menu.parent != null) menu.parent.remove (menu); menu.parent = this; menus.addElement(menu); if (peer != null) { menu.addNotify(); } return(menu);} |
countMenus() { return menus.size () + (getHelpMenu () == null ? 0 : 1); } | public int countMenus() { return menus.size() + (getHelpMenu() == null ? 0 : 1); } | countMenus(){ return menus.size () + (getHelpMenu () == null ? 0 : 1);} |
deleteShortcut(MenuShortcut shortcut) { | public void deleteShortcut(MenuShortcut shortcut) { | deleteShortcut(MenuShortcut shortcut){ MenuItem it; // This is a slow implementation, but it probably doesn't matter. while ((it = getShortcutMenuItem (shortcut)) != null) it.deleteShortcut ();} |
getHelpMenu() { return(helpMenu); } | public Menu getHelpMenu() { return helpMenu; } | getHelpMenu(){ return(helpMenu);} |
getMenu(int index) { return((Menu)menus.elementAt(index)); } | public Menu getMenu(int index) { return (Menu) menus.elementAt(index); } | getMenu(int index){ return((Menu)menus.elementAt(index));} |
getMenuCount() { return countMenus (); } | public int getMenuCount() { return countMenus(); } | getMenuCount(){ return countMenus ();} |
getShortcutMenuItem(MenuShortcut shortcut) { | public MenuItem getShortcutMenuItem(MenuShortcut shortcut) { | getShortcutMenuItem(MenuShortcut shortcut){ Enumeration e = menus.elements(); while (e.hasMoreElements()) { Menu menu = (Menu)e.nextElement(); MenuShortcut s = menu.getShortcut(); if ((s != null) && (s.equals(shortcut))) return(menu); } return(null);} |
if ((s != null) && (s.equals(shortcut))) return(menu); | if ((s != null) && s.equals(shortcut)) return menu; | getShortcutMenuItem(MenuShortcut shortcut){ Enumeration e = menus.elements(); while (e.hasMoreElements()) { Menu menu = (Menu)e.nextElement(); MenuShortcut s = menu.getShortcut(); if ((s != null) && (s.equals(shortcut))) return(menu); } return(null);} |
return(null); } | return null; } | getShortcutMenuItem(MenuShortcut shortcut){ Enumeration e = menus.elements(); while (e.hasMoreElements()) { Menu menu = (Menu)e.nextElement(); MenuShortcut s = menu.getShortcut(); if ((s != null) && (s.equals(shortcut))) return(menu); } return(null);} |
setHelpMenu(Menu menu) { | public synchronized void setHelpMenu(Menu menu) { | setHelpMenu(Menu menu){ if (helpMenu != null) { helpMenu.removeNotify (); helpMenu.parent = null; } helpMenu = menu; if (menu.parent != null) menu.parent.remove (menu); menu.parent = this; MenuBarPeer peer = (MenuBarPeer) getPeer (); if (peer != null) { menu.addNotify(); peer.addHelpMenu (menu); }} |
MenuBarPeer peer = (MenuBarPeer) getPeer (); if (peer != null) | MenuBarPeer myPeer = (MenuBarPeer) getPeer (); if (myPeer != null) | setHelpMenu(Menu menu){ if (helpMenu != null) { helpMenu.removeNotify (); helpMenu.parent = null; } helpMenu = menu; if (menu.parent != null) menu.parent.remove (menu); menu.parent = this; MenuBarPeer peer = (MenuBarPeer) getPeer (); if (peer != null) { menu.addNotify(); peer.addHelpMenu (menu); }} |
peer.addHelpMenu (menu); | myPeer.addHelpMenu(menu); } | setHelpMenu(Menu menu){ if (helpMenu != null) { helpMenu.removeNotify (); helpMenu.parent = null; } helpMenu = menu; if (menu.parent != null) menu.parent.remove (menu); menu.parent = this; MenuBarPeer peer = (MenuBarPeer) getPeer (); if (peer != null) { menu.addNotify(); peer.addHelpMenu (menu); }} |
} | setHelpMenu(Menu menu){ if (helpMenu != null) { helpMenu.removeNotify (); helpMenu.parent = null; } helpMenu = menu; if (menu.parent != null) menu.parent.remove (menu); menu.parent = this; MenuBarPeer peer = (MenuBarPeer) getPeer (); if (peer != null) { menu.addNotify(); peer.addHelpMenu (menu); }} |
|
shortcuts() { | public synchronized Enumeration shortcuts() { | shortcuts(){ Vector shortcuts = new Vector(); Enumeration e = menus.elements(); while (e.hasMoreElements()) { Menu menu = (Menu)e.nextElement(); if (menu.getShortcut() != null) shortcuts.addElement(menu.getShortcut()); } return(shortcuts.elements());} |
return(shortcuts.elements()); } | return shortcuts.elements(); } | shortcuts(){ Vector shortcuts = new Vector(); Enumeration e = menus.elements(); while (e.hasMoreElements()) { Menu menu = (Menu)e.nextElement(); if (menu.getShortcut() != null) shortcuts.addElement(menu.getShortcut()); } return(shortcuts.elements());} |
final int all = jnodeType.getNoDeclaredFields(); final ArrayList list = new ArrayList(all); for (int i = 0; i < all; i++) { final VmField f = jnodeType.getDeclaredField(i); if (!f.isStatic()) { list.add(f); } } return list; | if (jnodeType != null) { final int all = jnodeType.getNoDeclaredFields(); final ArrayList list = new ArrayList(all); for (int i = 0; i < all; i++) { final VmField f = jnodeType.getDeclaredField(i); if (!f.isStatic()) { list.add(f); } } return list; } else { return new ArrayList(0); } | private static List getInstanceFields(VmType jnodeType) { final int all = jnodeType.getNoDeclaredFields(); final ArrayList list = new ArrayList(all); for (int i = 0; i < all; i++) { final VmField f = jnodeType.getDeclaredField(i); if (!f.isStatic()) { list.add(f); } } return list; } |
final int all = jnodeType.getNoDeclaredFields(); final ArrayList list = new ArrayList(all); for (int i = 0; i < all; i++) { final VmField f = jnodeType.getDeclaredField(i); if (f.isStatic()) { list.add(f); } } return list; | if (jnodeType != null) { final int all = jnodeType.getNoDeclaredFields(); final ArrayList list = new ArrayList(all); for (int i = 0; i < all; i++) { final VmField f = jnodeType.getDeclaredField(i); if (f.isStatic()) { list.add(f); } } return list; } else { return new ArrayList(0); } | private static List getStaticFields(VmType jnodeType) { final int all = jnodeType.getNoDeclaredFields(); final ArrayList list = new ArrayList(all); for (int i = 0; i < all; i++) { final VmField f = jnodeType.getDeclaredField(i); if (f.isStatic()) { list.add(f); } } return list; } |
List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); | public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // IF we get here, we have the delmited case for populating // a value list. // our string that we will parse String valueListString = new String (buf, offset, len); String delimiter = (String) CurrentValueListParameter.get("delimiter"); String repeatable = (String) CurrentValueListParameter.get("repeatable"); // reconsitute information stored in CurrentValueListParameter table String parentNodeName = (String) CurrentValueListParameter.get("parentNodeName");// NOT currently complete. Adds values ONLY to axes. Need one for parameter too. // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); // split up string into values based on declared delimiter // and snag the string representation of the values ArrayList strValueList = splitStringIntoStringObjects(valueListString, delimiter, repeatable, null ); // now create value objects, add them to groups Iterator iter = strValueList.iterator(); while (iter.hasNext()) { String valueString = (String) iter.next(); // add the value to the axis Value newvalue = new Value(valueString); lastAxisObject.addAxisValue(newvalue); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueListParameter.put("isDelimitedCase", "true"); // notify that we did the list } |
|
Iterator iter = strValueList.iterator(); while (iter.hasNext()) | String valueListId = (String) CurrentValueListParameter.get("valueListId"); if (valueListId != null) { if (ValueListObj.containsKey(valueListId)) Log.warnln("More than one valueList node with valueListId=\""+valueListId+"\", using latest node." ); ValueListObj.put(valueListId, strValueList); } String valueListIdRef = (String) CurrentValueListParameter.get("valueListIdRef"); if (valueListIdRef != null) { if (ValueListObj.containsKey(valueListIdRef)) { ArrayList refValueListObj = (ArrayList) ValueListObj.get(valueListIdRef); strValueList = (ArrayList) refValueListObj.clone(); } else { Log.warnln("Error: Reader got an valueList with ValueListIdRef=\""+valueListIdRef+"\" but no previous valueList has that id! Ignoring add valueList request."); return; } } if( parentNodeName.equals(XDFNodeName.AXIS) ) | public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // IF we get here, we have the delmited case for populating // a value list. // our string that we will parse String valueListString = new String (buf, offset, len); String delimiter = (String) CurrentValueListParameter.get("delimiter"); String repeatable = (String) CurrentValueListParameter.get("repeatable"); // reconsitute information stored in CurrentValueListParameter table String parentNodeName = (String) CurrentValueListParameter.get("parentNodeName");// NOT currently complete. Adds values ONLY to axes. Need one for parameter too. // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); // split up string into values based on declared delimiter // and snag the string representation of the values ArrayList strValueList = splitStringIntoStringObjects(valueListString, delimiter, repeatable, null ); // now create value objects, add them to groups Iterator iter = strValueList.iterator(); while (iter.hasNext()) { String valueString = (String) iter.next(); // add the value to the axis Value newvalue = new Value(valueString); lastAxisObject.addAxisValue(newvalue); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueListParameter.put("isDelimitedCase", "true"); // notify that we did the list } |
String valueString = (String) iter.next(); | public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // IF we get here, we have the delmited case for populating // a value list. // our string that we will parse String valueListString = new String (buf, offset, len); String delimiter = (String) CurrentValueListParameter.get("delimiter"); String repeatable = (String) CurrentValueListParameter.get("repeatable"); // reconsitute information stored in CurrentValueListParameter table String parentNodeName = (String) CurrentValueListParameter.get("parentNodeName");// NOT currently complete. Adds values ONLY to axes. Need one for parameter too. // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); // split up string into values based on declared delimiter // and snag the string representation of the values ArrayList strValueList = splitStringIntoStringObjects(valueListString, delimiter, repeatable, null ); // now create value objects, add them to groups Iterator iter = strValueList.iterator(); while (iter.hasNext()) { String valueString = (String) iter.next(); // add the value to the axis Value newvalue = new Value(valueString); lastAxisObject.addAxisValue(newvalue); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueListParameter.put("isDelimitedCase", "true"); // notify that we did the list } |
|
Value newvalue = new Value(valueString); lastAxisObject.addAxisValue(newvalue); | List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); | public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // IF we get here, we have the delmited case for populating // a value list. // our string that we will parse String valueListString = new String (buf, offset, len); String delimiter = (String) CurrentValueListParameter.get("delimiter"); String repeatable = (String) CurrentValueListParameter.get("repeatable"); // reconsitute information stored in CurrentValueListParameter table String parentNodeName = (String) CurrentValueListParameter.get("parentNodeName");// NOT currently complete. Adds values ONLY to axes. Need one for parameter too. // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); // split up string into values based on declared delimiter // and snag the string representation of the values ArrayList strValueList = splitStringIntoStringObjects(valueListString, delimiter, repeatable, null ); // now create value objects, add them to groups Iterator iter = strValueList.iterator(); while (iter.hasNext()) { String valueString = (String) iter.next(); // add the value to the axis Value newvalue = new Value(valueString); lastAxisObject.addAxisValue(newvalue); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueListParameter.put("isDelimitedCase", "true"); // notify that we did the list } |
Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) | Iterator iter = strValueList.iterator(); while (iter.hasNext()) | public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // IF we get here, we have the delmited case for populating // a value list. // our string that we will parse String valueListString = new String (buf, offset, len); String delimiter = (String) CurrentValueListParameter.get("delimiter"); String repeatable = (String) CurrentValueListParameter.get("repeatable"); // reconsitute information stored in CurrentValueListParameter table String parentNodeName = (String) CurrentValueListParameter.get("parentNodeName");// NOT currently complete. Adds values ONLY to axes. Need one for parameter too. // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); // split up string into values based on declared delimiter // and snag the string representation of the values ArrayList strValueList = splitStringIntoStringObjects(valueListString, delimiter, repeatable, null ); // now create value objects, add them to groups Iterator iter = strValueList.iterator(); while (iter.hasNext()) { String valueString = (String) iter.next(); // add the value to the axis Value newvalue = new Value(valueString); lastAxisObject.addAxisValue(newvalue); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueListParameter.put("isDelimitedCase", "true"); // notify that we did the list } |
ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); | String valueString = (String) iter.next(); Value newvalue = new Value(valueString); lastAxisObject.addAxisValue(newvalue); Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } | public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // IF we get here, we have the delmited case for populating // a value list. // our string that we will parse String valueListString = new String (buf, offset, len); String delimiter = (String) CurrentValueListParameter.get("delimiter"); String repeatable = (String) CurrentValueListParameter.get("repeatable"); // reconsitute information stored in CurrentValueListParameter table String parentNodeName = (String) CurrentValueListParameter.get("parentNodeName");// NOT currently complete. Adds values ONLY to axes. Need one for parameter too. // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); // split up string into values based on declared delimiter // and snag the string representation of the values ArrayList strValueList = splitStringIntoStringObjects(valueListString, delimiter, repeatable, null ); // now create value objects, add them to groups Iterator iter = strValueList.iterator(); while (iter.hasNext()) { String valueString = (String) iter.next(); // add the value to the axis Value newvalue = new Value(valueString); lastAxisObject.addAxisValue(newvalue); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueListParameter.put("isDelimitedCase", "true"); // notify that we did the list } |
} | } else if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { Iterator iter = strValueList.iterator(); while (iter.hasNext()) { String valueString = (String) iter.next(); Value newvalue = new Value(valueString); LastParameterObject.addValue(newvalue); Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST+", aborting read."); System.exit(-1); } | public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // IF we get here, we have the delmited case for populating // a value list. // our string that we will parse String valueListString = new String (buf, offset, len); String delimiter = (String) CurrentValueListParameter.get("delimiter"); String repeatable = (String) CurrentValueListParameter.get("repeatable"); // reconsitute information stored in CurrentValueListParameter table String parentNodeName = (String) CurrentValueListParameter.get("parentNodeName");// NOT currently complete. Adds values ONLY to axes. Need one for parameter too. // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); // split up string into values based on declared delimiter // and snag the string representation of the values ArrayList strValueList = splitStringIntoStringObjects(valueListString, delimiter, repeatable, null ); // now create value objects, add them to groups Iterator iter = strValueList.iterator(); while (iter.hasNext()) { String valueString = (String) iter.next(); // add the value to the axis Value newvalue = new Value(valueString); lastAxisObject.addAxisValue(newvalue); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueListParameter.put("isDelimitedCase", "true"); // notify that we did the list } |
ArrayList values = getValueListNodeValues(); | ArrayList values = null; String valueListIdRef = (String) CurrentValueListParameter.get("valueListIdRef"); if (valueListIdRef != null) { if (ValueListObj.containsKey(valueListIdRef)) { | public void action (SaxDocumentHandler handler) { // generate valuelist values from algoritm IF we need to // (e.g. values where'nt in a delimited cdata list) // check to see if we didnt alrealy parse from a delmited string. if ( ((String) CurrentValueListParameter.get("isDelimitedCase")).equals("true") ) return; // we already did the list, leave here // 1. grab parent node name String parentNodeName = (String) CurrentValueListParameter.get("parentNodeName"); // 2. try to determine values from attributes (e.g. algorithm method) ArrayList values = getValueListNodeValues(); // 3. Populate correct parent node w/ values if(values.size() > 0 ) { // needed safety? ArrayList valueObjList = new ArrayList(); if( parentNodeName.equals(XDFNodeName.AXIS) ) { // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(lastAxisObject.addAxisValue(value)); } } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) {/* ValueGroup lastValueGroup = (ValueGroup) CurrentValueGroupList.get(CurrentValueGroupList.size()-1); newvalueGroup = lastValueGroup.addValueGroup(newvalueGroup);*/ if ( LastValueGroupParentObject instanceof Parameter ) { Parameter myParamObject = (Parameter) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myParamObject.addValue(value)); } } else if ( LastValueGroupParentObject instanceof Axis ) { // get the last axis Axis myAxisObject = (Axis) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myAxisObject.addAxisValue(value)); } } else { Log.warnln("Error: unknown valueGroupParent "+LastValueGroupParentObject+ " cant treat for "+XDFNodeName.VALUELIST); return; // bail } } else if ( parentNodeName.equals(XDFNodeName.PARAMETER) ) { Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(LastParameterObject.addValue(value)); } } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST); System.exit(-1); // fatal error, shut down } }// Need to do something wi/ ValueObjList HERE?? } |
ArrayList refValueListObj = (ArrayList) ValueListObj.get(valueListIdRef); values = (ArrayList) refValueListObj.clone(); } else { Log.warnln("Error: Reader got an valueList with ValueListIdRef=\""+valueListIdRef+"\" but no previous valueList has that id! Ignoring add valueList request."); return; } } else { values = getValueListNodeValues(); } String valueListId = (String) CurrentValueListParameter.get("valueListId"); if (valueListId != null) { if (ValueListObj.containsKey(valueListId)) Log.warnln("More than one valueList node with valueListId=\""+valueListId+"\", using latest node." ); ValueListObj.put(valueListId, values); } | public void action (SaxDocumentHandler handler) { // generate valuelist values from algoritm IF we need to // (e.g. values where'nt in a delimited cdata list) // check to see if we didnt alrealy parse from a delmited string. if ( ((String) CurrentValueListParameter.get("isDelimitedCase")).equals("true") ) return; // we already did the list, leave here // 1. grab parent node name String parentNodeName = (String) CurrentValueListParameter.get("parentNodeName"); // 2. try to determine values from attributes (e.g. algorithm method) ArrayList values = getValueListNodeValues(); // 3. Populate correct parent node w/ values if(values.size() > 0 ) { // needed safety? ArrayList valueObjList = new ArrayList(); if( parentNodeName.equals(XDFNodeName.AXIS) ) { // get the last axis List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(lastAxisObject.addAxisValue(value)); } } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) {/* ValueGroup lastValueGroup = (ValueGroup) CurrentValueGroupList.get(CurrentValueGroupList.size()-1); newvalueGroup = lastValueGroup.addValueGroup(newvalueGroup);*/ if ( LastValueGroupParentObject instanceof Parameter ) { Parameter myParamObject = (Parameter) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myParamObject.addValue(value)); } } else if ( LastValueGroupParentObject instanceof Axis ) { // get the last axis Axis myAxisObject = (Axis) LastValueGroupParentObject; Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(myAxisObject.addAxisValue(value)); } } else { Log.warnln("Error: unknown valueGroupParent "+LastValueGroupParentObject+ " cant treat for "+XDFNodeName.VALUELIST); return; // bail } } else if ( parentNodeName.equals(XDFNodeName.PARAMETER) ) { Iterator iter = values.iterator(); while (iter.hasNext()) { String valuePCDATA = (String) iter.next(); Value value = new Value (valuePCDATA); valueObjList.add(LastParameterObject.addValue(value)); } } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST); System.exit(-1); // fatal error, shut down } }// Need to do something wi/ ValueObjList HERE?? } |
|
String parentNodeName = getParentNodeName(); | String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); | public Object action (SaxDocumentHandler handler, AttributeList attrs) { // 1. re-init CurrentValueListParameter.clear(); // 2. populate ValueListparameters from attribute list CurrentValueListParameter = attribListToHashtable(attrs); // 3. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(); CurrentValueListParameter.put("parentNodeName", parentNodeName); // 4. set this parameter to false to indicate the future is not // yet determined for this :) CurrentValueListParameter.put("isDelimitedCase", "false"); return (Object) null; } |
algOid = new OID(params.getAlgorithm()); | algName = params.getAlgorithm (); algOid = getOid (algName); | public EncryptedPrivateKeyInfo(AlgorithmParameters params, byte[] encryptedData) throws IllegalArgumentException, NoSuchAlgorithmException { if (encryptedData.length == 0) { throw new IllegalArgumentException("0-length encryptedData"); } this.params = params; algOid = new OID(params.getAlgorithm()); this.encryptedData = (byte[]) encryptedData.clone(); } |
algId.add(DERReader.read(params.getEncoded())); | algId.add (DERReader.read (params.getEncoded())); } else { algId.add (new DERValue (DER.NULL, null)); | private void encode() throws IOException { List algId = new ArrayList(2); algId.add(new DERValue(DER.OBJECT_IDENTIFIER, algOid)); getAlgParameters(); if (params != null) { algId.add(DERReader.read(params.getEncoded())); } List epki = new ArrayList(2); epki.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, algId)); epki.add(new DERValue(DER.OCTET_STRING, encryptedData)); encoded = new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, epki).getEncoded(); } |
public final void init(byte[]params) throws IOException | public final void init(AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException | public final void init(byte[]params) throws IOException { paramSpi.engineInit(params); } |
paramSpi.engineInit(params); | paramSpi.engineInit(paramSpec); | public final void init(byte[]params) throws IOException { paramSpi.engineInit(params); } |
GPR regs[] = { X86Register.EAX, X86Register.EBX, X86Register.ECX, X86Register.EDX, X86Register.ESI }; for (GPR reg1 : regs) { os.writeIDIV_EAX(reg1); } if (true) { return; } | private final static void testCode32(X86Assembler os) throws UnresolvedObjectRefException { final Label label = new Label("label"); os.writeADD(X86Register.EDX, X86Register.EAX); os.setObjectRef(label); os.writeNOP(); os.writeLOOP(label); os.writeTEST_AL(0xff); os.writeTEST(X86Register.EBX, 0xABCD1234); os.writeCMPXCHG_EAX(X86Register.EDX, 4, X86Register.ECX, false); os.writeLEA(X86Register.ESI, X86Register.ESI, X86Register.EBX, 8, 4); os.writeCMPXCHG_EAX(X86Register.EDX, 4, X86Register.ECX, true); os.writeJMP(label, 2, false); os.writeCALL(label, 4, false); os.writeTEST(X86Register.ECX, X86Register.EBX); os.writeCMOVcc(X86Constants.JLE, X86Register.EAX, X86Register.EBX); os.writeCMOVcc(X86Constants.JE, X86Register.EAX, X86Register.EBX, 5); os.writeADD(BITS32, X86Register.EAX, 28, 11); os.writeCALL(X86Register.EAX, 28); os.writeCMP(X86Register.EAX, X86Register.ECX, 4); os.writeCMP(X86Register.EAX, 4, X86Register.ECX); os.writePrefix(X86Constants.FS_PREFIX); os.writeCMP_MEM(X86Register.ESP, 24); os.writeMOV_Const(BITS32, X86Register.ESP, 4, 24); os.writeSBB(X86Register.EDX, 5); os.writeSBB(X86Register.EDX, 305); final Label jt = new Label("Jumptable"); os.writeSHL(X86Register.ECX, 2); os.writeJMP(jt, X86Register.ECX); os.setObjectRef(jt); os.write32(0x1234ABCD); os.write32(0xFFEEDDCC); os.writeJMP(X86Register.EDX, 15); os.writeADD(X86Register.EDX, X86Register.EBX, 5); os.writeSUB(X86Register.EDX, 3); os.writeINC(BITS32, X86Register.EBX, 67); // INC [reg+67] os.writeCMP_Const(BITS32, X86Register.ECX, 0xF, 0x12); os.writeCMP_Const(BITS32, X86Register.ECX, 0x4, 0x1234); os.writeMOV_Const(BITS32, X86Register.EDI, X86Register.EAX, 4, 0x09, 0x1234); os.writeSETCC(X86Register.EDX, X86Constants.JA); os.writeADD(BITS32, X86Register.EAX, 28, 11); os.writeADD(BITS32, X86Register.EAX, 28, 255); os.writeSUB(X86Register.EAX, 11); os.writeSUB(X86Register.EAX, 255); os.writeSUB(BITS32, X86Register.EAX, 28, 11); os.writeSUB(BITS32, X86Register.EAX, 28, 255); os.writeTEST(BITS32, X86Register.EDI, 0x40, 0xFFFFFFFF); os.writeFLD32(X86Register.EAX, X86Register.ESI, 4, 15); os.writeFLD64(X86Register.EAX, X86Register.ESI, 8, 15); os.writeCALL(X86Register.EAX, X86Register.EDX, 1, 0); os.writeCALL(X86Register.EAX); os.writeCALL(X86Register.ESI); os.writeXCHG(X86Register.EAX, X86Register.EDX); os.writeXCHG(X86Register.ESI, X86Register.EAX); os.writeXCHG(X86Register.ECX, X86Register.EBX); os.writeXCHG(X86Register.EAX, 13, X86Register.EDX); os.writeXCHG(X86Register.ECX, 13, X86Register.EBX); os.writeMOV(X86Constants.BITS8, X86Register.ECX, X86Register.EBX, 1, 4, X86Register.ESI); os.writeMOV(X86Constants.BITS8, X86Register.EDX, X86Register.ECX, X86Register.EBX, 1, 4); os.writeMOVSX(X86Register.EDX, X86Register.EDX, X86Constants.BITS8); os.writeSAR(BITS32, X86Register.EBP, 16, 16); os.writeSAR(BITS32, X86Register.EBP, 16, 24); os.writeMOVZX(X86Register.EBX, X86Register.EBX, X86Constants.BITS16); os.writeAND(X86Register.EBX, 0x0000FFFF); // SSE tests os.writeArithSSEDOp(X86Operation.SSE_ADD, X86Register.XMM0, X86Register.XMM1); os.writeArithSSEDOp(X86Operation.SSE_ADD, X86Register.XMM0, X86Register.EBX, 5); os.writeArithSSEDOp(X86Operation.SSE_SUB, X86Register.XMM1, X86Register.XMM2); os.writeArithSSEDOp(X86Operation.SSE_SUB, X86Register.XMM1, X86Register.EBX, 5); os.writeArithSSEDOp(X86Operation.SSE_MUL, X86Register.XMM2, X86Register.XMM3); os.writeArithSSEDOp(X86Operation.SSE_MUL, X86Register.XMM2, X86Register.EBX, 5); os.writeArithSSEDOp(X86Operation.SSE_DIV, X86Register.XMM3, X86Register.XMM4); os.writeArithSSEDOp(X86Operation.SSE_DIV, X86Register.XMM3, X86Register.EBX, 5); os.writeArithSSESOp(X86Operation.SSE_ADD, X86Register.XMM0, X86Register.XMM1); os.writeArithSSESOp(X86Operation.SSE_ADD, X86Register.XMM0, X86Register.EBX, 5); os.writeArithSSESOp(X86Operation.SSE_SUB, X86Register.XMM1, X86Register.XMM2); os.writeArithSSESOp(X86Operation.SSE_SUB, X86Register.XMM1, X86Register.EBX, 5); os.writeArithSSESOp(X86Operation.SSE_MUL, X86Register.XMM2, X86Register.XMM3); os.writeArithSSESOp(X86Operation.SSE_MUL, X86Register.XMM2, X86Register.EBX, 5); os.writeArithSSESOp(X86Operation.SSE_DIV, X86Register.XMM3, X86Register.XMM4); os.writeArithSSESOp(X86Operation.SSE_DIV, X86Register.XMM3, X86Register.EBX, 5); os.writeMOVSD(X86Register.XMM0, X86Register.XMM1); os.writeMOVSD(X86Register.XMM0, X86Register.ESP, 0); os.writeMOVSD(X86Register.ESP, 0, X86Register.XMM1); os.writeMOVSS(X86Register.XMM0, X86Register.XMM1); os.writeMOVSS(X86Register.XMM0, X86Register.ESP, 0); os.writeMOVSS(X86Register.ESP, 0, X86Register.XMM1); } |
|
for (int i = 0; i < FIELD_COUNT; i++) { | int hour = fields[ZONE_OFFSET] / (60 * 60 * 1000); int minute = (fields[ZONE_OFFSET] - 60 * 60 * 1000 * hour) / (60 * 1000); int seconds = (fields[ZONE_OFFSET] - 60 * 60 * 1000 * hour - 60 * 1000 * minute) / 1000; int millis = fields[ZONE_OFFSET] - 60 * 60 * 1000 * hour - 60 * 1000 * minute - seconds * 1000; int[] tempFields = { 1, 1970, JANUARY, 1, 1, 1, 1, THURSDAY, 1, AM, hour, hour, minute, seconds, millis, fields[ZONE_OFFSET], fields[DST_OFFSET] }; fields = tempFields; for (int i = 0; i < FIELD_COUNT - 2; i++) | public final void clear() { isTimeSet = false; areFieldsSet = false; for (int i = 0; i < FIELD_COUNT; i++) { isSet[i] = false; fields[i] = 0; } } |
fields[i] = 0; } | isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true; | public final void clear() { isTimeSet = false; areFieldsSet = false; for (int i = 0; i < FIELD_COUNT; i++) { isSet[i] = false; fields[i] = 0; } } |
case YEAR: case MONTH: case DATE: | case MONTH: isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; break; case DAY_OF_MONTH: isSet[YEAR] = true; isSet[MONTH] = true; isSet[WEEK_OF_MONTH] = true; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_YEAR] = false; break; case WEEK_OF_MONTH: isSet[YEAR] = true; isSet[MONTH] = true; isSet[DAY_OF_WEEK] = true; isSet[DAY_OF_MONTH] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; isSet[DAY_OF_YEAR] = false; | public void set(int field, int value) { isTimeSet = false; fields[field] = value; isSet[field] = true; switch (field) { case YEAR: case MONTH: case DATE: isSet[WEEK_OF_YEAR] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; break; case AM_PM: isSet[HOUR_OF_DAY] = false; break; case HOUR_OF_DAY: isSet[AM_PM] = false; isSet[HOUR] = false; break; case HOUR: isSet[HOUR_OF_DAY] = false; break; case DST_OFFSET: explicitDSTOffset = true; } // May have crossed over a DST boundary. if (! explicitDSTOffset && (field != DST_OFFSET && field != ZONE_OFFSET)) isSet[DST_OFFSET] = false; } |
isSet[AM_PM] = true; | public void set(int field, int value) { isTimeSet = false; fields[field] = value; isSet[field] = true; switch (field) { case YEAR: case MONTH: case DATE: isSet[WEEK_OF_YEAR] = false; isSet[DAY_OF_YEAR] = false; isSet[WEEK_OF_MONTH] = false; isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; break; case AM_PM: isSet[HOUR_OF_DAY] = false; break; case HOUR_OF_DAY: isSet[AM_PM] = false; isSet[HOUR] = false; break; case HOUR: isSet[HOUR_OF_DAY] = false; break; case DST_OFFSET: explicitDSTOffset = true; } // May have crossed over a DST boundary. if (! explicitDSTOffset && (field != DST_OFFSET && field != ZONE_OFFSET)) isSet[DST_OFFSET] = false; } |
|
JLabel c = (JLabel) e.getSource(); c.revalidate(); c.repaint(); | public void propertyChange(PropertyChangeEvent e) { JLabel c = (JLabel) e.getSource(); c.revalidate(); c.repaint(); } |
|
super.swapComponents (curr, targ); | if (curr == 0) super.swapComponents(curr, targ); else while (curr > 0) super.swapComponents (curr, --curr); | public void setPosition(Component c, int position) { int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); if (range[0] == range[1]) throw new IllegalArgumentException (); int top = range[0]; int bot = range[1]; if (position == -1) position = (bot - top) - 1; int targ = Math.min(top + position, bot-1); int curr = -1; Component[] comps = getComponents(); for (int i = top; i < bot; ++i) { if (comps[i] == c) { curr = i; break; } } if (curr == -1) // should have found it throw new IllegalArgumentException(); super.swapComponents (curr, targ); revalidate(); repaint(); } |
return add_value(null, null, a_flags); | return add_value(null, new gnuAny(), a_flags); | public NamedValue add(int a_flags) { return add_value(null, null, a_flags); } |
return add_value(a_name, null, a_flags); | return add_value(a_name, new gnuAny(), a_flags); | public NamedValue add_item(String a_name, int a_flags) { return add_value(a_name, null, a_flags); } |
public InvalidDriverException(String s) { super(s); | public InvalidDriverException() { super(); | public InvalidDriverException(String s) { super(s); } |
reportHeader(out); | reportHeader(out, "Class", "Target", "Merge status"); | public void execute() { if (destDir == null) { throw new BuildException("The destdir attribute must be set"); } final Map<String, SourceFile> vmFiles = vmDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> classpathFiles = classpathDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs .scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); allFiles.addAll(classpathFiles.keySet()); try { destDir.mkdirs(); final File outFile = new File(destDir, "classpath-compare.html"); final PrintWriter out = new PrintWriter(new FileWriter(outFile)); reportHeader(out); int missingInCp = 0; int missingInVm = 0; int needsMerge = 0; int diffVmSpecific = 0; int diffClasspathBugfix = 0; int diffNative = 0; int diffJNode = 0; int vmSpecific = 0; for (String name : allFiles) { SourceFile cpFile = classpathFiles.get(name); final SourceFile vmFile = vmFiles.get(name); final SourceFile vmSpecificFile = vmSpecificFiles .get(name); if (vmSpecificFile != null) { // File is found as vm specific source reportVmSpecific(out, vmSpecificFile.getReportName(), "vm-specific"); vmSpecific++; } else if (vmFile == null) { // file is not found as vmspecific source, nor as vm source if (!cpFile.isIgnoreMissing()) { reportMissing(out, cpFile.getReportName(), "classpath", getFlags(cpFile)); missingInCp++; } } else if (cpFile == null) { // File is not found in classpath sources reportMissing(out, vmFile.getReportName(), "vm", 0); missingInVm++; } else { // We have both the classpath version and the vm version. cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); final String diffFileName = vmFile.getReportName() + ".diff"; int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { case NO_CHANGE: break; case NEEDS_MERGE: reportNeedsMerge(out, vmFile.getReportName(), vmFile .getTarget(), diffFileName, rc & FLAGS_MASK); needsMerge++; break; default: throw new RuntimeException("Invalid rc " + rc); } if ((rc & FLAG_VM_SPECIFIC) != 0) { diffVmSpecific++; } if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { diffClasspathBugfix++; } if ((rc & FLAG_NATIVE) != 0) { diffNative++; } if ((rc & FLAG_JNODE) != 0) { diffJNode++; } // Let's compare them } } // Package diffs for (Map.Entry<String, String> entry : packageDiffs.entrySet()) { final String pkg = entry.getKey(); final String diff = entry.getValue(); final String diffFileName = pkg + ".pkgdiff"; processPackageDiff(diffFileName, pkg, diff); reportPackageDiff(out, pkg, diffFileName, getFlags(diff)); } out.println("</table><p/>"); // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { out.println("Found " + missingInCp + " files missing in classpath</br>"); log("Found " + missingInCp + " files missing in classpath"); } if (missingInVm > 0) { out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { out.println("Found " + vmSpecific + " VM specific files<br/>"); log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { out.println("Found " + diffClasspathBugfix + " local classpath bugfixes<br/>"); log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } reportFooter(out); out.flush(); out.close(); } catch (IOException ex) { throw new BuildException(ex); } catch (InterruptedException ex) { throw new BuildException(ex); } } |
reportMissing(out, vmFile.getReportName(), "vm", 0); | reportMissing(out, vmFile.getReportName(), "vm", new Flags()); | public void execute() { if (destDir == null) { throw new BuildException("The destdir attribute must be set"); } final Map<String, SourceFile> vmFiles = vmDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> classpathFiles = classpathDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs .scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); allFiles.addAll(classpathFiles.keySet()); try { destDir.mkdirs(); final File outFile = new File(destDir, "classpath-compare.html"); final PrintWriter out = new PrintWriter(new FileWriter(outFile)); reportHeader(out); int missingInCp = 0; int missingInVm = 0; int needsMerge = 0; int diffVmSpecific = 0; int diffClasspathBugfix = 0; int diffNative = 0; int diffJNode = 0; int vmSpecific = 0; for (String name : allFiles) { SourceFile cpFile = classpathFiles.get(name); final SourceFile vmFile = vmFiles.get(name); final SourceFile vmSpecificFile = vmSpecificFiles .get(name); if (vmSpecificFile != null) { // File is found as vm specific source reportVmSpecific(out, vmSpecificFile.getReportName(), "vm-specific"); vmSpecific++; } else if (vmFile == null) { // file is not found as vmspecific source, nor as vm source if (!cpFile.isIgnoreMissing()) { reportMissing(out, cpFile.getReportName(), "classpath", getFlags(cpFile)); missingInCp++; } } else if (cpFile == null) { // File is not found in classpath sources reportMissing(out, vmFile.getReportName(), "vm", 0); missingInVm++; } else { // We have both the classpath version and the vm version. cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); final String diffFileName = vmFile.getReportName() + ".diff"; int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { case NO_CHANGE: break; case NEEDS_MERGE: reportNeedsMerge(out, vmFile.getReportName(), vmFile .getTarget(), diffFileName, rc & FLAGS_MASK); needsMerge++; break; default: throw new RuntimeException("Invalid rc " + rc); } if ((rc & FLAG_VM_SPECIFIC) != 0) { diffVmSpecific++; } if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { diffClasspathBugfix++; } if ((rc & FLAG_NATIVE) != 0) { diffNative++; } if ((rc & FLAG_JNODE) != 0) { diffJNode++; } // Let's compare them } } // Package diffs for (Map.Entry<String, String> entry : packageDiffs.entrySet()) { final String pkg = entry.getKey(); final String diff = entry.getValue(); final String diffFileName = pkg + ".pkgdiff"; processPackageDiff(diffFileName, pkg, diff); reportPackageDiff(out, pkg, diffFileName, getFlags(diff)); } out.println("</table><p/>"); // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { out.println("Found " + missingInCp + " files missing in classpath</br>"); log("Found " + missingInCp + " files missing in classpath"); } if (missingInVm > 0) { out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { out.println("Found " + vmSpecific + " VM specific files<br/>"); log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { out.println("Found " + diffClasspathBugfix + " local classpath bugfixes<br/>"); log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } reportFooter(out); out.flush(); out.close(); } catch (IOException ex) { throw new BuildException(ex); } catch (InterruptedException ex) { throw new BuildException(ex); } } |
int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { | Flags rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc.asInt() & ~FLAGS_MASK) { | public void execute() { if (destDir == null) { throw new BuildException("The destdir attribute must be set"); } final Map<String, SourceFile> vmFiles = vmDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> classpathFiles = classpathDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs .scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); allFiles.addAll(classpathFiles.keySet()); try { destDir.mkdirs(); final File outFile = new File(destDir, "classpath-compare.html"); final PrintWriter out = new PrintWriter(new FileWriter(outFile)); reportHeader(out); int missingInCp = 0; int missingInVm = 0; int needsMerge = 0; int diffVmSpecific = 0; int diffClasspathBugfix = 0; int diffNative = 0; int diffJNode = 0; int vmSpecific = 0; for (String name : allFiles) { SourceFile cpFile = classpathFiles.get(name); final SourceFile vmFile = vmFiles.get(name); final SourceFile vmSpecificFile = vmSpecificFiles .get(name); if (vmSpecificFile != null) { // File is found as vm specific source reportVmSpecific(out, vmSpecificFile.getReportName(), "vm-specific"); vmSpecific++; } else if (vmFile == null) { // file is not found as vmspecific source, nor as vm source if (!cpFile.isIgnoreMissing()) { reportMissing(out, cpFile.getReportName(), "classpath", getFlags(cpFile)); missingInCp++; } } else if (cpFile == null) { // File is not found in classpath sources reportMissing(out, vmFile.getReportName(), "vm", 0); missingInVm++; } else { // We have both the classpath version and the vm version. cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); final String diffFileName = vmFile.getReportName() + ".diff"; int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { case NO_CHANGE: break; case NEEDS_MERGE: reportNeedsMerge(out, vmFile.getReportName(), vmFile .getTarget(), diffFileName, rc & FLAGS_MASK); needsMerge++; break; default: throw new RuntimeException("Invalid rc " + rc); } if ((rc & FLAG_VM_SPECIFIC) != 0) { diffVmSpecific++; } if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { diffClasspathBugfix++; } if ((rc & FLAG_NATIVE) != 0) { diffNative++; } if ((rc & FLAG_JNODE) != 0) { diffJNode++; } // Let's compare them } } // Package diffs for (Map.Entry<String, String> entry : packageDiffs.entrySet()) { final String pkg = entry.getKey(); final String diff = entry.getValue(); final String diffFileName = pkg + ".pkgdiff"; processPackageDiff(diffFileName, pkg, diff); reportPackageDiff(out, pkg, diffFileName, getFlags(diff)); } out.println("</table><p/>"); // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { out.println("Found " + missingInCp + " files missing in classpath</br>"); log("Found " + missingInCp + " files missing in classpath"); } if (missingInVm > 0) { out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { out.println("Found " + vmSpecific + " VM specific files<br/>"); log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { out.println("Found " + diffClasspathBugfix + " local classpath bugfixes<br/>"); log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } reportFooter(out); out.flush(); out.close(); } catch (IOException ex) { throw new BuildException(ex); } catch (InterruptedException ex) { throw new BuildException(ex); } } |
.getTarget(), diffFileName, rc & FLAGS_MASK); | .getTarget(), diffFileName, rc.mask(FLAGS_MASK)); | public void execute() { if (destDir == null) { throw new BuildException("The destdir attribute must be set"); } final Map<String, SourceFile> vmFiles = vmDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> classpathFiles = classpathDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs .scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); allFiles.addAll(classpathFiles.keySet()); try { destDir.mkdirs(); final File outFile = new File(destDir, "classpath-compare.html"); final PrintWriter out = new PrintWriter(new FileWriter(outFile)); reportHeader(out); int missingInCp = 0; int missingInVm = 0; int needsMerge = 0; int diffVmSpecific = 0; int diffClasspathBugfix = 0; int diffNative = 0; int diffJNode = 0; int vmSpecific = 0; for (String name : allFiles) { SourceFile cpFile = classpathFiles.get(name); final SourceFile vmFile = vmFiles.get(name); final SourceFile vmSpecificFile = vmSpecificFiles .get(name); if (vmSpecificFile != null) { // File is found as vm specific source reportVmSpecific(out, vmSpecificFile.getReportName(), "vm-specific"); vmSpecific++; } else if (vmFile == null) { // file is not found as vmspecific source, nor as vm source if (!cpFile.isIgnoreMissing()) { reportMissing(out, cpFile.getReportName(), "classpath", getFlags(cpFile)); missingInCp++; } } else if (cpFile == null) { // File is not found in classpath sources reportMissing(out, vmFile.getReportName(), "vm", 0); missingInVm++; } else { // We have both the classpath version and the vm version. cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); final String diffFileName = vmFile.getReportName() + ".diff"; int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { case NO_CHANGE: break; case NEEDS_MERGE: reportNeedsMerge(out, vmFile.getReportName(), vmFile .getTarget(), diffFileName, rc & FLAGS_MASK); needsMerge++; break; default: throw new RuntimeException("Invalid rc " + rc); } if ((rc & FLAG_VM_SPECIFIC) != 0) { diffVmSpecific++; } if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { diffClasspathBugfix++; } if ((rc & FLAG_NATIVE) != 0) { diffNative++; } if ((rc & FLAG_JNODE) != 0) { diffJNode++; } // Let's compare them } } // Package diffs for (Map.Entry<String, String> entry : packageDiffs.entrySet()) { final String pkg = entry.getKey(); final String diff = entry.getValue(); final String diffFileName = pkg + ".pkgdiff"; processPackageDiff(diffFileName, pkg, diff); reportPackageDiff(out, pkg, diffFileName, getFlags(diff)); } out.println("</table><p/>"); // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { out.println("Found " + missingInCp + " files missing in classpath</br>"); log("Found " + missingInCp + " files missing in classpath"); } if (missingInVm > 0) { out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { out.println("Found " + vmSpecific + " VM specific files<br/>"); log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { out.println("Found " + diffClasspathBugfix + " local classpath bugfixes<br/>"); log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } reportFooter(out); out.flush(); out.close(); } catch (IOException ex) { throw new BuildException(ex); } catch (InterruptedException ex) { throw new BuildException(ex); } } |
if ((rc & FLAG_VM_SPECIFIC) != 0) { | if (rc.isSet(FLAG_VM_SPECIFIC)) { | public void execute() { if (destDir == null) { throw new BuildException("The destdir attribute must be set"); } final Map<String, SourceFile> vmFiles = vmDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> classpathFiles = classpathDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs .scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); allFiles.addAll(classpathFiles.keySet()); try { destDir.mkdirs(); final File outFile = new File(destDir, "classpath-compare.html"); final PrintWriter out = new PrintWriter(new FileWriter(outFile)); reportHeader(out); int missingInCp = 0; int missingInVm = 0; int needsMerge = 0; int diffVmSpecific = 0; int diffClasspathBugfix = 0; int diffNative = 0; int diffJNode = 0; int vmSpecific = 0; for (String name : allFiles) { SourceFile cpFile = classpathFiles.get(name); final SourceFile vmFile = vmFiles.get(name); final SourceFile vmSpecificFile = vmSpecificFiles .get(name); if (vmSpecificFile != null) { // File is found as vm specific source reportVmSpecific(out, vmSpecificFile.getReportName(), "vm-specific"); vmSpecific++; } else if (vmFile == null) { // file is not found as vmspecific source, nor as vm source if (!cpFile.isIgnoreMissing()) { reportMissing(out, cpFile.getReportName(), "classpath", getFlags(cpFile)); missingInCp++; } } else if (cpFile == null) { // File is not found in classpath sources reportMissing(out, vmFile.getReportName(), "vm", 0); missingInVm++; } else { // We have both the classpath version and the vm version. cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); final String diffFileName = vmFile.getReportName() + ".diff"; int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { case NO_CHANGE: break; case NEEDS_MERGE: reportNeedsMerge(out, vmFile.getReportName(), vmFile .getTarget(), diffFileName, rc & FLAGS_MASK); needsMerge++; break; default: throw new RuntimeException("Invalid rc " + rc); } if ((rc & FLAG_VM_SPECIFIC) != 0) { diffVmSpecific++; } if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { diffClasspathBugfix++; } if ((rc & FLAG_NATIVE) != 0) { diffNative++; } if ((rc & FLAG_JNODE) != 0) { diffJNode++; } // Let's compare them } } // Package diffs for (Map.Entry<String, String> entry : packageDiffs.entrySet()) { final String pkg = entry.getKey(); final String diff = entry.getValue(); final String diffFileName = pkg + ".pkgdiff"; processPackageDiff(diffFileName, pkg, diff); reportPackageDiff(out, pkg, diffFileName, getFlags(diff)); } out.println("</table><p/>"); // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { out.println("Found " + missingInCp + " files missing in classpath</br>"); log("Found " + missingInCp + " files missing in classpath"); } if (missingInVm > 0) { out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { out.println("Found " + vmSpecific + " VM specific files<br/>"); log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { out.println("Found " + diffClasspathBugfix + " local classpath bugfixes<br/>"); log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } reportFooter(out); out.flush(); out.close(); } catch (IOException ex) { throw new BuildException(ex); } catch (InterruptedException ex) { throw new BuildException(ex); } } |
if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { | if (rc.isSet(FLAG_CLASSPATH_BUGFIX)) { | public void execute() { if (destDir == null) { throw new BuildException("The destdir attribute must be set"); } final Map<String, SourceFile> vmFiles = vmDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> classpathFiles = classpathDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs .scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); allFiles.addAll(classpathFiles.keySet()); try { destDir.mkdirs(); final File outFile = new File(destDir, "classpath-compare.html"); final PrintWriter out = new PrintWriter(new FileWriter(outFile)); reportHeader(out); int missingInCp = 0; int missingInVm = 0; int needsMerge = 0; int diffVmSpecific = 0; int diffClasspathBugfix = 0; int diffNative = 0; int diffJNode = 0; int vmSpecific = 0; for (String name : allFiles) { SourceFile cpFile = classpathFiles.get(name); final SourceFile vmFile = vmFiles.get(name); final SourceFile vmSpecificFile = vmSpecificFiles .get(name); if (vmSpecificFile != null) { // File is found as vm specific source reportVmSpecific(out, vmSpecificFile.getReportName(), "vm-specific"); vmSpecific++; } else if (vmFile == null) { // file is not found as vmspecific source, nor as vm source if (!cpFile.isIgnoreMissing()) { reportMissing(out, cpFile.getReportName(), "classpath", getFlags(cpFile)); missingInCp++; } } else if (cpFile == null) { // File is not found in classpath sources reportMissing(out, vmFile.getReportName(), "vm", 0); missingInVm++; } else { // We have both the classpath version and the vm version. cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); final String diffFileName = vmFile.getReportName() + ".diff"; int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { case NO_CHANGE: break; case NEEDS_MERGE: reportNeedsMerge(out, vmFile.getReportName(), vmFile .getTarget(), diffFileName, rc & FLAGS_MASK); needsMerge++; break; default: throw new RuntimeException("Invalid rc " + rc); } if ((rc & FLAG_VM_SPECIFIC) != 0) { diffVmSpecific++; } if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { diffClasspathBugfix++; } if ((rc & FLAG_NATIVE) != 0) { diffNative++; } if ((rc & FLAG_JNODE) != 0) { diffJNode++; } // Let's compare them } } // Package diffs for (Map.Entry<String, String> entry : packageDiffs.entrySet()) { final String pkg = entry.getKey(); final String diff = entry.getValue(); final String diffFileName = pkg + ".pkgdiff"; processPackageDiff(diffFileName, pkg, diff); reportPackageDiff(out, pkg, diffFileName, getFlags(diff)); } out.println("</table><p/>"); // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { out.println("Found " + missingInCp + " files missing in classpath</br>"); log("Found " + missingInCp + " files missing in classpath"); } if (missingInVm > 0) { out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { out.println("Found " + vmSpecific + " VM specific files<br/>"); log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { out.println("Found " + diffClasspathBugfix + " local classpath bugfixes<br/>"); log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } reportFooter(out); out.flush(); out.close(); } catch (IOException ex) { throw new BuildException(ex); } catch (InterruptedException ex) { throw new BuildException(ex); } } |
if ((rc & FLAG_NATIVE) != 0) { | if (rc.isSet(FLAG_NATIVE)) { | public void execute() { if (destDir == null) { throw new BuildException("The destdir attribute must be set"); } final Map<String, SourceFile> vmFiles = vmDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> classpathFiles = classpathDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs .scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); allFiles.addAll(classpathFiles.keySet()); try { destDir.mkdirs(); final File outFile = new File(destDir, "classpath-compare.html"); final PrintWriter out = new PrintWriter(new FileWriter(outFile)); reportHeader(out); int missingInCp = 0; int missingInVm = 0; int needsMerge = 0; int diffVmSpecific = 0; int diffClasspathBugfix = 0; int diffNative = 0; int diffJNode = 0; int vmSpecific = 0; for (String name : allFiles) { SourceFile cpFile = classpathFiles.get(name); final SourceFile vmFile = vmFiles.get(name); final SourceFile vmSpecificFile = vmSpecificFiles .get(name); if (vmSpecificFile != null) { // File is found as vm specific source reportVmSpecific(out, vmSpecificFile.getReportName(), "vm-specific"); vmSpecific++; } else if (vmFile == null) { // file is not found as vmspecific source, nor as vm source if (!cpFile.isIgnoreMissing()) { reportMissing(out, cpFile.getReportName(), "classpath", getFlags(cpFile)); missingInCp++; } } else if (cpFile == null) { // File is not found in classpath sources reportMissing(out, vmFile.getReportName(), "vm", 0); missingInVm++; } else { // We have both the classpath version and the vm version. cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); final String diffFileName = vmFile.getReportName() + ".diff"; int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { case NO_CHANGE: break; case NEEDS_MERGE: reportNeedsMerge(out, vmFile.getReportName(), vmFile .getTarget(), diffFileName, rc & FLAGS_MASK); needsMerge++; break; default: throw new RuntimeException("Invalid rc " + rc); } if ((rc & FLAG_VM_SPECIFIC) != 0) { diffVmSpecific++; } if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { diffClasspathBugfix++; } if ((rc & FLAG_NATIVE) != 0) { diffNative++; } if ((rc & FLAG_JNODE) != 0) { diffJNode++; } // Let's compare them } } // Package diffs for (Map.Entry<String, String> entry : packageDiffs.entrySet()) { final String pkg = entry.getKey(); final String diff = entry.getValue(); final String diffFileName = pkg + ".pkgdiff"; processPackageDiff(diffFileName, pkg, diff); reportPackageDiff(out, pkg, diffFileName, getFlags(diff)); } out.println("</table><p/>"); // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { out.println("Found " + missingInCp + " files missing in classpath</br>"); log("Found " + missingInCp + " files missing in classpath"); } if (missingInVm > 0) { out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { out.println("Found " + vmSpecific + " VM specific files<br/>"); log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { out.println("Found " + diffClasspathBugfix + " local classpath bugfixes<br/>"); log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } reportFooter(out); out.flush(); out.close(); } catch (IOException ex) { throw new BuildException(ex); } catch (InterruptedException ex) { throw new BuildException(ex); } } |
if ((rc & FLAG_JNODE) != 0) { | if (rc.isSet(FLAG_JNODE)) { | public void execute() { if (destDir == null) { throw new BuildException("The destdir attribute must be set"); } final Map<String, SourceFile> vmFiles = vmDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> classpathFiles = classpathDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs .scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); allFiles.addAll(classpathFiles.keySet()); try { destDir.mkdirs(); final File outFile = new File(destDir, "classpath-compare.html"); final PrintWriter out = new PrintWriter(new FileWriter(outFile)); reportHeader(out); int missingInCp = 0; int missingInVm = 0; int needsMerge = 0; int diffVmSpecific = 0; int diffClasspathBugfix = 0; int diffNative = 0; int diffJNode = 0; int vmSpecific = 0; for (String name : allFiles) { SourceFile cpFile = classpathFiles.get(name); final SourceFile vmFile = vmFiles.get(name); final SourceFile vmSpecificFile = vmSpecificFiles .get(name); if (vmSpecificFile != null) { // File is found as vm specific source reportVmSpecific(out, vmSpecificFile.getReportName(), "vm-specific"); vmSpecific++; } else if (vmFile == null) { // file is not found as vmspecific source, nor as vm source if (!cpFile.isIgnoreMissing()) { reportMissing(out, cpFile.getReportName(), "classpath", getFlags(cpFile)); missingInCp++; } } else if (cpFile == null) { // File is not found in classpath sources reportMissing(out, vmFile.getReportName(), "vm", 0); missingInVm++; } else { // We have both the classpath version and the vm version. cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); final String diffFileName = vmFile.getReportName() + ".diff"; int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { case NO_CHANGE: break; case NEEDS_MERGE: reportNeedsMerge(out, vmFile.getReportName(), vmFile .getTarget(), diffFileName, rc & FLAGS_MASK); needsMerge++; break; default: throw new RuntimeException("Invalid rc " + rc); } if ((rc & FLAG_VM_SPECIFIC) != 0) { diffVmSpecific++; } if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { diffClasspathBugfix++; } if ((rc & FLAG_NATIVE) != 0) { diffNative++; } if ((rc & FLAG_JNODE) != 0) { diffJNode++; } // Let's compare them } } // Package diffs for (Map.Entry<String, String> entry : packageDiffs.entrySet()) { final String pkg = entry.getKey(); final String diff = entry.getValue(); final String diffFileName = pkg + ".pkgdiff"; processPackageDiff(diffFileName, pkg, diff); reportPackageDiff(out, pkg, diffFileName, getFlags(diff)); } out.println("</table><p/>"); // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { out.println("Found " + missingInCp + " files missing in classpath</br>"); log("Found " + missingInCp + " files missing in classpath"); } if (missingInVm > 0) { out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { out.println("Found " + vmSpecific + " VM specific files<br/>"); log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { out.println("Found " + diffClasspathBugfix + " local classpath bugfixes<br/>"); log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } reportFooter(out); out.flush(); out.close(); } catch (IOException ex) { throw new BuildException(ex); } catch (InterruptedException ex) { throw new BuildException(ex); } } |
reportClasspathBugs(outBugs, vmFile.getReportName(), vmFile .getTarget(), rc); | public void execute() { if (destDir == null) { throw new BuildException("The destdir attribute must be set"); } final Map<String, SourceFile> vmFiles = vmDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> classpathFiles = classpathDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs .scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); allFiles.addAll(classpathFiles.keySet()); try { destDir.mkdirs(); final File outFile = new File(destDir, "classpath-compare.html"); final PrintWriter out = new PrintWriter(new FileWriter(outFile)); reportHeader(out); int missingInCp = 0; int missingInVm = 0; int needsMerge = 0; int diffVmSpecific = 0; int diffClasspathBugfix = 0; int diffNative = 0; int diffJNode = 0; int vmSpecific = 0; for (String name : allFiles) { SourceFile cpFile = classpathFiles.get(name); final SourceFile vmFile = vmFiles.get(name); final SourceFile vmSpecificFile = vmSpecificFiles .get(name); if (vmSpecificFile != null) { // File is found as vm specific source reportVmSpecific(out, vmSpecificFile.getReportName(), "vm-specific"); vmSpecific++; } else if (vmFile == null) { // file is not found as vmspecific source, nor as vm source if (!cpFile.isIgnoreMissing()) { reportMissing(out, cpFile.getReportName(), "classpath", getFlags(cpFile)); missingInCp++; } } else if (cpFile == null) { // File is not found in classpath sources reportMissing(out, vmFile.getReportName(), "vm", 0); missingInVm++; } else { // We have both the classpath version and the vm version. cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); final String diffFileName = vmFile.getReportName() + ".diff"; int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { case NO_CHANGE: break; case NEEDS_MERGE: reportNeedsMerge(out, vmFile.getReportName(), vmFile .getTarget(), diffFileName, rc & FLAGS_MASK); needsMerge++; break; default: throw new RuntimeException("Invalid rc " + rc); } if ((rc & FLAG_VM_SPECIFIC) != 0) { diffVmSpecific++; } if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { diffClasspathBugfix++; } if ((rc & FLAG_NATIVE) != 0) { diffNative++; } if ((rc & FLAG_JNODE) != 0) { diffJNode++; } // Let's compare them } } // Package diffs for (Map.Entry<String, String> entry : packageDiffs.entrySet()) { final String pkg = entry.getKey(); final String diff = entry.getValue(); final String diffFileName = pkg + ".pkgdiff"; processPackageDiff(diffFileName, pkg, diff); reportPackageDiff(out, pkg, diffFileName, getFlags(diff)); } out.println("</table><p/>"); // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { out.println("Found " + missingInCp + " files missing in classpath</br>"); log("Found " + missingInCp + " files missing in classpath"); } if (missingInVm > 0) { out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { out.println("Found " + vmSpecific + " VM specific files<br/>"); log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { out.println("Found " + diffClasspathBugfix + " local classpath bugfixes<br/>"); log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } reportFooter(out); out.flush(); out.close(); } catch (IOException ex) { throw new BuildException(ex); } catch (InterruptedException ex) { throw new BuildException(ex); } } |
|
+ " local classpath bugfixes<br/>"); | + " local <a href=\"classpath-bugfix.html\">classpath bugfixes</a><br/>"); | public void execute() { if (destDir == null) { throw new BuildException("The destdir attribute must be set"); } final Map<String, SourceFile> vmFiles = vmDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> classpathFiles = classpathDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs .scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); allFiles.addAll(classpathFiles.keySet()); try { destDir.mkdirs(); final File outFile = new File(destDir, "classpath-compare.html"); final PrintWriter out = new PrintWriter(new FileWriter(outFile)); reportHeader(out); int missingInCp = 0; int missingInVm = 0; int needsMerge = 0; int diffVmSpecific = 0; int diffClasspathBugfix = 0; int diffNative = 0; int diffJNode = 0; int vmSpecific = 0; for (String name : allFiles) { SourceFile cpFile = classpathFiles.get(name); final SourceFile vmFile = vmFiles.get(name); final SourceFile vmSpecificFile = vmSpecificFiles .get(name); if (vmSpecificFile != null) { // File is found as vm specific source reportVmSpecific(out, vmSpecificFile.getReportName(), "vm-specific"); vmSpecific++; } else if (vmFile == null) { // file is not found as vmspecific source, nor as vm source if (!cpFile.isIgnoreMissing()) { reportMissing(out, cpFile.getReportName(), "classpath", getFlags(cpFile)); missingInCp++; } } else if (cpFile == null) { // File is not found in classpath sources reportMissing(out, vmFile.getReportName(), "vm", 0); missingInVm++; } else { // We have both the classpath version and the vm version. cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); final String diffFileName = vmFile.getReportName() + ".diff"; int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { case NO_CHANGE: break; case NEEDS_MERGE: reportNeedsMerge(out, vmFile.getReportName(), vmFile .getTarget(), diffFileName, rc & FLAGS_MASK); needsMerge++; break; default: throw new RuntimeException("Invalid rc " + rc); } if ((rc & FLAG_VM_SPECIFIC) != 0) { diffVmSpecific++; } if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { diffClasspathBugfix++; } if ((rc & FLAG_NATIVE) != 0) { diffNative++; } if ((rc & FLAG_JNODE) != 0) { diffJNode++; } // Let's compare them } } // Package diffs for (Map.Entry<String, String> entry : packageDiffs.entrySet()) { final String pkg = entry.getKey(); final String diff = entry.getValue(); final String diffFileName = pkg + ".pkgdiff"; processPackageDiff(diffFileName, pkg, diff); reportPackageDiff(out, pkg, diffFileName, getFlags(diff)); } out.println("</table><p/>"); // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { out.println("Found " + missingInCp + " files missing in classpath</br>"); log("Found " + missingInCp + " files missing in classpath"); } if (missingInVm > 0) { out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { out.println("Found " + vmSpecific + " VM specific files<br/>"); log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { out.println("Found " + diffClasspathBugfix + " local classpath bugfixes<br/>"); log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } reportFooter(out); out.flush(); out.close(); } catch (IOException ex) { throw new BuildException(ex); } catch (InterruptedException ex) { throw new BuildException(ex); } } |
reportFooter(outBugs); outBugs.flush(); outBugs.close(); | public void execute() { if (destDir == null) { throw new BuildException("The destdir attribute must be set"); } final Map<String, SourceFile> vmFiles = vmDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> classpathFiles = classpathDirs .scanJavaFiles(getProject()); final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs .scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); allFiles.addAll(classpathFiles.keySet()); try { destDir.mkdirs(); final File outFile = new File(destDir, "classpath-compare.html"); final PrintWriter out = new PrintWriter(new FileWriter(outFile)); reportHeader(out); int missingInCp = 0; int missingInVm = 0; int needsMerge = 0; int diffVmSpecific = 0; int diffClasspathBugfix = 0; int diffNative = 0; int diffJNode = 0; int vmSpecific = 0; for (String name : allFiles) { SourceFile cpFile = classpathFiles.get(name); final SourceFile vmFile = vmFiles.get(name); final SourceFile vmSpecificFile = vmSpecificFiles .get(name); if (vmSpecificFile != null) { // File is found as vm specific source reportVmSpecific(out, vmSpecificFile.getReportName(), "vm-specific"); vmSpecific++; } else if (vmFile == null) { // file is not found as vmspecific source, nor as vm source if (!cpFile.isIgnoreMissing()) { reportMissing(out, cpFile.getReportName(), "classpath", getFlags(cpFile)); missingInCp++; } } else if (cpFile == null) { // File is not found in classpath sources reportMissing(out, vmFile.getReportName(), "vm", 0); missingInVm++; } else { // We have both the classpath version and the vm version. cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); final String diffFileName = vmFile.getReportName() + ".diff"; int rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); switch (rc & ~FLAGS_MASK) { case NO_CHANGE: break; case NEEDS_MERGE: reportNeedsMerge(out, vmFile.getReportName(), vmFile .getTarget(), diffFileName, rc & FLAGS_MASK); needsMerge++; break; default: throw new RuntimeException("Invalid rc " + rc); } if ((rc & FLAG_VM_SPECIFIC) != 0) { diffVmSpecific++; } if ((rc & FLAG_CLASSPATH_BUGFIX) != 0) { diffClasspathBugfix++; } if ((rc & FLAG_NATIVE) != 0) { diffNative++; } if ((rc & FLAG_JNODE) != 0) { diffJNode++; } // Let's compare them } } // Package diffs for (Map.Entry<String, String> entry : packageDiffs.entrySet()) { final String pkg = entry.getKey(); final String diff = entry.getValue(); final String diffFileName = pkg + ".pkgdiff"; processPackageDiff(diffFileName, pkg, diff); reportPackageDiff(out, pkg, diffFileName, getFlags(diff)); } out.println("</table><p/>"); // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { out.println("Found " + missingInCp + " files missing in classpath</br>"); log("Found " + missingInCp + " files missing in classpath"); } if (missingInVm > 0) { out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { out.println("Found " + vmSpecific + " VM specific files<br/>"); log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { out.println("Found " + diffClasspathBugfix + " local classpath bugfixes<br/>"); log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } reportFooter(out); out.flush(); out.close(); } catch (IOException ex) { throw new BuildException(ex); } catch (InterruptedException ex) { throw new BuildException(ex); } } |
|
protected int getFlags(String code) { int flags = 0; if (code.indexOf("native") >= 0) { flags |= FLAG_NATIVE; } if (code.toLowerCase().indexOf("jnode") >= 0) { flags |= FLAG_JNODE; } if (code.indexOf(vmSpecificTag) >= 0) { flags |= FLAG_VM_SPECIFIC; } if (code.indexOf(classpathBugfixTag) >= 0) { flags |= FLAG_CLASSPATH_BUGFIX; } | protected Flags getFlags(String code) { final Flags flags = new Flags(); getFlags(code, flags); | protected int getFlags(String code) { int flags = 0; if (code.indexOf("native") >= 0) { flags |= FLAG_NATIVE; } if (code.toLowerCase().indexOf("jnode") >= 0) { flags |= FLAG_JNODE; } if (code.indexOf(vmSpecificTag) >= 0) { flags |= FLAG_VM_SPECIFIC; } if (code.indexOf(classpathBugfixTag) >= 0) { flags |= FLAG_CLASSPATH_BUGFIX; } return flags; } |
protected void reportFlags(PrintWriter out, int flags) { | protected void reportFlags(PrintWriter out, Flags flags) { | protected void reportFlags(PrintWriter out, int flags) { final StringBuffer b = new StringBuffer(); if ((flags & FLAG_TARGET_DIFF) != 0) { if (b.length() > 0) { b.append(", "); } b.append("different target"); } if ((flags & FLAG_VM_SPECIFIC) != 0) { if (b.length() > 0) { b.append(", "); } b.append("vm-specific"); } if ((flags & FLAG_CLASSPATH_BUGFIX) != 0) { if (b.length() > 0) { b.append(", "); } b.append("cp-bugfix"); } if ((flags & FLAG_NATIVE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("native"); } if ((flags & FLAG_JNODE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("jnode"); } if (b.length() > 0) { out.println(" <i>("); out.println(b.toString()); out.println(")</i>"); } } |
if ((flags & FLAG_TARGET_DIFF) != 0) { | if (flags.isSet(FLAG_TARGET_DIFF)) { | protected void reportFlags(PrintWriter out, int flags) { final StringBuffer b = new StringBuffer(); if ((flags & FLAG_TARGET_DIFF) != 0) { if (b.length() > 0) { b.append(", "); } b.append("different target"); } if ((flags & FLAG_VM_SPECIFIC) != 0) { if (b.length() > 0) { b.append(", "); } b.append("vm-specific"); } if ((flags & FLAG_CLASSPATH_BUGFIX) != 0) { if (b.length() > 0) { b.append(", "); } b.append("cp-bugfix"); } if ((flags & FLAG_NATIVE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("native"); } if ((flags & FLAG_JNODE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("jnode"); } if (b.length() > 0) { out.println(" <i>("); out.println(b.toString()); out.println(")</i>"); } } |
if ((flags & FLAG_VM_SPECIFIC) != 0) { | if (flags.isSet(FLAG_VM_SPECIFIC)) { | protected void reportFlags(PrintWriter out, int flags) { final StringBuffer b = new StringBuffer(); if ((flags & FLAG_TARGET_DIFF) != 0) { if (b.length() > 0) { b.append(", "); } b.append("different target"); } if ((flags & FLAG_VM_SPECIFIC) != 0) { if (b.length() > 0) { b.append(", "); } b.append("vm-specific"); } if ((flags & FLAG_CLASSPATH_BUGFIX) != 0) { if (b.length() > 0) { b.append(", "); } b.append("cp-bugfix"); } if ((flags & FLAG_NATIVE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("native"); } if ((flags & FLAG_JNODE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("jnode"); } if (b.length() > 0) { out.println(" <i>("); out.println(b.toString()); out.println(")</i>"); } } |
if ((flags & FLAG_CLASSPATH_BUGFIX) != 0) { | if (flags.isSet(FLAG_CLASSPATH_BUGFIX)) { | protected void reportFlags(PrintWriter out, int flags) { final StringBuffer b = new StringBuffer(); if ((flags & FLAG_TARGET_DIFF) != 0) { if (b.length() > 0) { b.append(", "); } b.append("different target"); } if ((flags & FLAG_VM_SPECIFIC) != 0) { if (b.length() > 0) { b.append(", "); } b.append("vm-specific"); } if ((flags & FLAG_CLASSPATH_BUGFIX) != 0) { if (b.length() > 0) { b.append(", "); } b.append("cp-bugfix"); } if ((flags & FLAG_NATIVE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("native"); } if ((flags & FLAG_JNODE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("jnode"); } if (b.length() > 0) { out.println(" <i>("); out.println(b.toString()); out.println(")</i>"); } } |
if ((flags & FLAG_NATIVE) != 0) { | if (flags.isSet(FLAG_NATIVE)) { | protected void reportFlags(PrintWriter out, int flags) { final StringBuffer b = new StringBuffer(); if ((flags & FLAG_TARGET_DIFF) != 0) { if (b.length() > 0) { b.append(", "); } b.append("different target"); } if ((flags & FLAG_VM_SPECIFIC) != 0) { if (b.length() > 0) { b.append(", "); } b.append("vm-specific"); } if ((flags & FLAG_CLASSPATH_BUGFIX) != 0) { if (b.length() > 0) { b.append(", "); } b.append("cp-bugfix"); } if ((flags & FLAG_NATIVE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("native"); } if ((flags & FLAG_JNODE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("jnode"); } if (b.length() > 0) { out.println(" <i>("); out.println(b.toString()); out.println(")</i>"); } } |
if ((flags & FLAG_JNODE) != 0) { | if (flags.isSet(FLAG_JNODE)) { | protected void reportFlags(PrintWriter out, int flags) { final StringBuffer b = new StringBuffer(); if ((flags & FLAG_TARGET_DIFF) != 0) { if (b.length() > 0) { b.append(", "); } b.append("different target"); } if ((flags & FLAG_VM_SPECIFIC) != 0) { if (b.length() > 0) { b.append(", "); } b.append("vm-specific"); } if ((flags & FLAG_CLASSPATH_BUGFIX) != 0) { if (b.length() > 0) { b.append(", "); } b.append("cp-bugfix"); } if ((flags & FLAG_NATIVE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("native"); } if ((flags & FLAG_JNODE) != 0) { if (b.length() > 0) { b.append(", "); } b.append("jnode"); } if (b.length() > 0) { out.println(" <i>("); out.println(b.toString()); out.println(")</i>"); } } |
protected void reportHeader(PrintWriter out) { | protected void reportHeader(PrintWriter out, String... headers) { | protected void reportHeader(PrintWriter out) { out.println("<html>"); out.println("<title>Classpath compare</title>"); out.println("<style type='text/css'>"); out.println(".classpath-only { background-color: #FFFFAA; }"); out.println(".vm-only { background-color: #CCCCFF; }"); out.println(".needsmerge { background-color: #FF9090; }"); out.println(".vm-specific { background-color: #119911; }"); out.println(".vm-specific-source { background-color: #22FF22; }"); out.println(".classpath-bugfix { background-color: #CCFFCC; }"); out.println("</style>"); out.println("<body>"); out.println("<h1>Classpath compare results</h1>"); out.println("Created at " + new Date()); out.println("<table border='1' width='100%' style='border: solid 1'>"); out.println("<tr>"); out.println("<th align='left'>Class</th>"); out.println("<th align='left'>Target</th>"); out.println("<th align='left'>Merge status</th>"); out.println("</tr>"); out.flush(); } |
out.println("<th align='left'>Class</th>"); out.println("<th align='left'>Target</th>"); out.println("<th align='left'>Merge status</th>"); | for(String header : headers) { out.println("<th align='left'>"+header+"</th>"); } | protected void reportHeader(PrintWriter out) { out.println("<html>"); out.println("<title>Classpath compare</title>"); out.println("<style type='text/css'>"); out.println(".classpath-only { background-color: #FFFFAA; }"); out.println(".vm-only { background-color: #CCCCFF; }"); out.println(".needsmerge { background-color: #FF9090; }"); out.println(".vm-specific { background-color: #119911; }"); out.println(".vm-specific-source { background-color: #22FF22; }"); out.println(".classpath-bugfix { background-color: #CCFFCC; }"); out.println("</style>"); out.println("<body>"); out.println("<h1>Classpath compare results</h1>"); out.println("Created at " + new Date()); out.println("<table border='1' width='100%' style='border: solid 1'>"); out.println("<tr>"); out.println("<th align='left'>Class</th>"); out.println("<th align='left'>Target</th>"); out.println("<th align='left'>Merge status</th>"); out.println("</tr>"); out.flush(); } |
String existsIn, int flags) { | String existsIn, Flags flags) { | protected void reportMissing(PrintWriter out, String fname, String existsIn, int flags) { out.println("<tr class='" + existsIn + "-only'>"); out.println("<td>" + fname + "</td>"); out.println("<td> </td>"); out.println("<td>Exists only in " + existsIn); reportFlags(out, flags); out.println("</td>"); out.println("</tr>"); out.flush(); } |
String target, String diffFileName, int flags) { out.println("<tr class='" + flagsToStyleClass(flags) + "'>"); | String target, String diffFileName, Flags flags) { out.println("<tr class='" + flagsToStyleClass(flags.asInt()) + "'>"); | protected void reportNeedsMerge(PrintWriter out, String fname, String target, String diffFileName, int flags) { out.println("<tr class='" + flagsToStyleClass(flags) + "'>"); out.println("<td>" + fname + "</td>"); if (target.equals(TargetedFileSet.DEFAULT_TARGET)) { target = " "; } out.println("<td>" + target + "</td>"); out.println("<td><a href='" + diffFileName + "'>Diff</a>"); reportFlags(out, flags); out.println("</td>"); out.println("</tr>"); out.flush(); } |
String diffFileName, int flags) { | String diffFileName, Flags flags) { | protected void reportPackageDiff(PrintWriter out, String pkg, String diffFileName, int flags) { out.println("<tr class='needsmerge'>"); out.println("<td>" + pkg + "</td>"); out.println("<td> </td>"); out.println("<td><a href='" + diffFileName + "'>diff</a>"); reportFlags(out, flags); out.println("</td>"); out.println("</tr>"); out.flush(); } |
protected int runDiff(SourceFile vmFile, SourceFile cpFile, | protected Flags runDiff(SourceFile vmFile, SourceFile cpFile, | protected int runDiff(SourceFile vmFile, SourceFile cpFile, String diffFileName, Map<String, String> packageDiffs) throws IOException, InterruptedException { final String[] cmd = { "diff", "-b", // Ignore white space change "-au", "-I", ".*$" + "Id:.*$.*", // Avoid cvs keyword // expansion in this string vmFile.getFileName(), cpFile.getFile().getAbsolutePath() }; final ByteArrayOutputStream out = new ByteArrayOutputStream(); final ByteArrayOutputStream err = new ByteArrayOutputStream(); final PumpStreamHandler streamHandler = new PumpStreamHandler(out, err); final Execute exe = new Execute(streamHandler); exe.setCommandline(cmd); exe.setWorkingDirectory(vmFile.getBaseDir()); final int rc = exe.execute(); if (rc != 0) { File diffFile = new File(destDir, diffFileName); FileOutputStream os = new FileOutputStream(diffFile); try { final byte[] diff = out.toByteArray(); os.write(diff); os.flush(); final String diffStr = new String(diff); final String pkg = vmFile.getPackageName(); String pkgDiff; if (packageDiffs.containsKey(pkg)) { pkgDiff = packageDiffs.get(pkg); pkgDiff = pkgDiff + "diff\n" + diffStr; } else { pkgDiff = diffStr; } packageDiffs.put(pkg, pkgDiff); int flags = getFlags(diffStr); if (!vmFile.getTarget().equals(cpFile.getTarget())) { flags |= FLAG_TARGET_DIFF; } return flags | NEEDS_MERGE; } finally { os.close(); } } else { return NO_CHANGE; } } |
final String[] cmd = { "diff", "-b", | final String[] cmd = { "diff", "-E", "-w", "-B", "-N", | protected int runDiff(SourceFile vmFile, SourceFile cpFile, String diffFileName, Map<String, String> packageDiffs) throws IOException, InterruptedException { final String[] cmd = { "diff", "-b", // Ignore white space change "-au", "-I", ".*$" + "Id:.*$.*", // Avoid cvs keyword // expansion in this string vmFile.getFileName(), cpFile.getFile().getAbsolutePath() }; final ByteArrayOutputStream out = new ByteArrayOutputStream(); final ByteArrayOutputStream err = new ByteArrayOutputStream(); final PumpStreamHandler streamHandler = new PumpStreamHandler(out, err); final Execute exe = new Execute(streamHandler); exe.setCommandline(cmd); exe.setWorkingDirectory(vmFile.getBaseDir()); final int rc = exe.execute(); if (rc != 0) { File diffFile = new File(destDir, diffFileName); FileOutputStream os = new FileOutputStream(diffFile); try { final byte[] diff = out.toByteArray(); os.write(diff); os.flush(); final String diffStr = new String(diff); final String pkg = vmFile.getPackageName(); String pkgDiff; if (packageDiffs.containsKey(pkg)) { pkgDiff = packageDiffs.get(pkg); pkgDiff = pkgDiff + "diff\n" + diffStr; } else { pkgDiff = diffStr; } packageDiffs.put(pkg, pkgDiff); int flags = getFlags(diffStr); if (!vmFile.getTarget().equals(cpFile.getTarget())) { flags |= FLAG_TARGET_DIFF; } return flags | NEEDS_MERGE; } finally { os.close(); } } else { return NO_CHANGE; } } |
int flags = getFlags(diffStr); | Flags flags = getFlags(diffStr); | protected int runDiff(SourceFile vmFile, SourceFile cpFile, String diffFileName, Map<String, String> packageDiffs) throws IOException, InterruptedException { final String[] cmd = { "diff", "-b", // Ignore white space change "-au", "-I", ".*$" + "Id:.*$.*", // Avoid cvs keyword // expansion in this string vmFile.getFileName(), cpFile.getFile().getAbsolutePath() }; final ByteArrayOutputStream out = new ByteArrayOutputStream(); final ByteArrayOutputStream err = new ByteArrayOutputStream(); final PumpStreamHandler streamHandler = new PumpStreamHandler(out, err); final Execute exe = new Execute(streamHandler); exe.setCommandline(cmd); exe.setWorkingDirectory(vmFile.getBaseDir()); final int rc = exe.execute(); if (rc != 0) { File diffFile = new File(destDir, diffFileName); FileOutputStream os = new FileOutputStream(diffFile); try { final byte[] diff = out.toByteArray(); os.write(diff); os.flush(); final String diffStr = new String(diff); final String pkg = vmFile.getPackageName(); String pkgDiff; if (packageDiffs.containsKey(pkg)) { pkgDiff = packageDiffs.get(pkg); pkgDiff = pkgDiff + "diff\n" + diffStr; } else { pkgDiff = diffStr; } packageDiffs.put(pkg, pkgDiff); int flags = getFlags(diffStr); if (!vmFile.getTarget().equals(cpFile.getTarget())) { flags |= FLAG_TARGET_DIFF; } return flags | NEEDS_MERGE; } finally { os.close(); } } else { return NO_CHANGE; } } |
flags |= FLAG_TARGET_DIFF; | flags.set(FLAG_TARGET_DIFF); | protected int runDiff(SourceFile vmFile, SourceFile cpFile, String diffFileName, Map<String, String> packageDiffs) throws IOException, InterruptedException { final String[] cmd = { "diff", "-b", // Ignore white space change "-au", "-I", ".*$" + "Id:.*$.*", // Avoid cvs keyword // expansion in this string vmFile.getFileName(), cpFile.getFile().getAbsolutePath() }; final ByteArrayOutputStream out = new ByteArrayOutputStream(); final ByteArrayOutputStream err = new ByteArrayOutputStream(); final PumpStreamHandler streamHandler = new PumpStreamHandler(out, err); final Execute exe = new Execute(streamHandler); exe.setCommandline(cmd); exe.setWorkingDirectory(vmFile.getBaseDir()); final int rc = exe.execute(); if (rc != 0) { File diffFile = new File(destDir, diffFileName); FileOutputStream os = new FileOutputStream(diffFile); try { final byte[] diff = out.toByteArray(); os.write(diff); os.flush(); final String diffStr = new String(diff); final String pkg = vmFile.getPackageName(); String pkgDiff; if (packageDiffs.containsKey(pkg)) { pkgDiff = packageDiffs.get(pkg); pkgDiff = pkgDiff + "diff\n" + diffStr; } else { pkgDiff = diffStr; } packageDiffs.put(pkg, pkgDiff); int flags = getFlags(diffStr); if (!vmFile.getTarget().equals(cpFile.getTarget())) { flags |= FLAG_TARGET_DIFF; } return flags | NEEDS_MERGE; } finally { os.close(); } } else { return NO_CHANGE; } } |
return flags | NEEDS_MERGE; | flags.set(NEEDS_MERGE); return flags; | protected int runDiff(SourceFile vmFile, SourceFile cpFile, String diffFileName, Map<String, String> packageDiffs) throws IOException, InterruptedException { final String[] cmd = { "diff", "-b", // Ignore white space change "-au", "-I", ".*$" + "Id:.*$.*", // Avoid cvs keyword // expansion in this string vmFile.getFileName(), cpFile.getFile().getAbsolutePath() }; final ByteArrayOutputStream out = new ByteArrayOutputStream(); final ByteArrayOutputStream err = new ByteArrayOutputStream(); final PumpStreamHandler streamHandler = new PumpStreamHandler(out, err); final Execute exe = new Execute(streamHandler); exe.setCommandline(cmd); exe.setWorkingDirectory(vmFile.getBaseDir()); final int rc = exe.execute(); if (rc != 0) { File diffFile = new File(destDir, diffFileName); FileOutputStream os = new FileOutputStream(diffFile); try { final byte[] diff = out.toByteArray(); os.write(diff); os.flush(); final String diffStr = new String(diff); final String pkg = vmFile.getPackageName(); String pkgDiff; if (packageDiffs.containsKey(pkg)) { pkgDiff = packageDiffs.get(pkg); pkgDiff = pkgDiff + "diff\n" + diffStr; } else { pkgDiff = diffStr; } packageDiffs.put(pkg, pkgDiff); int flags = getFlags(diffStr); if (!vmFile.getTarget().equals(cpFile.getTarget())) { flags |= FLAG_TARGET_DIFF; } return flags | NEEDS_MERGE; } finally { os.close(); } } else { return NO_CHANGE; } } |
return NO_CHANGE; | return new Flags(NO_CHANGE); | protected int runDiff(SourceFile vmFile, SourceFile cpFile, String diffFileName, Map<String, String> packageDiffs) throws IOException, InterruptedException { final String[] cmd = { "diff", "-b", // Ignore white space change "-au", "-I", ".*$" + "Id:.*$.*", // Avoid cvs keyword // expansion in this string vmFile.getFileName(), cpFile.getFile().getAbsolutePath() }; final ByteArrayOutputStream out = new ByteArrayOutputStream(); final ByteArrayOutputStream err = new ByteArrayOutputStream(); final PumpStreamHandler streamHandler = new PumpStreamHandler(out, err); final Execute exe = new Execute(streamHandler); exe.setCommandline(cmd); exe.setWorkingDirectory(vmFile.getBaseDir()); final int rc = exe.execute(); if (rc != 0) { File diffFile = new File(destDir, diffFileName); FileOutputStream os = new FileOutputStream(diffFile); try { final byte[] diff = out.toByteArray(); os.write(diff); os.flush(); final String diffStr = new String(diff); final String pkg = vmFile.getPackageName(); String pkgDiff; if (packageDiffs.containsKey(pkg)) { pkgDiff = packageDiffs.get(pkg); pkgDiff = pkgDiff + "diff\n" + diffStr; } else { pkgDiff = diffStr; } packageDiffs.put(pkg, pkgDiff); int flags = getFlags(diffStr); if (!vmFile.getTarget().equals(cpFile.getTarget())) { flags |= FLAG_TARGET_DIFF; } return flags | NEEDS_MERGE; } finally { os.close(); } } else { return NO_CHANGE; } } |
log.warn("In constructor: ", e); | if (log == null) System.out.println(e.getMessage()); else log.warn("In constructor: ", e); | public void init() { try { jbInit(); } catch(Exception e) { log.warn("In constructor: ", e); } } |
if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); | private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); log.info(" We have loaded a new one"); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); loadSystemProperty("SESSION_CONNECT_USER"); loadSystemProperty("SESSION_CONNECT_PASSWORD"); loadSystemProperty("SESSION_CONNECT_PROGRAM"); loadSystemProperty("SESSION_CONNECT_LIBRARY"); loadSystemProperty("SESSION_CONNECT_MENU"); manager = new SessionManager(); final Session s = manager.openSession(sesProps,"","Test Applet"); this.getContentPane().add(s); s.connect(); SwingUtilities.invokeLater(new Runnable() { public void run() { s.grabFocus(); } }); } |
|
rawSchemeSpecificPart = getURIGroup(matcher, SCHEME_SPEC_PART_GROUP); | rawSchemeSpecificPart = matcher.group(SCHEME_SPEC_PART_GROUP); schemeSpecificPart = unquote(rawSchemeSpecificPart); if (!isOpaque()) { | private void parseURI(String str) throws URISyntaxException { Pattern pattern = Pattern.compile(URI_REGEXP); Matcher matcher = pattern.matcher(str); if (matcher.matches()) { scheme = getURIGroup(matcher, SCHEME_GROUP); rawSchemeSpecificPart = getURIGroup(matcher, SCHEME_SPEC_PART_GROUP); rawAuthority = getURIGroup(matcher, AUTHORITY_GROUP); rawPath = getURIGroup(matcher, PATH_GROUP); rawQuery = getURIGroup(matcher, QUERY_GROUP); rawFragment = getURIGroup(matcher, FRAGMENT_GROUP); } else throw new URISyntaxException(str, "doesn't match URI regular expression"); if (rawAuthority != null) { pattern = Pattern.compile(AUTHORITY_REGEXP); matcher = pattern.matcher(rawAuthority); if (matcher.matches()) { rawUserInfo = getURIGroup(matcher, AUTHORITY_USERINFO_GROUP); rawHost = getURIGroup(matcher, AUTHORITY_HOST_GROUP); String portStr = getURIGroup(matcher, AUTHORITY_PORT_GROUP); if (portStr != null) try { port = Integer.parseInt(portStr); } catch (NumberFormatException e) { URISyntaxException use = new URISyntaxException (str, "doesn't match URI regular expression"); use.initCause(e); throw use; } } else throw new URISyntaxException(str, "doesn't match URI regular expression"); } // We must eagerly unquote the parts, because this is the only time // we may throw an exception. schemeSpecificPart = unquote(rawSchemeSpecificPart); authority = unquote(rawAuthority); userInfo = unquote(rawUserInfo); host = unquote(rawHost); path = unquote(rawPath); query = unquote(rawQuery); fragment = unquote(rawFragment); } |
rawPath = getURIGroup(matcher, PATH_GROUP); | rawPath = matcher.group(PATH_GROUP); | private void parseURI(String str) throws URISyntaxException { Pattern pattern = Pattern.compile(URI_REGEXP); Matcher matcher = pattern.matcher(str); if (matcher.matches()) { scheme = getURIGroup(matcher, SCHEME_GROUP); rawSchemeSpecificPart = getURIGroup(matcher, SCHEME_SPEC_PART_GROUP); rawAuthority = getURIGroup(matcher, AUTHORITY_GROUP); rawPath = getURIGroup(matcher, PATH_GROUP); rawQuery = getURIGroup(matcher, QUERY_GROUP); rawFragment = getURIGroup(matcher, FRAGMENT_GROUP); } else throw new URISyntaxException(str, "doesn't match URI regular expression"); if (rawAuthority != null) { pattern = Pattern.compile(AUTHORITY_REGEXP); matcher = pattern.matcher(rawAuthority); if (matcher.matches()) { rawUserInfo = getURIGroup(matcher, AUTHORITY_USERINFO_GROUP); rawHost = getURIGroup(matcher, AUTHORITY_HOST_GROUP); String portStr = getURIGroup(matcher, AUTHORITY_PORT_GROUP); if (portStr != null) try { port = Integer.parseInt(portStr); } catch (NumberFormatException e) { URISyntaxException use = new URISyntaxException (str, "doesn't match URI regular expression"); use.initCause(e); throw use; } } else throw new URISyntaxException(str, "doesn't match URI regular expression"); } // We must eagerly unquote the parts, because this is the only time // we may throw an exception. schemeSpecificPart = unquote(rawSchemeSpecificPart); authority = unquote(rawAuthority); userInfo = unquote(rawUserInfo); host = unquote(rawHost); path = unquote(rawPath); query = unquote(rawQuery); fragment = unquote(rawFragment); } |
schemeSpecificPart = unquote(rawSchemeSpecificPart); | private void parseURI(String str) throws URISyntaxException { Pattern pattern = Pattern.compile(URI_REGEXP); Matcher matcher = pattern.matcher(str); if (matcher.matches()) { scheme = getURIGroup(matcher, SCHEME_GROUP); rawSchemeSpecificPart = getURIGroup(matcher, SCHEME_SPEC_PART_GROUP); rawAuthority = getURIGroup(matcher, AUTHORITY_GROUP); rawPath = getURIGroup(matcher, PATH_GROUP); rawQuery = getURIGroup(matcher, QUERY_GROUP); rawFragment = getURIGroup(matcher, FRAGMENT_GROUP); } else throw new URISyntaxException(str, "doesn't match URI regular expression"); if (rawAuthority != null) { pattern = Pattern.compile(AUTHORITY_REGEXP); matcher = pattern.matcher(rawAuthority); if (matcher.matches()) { rawUserInfo = getURIGroup(matcher, AUTHORITY_USERINFO_GROUP); rawHost = getURIGroup(matcher, AUTHORITY_HOST_GROUP); String portStr = getURIGroup(matcher, AUTHORITY_PORT_GROUP); if (portStr != null) try { port = Integer.parseInt(portStr); } catch (NumberFormatException e) { URISyntaxException use = new URISyntaxException (str, "doesn't match URI regular expression"); use.initCause(e); throw use; } } else throw new URISyntaxException(str, "doesn't match URI regular expression"); } // We must eagerly unquote the parts, because this is the only time // we may throw an exception. schemeSpecificPart = unquote(rawSchemeSpecificPart); authority = unquote(rawAuthority); userInfo = unquote(rawUserInfo); host = unquote(rawHost); path = unquote(rawPath); query = unquote(rawQuery); fragment = unquote(rawFragment); } |
|
+ (getRawAuthority() == null ? "" : " + (getRawPath() == null ? "" : getRawPath()) + (getRawQuery() == null ? "" : "?" + getRawQuery()) | + getRawSchemeSpecificPart() | public String toString() { return (getScheme() == null ? "" : getScheme() + ":") + (getRawAuthority() == null ? "" : "//" + getRawAuthority()) + (getRawPath() == null ? "" : getRawPath()) + (getRawQuery() == null ? "" : "?" + getRawQuery()) + (getRawFragment() == null ? "" : "#" + getRawFragment()); } |
super("JFrame"); | super(""); | public JFrame() { super("JFrame"); frameInit(); } |
return close_action; | return closeAction; | public int getDefaultCloseOperation() { return close_action; } |
return "JFrame"; | StringBuffer sb = new StringBuffer(super.paramString()); sb.append(",defaultCloseOperation="); sb.append(SwingUtilities.convertWindowConstantToString( getDefaultCloseOperation())); sb.append(",rootPane="); if (rootPane != null) sb.append(rootPane); sb.append(",rootPaneCheckingEnabled=").append(rootPaneCheckingEnabled); return sb.toString(); | protected String paramString() { return "JFrame"; } |
switch (close_action) | switch (closeAction) | protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); switch (e.getID()) { case WindowEvent.WINDOW_CLOSING: { switch (close_action) { case EXIT_ON_CLOSE: { System.exit(0); break; } case DISPOSE_ON_CLOSE: { dispose(); break; } case HIDE_ON_CLOSE: { setVisible(false); break; } case DO_NOTHING_ON_CLOSE: break; } break; } case WindowEvent.WINDOW_CLOSED: case WindowEvent.WINDOW_OPENED: case WindowEvent.WINDOW_ICONIFIED: case WindowEvent.WINDOW_DEICONIFIED: case WindowEvent.WINDOW_ACTIVATED: case WindowEvent.WINDOW_DEACTIVATED: break; } } |
throw new IllegalArgumentException("defaultCloseOperation must be EXIT_ON_CLOSE, HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or DO_NOTHING_ON_CLOSE"); | throw new IllegalArgumentException("operation must be EXIT_ON_CLOSE, " + "HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or DO_NOTHING_ON_CLOSE"); | public void setDefaultCloseOperation(int operation) { SecurityManager sm = System.getSecurityManager(); if (sm != null && operation == EXIT_ON_CLOSE) sm.checkExit(0); if (operation != EXIT_ON_CLOSE && operation != DISPOSE_ON_CLOSE && operation != HIDE_ON_CLOSE && operation != DO_NOTHING_ON_CLOSE) throw new IllegalArgumentException("defaultCloseOperation must be EXIT_ON_CLOSE, HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or DO_NOTHING_ON_CLOSE"); close_action = operation; } |
close_action = operation; | closeAction = operation; | public void setDefaultCloseOperation(int operation) { SecurityManager sm = System.getSecurityManager(); if (sm != null && operation == EXIT_ON_CLOSE) sm.checkExit(0); if (operation != EXIT_ON_CLOSE && operation != DISPOSE_ON_CLOSE && operation != HIDE_ON_CLOSE && operation != DO_NOTHING_ON_CLOSE) throw new IllegalArgumentException("defaultCloseOperation must be EXIT_ON_CLOSE, HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or DO_NOTHING_ON_CLOSE"); close_action = operation; } |
boolean result = false; switch (numChildren) | boolean result = true; for (int i = 0; i < numChildren; ++i) | public boolean isOptimizedDrawingEnabled() { int numChildren = getComponentCount(); boolean result = false; // We implement a heuristic here in order to return a quick result: // - For 0 or 1 children it is clear that they do not overlap, return true. // - For 2 children we check their bounding rectangles and if they don't // interect, return true. // - For more than 2 children we return false. Comparing all the bounding // rectangles costs too much time and in most cases this will return // false anyway, since JLayeredPane are mostly used in JRootPane and then // have at least one child (the contentPane) that takes up the whole // area of the JLayeredPane. switch (numChildren) { case 0: case 1: result = true; break; case 2: Rectangle r1 = getComponent(0).getBounds(); Rectangle r2 = getComponent(1).getBounds(); result = !r1.intersects(r2); break; default: result = false; } return result; } |
case 0: case 1: result = true; | Component c1 = getComponent(i); if (! c1.isVisible()) continue; Rectangle r1 = c1.getBounds(); if (r1.isEmpty()) continue; for (int j = i + 1; j < numChildren; ++j) { Component c2 = getComponent(j); if (! c2.isVisible()) continue; Rectangle r2 = c2.getBounds(); if (r2.isEmpty()) continue; if (r1.intersects(r2)) { result = false; | public boolean isOptimizedDrawingEnabled() { int numChildren = getComponentCount(); boolean result = false; // We implement a heuristic here in order to return a quick result: // - For 0 or 1 children it is clear that they do not overlap, return true. // - For 2 children we check their bounding rectangles and if they don't // interect, return true. // - For more than 2 children we return false. Comparing all the bounding // rectangles costs too much time and in most cases this will return // false anyway, since JLayeredPane are mostly used in JRootPane and then // have at least one child (the contentPane) that takes up the whole // area of the JLayeredPane. switch (numChildren) { case 0: case 1: result = true; break; case 2: Rectangle r1 = getComponent(0).getBounds(); Rectangle r2 = getComponent(1).getBounds(); result = !r1.intersects(r2); break; default: result = false; } return result; } |
case 2: Rectangle r1 = getComponent(0).getBounds(); Rectangle r2 = getComponent(1).getBounds(); result = !r1.intersects(r2); | } if (result == false) | public boolean isOptimizedDrawingEnabled() { int numChildren = getComponentCount(); boolean result = false; // We implement a heuristic here in order to return a quick result: // - For 0 or 1 children it is clear that they do not overlap, return true. // - For 2 children we check their bounding rectangles and if they don't // interect, return true. // - For more than 2 children we return false. Comparing all the bounding // rectangles costs too much time and in most cases this will return // false anyway, since JLayeredPane are mostly used in JRootPane and then // have at least one child (the contentPane) that takes up the whole // area of the JLayeredPane. switch (numChildren) { case 0: case 1: result = true; break; case 2: Rectangle r1 = getComponent(0).getBounds(); Rectangle r2 = getComponent(1).getBounds(); result = !r1.intersects(r2); break; default: result = false; } return result; } |
default: result = false; | } | public boolean isOptimizedDrawingEnabled() { int numChildren = getComponentCount(); boolean result = false; // We implement a heuristic here in order to return a quick result: // - For 0 or 1 children it is clear that they do not overlap, return true. // - For 2 children we check their bounding rectangles and if they don't // interect, return true. // - For more than 2 children we return false. Comparing all the bounding // rectangles costs too much time and in most cases this will return // false anyway, since JLayeredPane are mostly used in JRootPane and then // have at least one child (the contentPane) that takes up the whole // area of the JLayeredPane. switch (numChildren) { case 0: case 1: result = true; break; case 2: Rectangle r1 = getComponent(0).getBounds(); Rectangle r2 = getComponent(1).getBounds(); result = !r1.intersects(r2); break; default: result = false; } return result; } |
addCompileHighOptLevel("java.lang.isolate"); | protected void setupCompileHighOptLevelPackages() { addCompileHighOptLevel("java.io"); addCompileHighOptLevel("java.lang"); addCompileHighOptLevel("java.lang.ref"); addCompileHighOptLevel("java.lang.reflect"); addCompileHighOptLevel("java.net"); addCompileHighOptLevel("java.nio"); addCompileHighOptLevel("java.security"); addCompileHighOptLevel("java.util"); addCompileHighOptLevel("java.util.jar"); addCompileHighOptLevel("java.util.zip"); addCompileHighOptLevel("javax.naming"); addCompileHighOptLevel("gnu.classpath"); addCompileHighOptLevel("gnu.java.io"); addCompileHighOptLevel("gnu.java.io.decode"); addCompileHighOptLevel("gnu.java.io.encode"); addCompileHighOptLevel("gnu.java.lang"); addCompileHighOptLevel("gnu.java.lang.reflect"); addCompileHighOptLevel("org.jnode.assembler"); addCompileHighOptLevel("org.jnode.boot"); addCompileHighOptLevel("org.jnode.naming"); addCompileHighOptLevel("org.jnode.plugin"); addCompileHighOptLevel("org.jnode.plugin.manager"); addCompileHighOptLevel("org.jnode.plugin.model"); addCompileHighOptLevel("org.jnode.protocol.plugin"); addCompileHighOptLevel("org.jnode.protocol.system"); addCompileHighOptLevel("org.jnode.security"); addCompileHighOptLevel("org.jnode.system"); addCompileHighOptLevel("org.jnode.system.event"); addCompileHighOptLevel("org.jnode.system.util"); addCompileHighOptLevel("org.jnode.util"); addCompileHighOptLevel("org.jnode.vm"); addCompileHighOptLevel("org.jnode.vm.bytecode"); addCompileHighOptLevel("org.jnode.vm.classmgr"); addCompileHighOptLevel("org.jnode.vm.compiler"); addCompileHighOptLevel("org.jnode.vm.compiler.ir"); addCompileHighOptLevel("org.jnode.vm.compiler.ir.quad"); addCompileHighOptLevel("org.jnode.vm.memmgr"); addCompileHighOptLevel("org.jnode.vm.memmgr.def"); addCompileHighOptLevel("org.jnode.vm.memmgr.mmtk"); addCompileHighOptLevel("org.jnode.vm.memmgr.mmtk.genrc"); addCompileHighOptLevel("org.jnode.vm.memmgr.mmtk.nogc"); addCompileHighOptLevel("org.jnode.vm.memmgr.mmtk.ms"); addCompileHighOptLevel("org.mmtk.plan"); addCompileHighOptLevel("org.mmtk.policy"); addCompileHighOptLevel("org.mmtk.utility"); addCompileHighOptLevel("org.mmtk.utility.alloc"); addCompileHighOptLevel("org.mmtk.utility.deque"); addCompileHighOptLevel("org.mmtk.utility.gcspy"); addCompileHighOptLevel("org.mmtk.utility.gcspy.drivers"); addCompileHighOptLevel("org.mmtk.utility.heap"); addCompileHighOptLevel("org.mmtk.utility.options"); addCompileHighOptLevel("org.mmtk.utility.scan"); addCompileHighOptLevel("org.mmtk.utility.statistics"); addCompileHighOptLevel("org.mmtk.vm"); addCompileHighOptLevel("org.mmtk.vm.gcspy"); if (false) { addCompileHighOptLevel("java.awt"); addCompileHighOptLevel("java.awt.event"); addCompileHighOptLevel("java.awt.peer"); addCompileHighOptLevel("java.awt.font"); addCompileHighOptLevel("java.awt.geom"); addPreloadPackage("javax.swing"); addPreloadPackage("javax.swing.border"); addPreloadPackage("javax.swing.event"); addPreloadPackage("javax.swing.plaf"); addPreloadPackage("javax.swing.plaf.basic"); addPreloadPackage("javax.swing.plaf.metal"); } } |
|
alwaysEmpty = (min == 0 && max == 0); | RETokenRepeated(int subIndex, REToken token, int min, int max) { super(subIndex); this.token = token; this.min = min; this.max = max; alwaysEmpty = (min == 0 && max == 0); } |
|
for (REMatch m = recurrent; m != null; m = m.next) { m.matchFlags &= ~REMatch.MF_FIND_ALL; } | private static REMatch findDoables(REToken tk, CharIndexed input, REMatch mymatch) { REMatch.REMatchList doables = new REMatch.REMatchList(); // try next repeat at all possible positions for (REMatch current = mymatch; current != null; current = current.next) { REMatch recurrent = (REMatch) current.clone(); int origin = recurrent.index; tk = (REToken) tk.clone(); tk.next = tk.uncle = null; if (tk.match(input, recurrent)) { if (recurrent.index == origin) recurrent.empty = true; // add all items in current to doables array doables.addTail(recurrent); } } return doables.head; } |
|
REMatch newMatch = mymatch; | boolean match(CharIndexed input, REMatch mymatch) { // Possible positions for the next repeat to match at REMatch newMatch = mymatch; // {0} needs some special treatment. if (alwaysEmpty) { REMatch result = matchRest(input, newMatch); if (result != null) { mymatch.assignFrom(result); return true; } else { return false; } } // number of times we've matched so far int numRepeats = 0; REMatch doables; int lastIndex = mymatch.index; boolean emptyMatchFound = false; while (numRepeats < min) { doables = findDoables(token, input, newMatch); // if none of the possibilities worked out, // it means that minimum number of repeats could not be found. if (doables == null) return false; // reassign where the next repeat can match newMatch = doables; // increment how many repeats we've successfully found ++numRepeats; if (newMatch.empty) { numRepeats = min; emptyMatchFound = true; break; } lastIndex = newMatch.index; } Vector positions = new Vector(); while (numRepeats <= max) { // We want to check something like // if (stingy) // and neglect the further matching. But experience tells // such neglection may cause incomplete matching. // For example, if we neglect the seemingly unnecessay // matching, /^(b+?|a){1,2}?c/ cannot match "bbc". // On the other hand, if we do not stop the unnecessary // matching, /(([a-c])b*?\2)*/ matches "ababbbcbc" // entirely when we wan to find only "ababb". // In order to make regression tests pass, we do as we did. if (stopMatchingIfSatisfied && stingy) { REMatch results = matchRest(input, newMatch); if (results != null) { mymatch.assignFrom(results); return true; } } positions.add(newMatch); if (emptyMatchFound) break; doables = findDoables(token, input, newMatch); if (doables == null) break; // doables.index == lastIndex occurs either // (1) when an empty string was the longest // that matched this token. // or // (2) when the same string matches this token many times. // For example, "acbab" itself matches "a.*b" and // its substrings "acb" and "ab" also match. // In this case, we do not have to go further until // numRepeats == max because the more numRepeats grows, // the shorter the substring matching this token becomes. // So the previous succesful match must have bee the best // match. But this is not necessarily the case if stingy. if (doables.index == lastIndex) { if (doables.empty) { emptyMatchFound = true; } else { if (!stingy) break; } } numRepeats++; newMatch = doables; lastIndex = newMatch.index; } // We're greedy, but ease off until a true match is found. // At this point we've either got too many or just the right amount. // See if this numRepeats works with the rest of the regexp. REMatch.REMatchList allResults = new REMatch.REMatchList(); int posCount = positions.size(); int posIndex = (stingy ? 0 : posCount - 1); while (posCount-- > 0) { REMatch m = (REMatch) positions.elementAt(posIndex); if (stingy) posIndex++; else posIndex--; REMatch results = matchRest(input, m); if (results != null) { // Order these from longest to shortest // Start by assuming longest (more repeats) // If stingy the order is shortest to longest. allResults.addTail(results); } else { if (possessive) break; } } if (allResults.head != null) { mymatch.assignFrom(allResults.head); // does this get all? return true; } // If we fall out, no matches. return false; } |
|
if (alwaysEmpty) { REMatch result = matchRest(input, newMatch); if (result != null) { mymatch.assignFrom(result); | boolean stopMatchingIfSatisfied = (mymatch.matchFlags & REMatch.MF_FIND_ALL) == 0; REMatch newMatch = matchMinimum(input, mymatch); if (newMatch == null) return false; int[] visited = initVisited(); for (REMatch m = newMatch; m != null; m = m.next) { visited = addVisited(m.index, visited); } int max1 = decreaseMax(max, min); newMatch = _match(input, newMatch, max1, stopMatchingIfSatisfied, visited); if (newMatch != null) { mymatch.assignFrom(newMatch); | boolean match(CharIndexed input, REMatch mymatch) { // Possible positions for the next repeat to match at REMatch newMatch = mymatch; // {0} needs some special treatment. if (alwaysEmpty) { REMatch result = matchRest(input, newMatch); if (result != null) { mymatch.assignFrom(result); return true; } else { return false; } } // number of times we've matched so far int numRepeats = 0; REMatch doables; int lastIndex = mymatch.index; boolean emptyMatchFound = false; while (numRepeats < min) { doables = findDoables(token, input, newMatch); // if none of the possibilities worked out, // it means that minimum number of repeats could not be found. if (doables == null) return false; // reassign where the next repeat can match newMatch = doables; // increment how many repeats we've successfully found ++numRepeats; if (newMatch.empty) { numRepeats = min; emptyMatchFound = true; break; } lastIndex = newMatch.index; } Vector positions = new Vector(); while (numRepeats <= max) { // We want to check something like // if (stingy) // and neglect the further matching. But experience tells // such neglection may cause incomplete matching. // For example, if we neglect the seemingly unnecessay // matching, /^(b+?|a){1,2}?c/ cannot match "bbc". // On the other hand, if we do not stop the unnecessary // matching, /(([a-c])b*?\2)*/ matches "ababbbcbc" // entirely when we wan to find only "ababb". // In order to make regression tests pass, we do as we did. if (stopMatchingIfSatisfied && stingy) { REMatch results = matchRest(input, newMatch); if (results != null) { mymatch.assignFrom(results); return true; } } positions.add(newMatch); if (emptyMatchFound) break; doables = findDoables(token, input, newMatch); if (doables == null) break; // doables.index == lastIndex occurs either // (1) when an empty string was the longest // that matched this token. // or // (2) when the same string matches this token many times. // For example, "acbab" itself matches "a.*b" and // its substrings "acb" and "ab" also match. // In this case, we do not have to go further until // numRepeats == max because the more numRepeats grows, // the shorter the substring matching this token becomes. // So the previous succesful match must have bee the best // match. But this is not necessarily the case if stingy. if (doables.index == lastIndex) { if (doables.empty) { emptyMatchFound = true; } else { if (!stingy) break; } } numRepeats++; newMatch = doables; lastIndex = newMatch.index; } // We're greedy, but ease off until a true match is found. // At this point we've either got too many or just the right amount. // See if this numRepeats works with the rest of the regexp. REMatch.REMatchList allResults = new REMatch.REMatchList(); int posCount = positions.size(); int posIndex = (stingy ? 0 : posCount - 1); while (posCount-- > 0) { REMatch m = (REMatch) positions.elementAt(posIndex); if (stingy) posIndex++; else posIndex--; REMatch results = matchRest(input, m); if (results != null) { // Order these from longest to shortest // Start by assuming longest (more repeats) // If stingy the order is shortest to longest. allResults.addTail(results); } else { if (possessive) break; } } if (allResults.head != null) { mymatch.assignFrom(allResults.head); // does this get all? return true; } // If we fall out, no matches. return false; } |
else { | boolean match(CharIndexed input, REMatch mymatch) { // Possible positions for the next repeat to match at REMatch newMatch = mymatch; // {0} needs some special treatment. if (alwaysEmpty) { REMatch result = matchRest(input, newMatch); if (result != null) { mymatch.assignFrom(result); return true; } else { return false; } } // number of times we've matched so far int numRepeats = 0; REMatch doables; int lastIndex = mymatch.index; boolean emptyMatchFound = false; while (numRepeats < min) { doables = findDoables(token, input, newMatch); // if none of the possibilities worked out, // it means that minimum number of repeats could not be found. if (doables == null) return false; // reassign where the next repeat can match newMatch = doables; // increment how many repeats we've successfully found ++numRepeats; if (newMatch.empty) { numRepeats = min; emptyMatchFound = true; break; } lastIndex = newMatch.index; } Vector positions = new Vector(); while (numRepeats <= max) { // We want to check something like // if (stingy) // and neglect the further matching. But experience tells // such neglection may cause incomplete matching. // For example, if we neglect the seemingly unnecessay // matching, /^(b+?|a){1,2}?c/ cannot match "bbc". // On the other hand, if we do not stop the unnecessary // matching, /(([a-c])b*?\2)*/ matches "ababbbcbc" // entirely when we wan to find only "ababb". // In order to make regression tests pass, we do as we did. if (stopMatchingIfSatisfied && stingy) { REMatch results = matchRest(input, newMatch); if (results != null) { mymatch.assignFrom(results); return true; } } positions.add(newMatch); if (emptyMatchFound) break; doables = findDoables(token, input, newMatch); if (doables == null) break; // doables.index == lastIndex occurs either // (1) when an empty string was the longest // that matched this token. // or // (2) when the same string matches this token many times. // For example, "acbab" itself matches "a.*b" and // its substrings "acb" and "ab" also match. // In this case, we do not have to go further until // numRepeats == max because the more numRepeats grows, // the shorter the substring matching this token becomes. // So the previous succesful match must have bee the best // match. But this is not necessarily the case if stingy. if (doables.index == lastIndex) { if (doables.empty) { emptyMatchFound = true; } else { if (!stingy) break; } } numRepeats++; newMatch = doables; lastIndex = newMatch.index; } // We're greedy, but ease off until a true match is found. // At this point we've either got too many or just the right amount. // See if this numRepeats works with the rest of the regexp. REMatch.REMatchList allResults = new REMatch.REMatchList(); int posCount = positions.size(); int posIndex = (stingy ? 0 : posCount - 1); while (posCount-- > 0) { REMatch m = (REMatch) positions.elementAt(posIndex); if (stingy) posIndex++; else posIndex--; REMatch results = matchRest(input, m); if (results != null) { // Order these from longest to shortest // Start by assuming longest (more repeats) // If stingy the order is shortest to longest. allResults.addTail(results); } else { if (possessive) break; } } if (allResults.head != null) { mymatch.assignFrom(allResults.head); // does this get all? return true; } // If we fall out, no matches. return false; } |
|
} int numRepeats = 0; REMatch doables; int lastIndex = mymatch.index; boolean emptyMatchFound = false; while (numRepeats < min) { doables = findDoables(token, input, newMatch); if (doables == null) return false; newMatch = doables; ++numRepeats; if (newMatch.empty) { numRepeats = min; emptyMatchFound = true; break; } lastIndex = newMatch.index; } Vector positions = new Vector(); while (numRepeats <= max) { if (stopMatchingIfSatisfied && stingy) { REMatch results = matchRest(input, newMatch); if (results != null) { mymatch.assignFrom(results); return true; } } positions.add(newMatch); if (emptyMatchFound) break; doables = findDoables(token, input, newMatch); if (doables == null) break; if (doables.index == lastIndex) { if (doables.empty) { emptyMatchFound = true; } else { if (!stingy) break; } } numRepeats++; newMatch = doables; lastIndex = newMatch.index; } REMatch.REMatchList allResults = new REMatch.REMatchList(); int posCount = positions.size(); int posIndex = (stingy ? 0 : posCount - 1); while (posCount-- > 0) { REMatch m = (REMatch) positions.elementAt(posIndex); if (stingy) posIndex++; else posIndex--; REMatch results = matchRest(input, m); if (results != null) { allResults.addTail(results); } else { if (possessive) break; } } if (allResults.head != null) { mymatch.assignFrom(allResults.head); return true; } return false; } | boolean match(CharIndexed input, REMatch mymatch) { // Possible positions for the next repeat to match at REMatch newMatch = mymatch; // {0} needs some special treatment. if (alwaysEmpty) { REMatch result = matchRest(input, newMatch); if (result != null) { mymatch.assignFrom(result); return true; } else { return false; } } // number of times we've matched so far int numRepeats = 0; REMatch doables; int lastIndex = mymatch.index; boolean emptyMatchFound = false; while (numRepeats < min) { doables = findDoables(token, input, newMatch); // if none of the possibilities worked out, // it means that minimum number of repeats could not be found. if (doables == null) return false; // reassign where the next repeat can match newMatch = doables; // increment how many repeats we've successfully found ++numRepeats; if (newMatch.empty) { numRepeats = min; emptyMatchFound = true; break; } lastIndex = newMatch.index; } Vector positions = new Vector(); while (numRepeats <= max) { // We want to check something like // if (stingy) // and neglect the further matching. But experience tells // such neglection may cause incomplete matching. // For example, if we neglect the seemingly unnecessay // matching, /^(b+?|a){1,2}?c/ cannot match "bbc". // On the other hand, if we do not stop the unnecessary // matching, /(([a-c])b*?\2)*/ matches "ababbbcbc" // entirely when we wan to find only "ababb". // In order to make regression tests pass, we do as we did. if (stopMatchingIfSatisfied && stingy) { REMatch results = matchRest(input, newMatch); if (results != null) { mymatch.assignFrom(results); return true; } } positions.add(newMatch); if (emptyMatchFound) break; doables = findDoables(token, input, newMatch); if (doables == null) break; // doables.index == lastIndex occurs either // (1) when an empty string was the longest // that matched this token. // or // (2) when the same string matches this token many times. // For example, "acbab" itself matches "a.*b" and // its substrings "acb" and "ab" also match. // In this case, we do not have to go further until // numRepeats == max because the more numRepeats grows, // the shorter the substring matching this token becomes. // So the previous succesful match must have bee the best // match. But this is not necessarily the case if stingy. if (doables.index == lastIndex) { if (doables.empty) { emptyMatchFound = true; } else { if (!stingy) break; } } numRepeats++; newMatch = doables; lastIndex = newMatch.index; } // We're greedy, but ease off until a true match is found. // At this point we've either got too many or just the right amount. // See if this numRepeats works with the rest of the regexp. REMatch.REMatchList allResults = new REMatch.REMatchList(); int posCount = positions.size(); int posIndex = (stingy ? 0 : posCount - 1); while (posCount-- > 0) { REMatch m = (REMatch) positions.elementAt(posIndex); if (stingy) posIndex++; else posIndex--; REMatch results = matchRest(input, m); if (results != null) { // Order these from longest to shortest // Start by assuming longest (more repeats) // If stingy the order is shortest to longest. allResults.addTail(results); } else { if (possessive) break; } } if (allResults.head != null) { mymatch.assignFrom(allResults.head); // does this get all? return true; } // If we fall out, no matches. return false; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.