rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
final EvictorReference ref = (EvictorReference)iter.next(); if (ref != null && ref.get() == null) {
Object o = iter.next(); while (o instanceof LenderReference) { o = ((LenderReference)o).get(); } if (o == null) {
public int size() { if (prune) { synchronized (getObjectPool().getPool()) { final Iterator iter = super.listIterator(); while (iter.hasNext()) { final EvictorReference ref = (EvictorReference)iter.next(); if (ref != null && ref.get() == null) { iter.remove(); } } } } return super.size(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/c533b17f67a27066967191311fa5512bef24cbc8/EvictorLender.java/clean/src/java/org/apache/commons/pool/composite/EvictorLender.java
return (currentUserLinkPath);
try { result = new String( currentUserLinkPath, "UTF-16" ); } catch (UnsupportedEncodingException e) { e.printStackTrace(); }
public String getLinkPath(int userType) { if (userType == CURRENT_USER) { return (currentUserLinkPath); } else { return (allUsersLinkPath); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/ShellLink.java/buggy/src/lib/com/izforge/izpack/util/os/ShellLink.java
return (allUsersLinkPath);
try { result = new String(allUsersLinkPath, "UTF-16"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); }
public String getLinkPath(int userType) { if (userType == CURRENT_USER) { return (currentUserLinkPath); } else { return (allUsersLinkPath); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/ShellLink.java/buggy/src/lib/com/izforge/izpack/util/os/ShellLink.java
return result;
public String getLinkPath(int userType) { if (userType == CURRENT_USER) { return (currentUserLinkPath); } else { return (allUsersLinkPath); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/ShellLink.java/buggy/src/lib/com/izforge/izpack/util/os/ShellLink.java
return (allUsersLinkPath);
String result = null; try { result = new String(allUsersLinkPath, "UTF-16"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return result;
public String getallUsersLinkPath() { return (allUsersLinkPath); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/ShellLink.java/buggy/src/lib/com/izforge/izpack/util/os/ShellLink.java
return (currentUserLinkPath);
String result =null; try { result = new String( currentUserLinkPath, "UTF-16"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return result;
public String getcurrentUserLinkPath() { return (currentUserLinkPath); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/ShellLink.java/buggy/src/lib/com/izforge/izpack/util/os/ShellLink.java
private void setAllLinkPaths() throws IllegalArgumentException
private void setAllLinkPaths() throws IllegalArgumentException, UnsupportedEncodingException
private void setAllLinkPaths() throws IllegalArgumentException { // sets currentUsersLinkPath and allUsersLinkPath GetFullLinkPath(CURRENT_USER, linkType); GetFullLinkPath(ALL_USERS, linkType); // be sure userType is valid. Override initial choice if not. if (userType == CURRENT_USER && currentUserLinkPath.length() == 0) { userType = ALL_USERS; } else if (userType == ALL_USERS && allUsersLinkPath.length() == 0) { userType = CURRENT_USER; } if (allUsersLinkPath.length() == 0 && currentUserLinkPath.length() == 0) { throw (new IllegalArgumentException( "linkType " + linkType + " is invalid.")); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/ShellLink.java/buggy/src/lib/com/izforge/izpack/util/os/ShellLink.java
if (userType == CURRENT_USER && currentUserLinkPath.length() == 0)
if (userType == CURRENT_USER && new String(currentUserLinkPath, "UTF-16").length() == 0)
private void setAllLinkPaths() throws IllegalArgumentException { // sets currentUsersLinkPath and allUsersLinkPath GetFullLinkPath(CURRENT_USER, linkType); GetFullLinkPath(ALL_USERS, linkType); // be sure userType is valid. Override initial choice if not. if (userType == CURRENT_USER && currentUserLinkPath.length() == 0) { userType = ALL_USERS; } else if (userType == ALL_USERS && allUsersLinkPath.length() == 0) { userType = CURRENT_USER; } if (allUsersLinkPath.length() == 0 && currentUserLinkPath.length() == 0) { throw (new IllegalArgumentException( "linkType " + linkType + " is invalid.")); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/ShellLink.java/buggy/src/lib/com/izforge/izpack/util/os/ShellLink.java
else if (userType == ALL_USERS && allUsersLinkPath.length() == 0)
else if (userType == ALL_USERS && new String( allUsersLinkPath, "UTF-16").length() == 0)
private void setAllLinkPaths() throws IllegalArgumentException { // sets currentUsersLinkPath and allUsersLinkPath GetFullLinkPath(CURRENT_USER, linkType); GetFullLinkPath(ALL_USERS, linkType); // be sure userType is valid. Override initial choice if not. if (userType == CURRENT_USER && currentUserLinkPath.length() == 0) { userType = ALL_USERS; } else if (userType == ALL_USERS && allUsersLinkPath.length() == 0) { userType = CURRENT_USER; } if (allUsersLinkPath.length() == 0 && currentUserLinkPath.length() == 0) { throw (new IllegalArgumentException( "linkType " + linkType + " is invalid.")); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/ShellLink.java/buggy/src/lib/com/izforge/izpack/util/os/ShellLink.java
if (allUsersLinkPath.length() == 0 && currentUserLinkPath.length() == 0) { throw (new IllegalArgumentException(
if ( new String(allUsersLinkPath, "UTF-16").length() == 0 && new String(currentUserLinkPath, "UTF-16").length() == 0) { throw (new IllegalArgumentException(
private void setAllLinkPaths() throws IllegalArgumentException { // sets currentUsersLinkPath and allUsersLinkPath GetFullLinkPath(CURRENT_USER, linkType); GetFullLinkPath(ALL_USERS, linkType); // be sure userType is valid. Override initial choice if not. if (userType == CURRENT_USER && currentUserLinkPath.length() == 0) { userType = ALL_USERS; } else if (userType == ALL_USERS && allUsersLinkPath.length() == 0) { userType = CURRENT_USER; } if (allUsersLinkPath.length() == 0 && currentUserLinkPath.length() == 0) { throw (new IllegalArgumentException( "linkType " + linkType + " is invalid.")); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/ShellLink.java/buggy/src/lib/com/izforge/izpack/util/os/ShellLink.java
public void setLinkType(int type) throws IllegalArgumentException
public void setLinkType(int type) throws IllegalArgumentException, UnsupportedEncodingException
public void setLinkType(int type) throws IllegalArgumentException { if ((type < MIN_TYPE) || (type > MAX_TYPE)) { throw (new IllegalArgumentException( "illegal value for type")); } linkType = type; // set curretnUsersLinkPath, allUsersLinkPath, sets userType to valid. setAllLinkPaths(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/ShellLink.java/buggy/src/lib/com/izforge/izpack/util/os/ShellLink.java
SAXBuilder parser = new SAXBuilder( "org.apache.crimson.parser.XMLReaderImpl", false );
private SparseGraph parseFile( String fileName ) { SparseGraph graph = new SparseGraph(); graph.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); try { _logger.info( "Parsing file: " + fileName ); _doc = _parser.build( fileName ); // Parse all vertices (nodes) Iterator iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "node" ) ); while ( iter.hasNext() ) { Object o = iter.next(); if ( o instanceof org.jdom.Element ) { org.jdom.Element element = (org.jdom.Element)o; if ( element.getAttributeValue( "yfiles.foldertype" ) != null ) { _logger.debug( "Excluded node: " + element.getAttributeValue( "yfiles.foldertype" ) ); continue; } _logger.debug( "id: " + element.getAttributeValue( "id" ) ); Iterator iter2 = element.getDescendants( new org.jdom.filter.ElementFilter( "NodeLabel" ) ); while ( iter2.hasNext() ) { Object o2 = iter2.next(); if ( o2 instanceof org.jdom.Element ) { org.jdom.Element nodeLabel = (org.jdom.Element)o2; _logger.debug( "Full name: " + nodeLabel.getQualifiedName() ); _logger.debug( "Name: " + nodeLabel.getTextTrim() ); DirectedSparseVertex v = (DirectedSparseVertex) graph.addVertex( new DirectedSparseVertex() ); v.addUserDatum( ID_KEY, element.getAttributeValue( "id" ), UserData.SHARED ); v.addUserDatum( VISITED_KEY, new Integer( 0 ), UserData.SHARED ); v.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); String str = nodeLabel.getTextTrim(); Pattern p = Pattern.compile( "(.*)", Pattern.MULTILINE ); Matcher m = p.matcher( str ); String label; if ( m.find( )) { label = m.group( 1 ); v.addUserDatum( LABEL_KEY, label, UserData.SHARED ); } else { throw new RuntimeException( "Label must be defined." ); } _logger.debug( "Added vertex: " + v.getUserDatum( LABEL_KEY ) ); // If merge is defined, find it... // If defined, it means that the node will be merged with all other nodes wit the same name, // but not replaced by any subgraphs p = Pattern.compile( "\\n(MERGE)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { v.addUserDatum( MERGE, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found MERGE for vertex: " + label ); } // If no merge is defined, find it... // If defined, it means that when merging graphs, this specific vertex will not be merged // or replaced by any subgraphs p = Pattern.compile( "\\n(NO_MERGE)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { v.addUserDatum( NO_MERGE, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found NO_MERGE for vertex: " + label ); } // If BLOCKED is defined, find it... // If defined, it means that this vertex will not be added to the graph // Sometimes it can be useful during testing to mark vertcies as BLOCKED // due to bugs in the system you test. When the bug is removed, the BLOCKED // tag can be removed. p = Pattern.compile( "\\n(BLOCKED)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { _logger.debug( "Found BLOCKED. This vetex will be removed from the graph: " + label ); v.addUserDatum( BLOCKED, BLOCKED, UserData.SHARED ); } // NOTE: Only for html applications // In browsers, the usage of the 'Back'-button can be used. // If defined, with a value value, which depicts the probability for the edge // to be executed, tha back-button will be pressed in the browser. // A value of 0.05 is the same as 5% chance of going down this road. p = Pattern.compile( "\\n(back=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find( ) ) { Float probability; String value = m.group( 2 ); try { probability = Float.valueOf( value.trim() ); } catch ( NumberFormatException error ) { throw new RuntimeException( "For label: " + label + ", back is not a correct float value: " + error.toString() ); } _logger.debug( "Found FLOAT value: " + probability + ", for vertex: " + label ); v.addUserDatum( BACK_KEY, probability, UserData.SHARED ); } } } } } Object[] vertices = graph.getVertices().toArray(); // Parse all edges (arrows or transtitions) iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "edge" ) ); while ( iter.hasNext() ) { Object o = iter.next(); if ( o instanceof org.jdom.Element ) { org.jdom.Element element = (org.jdom.Element)o; _logger.debug( "id: " + element.getAttributeValue( "id" ) ); Iterator iter2 = element.getDescendants( new org.jdom.filter.ElementFilter( "EdgeLabel" ) ); org.jdom.Element edgeLabel = null; if ( iter2.hasNext() ) { Object o2 = iter2.next(); if ( o2 instanceof org.jdom.Element ) { edgeLabel = (org.jdom.Element)o2; _logger.debug( "Full name: " + edgeLabel.getQualifiedName() ); _logger.debug( "Name: " + edgeLabel.getTextTrim() ); } } _logger.debug( "source: " + element.getAttributeValue( "source" ) ); _logger.debug( "target: " + element.getAttributeValue( "target" ) ); DirectedSparseVertex source = null; DirectedSparseVertex dest = null; for ( int i = 0; i < vertices.length; i++ ) { DirectedSparseVertex vertex = (DirectedSparseVertex)vertices[ i ]; // Find source vertex if ( vertex.getUserDatum( ID_KEY ).equals( element.getAttributeValue( "source" ) ) && vertex.getUserDatum( FILE_KEY ).equals( fileName ) ) { source = vertex; } if ( vertex.getUserDatum( ID_KEY ).equals( element.getAttributeValue( "target" ) ) && vertex.getUserDatum( FILE_KEY ).equals( fileName ) ) { dest = vertex; } } if ( source == null ) { String msg = "Could not find starting node for edge. Name: " + element.getAttributeValue( "source" ); _logger.error( msg ); throw new RuntimeException( msg ); } if ( dest == null ) { String msg = "Could not find end node for edge. Name: " + element.getAttributeValue( "target" ); _logger.error( msg ); throw new RuntimeException( msg ); } DirectedSparseEdge e = new DirectedSparseEdge( source, dest ); graph.addEdge( e ); e.addUserDatum( ID_KEY, element.getAttributeValue( "id" ), UserData.SHARED ); e.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); if ( edgeLabel != null ) { String str = edgeLabel.getTextTrim(); Pattern p = Pattern.compile( "(.*)", Pattern.MULTILINE ); Matcher m = p.matcher( str ); String label = null; if ( m.find() ) { label = m.group( 1 ); if ( !label.equalsIgnoreCase("") ) { e.addUserDatum( LABEL_KEY, label, UserData.SHARED ); _logger.debug( "Found label= " + label + " for edge id: " + edgeLabel.getQualifiedName() ); } } else { throw new RuntimeException( "Label for edge must be defined." ); } if ( label == null || label.equalsIgnoreCase("") ) { DirectedSparseVertex srcV = (DirectedSparseVertex)e.getSource(); String s = (String)srcV.getUserDatum( LABEL_KEY ); if ( s.compareTo( START_NODE ) != 0 ) { throw new RuntimeException( "Label for a edge comming from a non-Start vertex, must be defined." ); } } // If weight is defined, find it... // weight must be associated with a value, which depicts the probability for the edge // to be executed. // A value of 0.05 is the same as 5% chance of going down this road. p = Pattern.compile( "\\n(weight=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { Float weight; String value = m.group( 2 ); try { weight = Float.valueOf( value.trim() ); _logger.debug( "Found weight= " + weight + " for edge: " + label ); } catch ( NumberFormatException error ) { throw new RuntimeException( "For label: " + label + ", weight is not a correct float value: " + error.toString() ); } e.addUserDatum( WEIGHT_KEY, weight, UserData.SHARED ); } // If BLOCKED is defined, find it... // If defined, it means that this edge will not be added to the graph // Sometimes it can be useful during testing to mark edges as BLOCKED // due to bugs in the system you test. When the bug is removed, the BLOCKED // tag can be removed. p = Pattern.compile( "\\n(BLOCKED)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { _logger.debug( "Found BLOCKED. This edge will be removed from the graph: " + label ); e.addUserDatum( BLOCKED, BLOCKED, UserData.SHARED ); } // If No_history is defined, find it... // If defined, it means that when executing this edge, it shall not // be added to the history list of passed edgses. p = Pattern.compile( "\\n(No_history)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { e.addUserDatum( NO_HISTORY, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found No_history for edge: " + label ); } // If condition used defined, find it... p = Pattern.compile( "\\n(if: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); HashMap conditions = null; while ( m.find( ) ) { if ( conditions == null ) { conditions = new HashMap(); } String variable = m.group( 2 ); Boolean state = Boolean.valueOf( m.group( 3 ) ); conditions.put( variable, state ); _logger.debug( "Condition: " + variable + " = " + state ); } if ( conditions != null ) { e.addUserDatum( CONDITION_KEY, conditions, UserData.SHARED ); } // If state are defined, find them... HashMap states = null; p = Pattern.compile( "\\n(state: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( states == null ) { states = new HashMap(); } String variable = m.group( 2 ); Boolean state = Boolean.valueOf( m.group( 3 ) ); states.put( variable, state ); _logger.debug( "State: " + variable + " = " + state ); } if ( states != null ) { e.addUserDatum( STATE_KEY, states, UserData.SHARED ); } // If string variables are defined, find them... HashMap variables = null; p = Pattern.compile( "\\n(string: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); String variable = m.group( 3 ); variables.put( variableLabel, variable ); _logger.debug( "String variable: " + variableLabel + " = " + variable ); } // If integer variables are defined, find them... p = Pattern.compile( "\\n(integer: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); Integer variable = Integer.valueOf( m.group( 3 ) ); variables.put( variableLabel, variable ); _logger.debug( "Integer variable: " + variableLabel + " = " + variable ); } // If integer variables are defined, find them... p = Pattern.compile( "\\n(float: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); Float variable = Float.valueOf( m.group( 3 ) ); variables.put( variableLabel, variable ); _logger.debug( "Float variable: " + variableLabel + " = " + variable ); } if ( variables != null ) { e.addUserDatum( VARIABLE_KEY, variables, UserData.SHARED ); } } String str = (String)e.getUserDatum( LABEL_KEY ); if ( str == null || str.equals( "" ) ) { DirectedSparseVertex v = (DirectedSparseVertex)e.getSource(); str = (String)v.getUserDatum( LABEL_KEY ); if ( str.equals( "Start" ) == false ) { throw new RuntimeException( "Found an edge with no (or empty) label. This is only allowed when the source vertex is a Start vertex." ); } } e.addUserDatum( VISITED_KEY, new Integer( 0 ), UserData.SHARED ); _logger.debug( "Adderade edge: \"" + e.getUserDatum( LABEL_KEY ) + "\"" ); } } } catch ( org.jdom.JDOMException e ) { _logger.error( e ); throw new RuntimeException( "Kunde inte skanna filen: " + fileName ); } catch ( IOException e ) { e.printStackTrace(); throw new RuntimeException( "Kunde inte skanna filen: " + fileName ); } removeBlockedEntities( graph ); return graph; }
54457 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54457/81f66842d96640a147b514a21d2c8f1423313591/ModelBasedTesting.java/buggy/mbt/src/org/tigris/mbt/ModelBasedTesting.java
_doc = _parser.build( fileName );
Document doc = parser.build( fileName );
private SparseGraph parseFile( String fileName ) { SparseGraph graph = new SparseGraph(); graph.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); try { _logger.info( "Parsing file: " + fileName ); _doc = _parser.build( fileName ); // Parse all vertices (nodes) Iterator iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "node" ) ); while ( iter.hasNext() ) { Object o = iter.next(); if ( o instanceof org.jdom.Element ) { org.jdom.Element element = (org.jdom.Element)o; if ( element.getAttributeValue( "yfiles.foldertype" ) != null ) { _logger.debug( "Excluded node: " + element.getAttributeValue( "yfiles.foldertype" ) ); continue; } _logger.debug( "id: " + element.getAttributeValue( "id" ) ); Iterator iter2 = element.getDescendants( new org.jdom.filter.ElementFilter( "NodeLabel" ) ); while ( iter2.hasNext() ) { Object o2 = iter2.next(); if ( o2 instanceof org.jdom.Element ) { org.jdom.Element nodeLabel = (org.jdom.Element)o2; _logger.debug( "Full name: " + nodeLabel.getQualifiedName() ); _logger.debug( "Name: " + nodeLabel.getTextTrim() ); DirectedSparseVertex v = (DirectedSparseVertex) graph.addVertex( new DirectedSparseVertex() ); v.addUserDatum( ID_KEY, element.getAttributeValue( "id" ), UserData.SHARED ); v.addUserDatum( VISITED_KEY, new Integer( 0 ), UserData.SHARED ); v.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); String str = nodeLabel.getTextTrim(); Pattern p = Pattern.compile( "(.*)", Pattern.MULTILINE ); Matcher m = p.matcher( str ); String label; if ( m.find( )) { label = m.group( 1 ); v.addUserDatum( LABEL_KEY, label, UserData.SHARED ); } else { throw new RuntimeException( "Label must be defined." ); } _logger.debug( "Added vertex: " + v.getUserDatum( LABEL_KEY ) ); // If merge is defined, find it... // If defined, it means that the node will be merged with all other nodes wit the same name, // but not replaced by any subgraphs p = Pattern.compile( "\\n(MERGE)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { v.addUserDatum( MERGE, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found MERGE for vertex: " + label ); } // If no merge is defined, find it... // If defined, it means that when merging graphs, this specific vertex will not be merged // or replaced by any subgraphs p = Pattern.compile( "\\n(NO_MERGE)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { v.addUserDatum( NO_MERGE, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found NO_MERGE for vertex: " + label ); } // If BLOCKED is defined, find it... // If defined, it means that this vertex will not be added to the graph // Sometimes it can be useful during testing to mark vertcies as BLOCKED // due to bugs in the system you test. When the bug is removed, the BLOCKED // tag can be removed. p = Pattern.compile( "\\n(BLOCKED)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { _logger.debug( "Found BLOCKED. This vetex will be removed from the graph: " + label ); v.addUserDatum( BLOCKED, BLOCKED, UserData.SHARED ); } // NOTE: Only for html applications // In browsers, the usage of the 'Back'-button can be used. // If defined, with a value value, which depicts the probability for the edge // to be executed, tha back-button will be pressed in the browser. // A value of 0.05 is the same as 5% chance of going down this road. p = Pattern.compile( "\\n(back=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find( ) ) { Float probability; String value = m.group( 2 ); try { probability = Float.valueOf( value.trim() ); } catch ( NumberFormatException error ) { throw new RuntimeException( "For label: " + label + ", back is not a correct float value: " + error.toString() ); } _logger.debug( "Found FLOAT value: " + probability + ", for vertex: " + label ); v.addUserDatum( BACK_KEY, probability, UserData.SHARED ); } } } } } Object[] vertices = graph.getVertices().toArray(); // Parse all edges (arrows or transtitions) iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "edge" ) ); while ( iter.hasNext() ) { Object o = iter.next(); if ( o instanceof org.jdom.Element ) { org.jdom.Element element = (org.jdom.Element)o; _logger.debug( "id: " + element.getAttributeValue( "id" ) ); Iterator iter2 = element.getDescendants( new org.jdom.filter.ElementFilter( "EdgeLabel" ) ); org.jdom.Element edgeLabel = null; if ( iter2.hasNext() ) { Object o2 = iter2.next(); if ( o2 instanceof org.jdom.Element ) { edgeLabel = (org.jdom.Element)o2; _logger.debug( "Full name: " + edgeLabel.getQualifiedName() ); _logger.debug( "Name: " + edgeLabel.getTextTrim() ); } } _logger.debug( "source: " + element.getAttributeValue( "source" ) ); _logger.debug( "target: " + element.getAttributeValue( "target" ) ); DirectedSparseVertex source = null; DirectedSparseVertex dest = null; for ( int i = 0; i < vertices.length; i++ ) { DirectedSparseVertex vertex = (DirectedSparseVertex)vertices[ i ]; // Find source vertex if ( vertex.getUserDatum( ID_KEY ).equals( element.getAttributeValue( "source" ) ) && vertex.getUserDatum( FILE_KEY ).equals( fileName ) ) { source = vertex; } if ( vertex.getUserDatum( ID_KEY ).equals( element.getAttributeValue( "target" ) ) && vertex.getUserDatum( FILE_KEY ).equals( fileName ) ) { dest = vertex; } } if ( source == null ) { String msg = "Could not find starting node for edge. Name: " + element.getAttributeValue( "source" ); _logger.error( msg ); throw new RuntimeException( msg ); } if ( dest == null ) { String msg = "Could not find end node for edge. Name: " + element.getAttributeValue( "target" ); _logger.error( msg ); throw new RuntimeException( msg ); } DirectedSparseEdge e = new DirectedSparseEdge( source, dest ); graph.addEdge( e ); e.addUserDatum( ID_KEY, element.getAttributeValue( "id" ), UserData.SHARED ); e.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); if ( edgeLabel != null ) { String str = edgeLabel.getTextTrim(); Pattern p = Pattern.compile( "(.*)", Pattern.MULTILINE ); Matcher m = p.matcher( str ); String label = null; if ( m.find() ) { label = m.group( 1 ); if ( !label.equalsIgnoreCase("") ) { e.addUserDatum( LABEL_KEY, label, UserData.SHARED ); _logger.debug( "Found label= " + label + " for edge id: " + edgeLabel.getQualifiedName() ); } } else { throw new RuntimeException( "Label for edge must be defined." ); } if ( label == null || label.equalsIgnoreCase("") ) { DirectedSparseVertex srcV = (DirectedSparseVertex)e.getSource(); String s = (String)srcV.getUserDatum( LABEL_KEY ); if ( s.compareTo( START_NODE ) != 0 ) { throw new RuntimeException( "Label for a edge comming from a non-Start vertex, must be defined." ); } } // If weight is defined, find it... // weight must be associated with a value, which depicts the probability for the edge // to be executed. // A value of 0.05 is the same as 5% chance of going down this road. p = Pattern.compile( "\\n(weight=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { Float weight; String value = m.group( 2 ); try { weight = Float.valueOf( value.trim() ); _logger.debug( "Found weight= " + weight + " for edge: " + label ); } catch ( NumberFormatException error ) { throw new RuntimeException( "For label: " + label + ", weight is not a correct float value: " + error.toString() ); } e.addUserDatum( WEIGHT_KEY, weight, UserData.SHARED ); } // If BLOCKED is defined, find it... // If defined, it means that this edge will not be added to the graph // Sometimes it can be useful during testing to mark edges as BLOCKED // due to bugs in the system you test. When the bug is removed, the BLOCKED // tag can be removed. p = Pattern.compile( "\\n(BLOCKED)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { _logger.debug( "Found BLOCKED. This edge will be removed from the graph: " + label ); e.addUserDatum( BLOCKED, BLOCKED, UserData.SHARED ); } // If No_history is defined, find it... // If defined, it means that when executing this edge, it shall not // be added to the history list of passed edgses. p = Pattern.compile( "\\n(No_history)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { e.addUserDatum( NO_HISTORY, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found No_history for edge: " + label ); } // If condition used defined, find it... p = Pattern.compile( "\\n(if: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); HashMap conditions = null; while ( m.find( ) ) { if ( conditions == null ) { conditions = new HashMap(); } String variable = m.group( 2 ); Boolean state = Boolean.valueOf( m.group( 3 ) ); conditions.put( variable, state ); _logger.debug( "Condition: " + variable + " = " + state ); } if ( conditions != null ) { e.addUserDatum( CONDITION_KEY, conditions, UserData.SHARED ); } // If state are defined, find them... HashMap states = null; p = Pattern.compile( "\\n(state: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( states == null ) { states = new HashMap(); } String variable = m.group( 2 ); Boolean state = Boolean.valueOf( m.group( 3 ) ); states.put( variable, state ); _logger.debug( "State: " + variable + " = " + state ); } if ( states != null ) { e.addUserDatum( STATE_KEY, states, UserData.SHARED ); } // If string variables are defined, find them... HashMap variables = null; p = Pattern.compile( "\\n(string: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); String variable = m.group( 3 ); variables.put( variableLabel, variable ); _logger.debug( "String variable: " + variableLabel + " = " + variable ); } // If integer variables are defined, find them... p = Pattern.compile( "\\n(integer: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); Integer variable = Integer.valueOf( m.group( 3 ) ); variables.put( variableLabel, variable ); _logger.debug( "Integer variable: " + variableLabel + " = " + variable ); } // If integer variables are defined, find them... p = Pattern.compile( "\\n(float: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); Float variable = Float.valueOf( m.group( 3 ) ); variables.put( variableLabel, variable ); _logger.debug( "Float variable: " + variableLabel + " = " + variable ); } if ( variables != null ) { e.addUserDatum( VARIABLE_KEY, variables, UserData.SHARED ); } } String str = (String)e.getUserDatum( LABEL_KEY ); if ( str == null || str.equals( "" ) ) { DirectedSparseVertex v = (DirectedSparseVertex)e.getSource(); str = (String)v.getUserDatum( LABEL_KEY ); if ( str.equals( "Start" ) == false ) { throw new RuntimeException( "Found an edge with no (or empty) label. This is only allowed when the source vertex is a Start vertex." ); } } e.addUserDatum( VISITED_KEY, new Integer( 0 ), UserData.SHARED ); _logger.debug( "Adderade edge: \"" + e.getUserDatum( LABEL_KEY ) + "\"" ); } } } catch ( org.jdom.JDOMException e ) { _logger.error( e ); throw new RuntimeException( "Kunde inte skanna filen: " + fileName ); } catch ( IOException e ) { e.printStackTrace(); throw new RuntimeException( "Kunde inte skanna filen: " + fileName ); } removeBlockedEntities( graph ); return graph; }
54457 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54457/81f66842d96640a147b514a21d2c8f1423313591/ModelBasedTesting.java/buggy/mbt/src/org/tigris/mbt/ModelBasedTesting.java
Iterator iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "node" ) );
Iterator iter = doc.getDescendants( new org.jdom.filter.ElementFilter( "node" ) );
private SparseGraph parseFile( String fileName ) { SparseGraph graph = new SparseGraph(); graph.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); try { _logger.info( "Parsing file: " + fileName ); _doc = _parser.build( fileName ); // Parse all vertices (nodes) Iterator iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "node" ) ); while ( iter.hasNext() ) { Object o = iter.next(); if ( o instanceof org.jdom.Element ) { org.jdom.Element element = (org.jdom.Element)o; if ( element.getAttributeValue( "yfiles.foldertype" ) != null ) { _logger.debug( "Excluded node: " + element.getAttributeValue( "yfiles.foldertype" ) ); continue; } _logger.debug( "id: " + element.getAttributeValue( "id" ) ); Iterator iter2 = element.getDescendants( new org.jdom.filter.ElementFilter( "NodeLabel" ) ); while ( iter2.hasNext() ) { Object o2 = iter2.next(); if ( o2 instanceof org.jdom.Element ) { org.jdom.Element nodeLabel = (org.jdom.Element)o2; _logger.debug( "Full name: " + nodeLabel.getQualifiedName() ); _logger.debug( "Name: " + nodeLabel.getTextTrim() ); DirectedSparseVertex v = (DirectedSparseVertex) graph.addVertex( new DirectedSparseVertex() ); v.addUserDatum( ID_KEY, element.getAttributeValue( "id" ), UserData.SHARED ); v.addUserDatum( VISITED_KEY, new Integer( 0 ), UserData.SHARED ); v.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); String str = nodeLabel.getTextTrim(); Pattern p = Pattern.compile( "(.*)", Pattern.MULTILINE ); Matcher m = p.matcher( str ); String label; if ( m.find( )) { label = m.group( 1 ); v.addUserDatum( LABEL_KEY, label, UserData.SHARED ); } else { throw new RuntimeException( "Label must be defined." ); } _logger.debug( "Added vertex: " + v.getUserDatum( LABEL_KEY ) ); // If merge is defined, find it... // If defined, it means that the node will be merged with all other nodes wit the same name, // but not replaced by any subgraphs p = Pattern.compile( "\\n(MERGE)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { v.addUserDatum( MERGE, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found MERGE for vertex: " + label ); } // If no merge is defined, find it... // If defined, it means that when merging graphs, this specific vertex will not be merged // or replaced by any subgraphs p = Pattern.compile( "\\n(NO_MERGE)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { v.addUserDatum( NO_MERGE, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found NO_MERGE for vertex: " + label ); } // If BLOCKED is defined, find it... // If defined, it means that this vertex will not be added to the graph // Sometimes it can be useful during testing to mark vertcies as BLOCKED // due to bugs in the system you test. When the bug is removed, the BLOCKED // tag can be removed. p = Pattern.compile( "\\n(BLOCKED)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { _logger.debug( "Found BLOCKED. This vetex will be removed from the graph: " + label ); v.addUserDatum( BLOCKED, BLOCKED, UserData.SHARED ); } // NOTE: Only for html applications // In browsers, the usage of the 'Back'-button can be used. // If defined, with a value value, which depicts the probability for the edge // to be executed, tha back-button will be pressed in the browser. // A value of 0.05 is the same as 5% chance of going down this road. p = Pattern.compile( "\\n(back=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find( ) ) { Float probability; String value = m.group( 2 ); try { probability = Float.valueOf( value.trim() ); } catch ( NumberFormatException error ) { throw new RuntimeException( "For label: " + label + ", back is not a correct float value: " + error.toString() ); } _logger.debug( "Found FLOAT value: " + probability + ", for vertex: " + label ); v.addUserDatum( BACK_KEY, probability, UserData.SHARED ); } } } } } Object[] vertices = graph.getVertices().toArray(); // Parse all edges (arrows or transtitions) iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "edge" ) ); while ( iter.hasNext() ) { Object o = iter.next(); if ( o instanceof org.jdom.Element ) { org.jdom.Element element = (org.jdom.Element)o; _logger.debug( "id: " + element.getAttributeValue( "id" ) ); Iterator iter2 = element.getDescendants( new org.jdom.filter.ElementFilter( "EdgeLabel" ) ); org.jdom.Element edgeLabel = null; if ( iter2.hasNext() ) { Object o2 = iter2.next(); if ( o2 instanceof org.jdom.Element ) { edgeLabel = (org.jdom.Element)o2; _logger.debug( "Full name: " + edgeLabel.getQualifiedName() ); _logger.debug( "Name: " + edgeLabel.getTextTrim() ); } } _logger.debug( "source: " + element.getAttributeValue( "source" ) ); _logger.debug( "target: " + element.getAttributeValue( "target" ) ); DirectedSparseVertex source = null; DirectedSparseVertex dest = null; for ( int i = 0; i < vertices.length; i++ ) { DirectedSparseVertex vertex = (DirectedSparseVertex)vertices[ i ]; // Find source vertex if ( vertex.getUserDatum( ID_KEY ).equals( element.getAttributeValue( "source" ) ) && vertex.getUserDatum( FILE_KEY ).equals( fileName ) ) { source = vertex; } if ( vertex.getUserDatum( ID_KEY ).equals( element.getAttributeValue( "target" ) ) && vertex.getUserDatum( FILE_KEY ).equals( fileName ) ) { dest = vertex; } } if ( source == null ) { String msg = "Could not find starting node for edge. Name: " + element.getAttributeValue( "source" ); _logger.error( msg ); throw new RuntimeException( msg ); } if ( dest == null ) { String msg = "Could not find end node for edge. Name: " + element.getAttributeValue( "target" ); _logger.error( msg ); throw new RuntimeException( msg ); } DirectedSparseEdge e = new DirectedSparseEdge( source, dest ); graph.addEdge( e ); e.addUserDatum( ID_KEY, element.getAttributeValue( "id" ), UserData.SHARED ); e.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); if ( edgeLabel != null ) { String str = edgeLabel.getTextTrim(); Pattern p = Pattern.compile( "(.*)", Pattern.MULTILINE ); Matcher m = p.matcher( str ); String label = null; if ( m.find() ) { label = m.group( 1 ); if ( !label.equalsIgnoreCase("") ) { e.addUserDatum( LABEL_KEY, label, UserData.SHARED ); _logger.debug( "Found label= " + label + " for edge id: " + edgeLabel.getQualifiedName() ); } } else { throw new RuntimeException( "Label for edge must be defined." ); } if ( label == null || label.equalsIgnoreCase("") ) { DirectedSparseVertex srcV = (DirectedSparseVertex)e.getSource(); String s = (String)srcV.getUserDatum( LABEL_KEY ); if ( s.compareTo( START_NODE ) != 0 ) { throw new RuntimeException( "Label for a edge comming from a non-Start vertex, must be defined." ); } } // If weight is defined, find it... // weight must be associated with a value, which depicts the probability for the edge // to be executed. // A value of 0.05 is the same as 5% chance of going down this road. p = Pattern.compile( "\\n(weight=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { Float weight; String value = m.group( 2 ); try { weight = Float.valueOf( value.trim() ); _logger.debug( "Found weight= " + weight + " for edge: " + label ); } catch ( NumberFormatException error ) { throw new RuntimeException( "For label: " + label + ", weight is not a correct float value: " + error.toString() ); } e.addUserDatum( WEIGHT_KEY, weight, UserData.SHARED ); } // If BLOCKED is defined, find it... // If defined, it means that this edge will not be added to the graph // Sometimes it can be useful during testing to mark edges as BLOCKED // due to bugs in the system you test. When the bug is removed, the BLOCKED // tag can be removed. p = Pattern.compile( "\\n(BLOCKED)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { _logger.debug( "Found BLOCKED. This edge will be removed from the graph: " + label ); e.addUserDatum( BLOCKED, BLOCKED, UserData.SHARED ); } // If No_history is defined, find it... // If defined, it means that when executing this edge, it shall not // be added to the history list of passed edgses. p = Pattern.compile( "\\n(No_history)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { e.addUserDatum( NO_HISTORY, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found No_history for edge: " + label ); } // If condition used defined, find it... p = Pattern.compile( "\\n(if: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); HashMap conditions = null; while ( m.find( ) ) { if ( conditions == null ) { conditions = new HashMap(); } String variable = m.group( 2 ); Boolean state = Boolean.valueOf( m.group( 3 ) ); conditions.put( variable, state ); _logger.debug( "Condition: " + variable + " = " + state ); } if ( conditions != null ) { e.addUserDatum( CONDITION_KEY, conditions, UserData.SHARED ); } // If state are defined, find them... HashMap states = null; p = Pattern.compile( "\\n(state: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( states == null ) { states = new HashMap(); } String variable = m.group( 2 ); Boolean state = Boolean.valueOf( m.group( 3 ) ); states.put( variable, state ); _logger.debug( "State: " + variable + " = " + state ); } if ( states != null ) { e.addUserDatum( STATE_KEY, states, UserData.SHARED ); } // If string variables are defined, find them... HashMap variables = null; p = Pattern.compile( "\\n(string: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); String variable = m.group( 3 ); variables.put( variableLabel, variable ); _logger.debug( "String variable: " + variableLabel + " = " + variable ); } // If integer variables are defined, find them... p = Pattern.compile( "\\n(integer: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); Integer variable = Integer.valueOf( m.group( 3 ) ); variables.put( variableLabel, variable ); _logger.debug( "Integer variable: " + variableLabel + " = " + variable ); } // If integer variables are defined, find them... p = Pattern.compile( "\\n(float: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); Float variable = Float.valueOf( m.group( 3 ) ); variables.put( variableLabel, variable ); _logger.debug( "Float variable: " + variableLabel + " = " + variable ); } if ( variables != null ) { e.addUserDatum( VARIABLE_KEY, variables, UserData.SHARED ); } } String str = (String)e.getUserDatum( LABEL_KEY ); if ( str == null || str.equals( "" ) ) { DirectedSparseVertex v = (DirectedSparseVertex)e.getSource(); str = (String)v.getUserDatum( LABEL_KEY ); if ( str.equals( "Start" ) == false ) { throw new RuntimeException( "Found an edge with no (or empty) label. This is only allowed when the source vertex is a Start vertex." ); } } e.addUserDatum( VISITED_KEY, new Integer( 0 ), UserData.SHARED ); _logger.debug( "Adderade edge: \"" + e.getUserDatum( LABEL_KEY ) + "\"" ); } } } catch ( org.jdom.JDOMException e ) { _logger.error( e ); throw new RuntimeException( "Kunde inte skanna filen: " + fileName ); } catch ( IOException e ) { e.printStackTrace(); throw new RuntimeException( "Kunde inte skanna filen: " + fileName ); } removeBlockedEntities( graph ); return graph; }
54457 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54457/81f66842d96640a147b514a21d2c8f1423313591/ModelBasedTesting.java/buggy/mbt/src/org/tigris/mbt/ModelBasedTesting.java
iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "edge" ) );
iter = doc.getDescendants( new org.jdom.filter.ElementFilter( "edge" ) );
private SparseGraph parseFile( String fileName ) { SparseGraph graph = new SparseGraph(); graph.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); try { _logger.info( "Parsing file: " + fileName ); _doc = _parser.build( fileName ); // Parse all vertices (nodes) Iterator iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "node" ) ); while ( iter.hasNext() ) { Object o = iter.next(); if ( o instanceof org.jdom.Element ) { org.jdom.Element element = (org.jdom.Element)o; if ( element.getAttributeValue( "yfiles.foldertype" ) != null ) { _logger.debug( "Excluded node: " + element.getAttributeValue( "yfiles.foldertype" ) ); continue; } _logger.debug( "id: " + element.getAttributeValue( "id" ) ); Iterator iter2 = element.getDescendants( new org.jdom.filter.ElementFilter( "NodeLabel" ) ); while ( iter2.hasNext() ) { Object o2 = iter2.next(); if ( o2 instanceof org.jdom.Element ) { org.jdom.Element nodeLabel = (org.jdom.Element)o2; _logger.debug( "Full name: " + nodeLabel.getQualifiedName() ); _logger.debug( "Name: " + nodeLabel.getTextTrim() ); DirectedSparseVertex v = (DirectedSparseVertex) graph.addVertex( new DirectedSparseVertex() ); v.addUserDatum( ID_KEY, element.getAttributeValue( "id" ), UserData.SHARED ); v.addUserDatum( VISITED_KEY, new Integer( 0 ), UserData.SHARED ); v.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); String str = nodeLabel.getTextTrim(); Pattern p = Pattern.compile( "(.*)", Pattern.MULTILINE ); Matcher m = p.matcher( str ); String label; if ( m.find( )) { label = m.group( 1 ); v.addUserDatum( LABEL_KEY, label, UserData.SHARED ); } else { throw new RuntimeException( "Label must be defined." ); } _logger.debug( "Added vertex: " + v.getUserDatum( LABEL_KEY ) ); // If merge is defined, find it... // If defined, it means that the node will be merged with all other nodes wit the same name, // but not replaced by any subgraphs p = Pattern.compile( "\\n(MERGE)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { v.addUserDatum( MERGE, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found MERGE for vertex: " + label ); } // If no merge is defined, find it... // If defined, it means that when merging graphs, this specific vertex will not be merged // or replaced by any subgraphs p = Pattern.compile( "\\n(NO_MERGE)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { v.addUserDatum( NO_MERGE, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found NO_MERGE for vertex: " + label ); } // If BLOCKED is defined, find it... // If defined, it means that this vertex will not be added to the graph // Sometimes it can be useful during testing to mark vertcies as BLOCKED // due to bugs in the system you test. When the bug is removed, the BLOCKED // tag can be removed. p = Pattern.compile( "\\n(BLOCKED)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { _logger.debug( "Found BLOCKED. This vetex will be removed from the graph: " + label ); v.addUserDatum( BLOCKED, BLOCKED, UserData.SHARED ); } // NOTE: Only for html applications // In browsers, the usage of the 'Back'-button can be used. // If defined, with a value value, which depicts the probability for the edge // to be executed, tha back-button will be pressed in the browser. // A value of 0.05 is the same as 5% chance of going down this road. p = Pattern.compile( "\\n(back=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find( ) ) { Float probability; String value = m.group( 2 ); try { probability = Float.valueOf( value.trim() ); } catch ( NumberFormatException error ) { throw new RuntimeException( "For label: " + label + ", back is not a correct float value: " + error.toString() ); } _logger.debug( "Found FLOAT value: " + probability + ", for vertex: " + label ); v.addUserDatum( BACK_KEY, probability, UserData.SHARED ); } } } } } Object[] vertices = graph.getVertices().toArray(); // Parse all edges (arrows or transtitions) iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "edge" ) ); while ( iter.hasNext() ) { Object o = iter.next(); if ( o instanceof org.jdom.Element ) { org.jdom.Element element = (org.jdom.Element)o; _logger.debug( "id: " + element.getAttributeValue( "id" ) ); Iterator iter2 = element.getDescendants( new org.jdom.filter.ElementFilter( "EdgeLabel" ) ); org.jdom.Element edgeLabel = null; if ( iter2.hasNext() ) { Object o2 = iter2.next(); if ( o2 instanceof org.jdom.Element ) { edgeLabel = (org.jdom.Element)o2; _logger.debug( "Full name: " + edgeLabel.getQualifiedName() ); _logger.debug( "Name: " + edgeLabel.getTextTrim() ); } } _logger.debug( "source: " + element.getAttributeValue( "source" ) ); _logger.debug( "target: " + element.getAttributeValue( "target" ) ); DirectedSparseVertex source = null; DirectedSparseVertex dest = null; for ( int i = 0; i < vertices.length; i++ ) { DirectedSparseVertex vertex = (DirectedSparseVertex)vertices[ i ]; // Find source vertex if ( vertex.getUserDatum( ID_KEY ).equals( element.getAttributeValue( "source" ) ) && vertex.getUserDatum( FILE_KEY ).equals( fileName ) ) { source = vertex; } if ( vertex.getUserDatum( ID_KEY ).equals( element.getAttributeValue( "target" ) ) && vertex.getUserDatum( FILE_KEY ).equals( fileName ) ) { dest = vertex; } } if ( source == null ) { String msg = "Could not find starting node for edge. Name: " + element.getAttributeValue( "source" ); _logger.error( msg ); throw new RuntimeException( msg ); } if ( dest == null ) { String msg = "Could not find end node for edge. Name: " + element.getAttributeValue( "target" ); _logger.error( msg ); throw new RuntimeException( msg ); } DirectedSparseEdge e = new DirectedSparseEdge( source, dest ); graph.addEdge( e ); e.addUserDatum( ID_KEY, element.getAttributeValue( "id" ), UserData.SHARED ); e.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); if ( edgeLabel != null ) { String str = edgeLabel.getTextTrim(); Pattern p = Pattern.compile( "(.*)", Pattern.MULTILINE ); Matcher m = p.matcher( str ); String label = null; if ( m.find() ) { label = m.group( 1 ); if ( !label.equalsIgnoreCase("") ) { e.addUserDatum( LABEL_KEY, label, UserData.SHARED ); _logger.debug( "Found label= " + label + " for edge id: " + edgeLabel.getQualifiedName() ); } } else { throw new RuntimeException( "Label for edge must be defined." ); } if ( label == null || label.equalsIgnoreCase("") ) { DirectedSparseVertex srcV = (DirectedSparseVertex)e.getSource(); String s = (String)srcV.getUserDatum( LABEL_KEY ); if ( s.compareTo( START_NODE ) != 0 ) { throw new RuntimeException( "Label for a edge comming from a non-Start vertex, must be defined." ); } } // If weight is defined, find it... // weight must be associated with a value, which depicts the probability for the edge // to be executed. // A value of 0.05 is the same as 5% chance of going down this road. p = Pattern.compile( "\\n(weight=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { Float weight; String value = m.group( 2 ); try { weight = Float.valueOf( value.trim() ); _logger.debug( "Found weight= " + weight + " for edge: " + label ); } catch ( NumberFormatException error ) { throw new RuntimeException( "For label: " + label + ", weight is not a correct float value: " + error.toString() ); } e.addUserDatum( WEIGHT_KEY, weight, UserData.SHARED ); } // If BLOCKED is defined, find it... // If defined, it means that this edge will not be added to the graph // Sometimes it can be useful during testing to mark edges as BLOCKED // due to bugs in the system you test. When the bug is removed, the BLOCKED // tag can be removed. p = Pattern.compile( "\\n(BLOCKED)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { _logger.debug( "Found BLOCKED. This edge will be removed from the graph: " + label ); e.addUserDatum( BLOCKED, BLOCKED, UserData.SHARED ); } // If No_history is defined, find it... // If defined, it means that when executing this edge, it shall not // be added to the history list of passed edgses. p = Pattern.compile( "\\n(No_history)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { e.addUserDatum( NO_HISTORY, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found No_history for edge: " + label ); } // If condition used defined, find it... p = Pattern.compile( "\\n(if: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); HashMap conditions = null; while ( m.find( ) ) { if ( conditions == null ) { conditions = new HashMap(); } String variable = m.group( 2 ); Boolean state = Boolean.valueOf( m.group( 3 ) ); conditions.put( variable, state ); _logger.debug( "Condition: " + variable + " = " + state ); } if ( conditions != null ) { e.addUserDatum( CONDITION_KEY, conditions, UserData.SHARED ); } // If state are defined, find them... HashMap states = null; p = Pattern.compile( "\\n(state: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( states == null ) { states = new HashMap(); } String variable = m.group( 2 ); Boolean state = Boolean.valueOf( m.group( 3 ) ); states.put( variable, state ); _logger.debug( "State: " + variable + " = " + state ); } if ( states != null ) { e.addUserDatum( STATE_KEY, states, UserData.SHARED ); } // If string variables are defined, find them... HashMap variables = null; p = Pattern.compile( "\\n(string: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); String variable = m.group( 3 ); variables.put( variableLabel, variable ); _logger.debug( "String variable: " + variableLabel + " = " + variable ); } // If integer variables are defined, find them... p = Pattern.compile( "\\n(integer: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); Integer variable = Integer.valueOf( m.group( 3 ) ); variables.put( variableLabel, variable ); _logger.debug( "Integer variable: " + variableLabel + " = " + variable ); } // If integer variables are defined, find them... p = Pattern.compile( "\\n(float: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); Float variable = Float.valueOf( m.group( 3 ) ); variables.put( variableLabel, variable ); _logger.debug( "Float variable: " + variableLabel + " = " + variable ); } if ( variables != null ) { e.addUserDatum( VARIABLE_KEY, variables, UserData.SHARED ); } } String str = (String)e.getUserDatum( LABEL_KEY ); if ( str == null || str.equals( "" ) ) { DirectedSparseVertex v = (DirectedSparseVertex)e.getSource(); str = (String)v.getUserDatum( LABEL_KEY ); if ( str.equals( "Start" ) == false ) { throw new RuntimeException( "Found an edge with no (or empty) label. This is only allowed when the source vertex is a Start vertex." ); } } e.addUserDatum( VISITED_KEY, new Integer( 0 ), UserData.SHARED ); _logger.debug( "Adderade edge: \"" + e.getUserDatum( LABEL_KEY ) + "\"" ); } } } catch ( org.jdom.JDOMException e ) { _logger.error( e ); throw new RuntimeException( "Kunde inte skanna filen: " + fileName ); } catch ( IOException e ) { e.printStackTrace(); throw new RuntimeException( "Kunde inte skanna filen: " + fileName ); } removeBlockedEntities( graph ); return graph; }
54457 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54457/81f66842d96640a147b514a21d2c8f1423313591/ModelBasedTesting.java/buggy/mbt/src/org/tigris/mbt/ModelBasedTesting.java
catch ( org.jdom.JDOMException e )
catch ( JDOMException e )
private SparseGraph parseFile( String fileName ) { SparseGraph graph = new SparseGraph(); graph.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); try { _logger.info( "Parsing file: " + fileName ); _doc = _parser.build( fileName ); // Parse all vertices (nodes) Iterator iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "node" ) ); while ( iter.hasNext() ) { Object o = iter.next(); if ( o instanceof org.jdom.Element ) { org.jdom.Element element = (org.jdom.Element)o; if ( element.getAttributeValue( "yfiles.foldertype" ) != null ) { _logger.debug( "Excluded node: " + element.getAttributeValue( "yfiles.foldertype" ) ); continue; } _logger.debug( "id: " + element.getAttributeValue( "id" ) ); Iterator iter2 = element.getDescendants( new org.jdom.filter.ElementFilter( "NodeLabel" ) ); while ( iter2.hasNext() ) { Object o2 = iter2.next(); if ( o2 instanceof org.jdom.Element ) { org.jdom.Element nodeLabel = (org.jdom.Element)o2; _logger.debug( "Full name: " + nodeLabel.getQualifiedName() ); _logger.debug( "Name: " + nodeLabel.getTextTrim() ); DirectedSparseVertex v = (DirectedSparseVertex) graph.addVertex( new DirectedSparseVertex() ); v.addUserDatum( ID_KEY, element.getAttributeValue( "id" ), UserData.SHARED ); v.addUserDatum( VISITED_KEY, new Integer( 0 ), UserData.SHARED ); v.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); String str = nodeLabel.getTextTrim(); Pattern p = Pattern.compile( "(.*)", Pattern.MULTILINE ); Matcher m = p.matcher( str ); String label; if ( m.find( )) { label = m.group( 1 ); v.addUserDatum( LABEL_KEY, label, UserData.SHARED ); } else { throw new RuntimeException( "Label must be defined." ); } _logger.debug( "Added vertex: " + v.getUserDatum( LABEL_KEY ) ); // If merge is defined, find it... // If defined, it means that the node will be merged with all other nodes wit the same name, // but not replaced by any subgraphs p = Pattern.compile( "\\n(MERGE)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { v.addUserDatum( MERGE, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found MERGE for vertex: " + label ); } // If no merge is defined, find it... // If defined, it means that when merging graphs, this specific vertex will not be merged // or replaced by any subgraphs p = Pattern.compile( "\\n(NO_MERGE)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { v.addUserDatum( NO_MERGE, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found NO_MERGE for vertex: " + label ); } // If BLOCKED is defined, find it... // If defined, it means that this vertex will not be added to the graph // Sometimes it can be useful during testing to mark vertcies as BLOCKED // due to bugs in the system you test. When the bug is removed, the BLOCKED // tag can be removed. p = Pattern.compile( "\\n(BLOCKED)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { _logger.debug( "Found BLOCKED. This vetex will be removed from the graph: " + label ); v.addUserDatum( BLOCKED, BLOCKED, UserData.SHARED ); } // NOTE: Only for html applications // In browsers, the usage of the 'Back'-button can be used. // If defined, with a value value, which depicts the probability for the edge // to be executed, tha back-button will be pressed in the browser. // A value of 0.05 is the same as 5% chance of going down this road. p = Pattern.compile( "\\n(back=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find( ) ) { Float probability; String value = m.group( 2 ); try { probability = Float.valueOf( value.trim() ); } catch ( NumberFormatException error ) { throw new RuntimeException( "For label: " + label + ", back is not a correct float value: " + error.toString() ); } _logger.debug( "Found FLOAT value: " + probability + ", for vertex: " + label ); v.addUserDatum( BACK_KEY, probability, UserData.SHARED ); } } } } } Object[] vertices = graph.getVertices().toArray(); // Parse all edges (arrows or transtitions) iter = _doc.getDescendants( new org.jdom.filter.ElementFilter( "edge" ) ); while ( iter.hasNext() ) { Object o = iter.next(); if ( o instanceof org.jdom.Element ) { org.jdom.Element element = (org.jdom.Element)o; _logger.debug( "id: " + element.getAttributeValue( "id" ) ); Iterator iter2 = element.getDescendants( new org.jdom.filter.ElementFilter( "EdgeLabel" ) ); org.jdom.Element edgeLabel = null; if ( iter2.hasNext() ) { Object o2 = iter2.next(); if ( o2 instanceof org.jdom.Element ) { edgeLabel = (org.jdom.Element)o2; _logger.debug( "Full name: " + edgeLabel.getQualifiedName() ); _logger.debug( "Name: " + edgeLabel.getTextTrim() ); } } _logger.debug( "source: " + element.getAttributeValue( "source" ) ); _logger.debug( "target: " + element.getAttributeValue( "target" ) ); DirectedSparseVertex source = null; DirectedSparseVertex dest = null; for ( int i = 0; i < vertices.length; i++ ) { DirectedSparseVertex vertex = (DirectedSparseVertex)vertices[ i ]; // Find source vertex if ( vertex.getUserDatum( ID_KEY ).equals( element.getAttributeValue( "source" ) ) && vertex.getUserDatum( FILE_KEY ).equals( fileName ) ) { source = vertex; } if ( vertex.getUserDatum( ID_KEY ).equals( element.getAttributeValue( "target" ) ) && vertex.getUserDatum( FILE_KEY ).equals( fileName ) ) { dest = vertex; } } if ( source == null ) { String msg = "Could not find starting node for edge. Name: " + element.getAttributeValue( "source" ); _logger.error( msg ); throw new RuntimeException( msg ); } if ( dest == null ) { String msg = "Could not find end node for edge. Name: " + element.getAttributeValue( "target" ); _logger.error( msg ); throw new RuntimeException( msg ); } DirectedSparseEdge e = new DirectedSparseEdge( source, dest ); graph.addEdge( e ); e.addUserDatum( ID_KEY, element.getAttributeValue( "id" ), UserData.SHARED ); e.addUserDatum( FILE_KEY, fileName, UserData.SHARED ); if ( edgeLabel != null ) { String str = edgeLabel.getTextTrim(); Pattern p = Pattern.compile( "(.*)", Pattern.MULTILINE ); Matcher m = p.matcher( str ); String label = null; if ( m.find() ) { label = m.group( 1 ); if ( !label.equalsIgnoreCase("") ) { e.addUserDatum( LABEL_KEY, label, UserData.SHARED ); _logger.debug( "Found label= " + label + " for edge id: " + edgeLabel.getQualifiedName() ); } } else { throw new RuntimeException( "Label for edge must be defined." ); } if ( label == null || label.equalsIgnoreCase("") ) { DirectedSparseVertex srcV = (DirectedSparseVertex)e.getSource(); String s = (String)srcV.getUserDatum( LABEL_KEY ); if ( s.compareTo( START_NODE ) != 0 ) { throw new RuntimeException( "Label for a edge comming from a non-Start vertex, must be defined." ); } } // If weight is defined, find it... // weight must be associated with a value, which depicts the probability for the edge // to be executed. // A value of 0.05 is the same as 5% chance of going down this road. p = Pattern.compile( "\\n(weight=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { Float weight; String value = m.group( 2 ); try { weight = Float.valueOf( value.trim() ); _logger.debug( "Found weight= " + weight + " for edge: " + label ); } catch ( NumberFormatException error ) { throw new RuntimeException( "For label: " + label + ", weight is not a correct float value: " + error.toString() ); } e.addUserDatum( WEIGHT_KEY, weight, UserData.SHARED ); } // If BLOCKED is defined, find it... // If defined, it means that this edge will not be added to the graph // Sometimes it can be useful during testing to mark edges as BLOCKED // due to bugs in the system you test. When the bug is removed, the BLOCKED // tag can be removed. p = Pattern.compile( "\\n(BLOCKED)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { _logger.debug( "Found BLOCKED. This edge will be removed from the graph: " + label ); e.addUserDatum( BLOCKED, BLOCKED, UserData.SHARED ); } // If No_history is defined, find it... // If defined, it means that when executing this edge, it shall not // be added to the history list of passed edgses. p = Pattern.compile( "\\n(No_history)", Pattern.MULTILINE ); m = p.matcher( str ); if ( m.find() ) { e.addUserDatum( NO_HISTORY, m.group( 1 ), UserData.SHARED ); _logger.debug( "Found No_history for edge: " + label ); } // If condition used defined, find it... p = Pattern.compile( "\\n(if: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); HashMap conditions = null; while ( m.find( ) ) { if ( conditions == null ) { conditions = new HashMap(); } String variable = m.group( 2 ); Boolean state = Boolean.valueOf( m.group( 3 ) ); conditions.put( variable, state ); _logger.debug( "Condition: " + variable + " = " + state ); } if ( conditions != null ) { e.addUserDatum( CONDITION_KEY, conditions, UserData.SHARED ); } // If state are defined, find them... HashMap states = null; p = Pattern.compile( "\\n(state: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( states == null ) { states = new HashMap(); } String variable = m.group( 2 ); Boolean state = Boolean.valueOf( m.group( 3 ) ); states.put( variable, state ); _logger.debug( "State: " + variable + " = " + state ); } if ( states != null ) { e.addUserDatum( STATE_KEY, states, UserData.SHARED ); } // If string variables are defined, find them... HashMap variables = null; p = Pattern.compile( "\\n(string: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); String variable = m.group( 3 ); variables.put( variableLabel, variable ); _logger.debug( "String variable: " + variableLabel + " = " + variable ); } // If integer variables are defined, find them... p = Pattern.compile( "\\n(integer: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); Integer variable = Integer.valueOf( m.group( 3 ) ); variables.put( variableLabel, variable ); _logger.debug( "Integer variable: " + variableLabel + " = " + variable ); } // If integer variables are defined, find them... p = Pattern.compile( "\\n(float: (.*)=(.*))", Pattern.MULTILINE ); m = p.matcher( str ); while ( m.find( ) ) { if ( variables == null ) { variables = new HashMap(); } String variableLabel = m.group( 2 ); Float variable = Float.valueOf( m.group( 3 ) ); variables.put( variableLabel, variable ); _logger.debug( "Float variable: " + variableLabel + " = " + variable ); } if ( variables != null ) { e.addUserDatum( VARIABLE_KEY, variables, UserData.SHARED ); } } String str = (String)e.getUserDatum( LABEL_KEY ); if ( str == null || str.equals( "" ) ) { DirectedSparseVertex v = (DirectedSparseVertex)e.getSource(); str = (String)v.getUserDatum( LABEL_KEY ); if ( str.equals( "Start" ) == false ) { throw new RuntimeException( "Found an edge with no (or empty) label. This is only allowed when the source vertex is a Start vertex." ); } } e.addUserDatum( VISITED_KEY, new Integer( 0 ), UserData.SHARED ); _logger.debug( "Adderade edge: \"" + e.getUserDatum( LABEL_KEY ) + "\"" ); } } } catch ( org.jdom.JDOMException e ) { _logger.error( e ); throw new RuntimeException( "Kunde inte skanna filen: " + fileName ); } catch ( IOException e ) { e.printStackTrace(); throw new RuntimeException( "Kunde inte skanna filen: " + fileName ); } removeBlockedEntities( graph ); return graph; }
54457 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54457/81f66842d96640a147b514a21d2c8f1423313591/ModelBasedTesting.java/buggy/mbt/src/org/tigris/mbt/ModelBasedTesting.java
public void setLinkType(int type) throws IllegalArgumentException
public void setLinkType(int type) throws IllegalArgumentException, UnsupportedEncodingException
public void setLinkType(int type) throws IllegalArgumentException { }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/7fd6ecbf32a2883982eeb962733f98fd00021076/Shortcut.java/buggy/src/lib/com/izforge/izpack/util/os/Shortcut.java
this.parent = parent;
this.parentFrame = parent;
public UserInputPanel (InstallerFrame parent, InstallData installData) { super (parent, installData); instanceNumber = instanceCount++; this.parent = parent; // ---------------------------------------------------- // ---------------------------------------------------- layout = new TwoColumnLayout (10, 5, 30, 25, TwoColumnLayout.LEFT); setLayout (layout); // ---------------------------------------------------- // get a locale database // ---------------------------------------------------- try { //this.langpack = parent.langpack; String resource = LANG_FILE_NAME+"_"+idata.localeISO3; this.langpack = new LocaleDatabase (ResourceManager.getInstance().getInputStream (resource)); } catch (Throwable exception) {} // ---------------------------------------------------- // read the specifications // ---------------------------------------------------- try { readSpec (); } catch (Throwable exception) { // log the problem exception.printStackTrace (); } if (!haveSpec) { // return if we could not read the spec. further // processing will only lead to problems. In this // case we must skip the panel when it gets activated. return; } // ---------------------------------------------------- // process all field nodes. Each field node is analyzed // for its type, then an appropriate memeber function // is called that will create the correct UI elements. // ---------------------------------------------------- Vector fields = spec.getChildrenNamed (FIELD_NODE_ID); for (int i = 0; i < fields.size (); i++) { XMLElement field = (XMLElement)fields.elementAt (i); String attribute = field.getAttribute (TYPE); if (attribute != null) { if (attribute.equals (RULE_FIELD)) { addRuleField (field); } else if (attribute.equals (TEXT_FIELD)) { addTextField (field); } else if (attribute.equals (COMBO_FIELD)) { addComboBox (field); } else if (attribute.equals (RADIO_FIELD)) { addRadioButton (field); } else if (attribute.equals (PWD_FIELD)) { addPasswordField (field); } else if (attribute.equals (SPACE_FIELD)) { addSpace (field); } else if (attribute.equals (DIVIDER_FIELD)) { addDivider (field); } else if (attribute.equals (CHECK_FIELD)) { addCheckBox (field); } else if (attribute.equals (STATIC_TEXT)) { addText (field); } else if (attribute.equals (TITLE_FIELD)) { addTitle (field); } else if (attribute.equals (SEARCH_FIELD)) { addSearch (field); } } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/buggy/src/lib/com/izforge/izpack/panels/UserInputPanel.java
parent.skipPanel();
parentFrame.skipPanel();
public void panelActivate () { if (spec == null) { // TODO: translate emitError("User input specification could not be found.", "The specification for the user input panel could not be found. Please contact the packager."); parent.skipPanel(); } Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); if (!itemRequiredFor (forPacks) || !itemRequiredForOs(forOs)) { parent.skipPanel (); return; } if (!haveSpec) { parent.skipPanel (); return; } // if (uiBuilt) //{ // return; //} buildUI (); uiBuilt = true; if (packsDefined) { parent.lockPrevButton (); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/buggy/src/lib/com/izforge/izpack/panels/UserInputPanel.java
parent.skipPanel ();
parentFrame.skipPanel ();
public void panelActivate () { if (spec == null) { // TODO: translate emitError("User input specification could not be found.", "The specification for the user input panel could not be found. Please contact the packager."); parent.skipPanel(); } Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); if (!itemRequiredFor (forPacks) || !itemRequiredForOs(forOs)) { parent.skipPanel (); return; } if (!haveSpec) { parent.skipPanel (); return; } // if (uiBuilt) //{ // return; //} buildUI (); uiBuilt = true; if (packsDefined) { parent.lockPrevButton (); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/buggy/src/lib/com/izforge/izpack/panels/UserInputPanel.java
parent.skipPanel ();
parentFrame.skipPanel ();
public void panelActivate () { if (spec == null) { // TODO: translate emitError("User input specification could not be found.", "The specification for the user input panel could not be found. Please contact the packager."); parent.skipPanel(); } Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); if (!itemRequiredFor (forPacks) || !itemRequiredForOs(forOs)) { parent.skipPanel (); return; } if (!haveSpec) { parent.skipPanel (); return; } // if (uiBuilt) //{ // return; //} buildUI (); uiBuilt = true; if (packsDefined) { parent.lockPrevButton (); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/buggy/src/lib/com/izforge/izpack/panels/UserInputPanel.java
parent.lockPrevButton ();
parentFrame.lockPrevButton ();
public void panelActivate () { if (spec == null) { // TODO: translate emitError("User input specification could not be found.", "The specification for the user input panel could not be found. Please contact the packager."); parent.skipPanel(); } Vector forPacks = spec.getChildrenNamed (PACKS); Vector forOs = spec.getChildrenNamed(OS); if (!itemRequiredFor (forPacks) || !itemRequiredForOs(forOs)) { parent.skipPanel (); return; } if (!haveSpec) { parent.skipPanel (); return; } // if (uiBuilt) //{ // return; //} buildUI (); uiBuilt = true; if (packsDefined) { parent.lockPrevButton (); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/UserInputPanel.java/buggy/src/lib/com/izforge/izpack/panels/UserInputPanel.java
continue;
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while (panelsIterator.hasNext()) { Panel p = (Panel) panelsIterator.next(); String praefix = "com.izforge.izpack.panels."; if (p.className.compareTo(".") > -1) // Full qualified class name praefix = ""; if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = praefix + panelClassName + "AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch (ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if (automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation) automationHelperClass .newInstance(); } catch (Exception e) { System.err.println("ERROR: no default constructor for " + automationHelperClassName + ", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed(panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey(panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer) this.panelInstanceCount.get(panelClassName)).intValue(); } XMLElement panelRoot = (XMLElement) panelRoots.elementAt(panelRootNo); this.panelInstanceCount.put(panelClassName, new Integer(panelRootNo + 1)); // execute the installation logic for the current panel, if it has // any: if (automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch (Exception e) { System.err.println("ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace(); continue; } } } // this does nothing if the uninstaller was not included writeUninstallData(); System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/AutomatedInstaller.java/buggy/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
String praefix = "com.izforge.izpack.panels."; if( p.className.compareTo(".") > -1 ) praefix = "";
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while (panelsIterator.hasNext()) { Panel p = (Panel) panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels." + panelClassName + "AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch (ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if (automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation) automationHelperClass.newInstance(); } catch (Exception e) { System.err.println( "ERROR: no default constructor for " + automationHelperClassName + ", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed(panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey(panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer) this.panelInstanceCount.get(panelClassName)).intValue(); } XMLElement panelRoot = (XMLElement) panelRoots.elementAt(panelRootNo); this.panelInstanceCount.put(panelClassName, new Integer(panelRootNo + 1)); // execute the installation logic for the current panel, if it has any: if (automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch (Exception e) { System.err.println( "ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace(); continue; } } } // this does nothing if the uninstaller was not included writeUninstallData(); System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d28b4a0f8922435997696d344aa94afcad4e3475/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
"com.izforge.izpack.panels." + panelClassName + "AutomationHelper";
praefix + panelClassName + "AutomationHelper";
private void doInstall(AutomatedInstallData installdata) throws Exception { // TODO: i18n System.out.println("[ Starting automated installation ]"); // walk the panels in order Iterator panelsIterator = installdata.panelsOrder.iterator(); while (panelsIterator.hasNext()) { Panel p = (Panel) panelsIterator.next(); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; String panelClassName = p.className; String automationHelperClassName = "com.izforge.izpack.panels." + panelClassName + "AutomationHelper"; Class automationHelperClass = null; // determine if the panel supports automated install try { automationHelperClass = Class.forName(automationHelperClassName); } catch (ClassNotFoundException e) { // this is OK - not all panels have/need automation support. continue; } // instantiate the automation logic for the panel PanelAutomation automationHelperInstance = null; if (automationHelperClass != null) { try { automationHelperInstance = (PanelAutomation) automationHelperClass.newInstance(); } catch (Exception e) { System.err.println( "ERROR: no default constructor for " + automationHelperClassName + ", skipping..."); continue; } } // We get the panels root xml markup Vector panelRoots = installdata.xmlData.getChildrenNamed(panelClassName); int panelRootNo = 0; if (this.panelInstanceCount.containsKey(panelClassName)) { // get number of panel instance to process panelRootNo = ((Integer) this.panelInstanceCount.get(panelClassName)).intValue(); } XMLElement panelRoot = (XMLElement) panelRoots.elementAt(panelRootNo); this.panelInstanceCount.put(panelClassName, new Integer(panelRootNo + 1)); // execute the installation logic for the current panel, if it has any: if (automationHelperInstance != null) { try { automationHelperInstance.runAutomated(installdata, panelRoot); } catch (Exception e) { System.err.println( "ERROR: automated installation failed for panel " + panelClassName); e.printStackTrace(); continue; } } } // this does nothing if the uninstaller was not included writeUninstallData(); System.out.println("[ Automated installation done ]"); // Bye Housekeeper.getInstance().shutDown(0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/d28b4a0f8922435997696d344aa94afcad4e3475/AutomatedInstaller.java/clean/src/lib/com/izforge/izpack/installer/AutomatedInstaller.java
if (introText == null || introText.equals("PathInputPanel.intro")) introText = "";
if (introText == null || introText.startsWith("PathInputPanel.intro")) introText = "";
public PathInputPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // Set default values emptyTargetMsg = getI18nStringForClass("empty_target", "TargetPanel"); warnMsg = getI18nStringForClass("warn", "TargetPanel"); // if( this.class.) // Customize the default GridBagConstraints. GridBagConstraints gbConstraint = getDefaultGridBagConstraints(); gbConstraint.gridwidth = GridBagConstraints.REMAINDER; this.setDefaultGridBagConstraints(gbConstraint); String introText = getI18nStringForClass("intro", "PathInputPanel"); if (introText == null || introText.equals("PathInputPanel.intro")) introText = ""; // Intro // Create and customize constraint for it. // row 0 column 0 gbConstraint = getNextYGridBagConstraints(); // Create component and add it to this panel. MultiLineLabel introLabel = createMultiLineLabel(introText); add(introLabel, gbConstraint); // Label for input // Create and customize constraint for it. // row 1 column 0; is the next Y gbConstraint = getNextYGridBagConstraints(); gbConstraint.gridwidth = GridBagConstraints.RELATIVE; gbConstraint.insets = new Insets(0, 0, 10, 0); // Create component and add it to this panel. JLabel infoLabel = createLabel(getI18nStringForClass("info", "TargetPanel"), "open", JLabel.LEFT); add(infoLabel, gbConstraint); // Create path selection components and add they to this panel. pathSelectionPanel = new PathSelectionPanel(this, idata); gbConstraint = getNextYGridBagConstraints(); gbConstraint.gridwidth = GridBagConstraints.REMAINDER; gbConstraint.fill = GridBagConstraints.HORIZONTAL; gbConstraint.insets = new Insets(0, 0, 0, 0); add(pathSelectionPanel, gbConstraint); createLayoutBottom(); // Place a footer as last component, if completeGridBagLayout(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91bfeafc3265323a5f71aef073a52845e68294b0/PathInputPanel.java/clean/src/lib/com/izforge/izpack/panels/PathInputPanel.java
{
{
private void buildUI(File groups) { // System.out.println( "BuildUI for" + groups ); // constraints.gridx = 1; // constraints.gridy = line+1; // constraints.gridwidth = 3; // constraints.gridheight = 1; constraints.insets = new Insets(10, 10, 0, 0); // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if (OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled()) { menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); } createShortcuts = new JCheckBox(StringTool.replace(parent.langpack .getString("ShortcutPanel.regular.create"), "StartMenu", menuKind), true); createShortcuts.addActionListener(this); constraints.gridx = col; constraints.gridy = line + 1; constraints.gridwidth = 1; constraints.gridheight = 1; // constraints.weightx = 0.1; // constraints.weighty = 0.2; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.NORTHWEST; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); constraints.insets = new Insets(0, 10, 0, 0); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable("DesktopShortcutCheckboxEnabled"); boolean initialAllowedFlag = false; if (initialAllowedValue == null) { initialAllowedFlag = false; } else if (Boolean.TRUE.toString().equals(initialAllowedValue)) { initialAllowedFlag = true; } allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = col; constraints.gridy = line + 2; constraints.gridwidth = 1; constraints.gridheight = 1; // constraints.weighty = 0.2; // constraints.weighty = 1.0; // constraints.weighty = 0.5; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = col; constraints.gridy = line + 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.insets = new Insets(10, 10, 0, 0); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.NORTHWEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- Vector dirEntries = new Vector(); File[] entries = groups.listFiles(); // Quickfix prevent NullPointer on non default compliant Linux - KDEs // i.e Mandrake 2005 LE stores from now also in "applnk" instead in prior "applnk-mdk": if (entries != null) { for (int idx = 0; idx < entries.length; idx++) { if (entries[idx].isDirectory()) { dirEntries.add(entries[idx].getName()); } } } if (groupList == null) { groupList = new JList(); } groupList = addList(dirEntries, ListSelectionModel.SINGLE_SELECTION, groupList, col, line + 4, 1, 1, GridBagConstraints.BOTH); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); Debug.log("allUsers.setEnabled(), I'm Root: " + isRootUser); allUsers.setEnabled(isRootUser); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = col + 1; constraints.gridy = line + 4; constraints.gridwidth = 1; constraints.gridheight = 1; // constraints.weighty = 1.0; // constraints.weightx = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = col; constraints.gridy = line + 5; constraints.gridwidth = 1; constraints.gridheight = 1; // constraints.weighty = 1.0; // constraints.weightx = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = col + 1; constraints.gridy = line + 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6365af53bc69b4cf4264fcf587387018411f566f/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
} System.out.println(getProgramsFolder(Shortcut.CURRENT_USER));
}
public void panelActivate() { try { readShortcutSpec(); } catch (Throwable exception) { System.out.println("could not read shortcut spec!"); exception.printStackTrace(); } // Create the UI elements try { shortcut = (Shortcut) (TargetFactory.getInstance() .makeObject("com.izforge.izpack.util.os.Shortcut")); shortcut.initialize(Shortcut.APPLICATIONS, "-"); } catch (Throwable exception) { System.out.println("could not create shortcut instance"); exception.printStackTrace(); } analyzeShortcutSpec(); if (shortcutsToCreate && !OsVersion.IS_OSX) { if (shortcut.supported() && !simulteNotSupported) { File allUsersProgramsFolder = getProgramsFolder(Shortcut.ALL_USERS); Debug.log("All UsersProgramsFolder: '" + allUsersProgramsFolder + "'"); File forceTest = new File(allUsersProgramsFolder + File.separator + System.getProperty("user.name") + System.currentTimeMillis()); try { isRootUser = forceTest.createNewFile(); } catch (Exception e) { isRootUser = false; Debug.log("IOException: " + "'" + e.getLocalizedMessage() + "'"); Debug.log("You cannot create '" + forceTest + "'"); } if (forceTest.exists()) { Debug.log("Delete temporary File: '" + forceTest + "'"); forceTest.delete(); } String perm = isRootUser ? "can" : "cannot"; Debug.log("You " + perm + " write into '" + allUsersProgramsFolder + "'"); if (isRootUser) { itsUserType = Shortcut.ALL_USERS; } else { itsUserType = Shortcut.CURRENT_USER; } System.out.println(getProgramsFolder(Shortcut.CURRENT_USER)); buildUI(getProgramsFolder(isRootUser ? Shortcut.ALL_USERS : Shortcut.CURRENT_USER)); // addSelectionList(); // add( shortCutsArea ); // JList shortCutList = null; // addList( shortCuts, ListSelectionModel.SINGLE_SELECTION, shortCutList, col, // line+6, 1, 1, GridBagConstraints.BOTH ); } else { // TODO MEP: Test buildAlternateUI(); // parent.unlockNextButton(); // parent.lockPrevButton(); } } else { ; // parent.skipPanel (); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6365af53bc69b4cf4264fcf587387018411f566f/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
parent.unlockNextButton();
shortcutsCreationDone = true;
private void createShortcuts () { ShortcutData data; for (int i = 0; i < shortcuts.size (); i++) { data = (ShortcutData)shortcuts.elementAt (i); try { groupName = groupName + data.subgroup; shortcut.setLinkName (data.name); shortcut.setLinkType (data.type); shortcut.setArguments (data.commandLine); shortcut.setDescription (data.description); shortcut.setIconLocation (data.iconFile, data.iconIndex); shortcut.setShowCommand (data.initialState); shortcut.setTargetPath (data.target); shortcut.setWorkingDirectory (data.workingDirectory); if (data.addToGroup) { shortcut.setProgramGroup (groupName); } else { shortcut.setProgramGroup (""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ( (data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut.isSelected ()) ) { // save the shortcut shortcut.save (); // add the file and directory name to the file list String fileName = shortcut.getFileName (); String directoryName = shortcut.getDirectoryCreated (); files.add (fileName); if (!(directoryName == null)) { files.add (directoryName); } } } catch (Exception exception) { } } catch (Throwable exception) { continue; } } parent.unlockNextButton(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/f611ea2c1f9162f1ac9165276e50c923348b2693/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
!shortcutsCreationDone ||
public void makeXMLData (XMLElement panelRoot) { // ---------------------------------------------------- // if there are no shortcuts to create, shortcuts are // not supported, or we should simulate that they are // not supported, then we have nothing to add. Just // return // ---------------------------------------------------- if (!shortcutsToCreate || !shortcut.supported () || simulteNotSupported ) { return; } ShortcutData data; XMLElement dataElement; // ---------------------------------------------------- // add the item that defines the name of the program group // ---------------------------------------------------- dataElement = new XMLElement (AUTO_KEY_PROGRAM_GROUP); dataElement.setAttribute (AUTO_ATTRIBUTE_NAME, groupName); panelRoot.addChild (dataElement); // ---------------------------------------------------- // add the details for each of the shortcuts // ---------------------------------------------------- for (int i = 0; i < shortcuts.size (); i++) { data = (ShortcutData)shortcuts.elementAt (i); dataElement = new XMLElement (AUTO_KEY_SHORTCUT); dataElement.setAttribute (AUTO_ATTRIBUTE_NAME, data.name); dataElement.setAttribute (AUTO_ATTRIBUTE_GROUP, new Boolean (data.addToGroup).toString ()); dataElement.setAttribute (AUTO_ATTRIBUTE_TYPE, Integer.toString (data.type)); dataElement.setAttribute (AUTO_ATTRIBUTE_COMMAND, data.commandLine); dataElement.setAttribute (AUTO_ATTRIBUTE_DESCRIPTION, data.description); dataElement.setAttribute (AUTO_ATTRIBUTE_ICON, data.iconFile); dataElement.setAttribute (AUTO_ATTRIBUTE_ICON_INDEX, Integer.toString (data.iconIndex)); dataElement.setAttribute (AUTO_ATTRIBUTE_INITIAL_STATE, Integer.toString (data.initialState)); dataElement.setAttribute (AUTO_ATTRIBUTE_TARGET, data.target); dataElement.setAttribute (AUTO_ATTRIBUTE_WORKING_DIR, data.workingDirectory); // ---------------------------------------------- // add the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ( (data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut.isSelected ()) ) { panelRoot.addChild (dataElement); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/f611ea2c1f9162f1ac9165276e50c923348b2693/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
layout = new GridBagLayout(); gbConstraints = new GridBagConstraints();
GridBagLayout layout = new GridBagLayout(); GridBagConstraints gbConstraints = new GridBagConstraints();
public InfoPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We load the text loadInfo(); // We add the components infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons .getImageIcon("edit"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.1); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); textArea = new JTextArea(info); textArea.setCaretPosition(0); textArea.setEditable(false); scroller = new JScrollPane(textArea); parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 0.9); gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.anchor = GridBagConstraints.CENTER; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/InfoPanel.java/buggy/src/lib/com/izforge/izpack/panels/InfoPanel.java
infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
JLabel infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
public InfoPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We load the text loadInfo(); // We add the components infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons .getImageIcon("edit"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.1); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); textArea = new JTextArea(info); textArea.setCaretPosition(0); textArea.setEditable(false); scroller = new JScrollPane(textArea); parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 0.9); gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.anchor = GridBagConstraints.CENTER; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/InfoPanel.java/buggy/src/lib/com/izforge/izpack/panels/InfoPanel.java
textArea = new JTextArea(info);
JTextArea textArea = new JTextArea(info);
public InfoPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We load the text loadInfo(); // We add the components infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons .getImageIcon("edit"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.1); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); textArea = new JTextArea(info); textArea.setCaretPosition(0); textArea.setEditable(false); scroller = new JScrollPane(textArea); parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 0.9); gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.anchor = GridBagConstraints.CENTER; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/InfoPanel.java/buggy/src/lib/com/izforge/izpack/panels/InfoPanel.java
scroller = new JScrollPane(textArea);
JScrollPane scroller = new JScrollPane(textArea);
public InfoPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We load the text loadInfo(); // We add the components infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons .getImageIcon("edit"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.1); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); textArea = new JTextArea(info); textArea.setCaretPosition(0); textArea.setEditable(false); scroller = new JScrollPane(textArea); parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 0.9); gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.anchor = GridBagConstraints.CENTER; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/InfoPanel.java/buggy/src/lib/com/izforge/izpack/panels/InfoPanel.java
if(_maxActive > 0 && active < _maxActive) {
if(_maxActive <= 0 || active < _maxActive) {
public synchronized Object borrowObject(Object key) throws Exception { long starttime = System.currentTimeMillis(); for(;;) { CursorableLinkedList pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key,pool); _poolList.add(key); } ObjectTimestampPair pair = null; // if there are any sleeping, just grab one of those try { pair = (ObjectTimestampPair)(pool.removeFirst()); if(null != pair) { _totalIdle--; } } catch(NoSuchElementException e) { /* ignored */ } // otherwise if(null == pair) { // check if we can create one // (note we know that the num sleeping is 0, else we wouldn't be here) int active = 0; Integer act = (Integer)(_activeMap.get(key)); if(null != act) { active = act.intValue(); } if(_maxActive > 0 && active < _maxActive) { Object obj = _factory.makeObject(key); pair = new ObjectTimestampPair(obj); } else { // the pool is exhausted switch(_whenExhaustedAction) { case WHEN_EXHAUSTED_GROW: Object obj = _factory.makeObject(key); pair = new ObjectTimestampPair(obj); break; case WHEN_EXHAUSTED_FAIL: throw new NoSuchElementException(); case WHEN_EXHAUSTED_BLOCK: try { if(_maxWait <= 0) { wait(); } else { wait(_maxWait); } } catch(InterruptedException e) { // ignored } if(_maxWait > 0 && ((System.currentTimeMillis() - starttime) >= _maxWait)) { throw new NoSuchElementException("Timeout waiting for idle object"); } else { continue; // keep looping } default: throw new IllegalArgumentException("whenExhaustedAction " + _whenExhaustedAction + " not recognized."); } } } _factory.activateObject(key,pair.value); if(_testOnBorrow && !_factory.validateObject(key,pair.value)) { try { _factory.passivateObject(key,pair.value); } catch(Exception e) { ; // ignored, we're throwing it out anyway } _factory.destroyObject(key,pair.value); } else { Integer active = (Integer)(_activeMap.get(key)); if(null == active) { _activeMap.put(key,new Integer(1)); } else { _activeMap.put(key,new Integer(active.intValue() + 1)); } _totalActive++; return pair.value; } } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/20544d4c4b596fe00d312ec251e36a6dfdc00186/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
if (!str.equals("FIXED"))
if (!"FIXED".equals(str))
protected void processAttList(IXMLReader reader, IXMLEntityResolver entityResolver) throws Exception { if (!XMLUtil.checkLiteral(reader, '%', this.parameterEntityResolver, "TTLIST")) { XMLUtil.skipTag(reader, '%', this.parameterEntityResolver); return; } XMLUtil.skipWhitespace(reader, '%', null, null); String elementName = XMLUtil.scanIdentifier(reader, '%', this.parameterEntityResolver); XMLUtil.skipWhitespace(reader, '%', null, null); char ch = XMLUtil.read(reader, null, '%', this.parameterEntityResolver); Properties props = new Properties(); while (ch != '>') { reader.unread(ch); String attName = XMLUtil.scanIdentifier(reader, '%', this.parameterEntityResolver); XMLUtil.skipWhitespace(reader, '%', null, null); ch = XMLUtil.read(reader, null, '%', this.parameterEntityResolver); if (ch == '(') { while (ch != ')') { ch = XMLUtil.read(reader, null, '%', this.parameterEntityResolver); } } else { reader.unread(ch); XMLUtil.scanIdentifier(reader, '%', this.parameterEntityResolver); } XMLUtil.skipWhitespace(reader, '%', null, null); ch = XMLUtil.read(reader, null, '%', this.parameterEntityResolver); if (ch == '#') { String str = XMLUtil.scanIdentifier(reader, '%', this.parameterEntityResolver); XMLUtil.skipWhitespace(reader, '%', null, null); if (!str.equals("FIXED")) { XMLUtil.skipWhitespace(reader, '%', null, null); ch = XMLUtil.read(reader, null, '%', this.parameterEntityResolver); continue; } } else { reader.unread(ch); } String value = XMLUtil.scanString(reader, '%', false, this.parameterEntityResolver); props.put(attName, value); XMLUtil.skipWhitespace(reader, '%', null, null); ch = XMLUtil.read(reader, null, '%', this.parameterEntityResolver); } if (!props.isEmpty()) { this.attributeDefaultValues.put(elementName, props); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/NonValidator.java/buggy/src/lib/net/n3/nanoxml/NonValidator.java
System.err.println(f.getAttribute("src") + " " + override);
protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if("postinstall".compareToIgnoreCase(val) == 0) { executeOn = ExecutableFile.POSTINSTALL; } else { } // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if("jar".compareToIgnoreCase(val) == 0) { executeType = ExecutableFile.JAR; } else { } // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if("abort".compareToIgnoreCase(val) == 0) { onFailure = ExecutableFile.ABORT; } else if("warn".compareToIgnoreCase(val) == 0) { onFailure = ExecutableFile.WARN; } else { } // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList= new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add( new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if(f.getAttribute("override") != null) { override = f.getAttribute("override").equalsIgnoreCase("true"); } System.err.println(f.getAttribute("src") + " " + override); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); /* get includes and excludes */ Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement)xcludesList.get(j); includes[j] = (String)xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement)xcludesList.get(j); excludes[j] = (String)xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/21fc6274178696c5f24ffd06932f781242a691b3/Compiler.java/clean/src/lib/com/izforge/izpack/compiler/Compiler.java
if (socket.getLocalPort() > 0) { retValue = true; } else { retValue = false; }
retValue = socket.getLocalPort() > 0;
public boolean validate(ProcessingClient client) { InetAddress inet = null; String host = ""; int port = 0; boolean retValue = false; try { host = client.getFieldContents(0); port = Integer.parseInt(client.getFieldContents(1)); } catch (Exception e) { return false; } try { inet = InetAddress.getByName(host); ServerSocket socket = new ServerSocket(port, 0, inet); if (socket.getLocalPort() > 0) { retValue = true; } else { retValue = false; } socket.close(); } catch (Exception ex) { retValue = false; } return retValue; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/HostAddressValidator.java/buggy/src/lib/com/izforge/izpack/util/HostAddressValidator.java
return String.valueOf(counter);
return new String(String.valueOf(counter));
public Object makeObject() { counter++; return String.valueOf(counter); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
public void testOutOfMemory() throws Exception { pool = new SoftReferenceObjectPool(new SmallPoolableObjectFactory()); Object obj = pool.borrowObject(); assertEquals("1", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertEquals("2", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
try { HashMap map = new HashMap();
final List garbage = new LinkedList(); final Runtime runtime = Runtime.getRuntime(); while (pool.getNumIdle() > 0) { garbage.add(new byte[Math.min(1024 * 1024, (int)runtime.freeMemory())]); System.gc(); } garbage.clear(); System.gc();
public void testOutOfMemory() throws Exception { pool = new SoftReferenceObjectPool(new SmallPoolableObjectFactory()); Object obj = pool.borrowObject(); assertEquals("1", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertEquals("2", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { }
public void testOutOfMemory() throws Exception { pool = new SoftReferenceObjectPool(new SmallPoolableObjectFactory()); Object obj = pool.borrowObject(); assertEquals("1", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertEquals("2", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
public void testOutOfMemory() throws Exception { pool = new SoftReferenceObjectPool(new SmallPoolableObjectFactory()); Object obj = pool.borrowObject(); assertEquals("1", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertEquals("2", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
public void testOutOfMemory1000() throws Exception { pool = new SoftReferenceObjectPool(new SmallPoolableObjectFactory()); for (int i = 0 ; i < 1000 ; i++) { pool.addObject(); } Object obj = pool.borrowObject(); assertEquals("1000", obj); pool.returnObject(obj); obj = null; assertEquals(1000, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertEquals("1001", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
try { HashMap map = new HashMap();
final List garbage = new LinkedList(); final Runtime runtime = Runtime.getRuntime(); while (pool.getNumIdle() > 0) { garbage.add(new byte[Math.min(1024 * 1024, (int)runtime.freeMemory())]); System.gc(); } garbage.clear(); System.gc();
public void testOutOfMemory1000() throws Exception { pool = new SoftReferenceObjectPool(new SmallPoolableObjectFactory()); for (int i = 0 ; i < 1000 ; i++) { pool.addObject(); } Object obj = pool.borrowObject(); assertEquals("1000", obj); pool.returnObject(obj); obj = null; assertEquals(1000, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertEquals("1001", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { }
public void testOutOfMemory1000() throws Exception { pool = new SoftReferenceObjectPool(new SmallPoolableObjectFactory()); for (int i = 0 ; i < 1000 ; i++) { pool.addObject(); } Object obj = pool.borrowObject(); assertEquals("1000", obj); pool.returnObject(obj); obj = null; assertEquals(1000, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertEquals("1001", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
public void testOutOfMemory1000() throws Exception { pool = new SoftReferenceObjectPool(new SmallPoolableObjectFactory()); for (int i = 0 ; i < 1000 ; i++) { pool.addObject(); } Object obj = pool.borrowObject(); assertEquals("1000", obj); pool.returnObject(obj); obj = null; assertEquals(1000, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertEquals("1001", obj); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
public void testOutOfMemoryKeepMap() throws Exception { pool = new SoftReferenceObjectPool(new LargePoolableObjectFactory(1000000)); Object obj = pool.borrowObject(); assertTrue(((String)obj).startsWith("1.")); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); // allocate map outside try/catch block HashMap map = new HashMap(); try { for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } try { obj = pool.borrowObject(); fail("Expected out of memory"); } catch (OutOfMemoryError ex) { } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
HashMap map = new HashMap();
final Map map = new HashMap();
public void testOutOfMemoryKeepMap() throws Exception { pool = new SoftReferenceObjectPool(new LargePoolableObjectFactory(1000000)); Object obj = pool.borrowObject(); assertTrue(((String)obj).startsWith("1.")); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); // allocate map outside try/catch block HashMap map = new HashMap(); try { for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } try { obj = pool.borrowObject(); fail("Expected out of memory"); } catch (OutOfMemoryError ex) { } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i));
final Runtime runtime = Runtime.getRuntime(); int i = 0; while (true) { final int size = Math.max(1, Math.min(1048576, (int)runtime.freeMemory() / 2)); final byte[] data = new byte[size]; map.put(new Integer(i++), data);
public void testOutOfMemoryKeepMap() throws Exception { pool = new SoftReferenceObjectPool(new LargePoolableObjectFactory(1000000)); Object obj = pool.borrowObject(); assertTrue(((String)obj).startsWith("1.")); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); // allocate map outside try/catch block HashMap map = new HashMap(); try { for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } try { obj = pool.borrowObject(); fail("Expected out of memory"); } catch (OutOfMemoryError ex) { } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
public void testOutOfMemoryLarge() throws Exception { pool = new SoftReferenceObjectPool(new LargePoolableObjectFactory(1000000)); Object obj = pool.borrowObject(); assertTrue(((String)obj).startsWith("1.")); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertTrue(((String)obj).startsWith("2.")); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
try { HashMap map = new HashMap();
final List garbage = new LinkedList(); final Runtime runtime = Runtime.getRuntime(); while (pool.getNumIdle() > 0) { garbage.add(new byte[Math.min(1024 * 1024, (int)runtime.freeMemory())]); System.gc(); } garbage.clear(); System.gc();
public void testOutOfMemoryLarge() throws Exception { pool = new SoftReferenceObjectPool(new LargePoolableObjectFactory(1000000)); Object obj = pool.borrowObject(); assertTrue(((String)obj).startsWith("1.")); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertTrue(((String)obj).startsWith("2.")); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { }
public void testOutOfMemoryLarge() throws Exception { pool = new SoftReferenceObjectPool(new LargePoolableObjectFactory(1000000)); Object obj = pool.borrowObject(); assertTrue(((String)obj).startsWith("1.")); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertTrue(((String)obj).startsWith("2.")); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
public void testOutOfMemoryLarge() throws Exception { pool = new SoftReferenceObjectPool(new LargePoolableObjectFactory(1000000)); Object obj = pool.borrowObject(); assertTrue(((String)obj).startsWith("1.")); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); try { HashMap map = new HashMap(); for (int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } } catch (OutOfMemoryError ex) { } obj = pool.borrowObject(); assertTrue(((String)obj).startsWith("2.")); pool.returnObject(obj); obj = null; assertEquals(1, pool.getNumIdle()); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/532ad39f51997f39ee0ecc2aba7a094d80c5daac/TestSoftRefOutOfMemory.java/clean/src/test/org/apache/commons/pool/impl/TestSoftRefOutOfMemory.java
{ display = new JCheckBox(); display.setHorizontalAlignment(JLabel.CENTER); if (useAsEditor) display.addActionListener(this);
{ display = new JCheckBox(); display.setHorizontalAlignment(JLabel.CENTER); if (useAsEditor) display.addActionListener(this);
public CheckBoxEditorRenderer(boolean useAsEditor) { display = new JCheckBox(); display.setHorizontalAlignment(JLabel.CENTER); if (useAsEditor) display.addActionListener(this); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
}
}
public CheckBoxEditorRenderer(boolean useAsEditor) { display = new JCheckBox(); display.setHorizontalAlignment(JLabel.CENTER); if (useAsEditor) display.addActionListener(this); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
{ stopCellEditing(); }
{ stopCellEditing(); }
public void actionPerformed(ActionEvent e) { stopCellEditing(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
{ return new Integer(display.isSelected() ? 1 : 0); }
{ return new Integer(display.isSelected() ? 1 : 0); }
public Object getCellEditorValue() { return new Integer(display.isSelected() ? 1 : 0); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
JTable table, Object value, boolean isSelected, int row, int column) { return getTableCellRendererComponent(table, value, isSelected, false, row, column); }
JTable table, Object value, boolean isSelected, int row, int column) { return getTableCellRendererComponent( table, value, isSelected, false, row, column); }
public Component getTableCellEditorComponent( JTable table, Object value, boolean isSelected, int row, int column) { return getTableCellRendererComponent(table, value, isSelected, false, row, column); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (isSelected) { display.setForeground(table.getSelectionForeground()); display.setBackground(table.getSelectionBackground()); } else { display.setForeground(table.getForeground()); display.setBackground(table.getBackground()); } int state = ((Integer)value).intValue(); display.setSelected((value != null && Math.abs(state) == 1)); display.setEnabled(state >= 0); return display; }
public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (isSelected) { display.setForeground(table.getSelectionForeground()); display.setBackground(table.getSelectionBackground()); } else { display.setForeground(table.getForeground()); display.setBackground(table.getBackground()); } int state = ((Integer) value).intValue(); display.setSelected((value != null && Math.abs(state) == 1)); display.setEnabled(state >= 0); return display; }
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (isSelected) { display.setForeground(table.getSelectionForeground()); display.setBackground(table.getSelectionBackground()); } else { display.setForeground(table.getForeground()); display.setBackground(table.getBackground()); } int state = ((Integer)value).intValue(); display.setSelected((value != null && Math.abs(state) == 1)); display.setEnabled(state >= 0); return display; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
public PacksModel(List packs,List packsToInstall) { this.packs = packs; this.packsToInstall = packsToInstall; }
public PacksModel(List packs, List packsToInstall) { this.packs = packs; this.packsToInstall = packsToInstall; }
public PacksModel(List packs,List packsToInstall) { this.packs = packs; this.packsToInstall = packsToInstall; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
{ switch(columnIndex) { case 0: return Integer.class;
{ switch (columnIndex) { case 0 : return Integer.class;
public Class getColumnClass(int columnIndex) { switch(columnIndex) { case 0: return Integer.class; default : return String.class; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
default : return String.class; } }
default : return String.class; } }
public Class getColumnClass(int columnIndex) { switch(columnIndex) { case 0: return Integer.class; default : return String.class; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
{ return 3; }
{ return 3; }
public int getColumnCount() { return 3; }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
{ return packs.size(); }
{ return packs.size(); }
public int getRowCount() { return packs.size(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
{ Pack pack = (Pack) packs.get(rowIndex); switch(columnIndex) { case 0: int val = 0; if (pack.required) { val = -1; } else { val = (packsToInstall.contains(pack) ? 1 : 0 ); } return new Integer( val );
{ Pack pack = (Pack) packs.get(rowIndex); switch (columnIndex) { case 0 : int val = 0; if (pack.required) { val = -1; } else { val = (packsToInstall.contains(pack) ? 1 : 0); } return new Integer(val);
public Object getValueAt(int rowIndex, int columnIndex) { Pack pack = (Pack) packs.get(rowIndex); switch(columnIndex) { case 0: int val = 0; if (pack.required) { val = -1; } else { val = (packsToInstall.contains(pack) ? 1 : 0 ); } return new Integer( val ); case 1: return pack.name; case 2: return Pack.toByteUnitsString((int)pack.nbytes); default : return null; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
case 1: return pack.name;
case 1 : return pack.name;
public Object getValueAt(int rowIndex, int columnIndex) { Pack pack = (Pack) packs.get(rowIndex); switch(columnIndex) { case 0: int val = 0; if (pack.required) { val = -1; } else { val = (packsToInstall.contains(pack) ? 1 : 0 ); } return new Integer( val ); case 1: return pack.name; case 2: return Pack.toByteUnitsString((int)pack.nbytes); default : return null; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
case 2: return Pack.toByteUnitsString((int)pack.nbytes);
case 2 : return Pack.toByteUnitsString((int) pack.nbytes);
public Object getValueAt(int rowIndex, int columnIndex) { Pack pack = (Pack) packs.get(rowIndex); switch(columnIndex) { case 0: int val = 0; if (pack.required) { val = -1; } else { val = (packsToInstall.contains(pack) ? 1 : 0 ); } return new Integer( val ); case 1: return pack.name; case 2: return Pack.toByteUnitsString((int)pack.nbytes); default : return null; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
default : return null; } }
default : return null; } }
public Object getValueAt(int rowIndex, int columnIndex) { Pack pack = (Pack) packs.get(rowIndex); switch(columnIndex) { case 0: int val = 0; if (pack.required) { val = -1; } else { val = (packsToInstall.contains(pack) ? 1 : 0 ); } return new Integer( val ); case 1: return pack.name; case 2: return Pack.toByteUnitsString((int)pack.nbytes); default : return null; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
{ Pack pack = (Pack) packs.get(rowIndex); if (pack.required) { return false; } else if (columnIndex == 0) { return true; } else { return false; } }
{ Pack pack = (Pack) packs.get(rowIndex); if (pack.required) { return false; } else if (columnIndex == 0) { return true; } else { return false; } }
public boolean isCellEditable(int rowIndex, int columnIndex) { Pack pack = (Pack) packs.get(rowIndex); if (pack.required) { return false; } else if (columnIndex == 0) { return true; } else { return false; } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
if (columnIndex == 0) { if (aValue instanceof Integer) { Pack pack = (Pack) packs.get(rowIndex); if (((Integer)aValue).intValue() == 1) { packsToInstall.add(pack); bytes += pack.nbytes; } else { packsToInstall.remove(pack); bytes -= pack.nbytes; } showSpaceRequired(); } }
Pack pack = (Pack) packs.get(rowIndex); if (((Integer) aValue).intValue() == 1) { packsToInstall.add(pack); bytes += pack.nbytes; } else { packsToInstall.remove(pack); bytes -= pack.nbytes; } showSpaceRequired();
public void setValueAt(Object aValue, int rowIndex, int columnIndex) { if (columnIndex == 0) { if (aValue instanceof Integer) { Pack pack = (Pack) packs.get(rowIndex); if (((Integer)aValue).intValue() == 1) { packsToInstall.add(pack); bytes += pack.nbytes; } else { packsToInstall.remove(pack); bytes -= pack.nbytes; } showSpaceRequired(); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
} }
public void setValueAt(Object aValue, int rowIndex, int columnIndex) { if (columnIndex == 0) { if (aValue instanceof Integer) { Pack pack = (Pack) packs.get(rowIndex); if (((Integer)aValue).intValue() == 1) { packsToInstall.add(pack); bytes += pack.nbytes; } else { packsToInstall.remove(pack); bytes -= pack.nbytes; } showSpaceRequired(); } } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
JLabel infoLabel = new JLabel(parent.langpack.getString("PacksPanel.info"), parent.icons.getImageIcon("preferences"), JLabel.TRAILING);
JLabel infoLabel = new JLabel( parent.langpack.getString("PacksPanel.info"), parent.icons.getImageIcon("preferences"), JLabel.TRAILING);
public PacksPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JLabel infoLabel = new JLabel(parent.langpack.getString("PacksPanel.info"), parent.icons.getImageIcon("preferences"), JLabel.TRAILING); add(infoLabel); add(Box.createRigidArea(new Dimension(0, 3))); JLabel tipLabel = new JLabel(parent.langpack.getString("PacksPanel.tip"), parent.icons.getImageIcon("tip"), JLabel.TRAILING); add(tipLabel); add(Box.createRigidArea(new Dimension(0, 5))); packsTable = new JTable(); packsTable.setIntercellSpacing(new Dimension(0,0)); packsTable.setBackground(Color.white); packsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); packsTable.getSelectionModel().addListSelectionListener(this); packsTable.setShowGrid(false); tableScroller = new JScrollPane(packsTable); tableScroller.setAlignmentX(LEFT_ALIGNMENT); tableScroller.getViewport().setBackground(Color.white); tableScroller.setPreferredSize(new Dimension(300,(idata.guiPrefs.height/3+30))); add(tableScroller); descriptionArea = new JTextArea(); descriptionArea.setMargin(new Insets(2,2,2,2)); descriptionArea.setAlignmentX(LEFT_ALIGNMENT); descriptionArea.setCaretPosition(0); descriptionArea.setEditable(false); descriptionArea.setEditable(false); descriptionArea.setOpaque(false); descriptionArea.setLineWrap(true); descriptionArea.setWrapStyleWord(true); descriptionArea.setBorder(BorderFactory.createTitledBorder(parent.langpack.getString("PacksPanel.description"))); add(descriptionArea); JPanel spacePanel = new JPanel(); spacePanel.setAlignmentX(LEFT_ALIGNMENT); spacePanel.setLayout(new BoxLayout(spacePanel, BoxLayout.X_AXIS)); spacePanel.add(new JLabel(parent.langpack.getString("PacksPanel.space"))); spacePanel.add(Box.createHorizontalGlue()); spaceLabel = new JLabel("");// spaceLabel.setFont(new Font("Monospaced",Font.PLAIN,11)); spacePanel.add(spaceLabel); add(spacePanel); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
JLabel tipLabel = new JLabel(parent.langpack.getString("PacksPanel.tip"), parent.icons.getImageIcon("tip"), JLabel.TRAILING);
JLabel tipLabel = new JLabel( parent.langpack.getString("PacksPanel.tip"), parent.icons.getImageIcon("tip"), JLabel.TRAILING);
public PacksPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JLabel infoLabel = new JLabel(parent.langpack.getString("PacksPanel.info"), parent.icons.getImageIcon("preferences"), JLabel.TRAILING); add(infoLabel); add(Box.createRigidArea(new Dimension(0, 3))); JLabel tipLabel = new JLabel(parent.langpack.getString("PacksPanel.tip"), parent.icons.getImageIcon("tip"), JLabel.TRAILING); add(tipLabel); add(Box.createRigidArea(new Dimension(0, 5))); packsTable = new JTable(); packsTable.setIntercellSpacing(new Dimension(0,0)); packsTable.setBackground(Color.white); packsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); packsTable.getSelectionModel().addListSelectionListener(this); packsTable.setShowGrid(false); tableScroller = new JScrollPane(packsTable); tableScroller.setAlignmentX(LEFT_ALIGNMENT); tableScroller.getViewport().setBackground(Color.white); tableScroller.setPreferredSize(new Dimension(300,(idata.guiPrefs.height/3+30))); add(tableScroller); descriptionArea = new JTextArea(); descriptionArea.setMargin(new Insets(2,2,2,2)); descriptionArea.setAlignmentX(LEFT_ALIGNMENT); descriptionArea.setCaretPosition(0); descriptionArea.setEditable(false); descriptionArea.setEditable(false); descriptionArea.setOpaque(false); descriptionArea.setLineWrap(true); descriptionArea.setWrapStyleWord(true); descriptionArea.setBorder(BorderFactory.createTitledBorder(parent.langpack.getString("PacksPanel.description"))); add(descriptionArea); JPanel spacePanel = new JPanel(); spacePanel.setAlignmentX(LEFT_ALIGNMENT); spacePanel.setLayout(new BoxLayout(spacePanel, BoxLayout.X_AXIS)); spacePanel.add(new JLabel(parent.langpack.getString("PacksPanel.space"))); spacePanel.add(Box.createHorizontalGlue()); spaceLabel = new JLabel("");// spaceLabel.setFont(new Font("Monospaced",Font.PLAIN,11)); spacePanel.add(spaceLabel); add(spacePanel); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
packsTable.setIntercellSpacing(new Dimension(0,0));
packsTable.setIntercellSpacing(new Dimension(0, 0));
public PacksPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JLabel infoLabel = new JLabel(parent.langpack.getString("PacksPanel.info"), parent.icons.getImageIcon("preferences"), JLabel.TRAILING); add(infoLabel); add(Box.createRigidArea(new Dimension(0, 3))); JLabel tipLabel = new JLabel(parent.langpack.getString("PacksPanel.tip"), parent.icons.getImageIcon("tip"), JLabel.TRAILING); add(tipLabel); add(Box.createRigidArea(new Dimension(0, 5))); packsTable = new JTable(); packsTable.setIntercellSpacing(new Dimension(0,0)); packsTable.setBackground(Color.white); packsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); packsTable.getSelectionModel().addListSelectionListener(this); packsTable.setShowGrid(false); tableScroller = new JScrollPane(packsTable); tableScroller.setAlignmentX(LEFT_ALIGNMENT); tableScroller.getViewport().setBackground(Color.white); tableScroller.setPreferredSize(new Dimension(300,(idata.guiPrefs.height/3+30))); add(tableScroller); descriptionArea = new JTextArea(); descriptionArea.setMargin(new Insets(2,2,2,2)); descriptionArea.setAlignmentX(LEFT_ALIGNMENT); descriptionArea.setCaretPosition(0); descriptionArea.setEditable(false); descriptionArea.setEditable(false); descriptionArea.setOpaque(false); descriptionArea.setLineWrap(true); descriptionArea.setWrapStyleWord(true); descriptionArea.setBorder(BorderFactory.createTitledBorder(parent.langpack.getString("PacksPanel.description"))); add(descriptionArea); JPanel spacePanel = new JPanel(); spacePanel.setAlignmentX(LEFT_ALIGNMENT); spacePanel.setLayout(new BoxLayout(spacePanel, BoxLayout.X_AXIS)); spacePanel.add(new JLabel(parent.langpack.getString("PacksPanel.space"))); spacePanel.add(Box.createHorizontalGlue()); spaceLabel = new JLabel("");// spaceLabel.setFont(new Font("Monospaced",Font.PLAIN,11)); spacePanel.add(spaceLabel); add(spacePanel); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
tableScroller.setPreferredSize(new Dimension(300,(idata.guiPrefs.height/3+30)));
tableScroller.setPreferredSize( new Dimension(300, (idata.guiPrefs.height / 3 + 30)));
public PacksPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JLabel infoLabel = new JLabel(parent.langpack.getString("PacksPanel.info"), parent.icons.getImageIcon("preferences"), JLabel.TRAILING); add(infoLabel); add(Box.createRigidArea(new Dimension(0, 3))); JLabel tipLabel = new JLabel(parent.langpack.getString("PacksPanel.tip"), parent.icons.getImageIcon("tip"), JLabel.TRAILING); add(tipLabel); add(Box.createRigidArea(new Dimension(0, 5))); packsTable = new JTable(); packsTable.setIntercellSpacing(new Dimension(0,0)); packsTable.setBackground(Color.white); packsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); packsTable.getSelectionModel().addListSelectionListener(this); packsTable.setShowGrid(false); tableScroller = new JScrollPane(packsTable); tableScroller.setAlignmentX(LEFT_ALIGNMENT); tableScroller.getViewport().setBackground(Color.white); tableScroller.setPreferredSize(new Dimension(300,(idata.guiPrefs.height/3+30))); add(tableScroller); descriptionArea = new JTextArea(); descriptionArea.setMargin(new Insets(2,2,2,2)); descriptionArea.setAlignmentX(LEFT_ALIGNMENT); descriptionArea.setCaretPosition(0); descriptionArea.setEditable(false); descriptionArea.setEditable(false); descriptionArea.setOpaque(false); descriptionArea.setLineWrap(true); descriptionArea.setWrapStyleWord(true); descriptionArea.setBorder(BorderFactory.createTitledBorder(parent.langpack.getString("PacksPanel.description"))); add(descriptionArea); JPanel spacePanel = new JPanel(); spacePanel.setAlignmentX(LEFT_ALIGNMENT); spacePanel.setLayout(new BoxLayout(spacePanel, BoxLayout.X_AXIS)); spacePanel.add(new JLabel(parent.langpack.getString("PacksPanel.space"))); spacePanel.add(Box.createHorizontalGlue()); spaceLabel = new JLabel("");// spaceLabel.setFont(new Font("Monospaced",Font.PLAIN,11)); spacePanel.add(spaceLabel); add(spacePanel); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
descriptionArea.setMargin(new Insets(2,2,2,2));
descriptionArea.setMargin(new Insets(2, 2, 2, 2));
public PacksPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JLabel infoLabel = new JLabel(parent.langpack.getString("PacksPanel.info"), parent.icons.getImageIcon("preferences"), JLabel.TRAILING); add(infoLabel); add(Box.createRigidArea(new Dimension(0, 3))); JLabel tipLabel = new JLabel(parent.langpack.getString("PacksPanel.tip"), parent.icons.getImageIcon("tip"), JLabel.TRAILING); add(tipLabel); add(Box.createRigidArea(new Dimension(0, 5))); packsTable = new JTable(); packsTable.setIntercellSpacing(new Dimension(0,0)); packsTable.setBackground(Color.white); packsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); packsTable.getSelectionModel().addListSelectionListener(this); packsTable.setShowGrid(false); tableScroller = new JScrollPane(packsTable); tableScroller.setAlignmentX(LEFT_ALIGNMENT); tableScroller.getViewport().setBackground(Color.white); tableScroller.setPreferredSize(new Dimension(300,(idata.guiPrefs.height/3+30))); add(tableScroller); descriptionArea = new JTextArea(); descriptionArea.setMargin(new Insets(2,2,2,2)); descriptionArea.setAlignmentX(LEFT_ALIGNMENT); descriptionArea.setCaretPosition(0); descriptionArea.setEditable(false); descriptionArea.setEditable(false); descriptionArea.setOpaque(false); descriptionArea.setLineWrap(true); descriptionArea.setWrapStyleWord(true); descriptionArea.setBorder(BorderFactory.createTitledBorder(parent.langpack.getString("PacksPanel.description"))); add(descriptionArea); JPanel spacePanel = new JPanel(); spacePanel.setAlignmentX(LEFT_ALIGNMENT); spacePanel.setLayout(new BoxLayout(spacePanel, BoxLayout.X_AXIS)); spacePanel.add(new JLabel(parent.langpack.getString("PacksPanel.space"))); spacePanel.add(Box.createHorizontalGlue()); spaceLabel = new JLabel("");// spaceLabel.setFont(new Font("Monospaced",Font.PLAIN,11)); spacePanel.add(spaceLabel); add(spacePanel); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
descriptionArea.setBorder(BorderFactory.createTitledBorder(parent.langpack.getString("PacksPanel.description")));
descriptionArea.setBorder( BorderFactory.createTitledBorder( parent.langpack.getString("PacksPanel.description")));
public PacksPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JLabel infoLabel = new JLabel(parent.langpack.getString("PacksPanel.info"), parent.icons.getImageIcon("preferences"), JLabel.TRAILING); add(infoLabel); add(Box.createRigidArea(new Dimension(0, 3))); JLabel tipLabel = new JLabel(parent.langpack.getString("PacksPanel.tip"), parent.icons.getImageIcon("tip"), JLabel.TRAILING); add(tipLabel); add(Box.createRigidArea(new Dimension(0, 5))); packsTable = new JTable(); packsTable.setIntercellSpacing(new Dimension(0,0)); packsTable.setBackground(Color.white); packsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); packsTable.getSelectionModel().addListSelectionListener(this); packsTable.setShowGrid(false); tableScroller = new JScrollPane(packsTable); tableScroller.setAlignmentX(LEFT_ALIGNMENT); tableScroller.getViewport().setBackground(Color.white); tableScroller.setPreferredSize(new Dimension(300,(idata.guiPrefs.height/3+30))); add(tableScroller); descriptionArea = new JTextArea(); descriptionArea.setMargin(new Insets(2,2,2,2)); descriptionArea.setAlignmentX(LEFT_ALIGNMENT); descriptionArea.setCaretPosition(0); descriptionArea.setEditable(false); descriptionArea.setEditable(false); descriptionArea.setOpaque(false); descriptionArea.setLineWrap(true); descriptionArea.setWrapStyleWord(true); descriptionArea.setBorder(BorderFactory.createTitledBorder(parent.langpack.getString("PacksPanel.description"))); add(descriptionArea); JPanel spacePanel = new JPanel(); spacePanel.setAlignmentX(LEFT_ALIGNMENT); spacePanel.setLayout(new BoxLayout(spacePanel, BoxLayout.X_AXIS)); spacePanel.add(new JLabel(parent.langpack.getString("PacksPanel.space"))); spacePanel.add(Box.createHorizontalGlue()); spaceLabel = new JLabel("");// spaceLabel.setFont(new Font("Monospaced",Font.PLAIN,11)); spacePanel.add(spaceLabel); add(spacePanel); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
public PacksPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JLabel infoLabel = new JLabel(parent.langpack.getString("PacksPanel.info"), parent.icons.getImageIcon("preferences"), JLabel.TRAILING); add(infoLabel); add(Box.createRigidArea(new Dimension(0, 3))); JLabel tipLabel = new JLabel(parent.langpack.getString("PacksPanel.tip"), parent.icons.getImageIcon("tip"), JLabel.TRAILING); add(tipLabel); add(Box.createRigidArea(new Dimension(0, 5))); packsTable = new JTable(); packsTable.setIntercellSpacing(new Dimension(0,0)); packsTable.setBackground(Color.white); packsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); packsTable.getSelectionModel().addListSelectionListener(this); packsTable.setShowGrid(false); tableScroller = new JScrollPane(packsTable); tableScroller.setAlignmentX(LEFT_ALIGNMENT); tableScroller.getViewport().setBackground(Color.white); tableScroller.setPreferredSize(new Dimension(300,(idata.guiPrefs.height/3+30))); add(tableScroller); descriptionArea = new JTextArea(); descriptionArea.setMargin(new Insets(2,2,2,2)); descriptionArea.setAlignmentX(LEFT_ALIGNMENT); descriptionArea.setCaretPosition(0); descriptionArea.setEditable(false); descriptionArea.setEditable(false); descriptionArea.setOpaque(false); descriptionArea.setLineWrap(true); descriptionArea.setWrapStyleWord(true); descriptionArea.setBorder(BorderFactory.createTitledBorder(parent.langpack.getString("PacksPanel.description"))); add(descriptionArea); JPanel spacePanel = new JPanel(); spacePanel.setAlignmentX(LEFT_ALIGNMENT); spacePanel.setLayout(new BoxLayout(spacePanel, BoxLayout.X_AXIS)); spacePanel.add(new JLabel(parent.langpack.getString("PacksPanel.space"))); spacePanel.add(Box.createHorizontalGlue()); spaceLabel = new JLabel("");// spaceLabel.setFont(new Font("Monospaced",Font.PLAIN,11)); spacePanel.add(spaceLabel); add(spacePanel); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
packsTable.setModel(new PacksModel(idata.availablePacks, idata.selectedPacks)); CheckBoxEditorRenderer packSelectedRenderer = new CheckBoxEditorRenderer(false); packsTable.getColumnModel().getColumn(0).setCellRenderer(packSelectedRenderer); CheckBoxEditorRenderer packSelectedEditor = new CheckBoxEditorRenderer(true); packsTable.getColumnModel().getColumn(0).setCellEditor(packSelectedEditor);
packsTable.setModel( new PacksModel(idata.availablePacks, idata.selectedPacks)); CheckBoxEditorRenderer packSelectedRenderer = new CheckBoxEditorRenderer(false); packsTable.getColumnModel().getColumn(0).setCellRenderer( packSelectedRenderer); CheckBoxEditorRenderer packSelectedEditor = new CheckBoxEditorRenderer(true); packsTable.getColumnModel().getColumn(0).setCellEditor( packSelectedEditor);
public void panelActivate() { try { packsTable.setModel(new PacksModel(idata.availablePacks, idata.selectedPacks)); CheckBoxEditorRenderer packSelectedRenderer = new CheckBoxEditorRenderer(false); packsTable.getColumnModel().getColumn(0).setCellRenderer(packSelectedRenderer); CheckBoxEditorRenderer packSelectedEditor = new CheckBoxEditorRenderer(true); packsTable.getColumnModel().getColumn(0).setCellEditor(packSelectedEditor); packsTable.getColumnModel().getColumn(0).setMaxWidth(40); DefaultTableCellRenderer renderer1 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } }; packsTable.getColumnModel().getColumn(1).setCellRenderer(renderer1); DefaultTableCellRenderer renderer2 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } // public void setFont(Font f) // { // super.setFont(new Font("Monospaced",Font.PLAIN,11)); // } }; renderer2.setHorizontalAlignment(JLabel.RIGHT); packsTable.getColumnModel().getColumn(2).setCellRenderer(renderer2); packsTable.getColumnModel().getColumn(2).setMaxWidth(100); //remove header,so we don't need more strings tableScroller.remove(packsTable.getTableHeader()); tableScroller.setColumnHeaderView(null); tableScroller.setColumnHeader(null); // set the JCheckBoxes to the currently selected panels. The selection might have changed in another panel java.util.Iterator iter = idata.availablePacks.iterator(); bytes = 0; while (iter.hasNext()) { Pack p = (Pack) iter.next(); if (p.required) { bytes += p.nbytes; continue; } if (idata.selectedPacks.contains(p)) bytes += p.nbytes; } } catch (Exception e) { e.printStackTrace(); } showSpaceRequired(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
DefaultTableCellRenderer renderer1 = new DefaultTableCellRenderer(){
DefaultTableCellRenderer renderer1 = new DefaultTableCellRenderer() {
public void panelActivate() { try { packsTable.setModel(new PacksModel(idata.availablePacks, idata.selectedPacks)); CheckBoxEditorRenderer packSelectedRenderer = new CheckBoxEditorRenderer(false); packsTable.getColumnModel().getColumn(0).setCellRenderer(packSelectedRenderer); CheckBoxEditorRenderer packSelectedEditor = new CheckBoxEditorRenderer(true); packsTable.getColumnModel().getColumn(0).setCellEditor(packSelectedEditor); packsTable.getColumnModel().getColumn(0).setMaxWidth(40); DefaultTableCellRenderer renderer1 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } }; packsTable.getColumnModel().getColumn(1).setCellRenderer(renderer1); DefaultTableCellRenderer renderer2 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } // public void setFont(Font f) // { // super.setFont(new Font("Monospaced",Font.PLAIN,11)); // } }; renderer2.setHorizontalAlignment(JLabel.RIGHT); packsTable.getColumnModel().getColumn(2).setCellRenderer(renderer2); packsTable.getColumnModel().getColumn(2).setMaxWidth(100); //remove header,so we don't need more strings tableScroller.remove(packsTable.getTableHeader()); tableScroller.setColumnHeaderView(null); tableScroller.setColumnHeader(null); // set the JCheckBoxes to the currently selected panels. The selection might have changed in another panel java.util.Iterator iter = idata.availablePacks.iterator(); bytes = 0; while (iter.hasNext()) { Pack p = (Pack) iter.next(); if (p.required) { bytes += p.nbytes; continue; } if (idata.selectedPacks.contains(p)) bytes += p.nbytes; } } catch (Exception e) { e.printStackTrace(); } showSpaceRequired(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
DefaultTableCellRenderer renderer2 = new DefaultTableCellRenderer(){
DefaultTableCellRenderer renderer2 = new DefaultTableCellRenderer() {
public void panelActivate() { try { packsTable.setModel(new PacksModel(idata.availablePacks, idata.selectedPacks)); CheckBoxEditorRenderer packSelectedRenderer = new CheckBoxEditorRenderer(false); packsTable.getColumnModel().getColumn(0).setCellRenderer(packSelectedRenderer); CheckBoxEditorRenderer packSelectedEditor = new CheckBoxEditorRenderer(true); packsTable.getColumnModel().getColumn(0).setCellEditor(packSelectedEditor); packsTable.getColumnModel().getColumn(0).setMaxWidth(40); DefaultTableCellRenderer renderer1 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } }; packsTable.getColumnModel().getColumn(1).setCellRenderer(renderer1); DefaultTableCellRenderer renderer2 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } // public void setFont(Font f) // { // super.setFont(new Font("Monospaced",Font.PLAIN,11)); // } }; renderer2.setHorizontalAlignment(JLabel.RIGHT); packsTable.getColumnModel().getColumn(2).setCellRenderer(renderer2); packsTable.getColumnModel().getColumn(2).setMaxWidth(100); //remove header,so we don't need more strings tableScroller.remove(packsTable.getTableHeader()); tableScroller.setColumnHeaderView(null); tableScroller.setColumnHeader(null); // set the JCheckBoxes to the currently selected panels. The selection might have changed in another panel java.util.Iterator iter = idata.availablePacks.iterator(); bytes = 0; while (iter.hasNext()) { Pack p = (Pack) iter.next(); if (p.required) { bytes += p.nbytes; continue; } if (idata.selectedPacks.contains(p)) bytes += p.nbytes; } } catch (Exception e) { e.printStackTrace(); } showSpaceRequired(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
};
};
public void panelActivate() { try { packsTable.setModel(new PacksModel(idata.availablePacks, idata.selectedPacks)); CheckBoxEditorRenderer packSelectedRenderer = new CheckBoxEditorRenderer(false); packsTable.getColumnModel().getColumn(0).setCellRenderer(packSelectedRenderer); CheckBoxEditorRenderer packSelectedEditor = new CheckBoxEditorRenderer(true); packsTable.getColumnModel().getColumn(0).setCellEditor(packSelectedEditor); packsTable.getColumnModel().getColumn(0).setMaxWidth(40); DefaultTableCellRenderer renderer1 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } }; packsTable.getColumnModel().getColumn(1).setCellRenderer(renderer1); DefaultTableCellRenderer renderer2 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } // public void setFont(Font f) // { // super.setFont(new Font("Monospaced",Font.PLAIN,11)); // } }; renderer2.setHorizontalAlignment(JLabel.RIGHT); packsTable.getColumnModel().getColumn(2).setCellRenderer(renderer2); packsTable.getColumnModel().getColumn(2).setMaxWidth(100); //remove header,so we don't need more strings tableScroller.remove(packsTable.getTableHeader()); tableScroller.setColumnHeaderView(null); tableScroller.setColumnHeader(null); // set the JCheckBoxes to the currently selected panels. The selection might have changed in another panel java.util.Iterator iter = idata.availablePacks.iterator(); bytes = 0; while (iter.hasNext()) { Pack p = (Pack) iter.next(); if (p.required) { bytes += p.nbytes; continue; } if (idata.selectedPacks.contains(p)) bytes += p.nbytes; } } catch (Exception e) { e.printStackTrace(); } showSpaceRequired(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
} catch (Exception e)
} catch (Exception e)
public void panelActivate() { try { packsTable.setModel(new PacksModel(idata.availablePacks, idata.selectedPacks)); CheckBoxEditorRenderer packSelectedRenderer = new CheckBoxEditorRenderer(false); packsTable.getColumnModel().getColumn(0).setCellRenderer(packSelectedRenderer); CheckBoxEditorRenderer packSelectedEditor = new CheckBoxEditorRenderer(true); packsTable.getColumnModel().getColumn(0).setCellEditor(packSelectedEditor); packsTable.getColumnModel().getColumn(0).setMaxWidth(40); DefaultTableCellRenderer renderer1 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } }; packsTable.getColumnModel().getColumn(1).setCellRenderer(renderer1); DefaultTableCellRenderer renderer2 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } // public void setFont(Font f) // { // super.setFont(new Font("Monospaced",Font.PLAIN,11)); // } }; renderer2.setHorizontalAlignment(JLabel.RIGHT); packsTable.getColumnModel().getColumn(2).setCellRenderer(renderer2); packsTable.getColumnModel().getColumn(2).setMaxWidth(100); //remove header,so we don't need more strings tableScroller.remove(packsTable.getTableHeader()); tableScroller.setColumnHeaderView(null); tableScroller.setColumnHeader(null); // set the JCheckBoxes to the currently selected panels. The selection might have changed in another panel java.util.Iterator iter = idata.availablePacks.iterator(); bytes = 0; while (iter.hasNext()) { Pack p = (Pack) iter.next(); if (p.required) { bytes += p.nbytes; continue; } if (idata.selectedPacks.contains(p)) bytes += p.nbytes; } } catch (Exception e) { e.printStackTrace(); } showSpaceRequired(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
e.printStackTrace();
e.printStackTrace();
public void panelActivate() { try { packsTable.setModel(new PacksModel(idata.availablePacks, idata.selectedPacks)); CheckBoxEditorRenderer packSelectedRenderer = new CheckBoxEditorRenderer(false); packsTable.getColumnModel().getColumn(0).setCellRenderer(packSelectedRenderer); CheckBoxEditorRenderer packSelectedEditor = new CheckBoxEditorRenderer(true); packsTable.getColumnModel().getColumn(0).setCellEditor(packSelectedEditor); packsTable.getColumnModel().getColumn(0).setMaxWidth(40); DefaultTableCellRenderer renderer1 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } }; packsTable.getColumnModel().getColumn(1).setCellRenderer(renderer1); DefaultTableCellRenderer renderer2 = new DefaultTableCellRenderer(){ public void setBorder(Border b) { } // public void setFont(Font f) // { // super.setFont(new Font("Monospaced",Font.PLAIN,11)); // } }; renderer2.setHorizontalAlignment(JLabel.RIGHT); packsTable.getColumnModel().getColumn(2).setCellRenderer(renderer2); packsTable.getColumnModel().getColumn(2).setMaxWidth(100); //remove header,so we don't need more strings tableScroller.remove(packsTable.getTableHeader()); tableScroller.setColumnHeaderView(null); tableScroller.setColumnHeader(null); // set the JCheckBoxes to the currently selected panels. The selection might have changed in another panel java.util.Iterator iter = idata.availablePacks.iterator(); bytes = 0; while (iter.hasNext()) { Pack p = (Pack) iter.next(); if (p.required) { bytes += p.nbytes; continue; } if (idata.selectedPacks.contains(p)) bytes += p.nbytes; } } catch (Exception e) { e.printStackTrace(); } showSpaceRequired(); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
int i = packsTable.getSelectedRow(); if (i >= 0) { Pack pack = (Pack) idata.availablePacks.get(i); descriptionArea.setText(pack.description); }
Pack pack = (Pack) idata.availablePacks.get(i); descriptionArea.setText(pack.description);
public void valueChanged(ListSelectionEvent e) { int i = packsTable.getSelectedRow(); if (i >= 0) { Pack pack = (Pack) idata.availablePacks.get(i); descriptionArea.setText(pack.description); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
}
public void valueChanged(ListSelectionEvent e) { int i = packsTable.getSelectedRow(); if (i >= 0) { Pack pack = (Pack) idata.availablePacks.get(i); descriptionArea.setText(pack.description); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/PacksPanel.java/buggy/src/lib/com/izforge/izpack/panels/PacksPanel.java
this.createForAll = new Boolean( aCreateForAll.booleanValue( ) );
this.createForAll = Boolean.valueOf(aCreateForAll.booleanValue());
public void setCreateForAll( Boolean aCreateForAll ) { this.createForAll = new Boolean( aCreateForAll.booleanValue( ) ); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Shortcut.java/clean/src/lib/com/izforge/izpack/util/os/Shortcut.java
else if (os.regionMatches(true, 0, "macosx", 0, 6))
else if (os.regionMatches(true, 0, "mac os x", 0, 6))
private void loadInstallData() throws Exception { // Usefull variables InputStream in; DataInputStream datIn; ObjectInputStream objIn; int size; int i; // We load the variables Properties variables = null; in = getClass().getResourceAsStream("/vars"); if (null != in) { objIn = new ObjectInputStream(in); variables = (Properties) objIn.readObject(); objIn.close(); } // We load the Info data in = getClass().getResourceAsStream("/info"); objIn = new ObjectInputStream(in); Info inf = (Info) objIn.readObject(); objIn.close(); // We load the GUIPrefs in = getClass().getResourceAsStream("/GUIPrefs"); objIn = new ObjectInputStream(in); GUIPrefs guiPrefs = (GUIPrefs) objIn.readObject(); objIn.close(); // We read the panels order data in = getClass().getResourceAsStream("/panelsOrder"); datIn = new DataInputStream(in); size = datIn.readInt(); ArrayList panelsOrder = new ArrayList(); for (i = 0; i < size; i++) panelsOrder.add(datIn.readUTF()); datIn.close(); // We read the packs data in = getClass().getResourceAsStream("/packs.info"); objIn = new ObjectInputStream(in); size = objIn.readInt(); ArrayList availablePacks = new ArrayList(); for (i = 0; i < size; i++) availablePacks.add(objIn.readObject()); objIn.close(); // We determine the operating system and the initial installation path String os = System.getProperty("os.name"); String user = System.getProperty("user.name"); String dir; String installPath; if (os.regionMatches(true, 0, "windows", 0, 7)) dir = System.getProperty("user.home").substring(0, 3) + "Program Files" + File.separator; else if (os.regionMatches(true, 0, "macosx", 0, 6)) dir = "/Applications" + File.separator; else if (os.regionMatches(true, 0, "mac", 0, 3)) dir = ""; else if (user.equals("root")) dir = "/usr/local" + File.separator; else dir = System.getProperty("user.home") + File.separator; installPath = dir + inf.getAppName(); // We read the installation kind in = getClass().getResourceAsStream("/kind"); datIn = new DataInputStream(in); String kind = datIn.readUTF(); datIn.close(); // We build a new InstallData installdata = InstallData.getInstance(); installdata.setInstallPath(installPath); installdata.setVariable (ScriptParser.JAVA_HOME, System.getProperty("java.home")); installdata.setVariable (ScriptParser.USER_HOME, System.getProperty("user.home")); installdata.setVariable (ScriptParser.USER_NAME, System.getProperty("user.name")); installdata.setVariable (ScriptParser.FILE_SEPARATOR, File.separator); if (null != variables) { Enumeration enum = variables.keys(); String varName = null; String varValue = null; while (enum.hasMoreElements()) { varName = (String) enum.nextElement(); varValue = (String) variables.getProperty(varName); installdata.setVariable(varName, varValue); } }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9837a3273789a6260e1953183adf974200aa9e94/Installer.java/buggy/src/lib/com/izforge/izpack/installer/Installer.java
if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue;
if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue;
private void loadPanels() throws Exception { // Initialisation java.util.List panelsOrder = installdata.panelsOrder; int i; int size = panelsOrder.size(); String className; Class objectClass; Constructor constructor; Object object; IzPanel panel; Class[] paramsClasses = new Class[2]; paramsClasses[0] = Class.forName("com.izforge.izpack.installer.InstallerFrame"); paramsClasses[1] = Class.forName("com.izforge.izpack.installer.InstallData"); Object[] params = { this, installdata}; // We load each of them int curVisPanelNumber = 0; int lastVis = 0; for (i = 0; i < size; i++) { // We add the panel Panel p = (Panel) panelsOrder.get(i); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; className = p.className; String praefix = "com.izforge.izpack.panels."; if (className.indexOf('.') > -1) // Full qualified class name praefix = ""; objectClass = Class.forName(praefix + className); constructor = objectClass.getDeclaredConstructor(paramsClasses); object = constructor.newInstance(params); panel = (IzPanel) object; installdata.panels.add(panel); if (panel.isHidden()) visiblePanelMapping.add(i, new Integer(-1)); else { visiblePanelMapping.add(i, new Integer(curVisPanelNumber)); curVisPanelNumber++; lastVis = i; } // We add the XML data panel root XMLElement panelRoot = new XMLElement(className); installdata.xmlData.addChild(panelRoot); } visiblePanelMapping.add(i,new Integer(lastVis)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/549f7e63531736b94c9f5512636a03dd2e42aff0/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
visiblePanelMapping.add(i, new Integer(-1));
visiblePanelMapping.add(count, new Integer(-1));
private void loadPanels() throws Exception { // Initialisation java.util.List panelsOrder = installdata.panelsOrder; int i; int size = panelsOrder.size(); String className; Class objectClass; Constructor constructor; Object object; IzPanel panel; Class[] paramsClasses = new Class[2]; paramsClasses[0] = Class.forName("com.izforge.izpack.installer.InstallerFrame"); paramsClasses[1] = Class.forName("com.izforge.izpack.installer.InstallData"); Object[] params = { this, installdata}; // We load each of them int curVisPanelNumber = 0; int lastVis = 0; for (i = 0; i < size; i++) { // We add the panel Panel p = (Panel) panelsOrder.get(i); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; className = p.className; String praefix = "com.izforge.izpack.panels."; if (className.indexOf('.') > -1) // Full qualified class name praefix = ""; objectClass = Class.forName(praefix + className); constructor = objectClass.getDeclaredConstructor(paramsClasses); object = constructor.newInstance(params); panel = (IzPanel) object; installdata.panels.add(panel); if (panel.isHidden()) visiblePanelMapping.add(i, new Integer(-1)); else { visiblePanelMapping.add(i, new Integer(curVisPanelNumber)); curVisPanelNumber++; lastVis = i; } // We add the XML data panel root XMLElement panelRoot = new XMLElement(className); installdata.xmlData.addChild(panelRoot); } visiblePanelMapping.add(i,new Integer(lastVis)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/549f7e63531736b94c9f5512636a03dd2e42aff0/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
visiblePanelMapping.add(i, new Integer(curVisPanelNumber));
visiblePanelMapping.add(count, new Integer(curVisPanelNumber));
private void loadPanels() throws Exception { // Initialisation java.util.List panelsOrder = installdata.panelsOrder; int i; int size = panelsOrder.size(); String className; Class objectClass; Constructor constructor; Object object; IzPanel panel; Class[] paramsClasses = new Class[2]; paramsClasses[0] = Class.forName("com.izforge.izpack.installer.InstallerFrame"); paramsClasses[1] = Class.forName("com.izforge.izpack.installer.InstallData"); Object[] params = { this, installdata}; // We load each of them int curVisPanelNumber = 0; int lastVis = 0; for (i = 0; i < size; i++) { // We add the panel Panel p = (Panel) panelsOrder.get(i); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; className = p.className; String praefix = "com.izforge.izpack.panels."; if (className.indexOf('.') > -1) // Full qualified class name praefix = ""; objectClass = Class.forName(praefix + className); constructor = objectClass.getDeclaredConstructor(paramsClasses); object = constructor.newInstance(params); panel = (IzPanel) object; installdata.panels.add(panel); if (panel.isHidden()) visiblePanelMapping.add(i, new Integer(-1)); else { visiblePanelMapping.add(i, new Integer(curVisPanelNumber)); curVisPanelNumber++; lastVis = i; } // We add the XML data panel root XMLElement panelRoot = new XMLElement(className); installdata.xmlData.addChild(panelRoot); } visiblePanelMapping.add(i,new Integer(lastVis)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/549f7e63531736b94c9f5512636a03dd2e42aff0/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
lastVis = i;
lastVis = count;
private void loadPanels() throws Exception { // Initialisation java.util.List panelsOrder = installdata.panelsOrder; int i; int size = panelsOrder.size(); String className; Class objectClass; Constructor constructor; Object object; IzPanel panel; Class[] paramsClasses = new Class[2]; paramsClasses[0] = Class.forName("com.izforge.izpack.installer.InstallerFrame"); paramsClasses[1] = Class.forName("com.izforge.izpack.installer.InstallData"); Object[] params = { this, installdata}; // We load each of them int curVisPanelNumber = 0; int lastVis = 0; for (i = 0; i < size; i++) { // We add the panel Panel p = (Panel) panelsOrder.get(i); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; className = p.className; String praefix = "com.izforge.izpack.panels."; if (className.indexOf('.') > -1) // Full qualified class name praefix = ""; objectClass = Class.forName(praefix + className); constructor = objectClass.getDeclaredConstructor(paramsClasses); object = constructor.newInstance(params); panel = (IzPanel) object; installdata.panels.add(panel); if (panel.isHidden()) visiblePanelMapping.add(i, new Integer(-1)); else { visiblePanelMapping.add(i, new Integer(curVisPanelNumber)); curVisPanelNumber++; lastVis = i; } // We add the XML data panel root XMLElement panelRoot = new XMLElement(className); installdata.xmlData.addChild(panelRoot); } visiblePanelMapping.add(i,new Integer(lastVis)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/549f7e63531736b94c9f5512636a03dd2e42aff0/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
count++;
private void loadPanels() throws Exception { // Initialisation java.util.List panelsOrder = installdata.panelsOrder; int i; int size = panelsOrder.size(); String className; Class objectClass; Constructor constructor; Object object; IzPanel panel; Class[] paramsClasses = new Class[2]; paramsClasses[0] = Class.forName("com.izforge.izpack.installer.InstallerFrame"); paramsClasses[1] = Class.forName("com.izforge.izpack.installer.InstallData"); Object[] params = { this, installdata}; // We load each of them int curVisPanelNumber = 0; int lastVis = 0; for (i = 0; i < size; i++) { // We add the panel Panel p = (Panel) panelsOrder.get(i); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; className = p.className; String praefix = "com.izforge.izpack.panels."; if (className.indexOf('.') > -1) // Full qualified class name praefix = ""; objectClass = Class.forName(praefix + className); constructor = objectClass.getDeclaredConstructor(paramsClasses); object = constructor.newInstance(params); panel = (IzPanel) object; installdata.panels.add(panel); if (panel.isHidden()) visiblePanelMapping.add(i, new Integer(-1)); else { visiblePanelMapping.add(i, new Integer(curVisPanelNumber)); curVisPanelNumber++; lastVis = i; } // We add the XML data panel root XMLElement panelRoot = new XMLElement(className); installdata.xmlData.addChild(panelRoot); } visiblePanelMapping.add(i,new Integer(lastVis)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/549f7e63531736b94c9f5512636a03dd2e42aff0/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
visiblePanelMapping.add(i,new Integer(lastVis));
visiblePanelMapping.add(count,new Integer(lastVis));
private void loadPanels() throws Exception { // Initialisation java.util.List panelsOrder = installdata.panelsOrder; int i; int size = panelsOrder.size(); String className; Class objectClass; Constructor constructor; Object object; IzPanel panel; Class[] paramsClasses = new Class[2]; paramsClasses[0] = Class.forName("com.izforge.izpack.installer.InstallerFrame"); paramsClasses[1] = Class.forName("com.izforge.izpack.installer.InstallData"); Object[] params = { this, installdata}; // We load each of them int curVisPanelNumber = 0; int lastVis = 0; for (i = 0; i < size; i++) { // We add the panel Panel p = (Panel) panelsOrder.get(i); if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints)) continue; className = p.className; String praefix = "com.izforge.izpack.panels."; if (className.indexOf('.') > -1) // Full qualified class name praefix = ""; objectClass = Class.forName(praefix + className); constructor = objectClass.getDeclaredConstructor(paramsClasses); object = constructor.newInstance(params); panel = (IzPanel) object; installdata.panels.add(panel); if (panel.isHidden()) visiblePanelMapping.add(i, new Integer(-1)); else { visiblePanelMapping.add(i, new Integer(curVisPanelNumber)); curVisPanelNumber++; lastVis = i; } // We add the XML data panel root XMLElement panelRoot = new XMLElement(className); installdata.xmlData.addChild(panelRoot); } visiblePanelMapping.add(i,new Integer(lastVis)); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/549f7e63531736b94c9f5512636a03dd2e42aff0/InstallerFrame.java/buggy/src/lib/com/izforge/izpack/installer/InstallerFrame.java
setDialogType(SAVE_DIALOG);
private void buildGUI() { setFileSelectionMode(FILES_ONLY); JPEGFilter jpegFilter = new JPEGFilter(); setFileFilter(jpegFilter); addChoosableFileFilter(jpegFilter); PNGFilter pngFilter = new PNGFilter(); addChoosableFileFilter(pngFilter); setFileFilter(pngFilter); TIFFFilter tiffFilter = new TIFFFilter(); setFileFilter(tiffFilter); addChoosableFileFilter(tiffFilter); setAcceptAllFileFilterUsed(false); setApproveButtonToolTipText(UIUtilities.formatToolTipText(SAVE_AS)); setApproveButtonText("Save as"); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d580e2fe9976d2e5e37d7d8e5111f9608b56cb6d/ImageChooser.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/util/ImageChooser.java
Thread.currentThread().sleep(_timeBetweenEvictionRunsMillis);
Thread.currentThread().sleep(sleeptime);
public void run() { CursorableLinkedList.Cursor cursor = null; while(!_cancelled) { long sleeptime = 0L; synchronized(GenericObjectPool.this) { sleeptime = _timeBetweenEvictionRunsMillis; } try { Thread.currentThread().sleep(_timeBetweenEvictionRunsMillis); } catch(Exception e) { ; // ignored } try { synchronized(GenericObjectPool.this) { if(!_pool.isEmpty()) { if(null == cursor) { cursor = (CursorableLinkedList.Cursor)(_pool.cursor(_pool.size())); } else if(!cursor.hasPrevious()) { cursor.close(); cursor = (CursorableLinkedList.Cursor)(_pool.cursor(_pool.size())); } for(int i=0,m=getNumTests();i<m;i++) { if(!cursor.hasPrevious()) { cursor.close(); cursor = (CursorableLinkedList.Cursor)(_pool.cursor(_pool.size())); } else { ObjectTimestampPair pair = (ObjectTimestampPair)(cursor.previous()); if(_minEvictableIdleTimeMillis > 0 && System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis) { try { cursor.remove(); _factory.destroyObject(pair.value); } catch(Exception e) { ; // ignored } } else if(_testWhileIdle) { boolean active = false; try { _factory.activateObject(pair.value); active = true; } catch(Exception e) { cursor.remove(); try { _factory.passivateObject(pair.value); } catch(Exception ex) { ; // ignored } _factory.destroyObject(pair.value); } if(active) { if(!_factory.validateObject(pair.value)) { cursor.remove(); try { _factory.passivateObject(pair.value); } catch(Exception ex) { ; // ignored } _factory.destroyObject(pair.value); } else { try { _factory.passivateObject(pair.value); } catch(Exception e) { cursor.remove(); _factory.destroyObject(pair.value); } } } } } } } } } catch(Exception e) { // ignored } } if(null != cursor) { cursor.close(); } }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/f8a94bdfd8e4f6321272a5e3c1904b4e7a2028fb/GenericObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
value = val; tstamp = System.currentTimeMillis();
this(val, System.currentTimeMillis());
ObjectTimestampPair(Object val) { value = val; tstamp = System.currentTimeMillis(); }
50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/fa27f201a2a1a4c8b64f9fdcec217208e071ec3a/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
} if(null != launchInfo.m_className) { classMethods.put(launchInfo.m_className, EMPTY);
public static void updateLaunchConfiguration(ILaunchConfigurationWorkingCopy configuration, LaunchInfo launchInfo) { final List EMPTY= new ArrayList(); Map classMethods= new HashMap(); Collection classes= launchInfo.m_groupMap.values(); if(null != classes) { for(Iterator it= classes.iterator(); it.hasNext(); ) { List classList= (List) it.next(); for(Iterator itc= classList.iterator(); itc.hasNext(); ) { classMethods.put(itc.next(), EMPTY); } } } configuration.setAttribute(TestNGLaunchConfigurationConstants.TYPE, launchInfo.m_launchType); configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, launchInfo.m_projectName); configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, RemoteTestNG.class.getName()); configuration.setAttribute(TestNGLaunchConfigurationConstants.CLASS_TEST_LIST, Utils.stringToNullList(launchInfo.m_className)); configuration.setAttribute(TestNGLaunchConfigurationConstants.GROUP_LIST, new ArrayList(launchInfo.m_groupMap.keySet())); configuration.setAttribute(TestNGLaunchConfigurationConstants.GROUP_CLASS_LIST, Utils.uniqueMergeList(launchInfo.m_groupMap.values())); configuration.setAttribute(TestNGLaunchConfigurationConstants.SUITE_TEST_LIST, Utils.stringToNullList(launchInfo.m_suiteName)); configuration.setAttribute(TestNGLaunchConfigurationConstants.ALL_METHODS_LIST, toClassMethodsMap(classMethods)); configuration.setAttribute(TestNGLaunchConfigurationConstants.TESTNG_COMPLIANCE_LEVEL_ATTR, launchInfo.m_complianceLevel); configuration.setAttribute(TestNGLaunchConfigurationConstants.LOG_LEVEL, launchInfo.m_logLevel); }
53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/f6ce57acb0d612e9a31a10ef80334cc2ffb999f4/ConfigurationHelper.java/clean/src/main/org/testng/eclipse/ui/util/ConfigurationHelper.java
layout = new GridBagLayout(); gbConstraints = new GridBagConstraints();
GridBagLayout layout = new GridBagLayout(); GridBagConstraints gbConstraints = new GridBagConstraints();
public HTMLLicencePanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); // We load the licence loadLicence(); // We put our components infoLabel = LabelFactory.create(parent.langpack.getString("LicencePanel.info"), parent.icons.getImageIcon("history"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, 0, 2, 1, 1.0, 0.0); gbConstraints.insets = new Insets(5, 5, 5, 5); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(infoLabel, gbConstraints); add(infoLabel); try { textArea = new JEditorPane(); textArea.setEditable(false); textArea.addHyperlinkListener(this); JScrollPane scroller = new JScrollPane(textArea); textArea.setPage(loadLicence()); parent.buildConstraints(gbConstraints, 0, 1, 2, 1, 1.0, 1.0); gbConstraints.anchor = GridBagConstraints.CENTER; gbConstraints.fill = GridBagConstraints.BOTH; layout.addLayoutComponent(scroller, gbConstraints); add(scroller); } catch (Exception err) { err.printStackTrace(); } ButtonGroup group = new ButtonGroup(); yesRadio = new JRadioButton(parent.langpack.getString("LicencePanel.agree"), false); group.add(yesRadio); parent.buildConstraints(gbConstraints, 0, 2, 1, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(yesRadio, gbConstraints); add(yesRadio); yesRadio.addActionListener(this); noRadio = new JRadioButton(parent.langpack.getString("LicencePanel.notagree"), true); group.add(noRadio); parent.buildConstraints(gbConstraints, 0, 3, 1, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.WEST; gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.insets = new Insets(0, 5, 5, 5); layout.addLayoutComponent(noRadio, gbConstraints); add(noRadio); noRadio.addActionListener(this); setInitialFocus(textArea); }
54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/HTMLLicencePanel.java/clean/src/lib/com/izforge/izpack/panels/HTMLLicencePanel.java