提交 b1c82f1e 编写于 作者: J Jesse Glick

stephenc asks to use TODO rather than XXX

上级 e67746c9
......@@ -497,7 +497,7 @@ public final class FilePath implements Serializable {
private static void unzip(File dir, InputStream in) throws IOException {
File tmpFile = File.createTempFile("tmpzip", null); // uses java.io.tmpdir
try {
// XXX why does this not simply use ZipInputStream?
// TODO why does this not simply use ZipInputStream?
IOUtils.copy(in, tmpFile);
unzip(dir,tmpFile);
}
......
......@@ -797,7 +797,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
List<Future<UpdateCenter.UpdateCenterJob>> jobs = new ArrayList<Future<UpdateCenter.UpdateCenterJob>>();
UpdateCenter uc = Jenkins.getInstance().getUpdateCenter();
// XXX call uc.updateAllSites() when available? perhaps not, since we should not block on network here
// TODO call uc.updateAllSites() when available? perhaps not, since we should not block on network here
for (Map.Entry<String,VersionNumber> requestedPlugin : parseRequestedPlugins(configXml).entrySet()) {
PluginWrapper pw = getPlugin(requestedPlugin.getKey());
if (pw == null) { // install new
......
......@@ -1075,14 +1075,14 @@ public class Util {
// we still prefer to try JNA first as PosixAPI supports even smaller platforms.
POSIX posix = PosixAPI.jnr();
if (posix.isNative()) {
// XXX should we rethrow PosixException as IOException here?
// TODO should we rethrow PosixException as IOException here?
r = posix.symlink(targetPath,symlinkFile.getAbsolutePath());
}
}
}
if (r==null) {
// if all else fail, fall back to the most expensive approach of forking a process
// XXX is this really necessary? JavaPOSIX should do this automatically
// TODO is this really necessary? JavaPOSIX should do this automatically
r = new LocalProc(new String[]{
"ln","-s", targetPath, symlinkPath},
new String[0],listener.getLogger(), baseDir).join();
......
......@@ -724,7 +724,7 @@ public class Fingerprint implements ModelObject, Saveable {
}
void addWithoutSaving(String jobFullName, int n) {
synchronized(usages) { // XXX why not synchronized (this) like some, though not all, other accesses?
synchronized(usages) { // TODO why not synchronized (this) like some, though not all, other accesses?
RangeSet r = usages.get(jobFullName);
if(r==null) {
r = new RangeSet();
......
......@@ -149,7 +149,7 @@ public final class JDK extends ToolInstallation implements NodeSpecific<JDK>, En
public static class DescriptorImpl extends ToolDescriptor<JDK> {
public String getDisplayName() {
return "JDK"; // XXX I18N
return "JDK"; // TODO I18N
}
public @Override JDK[] getInstallations() {
......
......@@ -1369,7 +1369,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
if (tmp.exists()) {
Util.deleteRecursive(tmp);
}
// XXX on Java 7 prefer: Files.move(rootDir.toPath(), tmp.toPath(), StandardCopyOption.ATOMIC_MOVE)
// TODO on Java 7 prefer: Files.move(rootDir.toPath(), tmp.toPath(), StandardCopyOption.ATOMIC_MOVE)
boolean renamingSucceeded = rootDir.renameTo(tmp);
Util.deleteRecursive(tmp);
// some user reported that they see some left-over .xyz files in the workspace,
......@@ -1955,7 +1955,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
// Definitely prevented.
return false;
}
// XXX may be that keepLog is on (perhaps toggler earlier) yet isKeepLog() would be true anyway.
// TODO may be that keepLog is on (perhaps toggler earlier) yet isKeepLog() would be true anyway.
// In such a case this will incorrectly return true and logKeep.jelly will allow the toggle.
// However at least then (after redirecting to the same page) the toggle button will correctly disappear.
return true;
......
......@@ -70,7 +70,7 @@ public class StreamBuildListener extends StreamTaskListener implements BuildList
if (causes==null || causes.isEmpty())
l.println("Started");
else for (Cause cause : causes) {
// XXX elide duplicates as per CauseAction.getCauseCounts (used in summary.jelly)
// TODO elide duplicates as per CauseAction.getCauseCounts (used in summary.jelly)
cause.print(this);
}
}
......
......@@ -805,7 +805,7 @@ public abstract class View extends AbstractModelObject implements AccessControll
}
}
}
// XXX consider also adding the user of the UserCause when applicable
// TODO consider also adding the user of the UserCause when applicable
buildCount++;
progress((itemCount + 1.0 * buildCount / builds.size()) / (items.size() + 1));
}
......@@ -818,7 +818,7 @@ public abstract class View extends AbstractModelObject implements AccessControll
if (canceled()) {
return;
}
for (User u : User.getAll()) { // XXX nice to have a method to iterate these lazily
for (User u : User.getAll()) { // TODO nice to have a method to iterate these lazily
if (u == unknown) {
continue;
}
......
......@@ -44,7 +44,7 @@ public class JUnitParser extends TestResultParser {
private final boolean keepLongStdio;
/** XXX TestResultParser.all does not seem to ever be called so why must this be an Extension? */
/** TODO TestResultParser.all does not seem to ever be called so why must this be an Extension? */
@Deprecated
public JUnitParser() {
this(false);
......
......@@ -78,7 +78,7 @@ public class CommandInstaller extends ToolInstaller {
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException {
FilePath dir = preferredLocation(tool, node);
// XXX support Windows batch scripts, Unix scripts with interpreter line, etc. (see CommandInterpreter subclasses)
// TODO support Windows batch scripts, Unix scripts with interpreter line, etc. (see CommandInterpreter subclasses)
FilePath script = dir.createTextTempFile("hudson", ".sh", command);
try {
String[] cmd = {"sh", "-e", script.getRemote()};
......
......@@ -254,7 +254,7 @@ public abstract class FormFieldValidator {
protected BufferedReader open(URL url) throws IOException {
// use HTTP content type to find out the charset.
URLConnection con = ProxyConfiguration.open(url);
if (con == null) { // XXX is this even permitted by URL.openConnection?
if (con == null) { // TODO is this even permitted by URL.openConnection?
throw new IOException(url.toExternalForm());
}
return new BufferedReader(
......
......@@ -417,7 +417,7 @@ public abstract class FormValidation extends IOException implements HttpResponse
protected BufferedReader open(URL url) throws IOException {
// use HTTP content type to find out the charset.
URLConnection con = ProxyConfiguration.open(url);
if (con == null) { // XXX is this even permitted by URL.openConnection?
if (con == null) { // TODO is this even permitted by URL.openConnection?
throw new IOException(url.toExternalForm());
}
return new BufferedReader(
......
......@@ -122,7 +122,7 @@ public class XStream2 extends XStream {
}
static String trimVersion(String version) {
// XXX seems like there should be some trick with VersionNumber to do this
// TODO seems like there should be some trick with VersionNumber to do this
return version.replaceFirst(" .+$", "");
}
......
......@@ -1766,9 +1766,9 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
if (!d.isDirectory() && (d.getParentFile() == null || !d.getParentFile().canWrite())) {
return FormValidation.error(value + " does not exist and probably cannot be created");
}
// XXX failure to use either ITEM_* variable might be an error too?
// TODO failure to use either ITEM_* variable might be an error too?
}
return FormValidation.ok(); // XXX assumes it will be OK after substitution, but can we be sure?
return FormValidation.ok(); // TODO assumes it will be OK after substitution, but can we be sure?
}
// to route /descriptor/FQCN/xxx to getDescriptor(FQCN).xxx
......@@ -2271,7 +2271,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
if (ctx instanceof ItemGroup) {
ItemGroup g = (ItemGroup) ctx;
Item i = g.getItem(s);
if (i==null || !i.hasPermission(Item.READ)) { // XXX consider DISCOVER
if (i==null || !i.hasPermission(Item.READ)) { // TODO consider DISCOVER
ctx=null; // can't go up further
break;
}
......@@ -2339,7 +2339,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
return null; // this item can't have any children
if (!item.hasPermission(Item.READ))
return null; // XXX consider DISCOVER
return null; // TODO consider DISCOVER
parent = (ItemGroup) item;
}
......@@ -3631,7 +3631,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
|| rest.startsWith("/adjuncts/")
|| rest.startsWith("/signup")
|| rest.startsWith("/tcpSlaveAgentListener")
// XXX SlaveComputer.doSlaveAgentJnlp; there should be an annotation to request unprotected access
// TODO SlaveComputer.doSlaveAgentJnlp; there should be an annotation to request unprotected access
|| rest.matches("/computer/[^/]+/slave-agent[.]jnlp") && "true".equals(Stapler.getCurrentRequest().getParameter("encrypt"))
|| rest.startsWith("/cli")
|| rest.startsWith("/federatedLoginService/")
......@@ -3658,8 +3658,8 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
*/
public Collection<String> getUnprotectedRootActions() {
Set<String> names = new TreeSet<String>();
names.add("jnlpJars"); // XXX cleaner to refactor doJnlpJars into a URA
// XXX consider caching (expiring cache when actions changes)
names.add("jnlpJars"); // TODO cleaner to refactor doJnlpJars into a URA
// TODO consider caching (expiring cache when actions changes)
for (Action a : getActions()) {
if (a instanceof UnprotectedRootAction) {
names.add(a.getUrlName());
......
......@@ -100,7 +100,7 @@ class BuildReferenceMapAdapter<R> implements SortedMap<Integer,R> {
}
public boolean containsValue(Object value) {
return core.containsValue(value); // XXX should this be core.containsValue(wrap(value))?
return core.containsValue(value); // TODO should this be core.containsValue(wrap(value))?
}
public R get(Object key) {
......@@ -126,7 +126,7 @@ class BuildReferenceMapAdapter<R> implements SortedMap<Integer,R> {
@Override
public boolean equals(Object o) {
return core.equals(o); // XXX this is wrong
return core.equals(o); // TODO this is wrong
}
@Override
......
......@@ -48,7 +48,7 @@ THE SOFTWARE.
</j:choose>
<p>${%plugin.dependencies}</p>
<ul>
<j:forEach var="p" items="${app.pluginManager.plugins}"> <!-- XXX sort -->
<j:forEach var="p" items="${app.pluginManager.plugins}"> <!-- TODO sort -->
<li>
<a href="${rootURL}/pluginManager/plugin/${p.shortName}/thirdPartyLicenses">
<j:choose>
......
......@@ -65,7 +65,7 @@ THE SOFTWARE.
<p>
${%Run from slave command line:}
</p>
<!-- XXX conceal secret w/ JS if possible -->
<!-- TODO conceal secret w/ JS if possible -->
<pre>java -jar <a href="${rootURL}/jnlpJars/slave.jar">slave.jar</a> -jnlpUrl ${h.inferHudsonURL(request)}${it.url}slave-agent.jnlp -secret ${it.jnlpMac}</pre>
</li>
</j:otherwise>
......
......@@ -30,7 +30,7 @@ THE SOFTWARE.
autoCompleteDelimChar=","
field="childProjects"/>
</f:entry>
<j:if test="${descriptor.showEvenIfUnstableOption(targetType)}"> <!-- XXX JENKINS-16444 this will always be true when first adding step -->
<j:if test="${descriptor.showEvenIfUnstableOption(targetType)}"> <!-- TODO JENKINS-16444 this will always be true when first adding step -->
<f:entry title="">
<f:radio name="threshold" checked="${instance.threshold==null || instance.threshold.toString()=='SUCCESS'}"
title="${%Trigger only if build succeeds}" value="SUCCESS"/>
......
......@@ -23,7 +23,7 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<!-- XXX t:label? -->
<!-- TODO t:label? -->
<f:entry title="${%Version}" field="id">
<j:choose>
<j:set var="jdks" value="${descriptor.installableJDKs}"/>
......
......@@ -28,7 +28,7 @@ THE SOFTWARE.
Meant to be used from config.jelly of ToolInstaller subypes.
</st:documentation>
<f:entry title="${%Label}" field="label" help="/help/tools/help-label.html">
<!-- XXX could use Hudson.getLabels and make a combo box -->
<!-- TODO could use Hudson.getLabels and make a combo box -->
<f:textbox/>
</f:entry>
</j:jelly>
......@@ -33,7 +33,7 @@ THE SOFTWARE.
<d:tag name="feature">
<j:set var="iconUrl" value="${icon.startsWith('/') ? resURL+icon : imagesURL+'/48x48/'+icon}"/>
${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(href,iconUrl,title,requiresConfirmation,requiresConfirmation) : null}
<!-- XXX summary.jelly should be modified to accept requiresConfirmation so the icon link can be included -->
<!-- TODO summary.jelly should be modified to accept requiresConfirmation so the icon link can be included -->
<j:set var="_href" value="${href}"/>
<t:summary icon="${icon}"
href="${requiresConfirmation ? null : href}" iconOnly="true">
......
......@@ -65,7 +65,7 @@ THE SOFTWARE.
<a href="${rootURL}/${item.task.url}" class="model-link inside tl-tr" tooltip="${item.why}${h.escape(item.params)}&lt;br&gt;${%WaitingFor(item.inQueueForString)}">
<l:breakable value="${item.task.fullDisplayName}"/>
</a>
<!-- XXX include estimated number as in BuildHistoryWidget/entries.jelly if possible -->
<!-- TODO include estimated number as in BuildHistoryWidget/entries.jelly if possible -->
<j:if test="${stuck}">
&#160;
<a href="http://wiki.jenkins-ci.org/display/JENKINS/Executor+Starvation">
......
......@@ -57,7 +57,7 @@ var breadcrumbs = (function() {
}
function requireConfirmation(action, event, cfg) {
if (confirm(cfg.displayName + ': are you sure?')) { // XXX I18N
if (confirm(cfg.displayName + ': are you sure?')) { // TODO I18N
var form = document.createElement('form');
form.setAttribute('method', cfg.post ? 'POST' : 'GET');
form.setAttribute('action', cfg.url);
......
......@@ -35,7 +35,7 @@ THE SOFTWARE.
</st:attribute>
</st:documentation>
<st:adjunct includes="lib.layout.progressiveRendering.progressiveRendering"/>
<!-- XXX generate an ID so we can use this more than once per page -->
<!-- TODO generate an ID so we can use this more than once per page -->
<t:progressBar id="status" pos="0" tooltip="${tooltip ?: '%progressMessage'}"/>
<j:invoke method="start" on="${handler}"/>
<script>progressivelyRender(<st:bind value="${handler}"/>, ${callback});</script>
......
......@@ -29,7 +29,7 @@ function progressivelyRender(handler, callback) {
callback(r.data);
$('status').style.display = 'none';
} else if (r.status == 'canceled') {
// XXX ugly; replace with single tr of class=unknown?
// TODO ugly; replace with single tr of class=unknown?
$$('#status .progress-bar-done')[0].innerHTML = 'Aborted.';
} else if (r.status == 'error') {
$$('#status .progress-bar-done')[0].style.width = '100%';
......
......@@ -449,7 +449,7 @@ public class FilePathTest extends ChannelTestCase {
assertValidateAntFileMask(Messages.FilePath_validateAntFileMask_portionMatchButPreviousNotMatchAndSuggest("**/*.js", "**", "**/*.js"), d, "**/*.js");
assertValidateAntFileMask(Messages.FilePath_validateAntFileMask_doesntMatchAnything("index.htm"), d, "index.htm");
assertValidateAntFileMask(Messages.FilePath_validateAntFileMask_doesntMatchAndSuggest("f.html", "d1/d2/d3/f.html"), d, "f.html");
// XXX lots more to test, e.g. multiple patterns separated by commas; ought to have full code coverage for this method
// TODO lots more to test, e.g. multiple patterns separated by commas; ought to have full code coverage for this method
} finally {
Util.deleteRecursive(tmp);
}
......
......@@ -181,7 +181,7 @@ public class FunctionsTest {
when(Stapler.getCurrentRequest()).thenReturn(req);
TopLevelItemAndItemGroup ms = mock(TopLevelItemAndItemGroup.class);
when(ms.getShortUrl()).thenReturn("job/ms/");
// XXX "." (in second ancestor) is what Stapler currently fails to do. Could edit test to use ".." but set a different request path?
// TODO "." (in second ancestor) is what Stapler currently fails to do. Could edit test to use ".." but set a different request path?
createMockAncestors(req, createAncestor(j, "../.."), createAncestor(ms, "."));
Item m = mock(Item.class);
when(m.getParent()).thenReturn(ms);
......
......@@ -33,7 +33,7 @@ MavenModule.Pronoun=Module
MavenModuleSet.DiplayName=Build a maven2/3 project
MavenModuleSet.Pronoun=Maven2/3 project
# XXX obsolete keys?
# TODO obsolete keys?
MavenModuleSet.AlternateSettingsRelativePath=Alternate settings file must be a relative path.
MavenModuleSet.readResolve_missingConfigProvider=ERROR: 'config-file-provider' is not installed or disabled, therefore the config can't be fully loaded!!
MavenModuleSet.readResolve_updateConfigProvider=ERROR: Please update the 'config-file-provider' plugin, the current version is not supported anymore! (id={0})
......
......@@ -32,7 +32,7 @@ MavenModule.Pronoun=\u6a21\u7d44
MavenModuleSet.DiplayName=\u5efa\u7f6e Maven 2 \u6216 3 \u5c08\u6848
# XXX obsolete keys?
# TODO obsolete keys?
MavenModuleSet.AlternateSettingsRelativePath=\u66ff\u4ee3\u8a2d\u5b9a\u6a94\u8981\u7528\u76f8\u5c0d\u8def\u5f91\u3002
MavenModuleSet.readResolve_missingConfigProvider=\u932f\u8aa4: 'config-file-provider' \u6c92\u6709\u5b89\u88dd\u6216\u662f\u5df2\u505c\u7528\uff0c\u7121\u6cd5\u5b8c\u6574\u8f09\u5165\u8a2d\u5b9a!
MavenModuleSet.readResolve_updateConfigProvider=\u932f\u8aa4: \u8acb\u66f4\u65b0 'config-file-provider' \u5916\u639b\u7a0b\u5f0f\uff0c\u4e0d\u518d\u652f\u63f4\u9019\u500b\u7248\u672c! (id={0})
......
......@@ -451,7 +451,7 @@ public class JenkinsRule implements TestRule, MethodRule, RootAction {
// but because there's no explicit dispose method on ClassLoader, they won't get GC-ed until
// at some later point, leading to possible file descriptor overflow. So encourage GC now.
// see http://bugs.sun.com/view_bug.do?bug_id=4950148
// XXX use URLClassLoader.close() in Java 7
// TODO use URLClassLoader.close() in Java 7
System.gc();
}
}
......
......@@ -63,7 +63,7 @@ public class MemoryAssert {
* @param max the maximum desired memory usage (in bytes)
*/
public static void assertHeapUsage(Object o, int max) throws Exception {
// XXX could use ScannerUtils.recursiveSizeOf here
// TODO could use ScannerUtils.recursiveSizeOf here
CountingVisitor v = new CountingVisitor();
ScannerUtils.scan(ScannerUtils.skipNonStrongReferencesFilter(), v, Collections.singleton(o), false);
int memoryUsage = v.getTotalSize();
......
......@@ -226,7 +226,7 @@ public class MockFolder extends AbstractItem implements ModifiableTopLevelItemGr
}
@Override public List<Action> getViewActions() {
// XXX what should the default be? View.getOwnerViewActions uses Jenkins.actions; Jenkins.viewActions would make more sense as a default;
// TODO what should the default be? View.getOwnerViewActions uses Jenkins.actions; Jenkins.viewActions would make more sense as a default;
// or should it be empty by default since non-top-level folders probably do not need the same actions as root?
return Collections.emptyList();
}
......
......@@ -217,9 +217,9 @@ public class PluginManagerTest extends HudsonTestCase {
UpdateCenter.InstallationJob ijob = (UpdateCenter.InstallationJob) job;
assertEquals("tasks", ijob.plugin.name);
assertNotNull(jenkins.getPluginManager().getPlugin("tasks"));
// XXX restart scheduled (SuccessButRequiresRestart) after upgrade or Support-Dynamic-Loading: false
// XXX dependencies installed or upgraded too
// XXX required plugin installed but inactive
// TODO restart scheduled (SuccessButRequiresRestart) after upgrade or Support-Dynamic-Loading: false
// TODO dependencies installed or upgraded too
// TODO required plugin installed but inactive
}
}
......@@ -53,7 +53,7 @@ public class CopyJobCommandTest {
assertEquals(out.toString(), 0, result);
assertEquals("", out.toString());
assertNotNull(j.jenkins.getItemByFullName("dir2/p2"));
// XXX test copying from/to root, or into nonexistent folder
// TODO test copying from/to root, or into nonexistent folder
}
}
......@@ -39,7 +39,7 @@ public class GroovyInitScriptTest {
@LocalData
@Test public void errorsHandled() throws Exception {
assertEquals("true", System.getProperty("started"));
/* XXX Jenkins.logRecords empty during a test, and adding a handler to root logger in JenkinsRule.before() does not work:
/* TODO Jenkins.logRecords empty during a test, and adding a handler to root logger in JenkinsRule.before() does not work:
assertTrue(log, log.contains("Nonexistent"));
*/
}
......
......@@ -333,7 +333,7 @@ public class AbstractProjectTest extends HudsonTestCase {
@Bug(17137)
public void testExternalBuildDirectorySymlinks() throws Exception {
// XXX when using JUnit 4 add: Assume.assumeFalse(Functions.isWindows()); // symlinks may not be available
// TODO when using JUnit 4 add: Assume.assumeFalse(Functions.isWindows()); // symlinks may not be available
HtmlForm form = new WebClient().goTo("configure").getFormByName("config");
File builds = createTmpDir();
form.getInputByName("_.rawBuildsDir").setValueAttribute(builds + "/${ITEM_FULL_NAME}");
......
......@@ -87,7 +87,7 @@ public class SuiteResultTest {
}
SuiteResult sr = parseOne(data);
assertHeapUsage(sr, 1100 + /* Unicode overhead */2 * (int) (/*259946*/data.length() + /*495600*/data2.length() + /* SuiteResult.file */data.getAbsolutePath().length()));
// XXX serialize using TestResultAction.XSTREAM and verify that round-tripped object has same size
// TODO serialize using TestResultAction.XSTREAM and verify that round-tripped object has same size
} finally {
data2.delete();
}
......
......@@ -100,12 +100,12 @@ var crumb = {
wrap: function(headers) {
if (this.fieldName!=null) {
if (headers instanceof Array)
// XXX prototype.js only seems to interpret object
// TODO prototype.js only seems to interpret object
headers.push(this.fieldName, this.value);
else
headers[this.fieldName]=this.value;
}
// XXX return value unused
// TODO return value unused
return headers;
},
......@@ -578,7 +578,7 @@ function sequencer(fs) {
/** @deprecated Use {@link Behaviour.specify} instead. */
var jenkinsRules = {
// XXX convert as many as possible to Behaviour.specify calls; some seem to have an implicit order dependency, but what?
// TODO convert as many as possible to Behaviour.specify calls; some seem to have an implicit order dependency, but what?
"BODY" : function() {
tooltip = new YAHOO.widget.Tooltip("tt", {context:[], zindex:999});
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册