blob: 0e2d9bb71789f5b7d5d005cbd4344a5b4b591f78 [file] [log] [blame]
// Copyright (C) 2014 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.googlesource.gerrit.plugins.gitblit.app;
import com.gitblit.manager.INotificationManager;
import com.gitblit.manager.IPluginManager;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IRuntimeManager;
import com.gitblit.manager.IUserManager;
import com.gitblit.models.RepositoryModel;
import com.gitblit.tickets.NullTicketService;
import com.gitblit.tickets.TicketLabel;
import com.gitblit.tickets.TicketMilestone;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.Collections;
import java.util.List;
/**
* The {@link NullTicketService} of GitBlit is not really a null service. It creates a
* TicketIndexer, and because it neglects to override some methods from its base class, that even
* gets called sometimes, which then produces exceptions.
*/
@Singleton
public class ReallyNullTicketService extends NullTicketService {
@Inject
public ReallyNullTicketService(
IRuntimeManager runtimeManager,
IPluginManager pluginManager,
INotificationManager notificationManager,
IUserManager userManager,
IRepositoryManager repositoryManager) {
super(runtimeManager, pluginManager, notificationManager, userManager, repositoryManager);
}
@Override
public boolean hasTickets(RepositoryModel repository) {
return false;
}
@Override
public boolean isAcceptingNewPatchsets(RepositoryModel repository) {
return false;
}
@Override
public boolean isAcceptingNewTickets(RepositoryModel repository) {
return false;
}
@Override
public boolean isAcceptingTicketUpdates(RepositoryModel repository) {
return false;
}
@Override
public List<TicketLabel> getLabels(RepositoryModel repository) {
return Collections.emptyList();
}
@Override
public List<TicketMilestone> getMilestones(RepositoryModel repository) {
return Collections.emptyList();
}
}