Skip to content

Commit 8554f6d

Browse files
committed
[PLXCOMP-45] Renamed bad variable name, deprecated old setter added new one
Suggestion by Brian Fox
1 parent dfcd8ea commit 8554f6d

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

src/main/java/org/codehaus/plexus/archiver/war/WarArchiver.java

+20-6
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,30 @@ public class WarArchiver
5353
/**
5454
* flag set if finding the webxml is to be expected.
5555
*/
56-
private boolean ignoreWebxml = true;
56+
private boolean expectWebXml = true;
5757

5858
/**
5959
* flag set if the descriptor is added
6060
*/
6161
private boolean descriptorAdded;
6262

63-
public void setIgnoreWebxml( boolean ignore )
63+
/*
64+
* @deprecated Use setExpectWebXml instead !
65+
* @param excpectWebXml true if web xml is *expected* from the client
66+
*/
67+
@Deprecated
68+
public void setIgnoreWebxml( boolean excpectWebXml )
69+
{
70+
expectWebXml = excpectWebXml;
71+
}
72+
73+
/*.
74+
* Indicates if the client is required to supply web.xml
75+
* @param excpectWebXml true if web xml is *expected* from the client
76+
*/
77+
public void setExpectWebXml( boolean expectWebXml )
6478
{
65-
ignoreWebxml = ignore;
79+
this.expectWebXml = expectWebXml;
6680
}
6781

6882
public WarArchiver()
@@ -143,7 +157,7 @@ protected void initZipOutputStream( ZipArchiveOutputStream zOut )
143157
throws IOException, ArchiverException
144158
{
145159
// If no webxml file is specified, it's an error.
146-
if ( ignoreWebxml && deploymentDescriptor == null && !isInUpdateMode() )
160+
if ( expectWebXml && deploymentDescriptor == null && !isInUpdateMode() )
147161
{
148162
throw new ArchiverException( "webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)" );
149163
}
@@ -162,7 +176,7 @@ protected void zipFile( ArchiveEntry entry, ZipArchiveOutputStream zOut, String
162176
// by the "webxml" attribute and in a <fileset> element.
163177
if ( vPath.equalsIgnoreCase( "WEB-INF/web.xml" ) )
164178
{
165-
if ( descriptorAdded || ( ignoreWebxml
179+
if ( descriptorAdded || ( expectWebXml
166180
&& ( deploymentDescriptor == null
167181
|| !ResourceUtils.isCanonicalizedSame( entry.getResource(), deploymentDescriptor ) ) ) )
168182
{
@@ -190,7 +204,7 @@ protected void zipFile( ArchiveEntry entry, ZipArchiveOutputStream zOut, String
190204
protected void cleanUp()
191205
{
192206
descriptorAdded = false;
193-
ignoreWebxml = true;
207+
expectWebXml = true;
194208
super.cleanUp();
195209
}
196210
}

0 commit comments

Comments
 (0)