bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 5,480
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 5,481
|
public void paintTrack(Graphics g) { Color saved_color = g.getColor(); int width; int height; Point a = new Point(trackRect.x, trackRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Polygon high; Polygon shadow; if (slider.getOrientation() == JSlider.HORIZONTAL) { width = trackRect.width; height = (thumbRect.height / 4 == 0) ? 1 : thumbRect.height / 4; a.translate(0, (trackRect.height / 2) - (height / 2)); b.translate(0, (trackRect.height / 2) + (height / 2)); c.translate(trackRect.width, (trackRect.height / 2) + (height / 2)); d.translate(trackRect.width, (trackRect.height / 2) - (height / 2)); } else { width = (thumbRect.width / 4 == 0) ? 1 : thumbRect.width / 4; height = trackRect.height; a.translate((trackRect.width / 2) - (width / 2), 0); b.translate((trackRect.width / 2) - (width / 2), trackRect.height); c.translate((trackRect.width / 2) + (width / 2), trackRect.height); d.translate((trackRect.width / 2) + (width / 2), 0); } g.setColor(Color.GRAY); g.fillRect(a.x, a.y, width, height); g.setColor(getHighlightColor()); g.drawLine(b.x, b.y, c.x, c.y); g.drawLine(c.x, c.y, d.x, d.y); g.setColor(getShadowColor()); g.drawLine(b.x, b.y, a.x, a.y); g.drawLine(a.x, a.y, d.x, d.y); g.setColor(saved_color); }
|
public void paintTrack(Graphics g) { Color saved_color = g.getColor(); int width; int height; Point a = new Point(trackRect.x, trackRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Polygon high; Polygon shadow; if (slider.getOrientation() == JSlider.HORIZONTAL) { width = trackRect.width; height = (thumbRect.height / 4 == 0) ? 1 : thumbRect.height / 4; a.translate(0, (trackRect.height / 2) - (height / 2)); b.translate(0, (trackRect.height / 2) + (height / 2)); c.translate(trackRect.width, (trackRect.height / 2) + (height / 2)); d.translate(trackRect.width, (trackRect.height / 2) - (height / 2)); } else { width = (thumbRect.width / 4 == 0) ? 1 : thumbRect.width / 4; height = trackRect.height; a.translate((trackRect.width / 2) - (width / 2), 0); b.translate((trackRect.width / 2) - (width / 2), trackRect.height); c.translate((trackRect.width / 2) + (width / 2), trackRect.height); d.translate((trackRect.width / 2) + (width / 2), 0); } g.setColor(Color.GRAY); g.fillRect(a.x, a.y, width, height); g.setColor(getHighlightColor()); g.drawLine(b.x, b.y, c.x, c.y); g.drawLine(c.x, c.y, d.x, d.y); g.setColor(getShadowColor()); g.drawLine(b.x, b.y, a.x, a.y); g.drawLine(a.x, a.y, d.x, d.y); g.setColor(saved_color); }
| 5,483
|
protected int xPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.width; int xPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) xPos += trackRect.x; else { xPos = trackRect.width - xPos; xPos += trackRect.x; } return xPos; }
|
protected int xPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.width; int xPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) xPos += trackRect.x; else { xPos = trackRect.width - xPos; xPos += trackRect.x; } return xPos; }
| 5,484
|
protected int xPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.width; int xPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) xPos += trackRect.x; else { xPos = trackRect.width - xPos; xPos += trackRect.x; } return xPos; }
|
protected int xPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.width; int xPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) xPos += trackRect.x; else { xPos = len - xPos; xPos += trackRect.x; } return xPos; }
| 5,485
|
protected int yPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.height; int yPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) { yPos = trackRect.height - yPos; yPos += trackRect.y; } else yPos += trackRect.y; return yPos; }
|
protected int yPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.height; int yPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) { yPos = trackRect.height - yPos; yPos += trackRect.y; } else yPos += trackRect.y; return yPos; }
| 5,486
|
protected int yPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.height; int yPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) { yPos = trackRect.height - yPos; yPos += trackRect.y; } else yPos += trackRect.y; return yPos; }
|
protected int yPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.height; int yPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) { yPos = len - yPos; yPos += trackRect.y; } else yPos += trackRect.y; return yPos; }
| 5,487
|
public Group removeFromGroup (Group groupObject) { if (groupObject != null) { if (groupMemberHash.contains(groupObject)) { //this object does belong to the indicated Group object groupObject.removeMemberObj(this); groupMemberHash.remove(groupObject); return groupObject; } else { Log.error("Can't delete from group. not a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: The group to add to is null"); return null; } }
|
public Group removeFromGroup (Group groupObject) { if (groupObject != null) { if (groupMemberHash.contains(groupObject)) { //this object does belong to the indicated Group object groupObject.removeMemberObject((Object) this); groupMemberHash.remove(groupObject); return groupObject; } else { Log.error("Can't delete from group. not a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: The group to add to is null"); return null; } }
| 5,488
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.error("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); //write out closing node after PCDATA, leaving no space between them. //k.z. 10/18/2000 if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; //now we are done, return! //k.z. 10/18/2000 }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); //write out closing node after PCDATA, leaving no space between them. //k.z. 10/18/2000 if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; //now we are done, return! //k.z. 10/18/2000 }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 5,489
|
public final KeyboardEvent interpretScancode(int scancode) { final boolean extendedMode = this.extendedMode; if (scancode == XT_EXTENDED) { this.extendedMode = true; return null; } else { this.extendedMode = false; } final boolean released = ((scancode & XT_RELEASE) != 0); final long time = System.currentTimeMillis(); scancode &= 0x7f; int vk = deriveKeyCode(scancode, extendedMode); // debug output to find new keycodes// System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/); if (!extendedMode) vk = keys.getKey(scancode).getLowerVirtuelKey(); adjustFlags(vk, released); // debug output to find new keycodes// System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/); try { final char ch; ch = interpretExtendedScanCode(scancode, vk, released, extendedMode); return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch); } catch (UnsupportedKeyException e) { final char ch; if ((flags & InputEvent.SHIFT_DOWN_MASK) != 0) { ch = keys.getKey(scancode).getUpperChar(); if (!extendedMode) vk = keys.getKey(scancode).getUpperVirtuelKey(); } else if ((flags & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) { ch = keys.getKey(scancode).getAltGrChar(); if (!extendedMode) vk = keys.getKey(scancode).getAltGrVirtuelKey(); } else { ch = keys.getKey(scancode).getLowerChar(); } return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch); } catch (DeadKeyException e) { return null; } }
|
public final KeyboardEvent interpretScancode(int scancode) { final boolean extendedMode = this.extendedMode; if (scancode == XT_EXTENDED) { this.extendedMode = true; return null; } else { this.extendedMode = false; } final boolean released = ((scancode & XT_RELEASE) != 0); final long time = System.currentTimeMillis(); scancode &= 0x7f; int vk = deriveKeyCode(scancode, extendedMode); // debug output to find new keycodes// System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/); if (!extendedMode) vk = keys.getKey(scancode).getLowerVirtuelKey(); adjustFlags(vk, released); // debug output to find new keycodes// System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/); try { final char ch; ch = interpretExtendedScanCode(scancode, vk, released, extendedMode); return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch); } catch (UnsupportedKeyException e) { final char ch; if ((flags & InputEvent.SHIFT_DOWN_MASK) != 0) { ch = keys.getKey(scancode).getUpperChar(); if (!extendedMode) vk = keys.getKey(scancode).getUpperVirtuelKey(); } else if ((flags & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) { ch = keys.getKey(scancode).getAltGrChar(); if (!extendedMode) vk = keys.getKey(scancode).getAltGrVirtuelKey(); } else { ch = keys.getKey(scancode).getLowerChar(); } return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch); } catch (DeadKeyException e) { return null; } }
| 5,490
|
public TabSet(TabStop[] t) { tabs = t; }
|
public TabSet(TabStop[] t) { if (t != null) tabs = (TabStop[]) t.clone(); else tabs = new TabStop[0]; }
| 5,491
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
| 5,493
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
| 5,494
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return -1; }
| 5,495
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); DerUtil.checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 5,498
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); DerUtil.checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 5,499
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); DerUtil.checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 5,500
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 5,501
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 5,502
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 5,503
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); DerUtil.checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 5,504
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); DerUtil.checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 5,505
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); DerUtil.checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 5,506
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 5,507
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 5,508
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 5,509
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); DerUtil.checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 5,510
|
public DHCPMessage(BOOTPHeader hdr, int msgType) { this(hdr); messageType = msgType; }
|
public DHCPMessage(BOOTPHeader hdr, int msgType) { this(hdr); messageType = msgType; }
| 5,512
|
public void invalidateLayout(Container target) { synchronized (this) { glassPaneBounds = null; layeredPaneBounds = null; contentPaneBounds = null; menuBarBounds = null; prefSize = null; } }
|
public void invalidateLayout(Container target) { synchronized (this) { glassPaneBounds = null; layeredPaneBounds = null; contentPaneBounds = null; menuBarBounds = null; } }
| 5,513
|
public Dimension preferredLayoutSize(Container c) { // We must synchronize here, otherwise we cannot guarantee that the // prefSize is still non-null when returning. synchronized (this) { if (prefSize == null) { Insets i = getInsets(); prefSize = new Dimension(i.left + i.right, i.top + i.bottom); Dimension contentPrefSize = contentPane.getPreferredSize(); prefSize.width += contentPrefSize.width; prefSize.height += contentPrefSize.height; if (menuBar != null) { Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.width > contentPrefSize.width) prefSize.width += menuBarSize.width - contentPrefSize.width; prefSize.height += menuBarSize.height; } } // Return a copy here so the cached value won't get trashed by some // other component. return new Dimension(prefSize); } }
|
public Dimension preferredLayoutSize(Container c) { // We must synchronize here, otherwise we cannot guarantee that the // prefSize is still non-null when returning. synchronized (this) { if (prefSize == null) { Insets i = getInsets(); prefSize = new Dimension(i.left + i.right, i.top + i.bottom); Dimension contentPrefSize = contentPane.getPreferredSize(); prefSize.width += contentPrefSize.width; prefSize.height += contentPrefSize.height; if (menuBar != null) { Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.width > contentPrefSize.width) prefSize.width += menuBarSize.width - contentPrefSize.width; prefSize.height += menuBarSize.height; } } // Return a copy here so the cached value won't get trashed by some // other component. return new Dimension(prefSize); } }
| 5,514
|
public Dimension preferredLayoutSize(Container c) { // We must synchronize here, otherwise we cannot guarantee that the // prefSize is still non-null when returning. synchronized (this) { if (prefSize == null) { Insets i = getInsets(); prefSize = new Dimension(i.left + i.right, i.top + i.bottom); Dimension contentPrefSize = contentPane.getPreferredSize(); prefSize.width += contentPrefSize.width; prefSize.height += contentPrefSize.height; if (menuBar != null) { Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.width > contentPrefSize.width) prefSize.width += menuBarSize.width - contentPrefSize.width; prefSize.height += menuBarSize.height; } } // Return a copy here so the cached value won't get trashed by some // other component. return new Dimension(prefSize); } }
|
public Dimension preferredLayoutSize(Container c) { // We must synchronize here, otherwise we cannot guarantee that the // prefSize is still non-null when returning. synchronized (this) { if (prefSize == null) { Insets i = getInsets(); prefSize = new Dimension(i.left + i.right, i.top + i.bottom); Dimension contentPrefSize = contentPane.getPreferredSize(); prefSize.width += contentPrefSize.width; prefSize.height += contentPrefSize.height; if (menuBar != null) { Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.width > contentPrefSize.width) prefSize.width += menuBarSize.width - contentPrefSize.width; prefSize.height += menuBarSize.height; } } // Return a copy here so the cached value won't get trashed by some // other component. return new Dimension(prefSize); } }
| 5,515
|
protected JComponent createNorthPane(JInternalFrame w) { titlePane = new MetalInternalFrameTitlePane(w); titlePane.setBorder(new EmptyBorder(2, 2, 2, 2)); return titlePane; }
|
protected JComponent createNorthPane(JInternalFrame w) { titlePane = new MetalInternalFrameTitlePane(w); return titlePane; }
| 5,516
|
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalInternalFrameUI instance; if (o == null) { instance = new MetalInternalFrameUI((JInternalFrame) component); instances.put(component, instance); } else instance = (MetalInternalFrameUI) o; return instance; }
|
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalInternalFrameUI instance; if (o == null) { instance = new MetalInternalFrameUI((JInternalFrame) component); instances.put(component, instance); } else instance = (MetalInternalFrameUI) o; return instance; }
| 5,517
|
public static RepaintManager currentManager(Component component) { if (currentRepaintManagers == null) currentRepaintManagers = new HashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); RepaintManager currentManager = (RepaintManager) currentRepaintManagers.get(threadGroup); if (currentManager == null) { currentManager = new RepaintManager(); currentRepaintManagers.put(threadGroup, currentManager); } return currentManager; }
|
public static RepaintManager currentManager(Component component) { if (currentRepaintManagers == null) currentRepaintManagers = new WeakHashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); RepaintManager currentManager = (RepaintManager) currentRepaintManagers.get(threadGroup); if (currentManager == null) { currentManager = new RepaintManager(); currentRepaintManagers.put(threadGroup, currentManager); } return currentManager; }
| 5,518
|
public static void setCurrentManager(RepaintManager manager) { if (currentRepaintManagers == null) currentRepaintManagers = new HashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); currentRepaintManagers.put(threadGroup, manager); }
|
public static void setCurrentManager(RepaintManager manager) { if (currentRepaintManagers == null) currentRepaintManagers = new WeakHashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); currentRepaintManagers.put(threadGroup, manager); }
| 5,519
|
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Value newvalue = new Value(); // reconsitute the value node PCdata from passed information. // and add value to object newvalue.setValue( new String (buf, offset, len) ); // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { newvalue = LastParameterObject.addValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newvalue = lastAxisObject.addAxisValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { // nothing here yet } else { Log.errorln("Error: weird parent node "+parentNodeName+" for value."); System.exit(-1); // fatal error, shut down } // 4. add this object to all open groups Iterator iter = CurrentValueGroupList.iterator(); while (iter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter.next(); newvalue.addToGroup(nextValueGroupObj); } }
|
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // grab parent node name String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); // create new object appropriately Value newvalue = new Value(); // reconsitute the value node PCdata from passed information. // and add value to object newvalue.setValue( new String (buf, offset, len) ); // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { newvalue = LastParameterObject.addValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newvalue = lastAxisObject.addAxisValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { // nothing here yet } else { Log.errorln("Error: weird parent node "+parentNodeName+" for value."); System.exit(-1); // fatal error, shut down } // 4. add this object to all open groups Iterator iter = CurrentValueGroupList.iterator(); while (iter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter.next(); newvalue.addToGroup(nextValueGroupObj); } }
| 5,520
|
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Value newvalue = new Value(); // reconsitute the value node PCdata from passed information. // and add value to object newvalue.setValue( new String (buf, offset, len) ); // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { newvalue = LastParameterObject.addValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newvalue = lastAxisObject.addAxisValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { // nothing here yet } else { Log.errorln("Error: weird parent node "+parentNodeName+" for value."); System.exit(-1); // fatal error, shut down } // 4. add this object to all open groups Iterator iter = CurrentValueGroupList.iterator(); while (iter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter.next(); newvalue.addToGroup(nextValueGroupObj); } }
|
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Value newvalue = new Value(); // reconsitute the value node PCdata from passed information. // and add value to object newvalue.setValue( new String (buf, offset, len) ); // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { newvalue = LastParameterObject.addValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newvalue = lastAxisObject.addAxisValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { // nothing here yet } else { Log.errorln("Error: weird parent node "+parentNodeName+" for value."); System.exit(-1); // fatal error, shut down } // 4. add this object to all open groups Iterator iter = CurrentValueGroupList.iterator(); while (iter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter.next(); newvalue.addToGroup(nextValueGroupObj); } }
| 5,521
|
public final void invokeJavaMethod(String signature, X86CompilerContext context) { os.writeCALL(Register.EAX, context.getVmMethodNativeCodeField().getOffset()); //writeJumpTableCALL(X86JumpTable.VM_INVOKE_OFS); char ch = signature.charAt(signature.length() - 1); if (ch == 'V') { /** No return value */ } else if ((ch == 'J') || (ch == 'D')) { /** Wide return value */ writePUSH(Register.EDX); writePUSH(Register.EAX); } else { /** Normal return value */ writePUSH(Register.EAX); } }
|
public final void invokeJavaMethod(String signature, X86CompilerContext context) { os.writeCALL(Register.EAX, context.getVmMethodNativeCodeField().getOffset()); //writeJumpTableCALL(X86JumpTable.VM_INVOKE_OFS); char ch = signature.charAt(signature.length() - 1); if (ch == 'V') { /** No return value */ } else if ((ch == 'J') || (ch == 'D')) { /** Wide return value */ writePUSH(Register.EDX); writePUSH(Register.EAX); } else { /** Normal return value */ writePUSH(Register.EAX); } }
| 5,524
|
public final void writeLoadSTATICS(X86CompilerContext context) { final int offset = context.getVmProcessorStaticsTable().getOffset(); os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset); }
|
public final void writeLoadSTATICS(X86CompilerContext context, Label labelPrefix, boolean isTestOnly) { final int offset = context.getVmProcessorStaticsTable().getOffset(); os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset); }
| 5,525
|
public final void writeLoadSTATICS(X86CompilerContext context) { final int offset = context.getVmProcessorStaticsTable().getOffset(); os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset); }
|
public final void writeLoadSTATICS(X86CompilerContext context) { final int offset = context.getVmProcessorStaticsTable().getOffset(); os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset); }
| 5,526
|
public void flush() throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
|
public void flush() throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
| 5,527
|
public boolean send() throws Exception { try { if(!loadConfig(configFile)) return false; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from == null) from = SMTPProperties.getProperty("mail.smtp.from"); if (from != null && from.length() > 0) { pers = SMTPProperties.getProperty("mail.smtp.realname"); if (pers != null) msg.setFrom(new InternetAddress(from, pers)); } if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg); return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; }
|
public boolean send() throws Exception { try { if(!loadConfig(configFile)) return false; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from == null) from = SMTPProperties.getProperty("mail.smtp.from"); if (from != null && from.length() > 0) { pers = SMTPProperties.getProperty("mail.smtp.realname"); if (pers != null) msg.setFrom(new InternetAddress(from, pers)); } if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg); return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false; }
| 5,528
|
public void load(String filename) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkLink(filename); if (loadLib(filename) == 0) throw new UnsatisfiedLinkError("Could not load library " + filename); }
|
public void load(String filename) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkLink(filename); if (loadLib(filename) == 0) throw new UnsatisfiedLinkError("Could not load library " + filename); }
| 5,529
|
private static int loadLib(String filename) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkRead(filename); return VMRuntime.nativeLoad(filename); }
|
private static int loadLib(String filename, ClassLoader loader) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkRead(filename); return VMRuntime.nativeLoad(filename); }
| 5,530
|
private static int loadLib(String filename) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkRead(filename); return VMRuntime.nativeLoad(filename); }
|
private static int loadLib(String filename) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkRead(filename); return VMRuntime.nativeLoad(filename, loader); }
| 5,531
|
public void loadLibrary(String libname) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkLink(libname); String filename; ClassLoader cl = VMSecurityManager.currentClassLoader(); if (cl != null) { filename = cl.findLibrary(libname); if (filename != null) { if (loadLib(filename) != 0) return; else throw new UnsatisfiedLinkError("Could not load library " + filename); } } filename = VMRuntime.mapLibraryName(libname); for (int i = 0; i < libpath.length; i++) if (loadLib(libpath[i] + filename) != 0) return; throw new UnsatisfiedLinkError("Could not find library " + libname + "."); }
|
public void loadLibrary(String libname) { SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkLink(libname); String filename; ClassLoader cl = VMSecurityManager.currentClassLoader(); if (cl != null) { filename = cl.findLibrary(libname); if (filename != null) { if (loadLib(filename) != 0) return; else throw new UnsatisfiedLinkError("Could not load library " + filename); } } filename = VMRuntime.mapLibraryName(libname); for (int i = 0; i < libpath.length; i++) if (loadLib(libpath[i] + filename) != 0) return; throw new UnsatisfiedLinkError("Could not find library " + libname + "."); }
| 5,532
|
public PrivateKey readPrivateKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal private key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); } return kpc.decodePrivateKey(kb); }
|
public PrivateKey readPrivateKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal private key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); } return kpc.decodePrivateKey(kb); }
| 5,533
|
public PrivateKey readPrivateKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal private key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); } return kpc.decodePrivateKey(kb); }
|
public PrivateKey readPrivateKey() throws KeyAgreementException if (in.available() < 4) throw new KeyAgreementException( "not enough bytes for a private key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) throw new KeyAgreementException("illegal private key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); } return kpc.decodePrivateKey(kb); }
| 5,534
|
public PrivateKey readPrivateKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal private key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); } return kpc.decodePrivateKey(kb); }
|
public PrivateKey readPrivateKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal private key encoding"); byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); return kpc.decodePrivateKey(kb);
| 5,535
|
public PrivateKey readPrivateKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal private key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); } return kpc.decodePrivateKey(kb); }
|
public PrivateKey readPrivateKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a private key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal private key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid private key, or encoded with an unknown codec"); } return kpc.decodePrivateKey(kb); }
| 5,536
|
public PublicKey readPublicKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal public key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); } return kpc.decodePublicKey(kb); }
|
public PublicKey readPublicKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal public key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); } return kpc.decodePublicKey(kb); }
| 5,537
|
public PublicKey readPublicKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal public key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); } return kpc.decodePublicKey(kb); }
|
public PublicKey readPublicKey() throws KeyAgreementException if (in.available() < 4) throw new KeyAgreementException( "not enough bytes for a public key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) throw new KeyAgreementException("illegal public key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); } return kpc.decodePublicKey(kb); }
| 5,538
|
public PublicKey readPublicKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal public key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); } return kpc.decodePublicKey(kb); }
|
public PublicKey readPublicKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal public key encoding"); byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); return kpc.decodePublicKey(kb);
| 5,539
|
public PublicKey readPublicKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal public key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); } return kpc.decodePublicKey(kb); }
|
public PublicKey readPublicKey() throws KeyAgreementException { if (in.available() < 4) { throw new KeyAgreementException( "not enough bytes for a public key in message"); } byte[] elementLengthBytes = new byte[4]; in.read(elementLengthBytes, 0, 4); int elementLength = fourBytesToLength(elementLengthBytes); if (in.available() < elementLength) { throw new KeyAgreementException("illegal public key encoding"); } byte[] kb = new byte[elementLength]; in.read(kb, 0, elementLength); // instantiate the right codec and decode IKeyPairCodec kpc = KeyPairCodecFactory.getInstance(kb); if (kpc == null) { throw new KeyAgreementException( "invalid public key, or encoded with an unknown codec"); } return kpc.decodePublicKey(kb); }
| 5,540
|
protected void paintFocus(Graphics g, AbstractButton b, Rectangle vr, Rectangle tr, Rectangle ir) { if (b.hasFocus() && b.isFocusPainted()) { Color saved_color = g.getColor(); g.setColor(focusColor); Rectangle focusRect = ir.union(tr); g.drawRect(focusRect.x, focusRect.y, focusRect.width, focusRect.height); g.setColor(saved_color); } }
|
protected void paintFocus(Graphics g, AbstractButton b, Rectangle vr, Rectangle tr, Rectangle ir) { if (b.hasFocus() && b.isFocusPainted()) { Color saved_color = g.getColor(); g.setColor(focusColor); Rectangle focusRect = ir.union(tr); g.drawRect(focusRect.x, focusRect.y, focusRect.width, focusRect.height); g.setColor(saved_color); } }
| 5,542
|
private void getNewSessionOptions() { try { BufferedReader in = new BufferedReader( new InputStreamReader( socket.getInputStream())); String inputLine, outputLine; bootEvent = new BootEvent(this,in.readLine()); System.out.println(bootEvent.getNewSessionOptions()); fireBootEvent(); in.close(); socket.close(); } catch (IOException e) { e.printStackTrace(); } }
|
private void getNewSessionOptions() { try { BufferedReader in = new BufferedReader( new InputStreamReader( socket.getInputStream())); bootEvent = new BootEvent(this,in.readLine()); System.out.println(bootEvent.getNewSessionOptions()); fireBootEvent(); in.close(); socket.close(); } catch (IOException e) { e.printStackTrace(); } }
| 5,543
|
protected Component addSingletonComponent(Component oldComponent, Component newComponent) { return null; }
|
protected Component addSingletonComponent(Component oldComponent, Component newComponent) { return null; }
| 5,545
|
public BasicPermission(String name) { super(name); if (name.indexOf("*") != -1) { if ((!name.endsWith(".*") && !name.equals("*")) || name.indexOf("*") != name.lastIndexOf("*")) throw new IllegalArgumentException("Bad wildcard: " + name); } if ("".equals(name)) throw new IllegalArgumentException("Empty name"); }
|
public BasicPermission(String name) { super(name); if (name.indexOf("*") != -1) { if ((!name.endsWith(".*") && !name.equals("*")) || name.indexOf("*") != name.lastIndexOf("*")) throw new IllegalArgumentException("Bad wildcard: " + name); } if ("".equals(name)) throw new IllegalArgumentException("Empty name"); }
| 5,548
|
public X86BytecodeVisitor(NativeStream outputStream, CompiledMethod cm, boolean isBootstrap, X86CompilerContext context) { this.os = (AbstractX86Stream) outputStream; this.context = context; this.vstack = new VirtualStack(os); final X86RegisterPool pool = new X86RegisterPool(); this.helper = new X86CompilerHelper(os, vstack.createStackMgr(pool), context, isBootstrap); this.cm = cm; this.slotSize = VmX86Architecture.SLOT_SIZE; this.arrayLengthOffset = VmArray.LENGTH_OFFSET * slotSize; this.arrayDataOffset = VmArray.DATA_OFFSET * slotSize; this.tibOffset = ObjectLayout.TIB_SLOT * slotSize; this.log = os.isLogEnabled(); this.eContext = new EmitterContext(os, helper, vstack, pool); }
|
public X86BytecodeVisitor(NativeStream outputStream, CompiledMethod cm, boolean isBootstrap, X86CompilerContext context) { this.os = (AbstractX86Stream) outputStream; this.context = context; this.vstack = new VirtualStack(os); final X86RegisterPool pool = new X86RegisterPool(); this.ifac = ItemFactory.getFactory(); this.helper = new X86CompilerHelper(os, vstack.createStackMgr(pool, ifac), context, isBootstrap); this.cm = cm; this.slotSize = VmX86Architecture.SLOT_SIZE; this.arrayLengthOffset = VmArray.LENGTH_OFFSET * slotSize; this.arrayDataOffset = VmArray.DATA_OFFSET * slotSize; this.tibOffset = ObjectLayout.TIB_SLOT * slotSize; this.log = os.isLogEnabled(); this.eContext = new EmitterContext(os, helper, vstack, pool); }
| 5,549
|
public X86BytecodeVisitor(NativeStream outputStream, CompiledMethod cm, boolean isBootstrap, X86CompilerContext context) { this.os = (AbstractX86Stream) outputStream; this.context = context; this.vstack = new VirtualStack(os); final X86RegisterPool pool = new X86RegisterPool(); this.helper = new X86CompilerHelper(os, vstack.createStackMgr(pool), context, isBootstrap); this.cm = cm; this.slotSize = VmX86Architecture.SLOT_SIZE; this.arrayLengthOffset = VmArray.LENGTH_OFFSET * slotSize; this.arrayDataOffset = VmArray.DATA_OFFSET * slotSize; this.tibOffset = ObjectLayout.TIB_SLOT * slotSize; this.log = os.isLogEnabled(); this.eContext = new EmitterContext(os, helper, vstack, pool); }
|
public X86BytecodeVisitor(NativeStream outputStream, CompiledMethod cm, boolean isBootstrap, X86CompilerContext context) { this.os = (AbstractX86Stream) outputStream; this.context = context; this.vstack = new VirtualStack(os); final X86RegisterPool pool = new X86RegisterPool(); this.helper = new X86CompilerHelper(os, vstack.createStackMgr(pool), context, isBootstrap); this.cm = cm; this.slotSize = VmX86Architecture.SLOT_SIZE; this.arrayLengthOffset = VmArray.LENGTH_OFFSET * slotSize; this.arrayDataOffset = VmArray.DATA_OFFSET * slotSize; this.tibOffset = ObjectLayout.TIB_SLOT * slotSize; this.log = os.isLogEnabled(); this.eContext = new EmitterContext(os, helper, vstack, pool, ifac); }
| 5,550
|
public void endInlinedMethod(VmMethod previousMethod) { helper.setMethod(previousMethod); os.setObjectRef(inlinedMethod.getEndOfInlineLabel()); this.currentMethod = previousMethod; inlinedMethod.pushExitStack(vstack); this.inlinedMethod = null; if (debug) { BootLog.debug("endInlinedMethod"); } }
|
public void endInlinedMethod(VmMethod previousMethod) { helper.setMethod(previousMethod); os.setObjectRef(inlinedMethod.getEndOfInlineLabel()); this.currentMethod = previousMethod; inlinedMethod.pushExitStack(ifac, vstack); this.inlinedMethod = null; if (debug) { BootLog.debug("endInlinedMethod"); } }
| 5,551
|
public void startBasicBlock(BasicBlock bb) { if (log) { os.log("Start of basic block " + bb); } if (debug) { BootLog.debug("-- Start of BB " + bb); } startOfBB = true; this.vstack.reset(); eContext.getPool().reset(os); // Push the result from the outer method stack on the vstack if (inlinedMethod != null) { inlinedMethod.pushOuterMethodStack(vstack); } // Push the items on the vstack the result from a previous basic block. final TypeStack tstack = bb.getStartStack(); vstack.pushAll(tstack); if (debug) { BootLog.debug("-- VStack: " + vstack.toString()); } }
|
public void startBasicBlock(BasicBlock bb) { if (log) { os.log("Start of basic block " + bb); } if (debug) { BootLog.debug("-- Start of BB " + bb); } startOfBB = true; this.vstack.reset(); eContext.getPool().reset(os); // Push the result from the outer method stack on the vstack if (inlinedMethod != null) { inlinedMethod.pushOuterMethodStack(ifac, vstack); } // Push the items on the vstack the result from a previous basic block. final TypeStack tstack = bb.getStartStack(); vstack.pushAll(tstack); if (debug) { BootLog.debug("-- VStack: " + vstack.toString()); } }
| 5,552
|
public void startBasicBlock(BasicBlock bb) { if (log) { os.log("Start of basic block " + bb); } if (debug) { BootLog.debug("-- Start of BB " + bb); } startOfBB = true; this.vstack.reset(); eContext.getPool().reset(os); // Push the result from the outer method stack on the vstack if (inlinedMethod != null) { inlinedMethod.pushOuterMethodStack(vstack); } // Push the items on the vstack the result from a previous basic block. final TypeStack tstack = bb.getStartStack(); vstack.pushAll(tstack); if (debug) { BootLog.debug("-- VStack: " + vstack.toString()); } }
|
public void startBasicBlock(BasicBlock bb) { if (log) { os.log("Start of basic block " + bb); } if (debug) { BootLog.debug("-- Start of BB " + bb); } startOfBB = true; this.vstack.reset(); eContext.getPool().reset(os); // Push the result from the outer method stack on the vstack if (inlinedMethod != null) { inlinedMethod.pushOuterMethodStack(vstack); } // Push the items on the vstack the result from a previous basic block. final TypeStack tstack = bb.getStartStack(); vstack.pushAll(ifac, tstack); if (debug) { BootLog.debug("-- VStack: " + vstack.toString()); } }
| 5,553
|
public final void visit_aconst_null() { vstack.push(RefItem.createConst(null)); }
|
public final void visit_aconst_null() { vstack.push(ifac.createAConst(null)); }
| 5,554
|
public final void visit_aload(int index) { vstack.push(RefItem.createLocal(stackFrame.getEbpOffset(index))); }
|
public final void visit_aload(int index) { vstack.push(ifac.createLocal(JvmType.REFERENCE, stackFrame.getEbpOffset(index))); }
| 5,555
|
public final void visit_daload() { final IntItem idx = vstack.popInt(); final RefItem ref = vstack.popRef(); idx.loadIf(eContext, ~Item.Kind.CONSTANT); ref.load(eContext); final Register refr = ref.getRegister(); checkBounds(ref, idx); FPUHelper.ensureStackCapacity(os, eContext, vstack, 1); if (idx.isConstant()) { final int offset = idx.getValue() * 8; os.writeFLD64(refr, offset + arrayDataOffset); } else { final Register idxr = idx.getRegister(); os.writeFLD64(refr, idxr, 8, arrayDataOffset); } // Release ref.release(eContext); idx.release(eContext); // Push result final Item result = DoubleItem.createFPUStack(); vstack.fpuStack.push(result); vstack.push(result); }
|
public final void visit_daload() { final IntItem idx = vstack.popInt(); final RefItem ref = vstack.popRef(); idx.loadIf(eContext, ~Item.Kind.CONSTANT); ref.load(eContext); final Register refr = ref.getRegister(); checkBounds(ref, idx); FPUHelper.ensureStackCapacity(os, eContext, vstack, 1); if (idx.isConstant()) { final int offset = idx.getValue() * 8; os.writeFLD64(refr, offset + arrayDataOffset); } else { final Register idxr = idx.getRegister(); os.writeFLD64(refr, idxr, 8, arrayDataOffset); } // Release ref.release(eContext); idx.release(eContext); // Push result final Item result = ifac.createFPUStack(JvmType.DOUBLE); vstack.fpuStack.push(result); vstack.push(result); }
| 5,557
|
public final void visit_dconst(double value) { vstack.push(DoubleItem.createConst(value)); }
|
public final void visit_dconst(double value) { vstack.push(ifac.createDConst(value)); }
| 5,558
|
public final void visit_dload(int index) { vstack.push(DoubleItem.createLocal(stackFrame.getWideEbpOffset(index))); }
|
public final void visit_dload(int index) { vstack.push(ifac.createLocal(JvmType.DOUBLE, stackFrame.getWideEbpOffset(index))); }
| 5,559
|
public final void visit_fconst(float value) { vstack.push(FloatItem.createConst(value)); }
|
public final void visit_fconst(float value) { vstack.push(ifac.createFConst(value)); }
| 5,560
|
public final void visit_fload(int index) { vstack.push(FloatItem.createLocal(stackFrame.getEbpOffset(index))); }
|
public final void visit_fload(int index) { vstack.push(ifac.createLocal(JvmType.FLOAT, stackFrame.getEbpOffset(index))); }
| 5,561
|
public final void visit_getfield(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final VmField field = fieldRef.getResolvedVmField(); if (field.isStatic()) { throw new IncompatibleClassChangeError( "getfield called on static field " + fieldRef.getName()); } final VmInstanceField inf = (VmInstanceField) field; final int fieldOffset = inf.getOffset(); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final boolean isfloat = JvmType.isFloat(type); // Pop & load final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // get field final Item result; if (!fieldRef.isWide()) { if (isfloat) { result = FloatItem.createFPUStack(); os.writeFLD32(refr, fieldOffset); vstack.fpuStack.push(result); } else { final WordItem iw = L1AHelper.requestWordRegister(eContext, type, false); os.writeMOV(INTSIZE, iw.getRegister(), refr, fieldOffset); result = iw; } } else { if (isfloat) { result = DoubleItem.createFPUStack(); os.writeFLD64(refr, fieldOffset); vstack.fpuStack.push(result); } else { final DoubleWordItem idw = L1AHelper .requestDoubleWordRegisters(eContext, type); final Register lsb = idw.getLsbRegister(); final Register msb = idw.getMsbRegister(); os.writeMOV(INTSIZE, lsb, refr, fieldOffset + LSB); os.writeMOV(INTSIZE, msb, refr, fieldOffset + MSB); result = idw; } } // Release ref.release(eContext); // Push result vstack.push(result); }
|
public final void visit_getfield(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final VmField field = fieldRef.getResolvedVmField(); if (field.isStatic()) { throw new IncompatibleClassChangeError( "getfield called on static field " + fieldRef.getName()); } final VmInstanceField inf = (VmInstanceField) field; final int fieldOffset = inf.getOffset(); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final boolean isfloat = JvmType.isFloat(type); // Pop & load final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // get field final Item result; if (!fieldRef.isWide()) { if (isfloat) { result = ifac.createFPUStack(JvmType.FLOAT); os.writeFLD32(refr, fieldOffset); vstack.fpuStack.push(result); } else { final WordItem iw = L1AHelper.requestWordRegister(eContext, type, false); os.writeMOV(INTSIZE, iw.getRegister(), refr, fieldOffset); result = iw; } } else { if (isfloat) { result = DoubleItem.createFPUStack(); os.writeFLD64(refr, fieldOffset); vstack.fpuStack.push(result); } else { final DoubleWordItem idw = L1AHelper .requestDoubleWordRegisters(eContext, type); final Register lsb = idw.getLsbRegister(); final Register msb = idw.getMsbRegister(); os.writeMOV(INTSIZE, lsb, refr, fieldOffset + LSB); os.writeMOV(INTSIZE, msb, refr, fieldOffset + MSB); result = idw; } } // Release ref.release(eContext); // Push result vstack.push(result); }
| 5,562
|
public final void visit_getfield(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final VmField field = fieldRef.getResolvedVmField(); if (field.isStatic()) { throw new IncompatibleClassChangeError( "getfield called on static field " + fieldRef.getName()); } final VmInstanceField inf = (VmInstanceField) field; final int fieldOffset = inf.getOffset(); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final boolean isfloat = JvmType.isFloat(type); // Pop & load final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // get field final Item result; if (!fieldRef.isWide()) { if (isfloat) { result = FloatItem.createFPUStack(); os.writeFLD32(refr, fieldOffset); vstack.fpuStack.push(result); } else { final WordItem iw = L1AHelper.requestWordRegister(eContext, type, false); os.writeMOV(INTSIZE, iw.getRegister(), refr, fieldOffset); result = iw; } } else { if (isfloat) { result = DoubleItem.createFPUStack(); os.writeFLD64(refr, fieldOffset); vstack.fpuStack.push(result); } else { final DoubleWordItem idw = L1AHelper .requestDoubleWordRegisters(eContext, type); final Register lsb = idw.getLsbRegister(); final Register msb = idw.getMsbRegister(); os.writeMOV(INTSIZE, lsb, refr, fieldOffset + LSB); os.writeMOV(INTSIZE, msb, refr, fieldOffset + MSB); result = idw; } } // Release ref.release(eContext); // Push result vstack.push(result); }
|
public final void visit_getfield(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final VmField field = fieldRef.getResolvedVmField(); if (field.isStatic()) { throw new IncompatibleClassChangeError( "getfield called on static field " + fieldRef.getName()); } final VmInstanceField inf = (VmInstanceField) field; final int fieldOffset = inf.getOffset(); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final boolean isfloat = JvmType.isFloat(type); // Pop & load final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // get field final Item result; if (!fieldRef.isWide()) { if (isfloat) { result = FloatItem.createFPUStack(); os.writeFLD32(refr, fieldOffset); vstack.fpuStack.push(result); } else { final WordItem iw = L1AHelper.requestWordRegister(eContext, type, false); os.writeMOV(INTSIZE, iw.getRegister(), refr, fieldOffset); result = iw; } } else { if (isfloat) { result = ifac.createFPUStack(JvmType.DOUBLE); os.writeFLD64(refr, fieldOffset); vstack.fpuStack.push(result); } else { final DoubleWordItem idw = L1AHelper .requestDoubleWordRegisters(eContext, type); final Register lsb = idw.getLsbRegister(); final Register msb = idw.getMsbRegister(); os.writeMOV(INTSIZE, lsb, refr, fieldOffset + LSB); os.writeMOV(INTSIZE, msb, refr, fieldOffset + MSB); result = idw; } } // Release ref.release(eContext); // Push result vstack.push(result); }
| 5,563
|
public final void visit_getstatic(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final VmStaticField sf = (VmStaticField) fieldRef.getResolvedVmField(); // Initialize if needed if (!sf.getDeclaringClass().isInitialized()) { final X86RegisterPool pool = eContext.getPool(); final Register tmp = L1AHelper.requestRegister(eContext, JvmType.INT, false); writeInitializeClass(fieldRef, tmp); pool.release(tmp); } // Get static field object if (JvmType.isFloat(type)) { final boolean is32bit = !fieldRef.isWide(); helper.writeGetStaticsEntryToFPU(curInstrLabel, sf, is32bit); final Item result = FPUHelper.createFPUStack(type); vstack.fpuStack.push(result); vstack.push(result); } else if (!fieldRef.isWide()) { final WordItem result = L1AHelper.requestWordRegister(eContext, type, false); final Register resultr = result.getRegister(); helper.writeGetStaticsEntry(curInstrLabel, resultr, sf); vstack.push(result); } else { final DoubleWordItem result = L1AHelper.requestDoubleWordRegisters( eContext, type); final Register lsb = result.getLsbRegister(); final Register msb = result.getMsbRegister(); helper.writeGetStaticsEntry64(curInstrLabel, lsb, msb, sf); vstack.push(result); } }
|
public final void visit_getstatic(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final VmStaticField sf = (VmStaticField) fieldRef.getResolvedVmField(); // Initialize if needed if (!sf.getDeclaringClass().isInitialized()) { final X86RegisterPool pool = eContext.getPool(); final Register tmp = L1AHelper.requestRegister(eContext, JvmType.INT, false); writeInitializeClass(fieldRef, tmp); pool.release(tmp); } // Get static field object if (JvmType.isFloat(type)) { final boolean is32bit = !fieldRef.isWide(); helper.writeGetStaticsEntryToFPU(curInstrLabel, sf, is32bit); final Item result = ifac.createFPUStack(type); vstack.fpuStack.push(result); vstack.push(result); } else if (!fieldRef.isWide()) { final WordItem result = L1AHelper.requestWordRegister(eContext, type, false); final Register resultr = result.getRegister(); helper.writeGetStaticsEntry(curInstrLabel, resultr, sf); vstack.push(result); } else { final DoubleWordItem result = L1AHelper.requestDoubleWordRegisters( eContext, type); final Register lsb = result.getLsbRegister(); final Register msb = result.getMsbRegister(); helper.writeGetStaticsEntry64(curInstrLabel, lsb, msb, sf); vstack.push(result); } }
| 5,564
|
public final void visit_i2b() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(IntItem.createConst((byte) v.getValue())); } else { v.loadToBITS8GPR(eContext); final Register r = v.getRegister(); os.writeMOVSX(r, r, BYTESIZE); vstack.push(v); } }
|
public final void visit_i2b() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(ifac.createIConst((byte) v.getValue())); } else { v.loadToBITS8GPR(eContext); final Register r = v.getRegister(); os.writeMOVSX(r, r, BYTESIZE); vstack.push(v); } }
| 5,565
|
public final void visit_i2c() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(IntItem.createConst((char) v.getValue())); } else { v.load(eContext); final Register r = v.getRegister(); os.writeMOVZX(r, r, WORDSIZE); vstack.push(v); } }
|
public final void visit_i2c() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(ifac.createIConst((char) v.getValue())); } else { v.load(eContext); final Register r = v.getRegister(); os.writeMOVZX(r, r, WORDSIZE); vstack.push(v); } }
| 5,566
|
public final void visit_i2l() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(LongItem.createConst(v.getValue())); } else { final X86RegisterPool pool = eContext.getPool(); L1AHelper.requestRegister(eContext, EAX); L1AHelper.requestRegister(eContext, EDX); v.loadTo(eContext, EAX); final LongItem result = LongItem.createReg(EAX, EDX); os.writeCDQ(); /* Sign extend EAX -> EDX:EAX */ pool.transferOwnerTo(EAX, result); pool.transferOwnerTo(EDX, result); // We do not release v, because its register (EAX) is re-used in // result // Push result vstack.push(result); } }
|
public final void visit_i2l() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(ifac.createLConst(v.getValue())); } else { final X86RegisterPool pool = eContext.getPool(); L1AHelper.requestRegister(eContext, EAX); L1AHelper.requestRegister(eContext, EDX); v.loadTo(eContext, EAX); final LongItem result = LongItem.createReg(EAX, EDX); os.writeCDQ(); /* Sign extend EAX -> EDX:EAX */ pool.transferOwnerTo(EAX, result); pool.transferOwnerTo(EDX, result); // We do not release v, because its register (EAX) is re-used in // result // Push result vstack.push(result); } }
| 5,567
|
public final void visit_i2l() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(LongItem.createConst(v.getValue())); } else { final X86RegisterPool pool = eContext.getPool(); L1AHelper.requestRegister(eContext, EAX); L1AHelper.requestRegister(eContext, EDX); v.loadTo(eContext, EAX); final LongItem result = LongItem.createReg(EAX, EDX); os.writeCDQ(); /* Sign extend EAX -> EDX:EAX */ pool.transferOwnerTo(EAX, result); pool.transferOwnerTo(EDX, result); // We do not release v, because its register (EAX) is re-used in // result // Push result vstack.push(result); } }
|
public final void visit_i2l() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(LongItem.createConst(v.getValue())); } else { final X86RegisterPool pool = eContext.getPool(); L1AHelper.requestRegister(eContext, EAX); L1AHelper.requestRegister(eContext, EDX); v.loadTo(eContext, EAX); final LongItem result = (LongItem)ifac.createReg(JvmType.LONG, EAX, EDX); os.writeCDQ(); /* Sign extend EAX -> EDX:EAX */ pool.transferOwnerTo(EAX, result); pool.transferOwnerTo(EDX, result); // We do not release v, because its register (EAX) is re-used in // result // Push result vstack.push(result); } }
| 5,568
|
public final void visit_i2s() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(IntItem.createConst((short) v.getValue())); } else { v.load(eContext); final Register r = v.getRegister(); os.writeMOVSX(r, r, WORDSIZE); vstack.push(v); } }
|
public final void visit_i2s() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(ifac.createIConst((short) v.getValue())); } else { v.load(eContext); final Register r = v.getRegister(); os.writeMOVSX(r, r, WORDSIZE); vstack.push(v); } }
| 5,569
|
public final void visit_iconst(int value) { vstack.push(IntItem.createConst(value)); }
|
public final void visit_iconst(int value) { vstack.push(ifac.createIConst(value)); }
| 5,570
|
public final void visit_iload(int index) { vstack.push(IntItem.createLocal(stackFrame.getEbpOffset(index))); }
|
public final void visit_iload(int index) { vstack.push(ifac.createLocal(JvmType.INT, stackFrame.getEbpOffset(index))); }
| 5,571
|
public final void visit_ineg() { final IntItem val = vstack.popInt(); val.loadIf(eContext, ~Item.Kind.CONSTANT); if (val.isConstant()) { vstack.push(IntItem.createConst(-val.getValue())); } else { os.writeNEG(val.getRegister()); vstack.push(val); } }
|
public final void visit_ineg() { final IntItem val = vstack.popInt(); val.loadIf(eContext, ~Item.Kind.CONSTANT); if (val.isConstant()) { vstack.push(ifac.createIConst(-val.getValue())); } else { os.writeNEG(val.getRegister()); vstack.push(val); } }
| 5,572
|
public final void visit_instanceof(VmConstClass classRef) { // Prepare final X86RegisterPool pool = eContext.getPool(); // Pre-claim ECX L1AHelper.requestRegister(eContext, ECX); // Load reference final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // Allocate tmp registers final Register classr = L1AHelper.requestRegister(eContext, JvmType.INT, false); final Register tmpr = L1AHelper.requestRegister(eContext, JvmType.INT, false); /* Objectref is already on the stack */ writeResolveAndLoadClassToReg(classRef, classr); final Label trueLabel = new Label(this.curInstrLabel + "io-true"); final Label endLabel = new Label(this.curInstrLabel + "io-end"); /* Is instanceof? */ instanceOf(refr, classr, tmpr, trueLabel, false); /* Not instanceof */ //TODO: use setcc instead of jumps os.writeXOR(refr, refr); os.writeJMP(endLabel); os.setObjectRef(trueLabel); os.writeMOV_Const(refr, 1); // Push result os.setObjectRef(endLabel); final IntItem result = IntItem.createReg(refr); pool.transferOwnerTo(refr, result); vstack.push(result); // Release pool.release(classr); pool.release(tmpr); pool.release(ECX); }
|
public final void visit_instanceof(VmConstClass classRef) { // Prepare final X86RegisterPool pool = eContext.getPool(); // Pre-claim ECX L1AHelper.requestRegister(eContext, ECX); // Load reference final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // Allocate tmp registers final Register classr = L1AHelper.requestRegister(eContext, JvmType.INT, false); final Register tmpr = L1AHelper.requestRegister(eContext, JvmType.INT, false); /* Objectref is already on the stack */ writeResolveAndLoadClassToReg(classRef, classr); final Label trueLabel = new Label(this.curInstrLabel + "io-true"); final Label endLabel = new Label(this.curInstrLabel + "io-end"); /* Is instanceof? */ instanceOf(refr, classr, tmpr, trueLabel, false); /* Not instanceof */ //TODO: use setcc instead of jumps os.writeXOR(refr, refr); os.writeJMP(endLabel); os.setObjectRef(trueLabel); os.writeMOV_Const(refr, 1); // Push result os.setObjectRef(endLabel); final IntItem result = (IntItem)ifac.createReg(JvmType.INT, refr); pool.transferOwnerTo(refr, result); vstack.push(result); // Release pool.release(classr); pool.release(tmpr); pool.release(ECX); }
| 5,573
|
public final void visit_irem() { // Pre-claim result in EDX L1AHelper.requestRegister(eContext, EDX); final IntItem result = IntItem.createReg(EDX); eContext.getPool().transferOwnerTo(EDX, result); final IntItem v2 = vstack.popInt(); final IntItem v1 = vstack.popInt(); // v1 must be in EAX L1AHelper.requestRegister(eContext, EAX, v1); // Load v2.loadIf(eContext, ~Item.Kind.LOCAL); v1.loadTo(eContext, EAX); // Calculate os.writeCDQ(); // EAX -> EDX:EAX if (v2.isLocal()) { os.writeIDIV_EAX(FP, v2.getOffsetToFP()); } else { os.writeIDIV_EAX(v2.getRegister()); } // Result vstack.push(result); // Release v1.release(eContext); v2.release(eContext); }
|
public final void visit_irem() { // Pre-claim result in EDX L1AHelper.requestRegister(eContext, EDX); final IntItem result = (IntItem)ifac.createReg(JvmType.INT, EDX); eContext.getPool().transferOwnerTo(EDX, result); final IntItem v2 = vstack.popInt(); final IntItem v1 = vstack.popInt(); // v1 must be in EAX L1AHelper.requestRegister(eContext, EAX, v1); // Load v2.loadIf(eContext, ~Item.Kind.LOCAL); v1.loadTo(eContext, EAX); // Calculate os.writeCDQ(); // EAX -> EDX:EAX if (v2.isLocal()) { os.writeIDIV_EAX(FP, v2.getOffsetToFP()); } else { os.writeIDIV_EAX(v2.getRegister()); } // Result vstack.push(result); // Release v1.release(eContext); v2.release(eContext); }
| 5,574
|
public final void visit_l2i() { final LongItem v = vstack.popLong(); if (v.isConstant()) { vstack.push(IntItem.createConst((int) v.getValue())); } else { final X86RegisterPool pool = eContext.getPool(); v.load(eContext); final Register lsb = v.getLsbRegister(); v.release(eContext); pool.request(lsb); final IntItem result = IntItem.createReg(lsb); pool.transferOwnerTo(lsb, result); vstack.push(result); } }
|
public final void visit_l2i() { final LongItem v = vstack.popLong(); if (v.isConstant()) { vstack.push(ifac.createIConst((int) v.getValue())); } else { final X86RegisterPool pool = eContext.getPool(); v.load(eContext); final Register lsb = v.getLsbRegister(); v.release(eContext); pool.request(lsb); final IntItem result = IntItem.createReg(lsb); pool.transferOwnerTo(lsb, result); vstack.push(result); } }
| 5,575
|
public final void visit_l2i() { final LongItem v = vstack.popLong(); if (v.isConstant()) { vstack.push(IntItem.createConst((int) v.getValue())); } else { final X86RegisterPool pool = eContext.getPool(); v.load(eContext); final Register lsb = v.getLsbRegister(); v.release(eContext); pool.request(lsb); final IntItem result = IntItem.createReg(lsb); pool.transferOwnerTo(lsb, result); vstack.push(result); } }
|
public final void visit_l2i() { final LongItem v = vstack.popLong(); if (v.isConstant()) { vstack.push(IntItem.createConst((int) v.getValue())); } else { final X86RegisterPool pool = eContext.getPool(); v.load(eContext); final Register lsb = v.getLsbRegister(); v.release(eContext); pool.request(lsb); final IntItem result = (IntItem)ifac.createReg(JvmType.INT, lsb); pool.transferOwnerTo(lsb, result); vstack.push(result); } }
| 5,576
|
public final void visit_lconst(long v) { vstack.push(LongItem.createConst(v)); }
|
public final void visit_lconst(long v) { vstack.push(ifac.createLConst(v)); }
| 5,577
|
public final void visit_lload(int index) { vstack.push(LongItem.createLocal(stackFrame.getWideEbpOffset(index))); }
|
public final void visit_lload(int index) { vstack.push(ifac.createLocal(JvmType.LONG, stackFrame.getWideEbpOffset(index))); }
| 5,578
|
public final void visit_lneg() { final LongItem v = vstack.popLong(); if (v.isConstant()) { vstack.push(LongItem.createConst(-v.getValue())); } else { // Load val v.load(eContext); final Register lsb = v.getLsbRegister(); final Register msb = v.getMsbRegister(); // Calculate os.writeNEG(msb); // msb := -msb os.writeNEG(lsb); // lsb := -lsb os.writeSBB(msb, 0); // high += borrow // Push vstack.push(v); } }
|
public final void visit_lneg() { final LongItem v = vstack.popLong(); if (v.isConstant()) { vstack.push(ifac.createLConst(-v.getValue())); } else { // Load val v.load(eContext); final Register lsb = v.getLsbRegister(); final Register msb = v.getMsbRegister(); // Calculate os.writeNEG(msb); // msb := -msb os.writeNEG(lsb); // lsb := -lsb os.writeSBB(msb, 0); // high += borrow // Push vstack.push(v); } }
| 5,579
|
public final void visit_lshr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong(); final X86RegisterPool pool = eContext.getPool(); // Get cnt into ECX if (!cnt.uses(ECX)) { val.spillIfUsing(eContext, ECX); L1AHelper.requestRegister(eContext, ECX, cnt); cnt.loadTo(eContext, ECX); } // Load val val.load(eContext); final Register lsb = val.getLsbRegister(); final Register msb = val.getMsbRegister(); // Calculate os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSAR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeSAR(msb, 31); os.writeSAR_CL(lsb); os.setObjectRef(endLabel); // Push final LongItem result = LongItem.createReg(lsb, msb); pool.transferOwnerTo(lsb, result); pool.transferOwnerTo(msb, result); vstack.push(result); // Release cnt.release(eContext); }
|
public final void visit_lshr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong(); final X86RegisterPool pool = eContext.getPool(); // Get cnt into ECX if (!cnt.uses(ECX)) { val.spillIfUsing(eContext, ECX); L1AHelper.requestRegister(eContext, ECX, cnt); cnt.loadTo(eContext, ECX); } // Load val val.load(eContext); final Register lsb = val.getLsbRegister(); final Register msb = val.getMsbRegister(); // Calculate os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSAR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeSAR(msb, 31); os.writeSAR_CL(lsb); os.setObjectRef(endLabel); // Push final LongItem result = (LongItem)ifac.createReg(JvmType.LONG, lsb, msb); pool.transferOwnerTo(lsb, result); pool.transferOwnerTo(msb, result); vstack.push(result); // Release cnt.release(eContext); }
| 5,580
|
public final void visit_lushr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong(); final X86RegisterPool pool = eContext.getPool(); // Get cnt into ECX if (!cnt.uses(ECX)) { val.spillIfUsing(eContext, ECX); L1AHelper.requestRegister(eContext, ECX, cnt); cnt.loadTo(eContext, ECX); } // Load val val.load(eContext); final Register lsb = val.getLsbRegister(); final Register msb = val.getMsbRegister(); // Calculate os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSHR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeXOR(msb, msb); os.writeSHR_CL(lsb); os.setObjectRef(endLabel); // Push final LongItem result = LongItem.createReg(lsb, msb); pool.transferOwnerTo(lsb, result); pool.transferOwnerTo(msb, result); vstack.push(result); // Release cnt.release(eContext); }
|
public final void visit_lushr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong(); final X86RegisterPool pool = eContext.getPool(); // Get cnt into ECX if (!cnt.uses(ECX)) { val.spillIfUsing(eContext, ECX); L1AHelper.requestRegister(eContext, ECX, cnt); cnt.loadTo(eContext, ECX); } // Load val val.load(eContext); final Register lsb = val.getLsbRegister(); final Register msb = val.getMsbRegister(); // Calculate os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSHR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeXOR(msb, msb); os.writeSHR_CL(lsb); os.setObjectRef(endLabel); // Push final LongItem result = (LongItem)ifac.createReg(JvmType.LONG, lsb, msb); pool.transferOwnerTo(lsb, result); pool.transferOwnerTo(msb, result); vstack.push(result); // Release cnt.release(eContext); }
| 5,581
|
public final void visit_multianewarray(VmConstClass clazz, int dimensions) { // flush all vstack items to the stack // all registers are freed vstack.push(eContext); // Create the dimensions array os.writePUSH(10); /* type=int */ os.writePUSH(dimensions); /* elements */ invokeJavaMethod(context.getAllocPrimitiveArrayMethod()); final RefItem dims = vstack.popRef(); final Register dimsr = dims.getRegister(); // Dimension array is now in dimsr // Pop all dimensions (note the reverse order that allocMultiArray // expects) for (int i = 0; i < dimensions; i++) { final int ofs = arrayDataOffset + (i * slotSize); final IntItem v = vstack.popInt(); v.release1(eContext); os.writePOP(dimsr, ofs); } // Allocate tmp register final Register classr = L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false); // Resolve the array class writeResolveAndLoadClassToReg(clazz, classr); // Release dims, because invokeJavaMethod needs EAX dims.release(eContext); // Now call the multianewarrayhelper os.writePUSH(classr); // array-class os.writePUSH(dimsr); // dimensions[] invokeJavaMethod(context.getAllocMultiArrayMethod()); // Result is now on the vstack // Release L1AHelper.releaseRegister(eContext, classr); }
|
public final void visit_multianewarray(VmConstClass clazz, int dimensions) { // flush all vstack items to the stack // all registers are freed vstack.push(eContext); // Create the dimensions array os.writePUSH(10); /* type=int */ os.writePUSH(dimensions); /* elements */ invokeJavaMethod(context.getAllocPrimitiveArrayMethod()); final RefItem dims = vstack.popRef(); final Register dimsr = dims.getRegister(); // Dimension array is now in dimsr // Pop all dimensions (note the reverse order that allocMultiArray // expects) for (int i = 0; i < dimensions; i++) { final int ofs = arrayDataOffset + (i * 4); final IntItem v = vstack.popInt(); v.release1(eContext); os.writePOP(dimsr, ofs); } // Allocate tmp register final Register classr = L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false); // Resolve the array class writeResolveAndLoadClassToReg(clazz, classr); // Release dims, because invokeJavaMethod needs EAX dims.release(eContext); // Now call the multianewarrayhelper os.writePUSH(classr); // array-class os.writePUSH(dimsr); // dimensions[] invokeJavaMethod(context.getAllocMultiArrayMethod()); // Result is now on the vstack // Release L1AHelper.releaseRegister(eContext, classr); }
| 5,582
|
private final void waload(int jvmType) { final IntItem idx = vstack.popInt(); final RefItem ref = vstack.popRef(); final int valSize; final int scale; final int resultType; final boolean isfloat = (jvmType == JvmType.FLOAT); switch (jvmType) { case JvmType.BYTE: valSize = BYTESIZE; scale = 1; resultType = JvmType.INT; break; case JvmType.CHAR: case JvmType.SHORT: valSize = WORDSIZE; scale = 2; resultType = JvmType.INT; break; case JvmType.INT: valSize = INTSIZE; scale = 4; resultType = JvmType.INT; break; case JvmType.FLOAT: valSize = INTSIZE; scale = 4; resultType = JvmType.FLOAT; break; case JvmType.REFERENCE: valSize = INTSIZE; scale = 4; resultType = JvmType.REFERENCE; break; default: throw new IllegalArgumentException("Invalid type " + jvmType); } // Create result final WordItem result; final Register resultr; if (isfloat) { result = FloatItem.createFPUStack(); resultr = null; } else { result = L1AHelper.requestWordRegister(eContext, resultType, (valSize == BYTESIZE)); resultr = result.getRegister(); } // Load idx.loadIf(eContext, ~Item.Kind.CONSTANT); ref.load(eContext); final Register refr = ref.getRegister(); // Verify checkBounds(ref, idx); if (isfloat) { FPUHelper.ensureStackCapacity(os, eContext, vstack, 1); } // Load data if (idx.isConstant()) { final int offset = idx.getValue() * scale; if (isfloat) { os.writeFLD32(refr, offset + arrayDataOffset); } else { os.writeMOV(valSize, resultr, refr, offset + arrayDataOffset); } } else { final Register idxr = idx.getRegister(); if (isfloat) { os.writeFLD32(refr, idxr, scale, arrayDataOffset); } else { os.writeMOV(valSize, resultr, refr, idxr, scale, arrayDataOffset); } } // Post process switch (jvmType) { case JvmType.BYTE: os.writeMOVSX(resultr, resultr, BYTESIZE); break; case JvmType.CHAR: os.writeMOVZX(resultr, resultr, WORDSIZE); break; case JvmType.SHORT: os.writeMOVSX(resultr, resultr, WORDSIZE); break; } // Release ref.release(eContext); idx.release(eContext); // Push result vstack.push(result); if (isfloat) { vstack.fpuStack.push(result); } }
|
private final void waload(int jvmType) { final IntItem idx = vstack.popInt(); final RefItem ref = vstack.popRef(); final int valSize; final int scale; final int resultType; final boolean isfloat = (jvmType == JvmType.FLOAT); switch (jvmType) { case JvmType.BYTE: valSize = BYTESIZE; scale = 1; resultType = JvmType.INT; break; case JvmType.CHAR: case JvmType.SHORT: valSize = WORDSIZE; scale = 2; resultType = JvmType.INT; break; case JvmType.INT: valSize = INTSIZE; scale = 4; resultType = JvmType.INT; break; case JvmType.FLOAT: valSize = INTSIZE; scale = 4; resultType = JvmType.FLOAT; break; case JvmType.REFERENCE: valSize = INTSIZE; scale = 4; resultType = JvmType.REFERENCE; break; default: throw new IllegalArgumentException("Invalid type " + jvmType); } // Create result final WordItem result; final Register resultr; if (isfloat) { result = (WordItem)ifac.createFPUStack(JvmType.FLOAT); resultr = null; } else { result = L1AHelper.requestWordRegister(eContext, resultType, (valSize == BYTESIZE)); resultr = result.getRegister(); } // Load idx.loadIf(eContext, ~Item.Kind.CONSTANT); ref.load(eContext); final Register refr = ref.getRegister(); // Verify checkBounds(ref, idx); if (isfloat) { FPUHelper.ensureStackCapacity(os, eContext, vstack, 1); } // Load data if (idx.isConstant()) { final int offset = idx.getValue() * scale; if (isfloat) { os.writeFLD32(refr, offset + arrayDataOffset); } else { os.writeMOV(valSize, resultr, refr, offset + arrayDataOffset); } } else { final Register idxr = idx.getRegister(); if (isfloat) { os.writeFLD32(refr, idxr, scale, arrayDataOffset); } else { os.writeMOV(valSize, resultr, refr, idxr, scale, arrayDataOffset); } } // Post process switch (jvmType) { case JvmType.BYTE: os.writeMOVSX(resultr, resultr, BYTESIZE); break; case JvmType.CHAR: os.writeMOVZX(resultr, resultr, WORDSIZE); break; case JvmType.SHORT: os.writeMOVSX(resultr, resultr, WORDSIZE); break; } // Release ref.release(eContext); idx.release(eContext); // Push result vstack.push(result); if (isfloat) { vstack.fpuStack.push(result); } }
| 5,583
|
public BasicBlock(int startPC) { this(startPC, -1, false); }
|
public BasicBlock(int startPC) { this(startPC, -1, false); }
| 5,584
|
public Rectangle2D getBounds2D() { // XXX Implement. throw new Error("not implemented"); }
|
public Rectangle2D getBounds2D() { // XXX Implement. if (solids.size() == 0) return new Rectangle2D.Double(0.0, 0.0, 0.0, 0.0); double xmin; double xmax; double ymin; double ymax; xmin = xmax = ((Segment) solids.elementAt(0)).P1.getX(); ymin = ymax = ((Segment) solids.elementAt(0)).P1.getY(); for (int path = 0; path < solids.size(); path++) { Rectangle2D r = ((Segment) solids.elementAt(path)).getPathBounds(); xmin = Math.min(r.getMinX(), xmin); ymin = Math.min(r.getMinY(), ymin); xmax = Math.max(r.getMaxX(), xmax); ymax = Math.max(r.getMaxY(), ymax); }
| 5,585
|
void jbInit() throws Exception { // create some reusable borders and layouts BorderLayout borderLayout = new BorderLayout(); mapper = new KeyMapper(); mapper.init(); functions = new JList(lm); // add list selection listener to our functions list so that we // can display the mapped key(s) to the function when a new // function is selected. functions.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent lse) { if (!lse.getValueIsAdjusting()) { setKeyDescription(functions.getSelectedIndex()); } } }); loadList(LangTool.getString("key.labelKeys")); functions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JScrollPane functionsScroll = new JScrollPane(functions); JPanel fp = new JPanel(); JComboBox whichKeys = new JComboBox(); whichKeys.addItem(LangTool.getString("key.labelKeys")); whichKeys.addItem(LangTool.getString("key.labelMacros")); whichKeys.addItem(LangTool.getString("key.labelSpecial")); whichKeys.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); loadList((String)cb.getSelectedItem()); } }); fp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("key.labelDesc"))); fp.setLayout(new BoxLayout(fp,BoxLayout.Y_AXIS)); fp.add(whichKeys); fp.add(functionsScroll); strokeDesc.setColumns(30); strokeDesc.setBackground(functions.getBackground()); strokeDesc.setEditable(false); strokeDescAlt.setColumns(30); strokeDescAlt.setBackground(functions.getBackground()); strokeDescAlt.setEditable(false); JPanel dp = new JPanel(); dp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("key.labelMapTo"))); dp.setLayout(new BoxLayout(dp,BoxLayout.Y_AXIS)); JPanel primeKeyPanel = new JPanel(); primeKeyPanel.add(strokeDesc); addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Prime", primeKeyPanel,true); addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Prime", primeKeyPanel,true); JPanel altKeyPanel = new JPanel(); altKeyPanel.add(strokeDescAlt); addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Alt", altKeyPanel,true); addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Alt", altKeyPanel,true); dp.add(primeKeyPanel); dp.add(altKeyPanel); keyPanel.setLayout(borderLayout); keyPanel.add(fp,BorderLayout.WEST); keyPanel.add(dp,BorderLayout.CENTER); // add the panels to our dialog getContentPane().add(keyPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // add option buttons to options panel// addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP",options,true);// addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE",options,true); addOptButton(LangTool.getString("key.labelDone","Done"),"DONE",options,true); this.setModal(true); this.setTitle(LangTool.getString("key.title")); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // now show the world what we can do show(); }
|
void jbInit() throws Exception { // create some reusable borders and layouts BorderLayout borderLayout = new BorderLayout(); mapper = new KeyMapper(); mapper.init(); functions = new JList(lm); // add list selection listener to our functions list so that we // can display the mapped key(s) to the function when a new // function is selected. functions.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent lse) { if (!lse.getValueIsAdjusting()) { setKeyDescription(functions.getSelectedIndex()); } } }); loadList(LangTool.getString("key.labelKeys")); functions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JScrollPane functionsScroll = new JScrollPane(functions); JPanel fp = new JPanel(); JComboBox whichKeys = new JComboBox(); whichKeys.addItem(LangTool.getString("key.labelKeys")); whichKeys.addItem(LangTool.getString("key.labelMacros")); whichKeys.addItem(LangTool.getString("key.labelSpecial")); whichKeys.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); loadList((String)cb.getSelectedItem()); } }); fp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("key.labelDesc"))); fp.setLayout(new BoxLayout(fp,BoxLayout.Y_AXIS)); fp.add(whichKeys); fp.add(functionsScroll); strokeDesc.setColumns(30); strokeDesc.setBackground(functions.getBackground()); strokeDesc.setEditable(false); strokeDescAlt.setColumns(30); strokeDescAlt.setBackground(functions.getBackground()); strokeDescAlt.setEditable(false); JPanel dp = new JPanel(); dp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("key.labelMapTo"))); dp.setLayout(new BoxLayout(dp,BoxLayout.Y_AXIS)); JPanel primeKeyPanel = new JPanel(); primeKeyPanel.add(strokeDesc); addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Prime", primeKeyPanel,true); addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Prime", primeKeyPanel,true); JPanel altKeyPanel = new JPanel(); altKeyPanel.add(strokeDescAlt); addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Alt", altKeyPanel,true); addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Alt", altKeyPanel,true); dp.add(primeKeyPanel); dp.add(altKeyPanel); keyPanel.setLayout(borderLayout); keyPanel.add(fp,BorderLayout.WEST); keyPanel.add(dp,BorderLayout.CENTER); // add the panels to our dialog getContentPane().add(keyPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // add option buttons to options panel// addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP",options,true);// addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE",options,true); addOptButton(LangTool.getString("key.labelDone","Done"),"DONE",options,true); this.setModal(true); this.setTitle(LangTool.getString("key.title")); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // now show the world what we can do show(); }
| 5,587
|
void jbInit() throws Exception { // create some reusable borders and layouts BorderLayout borderLayout = new BorderLayout(); mapper = new KeyMapper(); mapper.init(); functions = new JList(lm); // add list selection listener to our functions list so that we // can display the mapped key(s) to the function when a new // function is selected. functions.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent lse) { if (!lse.getValueIsAdjusting()) { setKeyDescription(functions.getSelectedIndex()); } } }); loadList(LangTool.getString("key.labelKeys")); functions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JScrollPane functionsScroll = new JScrollPane(functions); JPanel fp = new JPanel(); JComboBox whichKeys = new JComboBox(); whichKeys.addItem(LangTool.getString("key.labelKeys")); whichKeys.addItem(LangTool.getString("key.labelMacros")); whichKeys.addItem(LangTool.getString("key.labelSpecial")); whichKeys.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); loadList((String)cb.getSelectedItem()); } }); fp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("key.labelDesc"))); fp.setLayout(new BoxLayout(fp,BoxLayout.Y_AXIS)); fp.add(whichKeys); fp.add(functionsScroll); strokeDesc.setColumns(30); strokeDesc.setBackground(functions.getBackground()); strokeDesc.setEditable(false); strokeDescAlt.setColumns(30); strokeDescAlt.setBackground(functions.getBackground()); strokeDescAlt.setEditable(false); JPanel dp = new JPanel(); dp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("key.labelMapTo"))); dp.setLayout(new BoxLayout(dp,BoxLayout.Y_AXIS)); JPanel primeKeyPanel = new JPanel(); primeKeyPanel.add(strokeDesc); addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Prime", primeKeyPanel,true); addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Prime", primeKeyPanel,true); JPanel altKeyPanel = new JPanel(); altKeyPanel.add(strokeDescAlt); addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Alt", altKeyPanel,true); addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Alt", altKeyPanel,true); dp.add(primeKeyPanel); dp.add(altKeyPanel); keyPanel.setLayout(borderLayout); keyPanel.add(fp,BorderLayout.WEST); keyPanel.add(dp,BorderLayout.CENTER); // add the panels to our dialog getContentPane().add(keyPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // add option buttons to options panel// addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP",options,true);// addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE",options,true); addOptButton(LangTool.getString("key.labelDone","Done"),"DONE",options,true); this.setModal(true); this.setTitle(LangTool.getString("key.title")); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // now show the world what we can do show(); }
|
void jbInit() throws Exception { // create some reusable borders and layouts BorderLayout borderLayout = new BorderLayout(); mapper = new KeyMapper(); mapper.init(); functions = new JList(lm); // add list selection listener to our functions list so that we // can display the mapped key(s) to the function when a new // function is selected. functions.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent lse) { if (!lse.getValueIsAdjusting()) { setKeyDescription(functions.getSelectedIndex()); } } }); loadList(LangTool.getString("key.labelKeys")); functions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JScrollPane functionsScroll = new JScrollPane(functions); JPanel fp = new JPanel(); JComboBox whichKeys = new JComboBox(); whichKeys.addItem(LangTool.getString("key.labelKeys")); whichKeys.addItem(LangTool.getString("key.labelMacros")); whichKeys.addItem(LangTool.getString("key.labelSpecial")); whichKeys.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); loadList((String)cb.getSelectedItem()); } }); fp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("key.labelDesc"))); fp.setLayout(new BoxLayout(fp,BoxLayout.Y_AXIS)); fp.add(whichKeys); fp.add(functionsScroll); strokeDesc.setColumns(30); strokeDesc.setBackground(functions.getBackground()); strokeDesc.setEditable(false); strokeDescAlt.setColumns(30); strokeDescAlt.setBackground(functions.getBackground()); strokeDescAlt.setEditable(false); JPanel dp = new JPanel(); dp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("key.labelMapTo"))); dp.setLayout(new BoxLayout(dp,BoxLayout.Y_AXIS)); JPanel primeKeyPanel = new JPanel(); primeKeyPanel.add(strokeDesc); addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Prime", primeKeyPanel,true); addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Prime", primeKeyPanel,true); JPanel altKeyPanel = new JPanel(); altKeyPanel.add(strokeDescAlt); addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Alt", altKeyPanel,true); addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Alt", altKeyPanel,true); dp.add(primeKeyPanel); dp.add(altKeyPanel); keyPanel.setLayout(borderLayout); keyPanel.add(fp,BorderLayout.WEST); keyPanel.add(dp,BorderLayout.CENTER); // add the panels to our dialog getContentPane().add(keyPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // add option buttons to options panel// addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP",options,true);// addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE",options,true); addOptButton(LangTool.getString("key.labelDone","Done"),"DONE",options,true); this.setModal(true); this.setTitle(LangTool.getString("key.title")); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // now show the world what we can do show(); }
| 5,588
|
private void mapIt() { Object[] message = new Object[1]; JPanel kgp = new JPanel(); final KeyGetter kg = new KeyGetter(); kg.setForeground(Color.blue); message[0] = kgp; String function; if (functions.getSelectedValue() instanceof String) function = (String)functions.getSelectedValue(); else if (functions.getSelectedValue() instanceof Macro) { function = ((Macro)functions.getSelectedValue()).toString(); } else function = ((KeyDescription)functions.getSelectedValue()).toString(); kg.setText(LangTool.getString("key.labelMessage") + function); kgp.add(kg); String[] options = new String[1]; options[0] = LangTool.getString("key.labelClose"); JOptionPane opain = new JOptionPane(message, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, // option type null, options, options[0]); dialog = opain.createDialog(this, getTitle()); // add window listener to the dialog so that we can place focus on the // key getter label instead of default and set the new key value when // the window is closed. dialog.addWindowListener(new WindowAdapter() { boolean gotFocus = false; public void windowClosed(WindowEvent we) { setNewKeyStrokes(kg.keyevent); } public void windowActivated(WindowEvent we) { // Once window gets focus, set initial focus to our KeyGetter // component if (!gotFocus) { kg.grabFocus(); gotFocus = true; } } }); dialog.setVisible(true); }
|
private void mapIt() { Object[] message = new Object[1]; JPanel kgp = new JPanel(); final KeyGetterInterface kg = getMeAKeyProcessor(); kg.setForeground(Color.blue); message[0] = kgp; String function; if (functions.getSelectedValue() instanceof String) function = (String)functions.getSelectedValue(); else if (functions.getSelectedValue() instanceof Macro) { function = ((Macro)functions.getSelectedValue()).toString(); } else function = ((KeyDescription)functions.getSelectedValue()).toString(); kg.setText(LangTool.getString("key.labelMessage") + function); kgp.add(kg); String[] options = new String[1]; options[0] = LangTool.getString("key.labelClose"); JOptionPane opain = new JOptionPane(message, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, // option type null, options, options[0]); dialog = opain.createDialog(this, getTitle()); // add window listener to the dialog so that we can place focus on the // key getter label instead of default and set the new key value when // the window is closed. dialog.addWindowListener(new WindowAdapter() { boolean gotFocus = false; public void windowClosed(WindowEvent we) { setNewKeyStrokes(kg.keyevent); } public void windowActivated(WindowEvent we) { // Once window gets focus, set initial focus to our KeyGetter // component if (!gotFocus) { kg.grabFocus(); gotFocus = true; } } }); dialog.setVisible(true); }
| 5,589
|
private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { Object o = functions.getSelectedValue(); String name; if (o instanceof Macro) { name = ((Macro)o).getFullName(); } else { name = (String)o; } mapper.removeKeyStroke(name); strokeDesc.setText(mapper.getKeyStrokeDesc( name)); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } mods = true; }
|
private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { Object o = functions.getSelectedValue(); String name; if (o instanceof Macro) { name = ((Macro)o).getFullName(); } else { name = (String)o; } mapper.removeKeyStroke(name); strokeDesc.setText(mapper.getKeyStrokeDesc( name)); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } mods = true; }
| 5,591
|
private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { Object o = functions.getSelectedValue(); String name; if (o instanceof Macro) { name = ((Macro)o).getFullName(); } else { name = (String)o; } mapper.removeKeyStroke(name); strokeDesc.setText(mapper.getKeyStrokeDesc( name)); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } mods = true; }
|
private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { Object o = functions.getSelectedValue(); String name; if (o instanceof Macro) { name = ((Macro)o).getFullName(); } else { name = (String)o; } mapper.removeKeyStroke(name); strokeDesc.setText(mapper.getKeyStrokeDesc( name)); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } mods = true; }
| 5,592
|
private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { Object o = functions.getSelectedValue(); String name; if (o instanceof Macro) { name = ((Macro)o).getFullName(); } else { name = (String)o; } mapper.removeKeyStroke(name); strokeDesc.setText(mapper.getKeyStrokeDesc( name)); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } mods = true; }
|
private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { Object o = functions.getSelectedValue(); String name; if (o instanceof Macro) { name = ((Macro)o).getFullName(); } else { name = (String)o; } mapper.removeKeyStroke(name); strokeDesc.setText(mapper.getKeyStrokeDesc( name)); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } mods = true; }
| 5,593
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.