id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
9,101
.filter(COLUMN_PROCESS_STATUS, equalsTo(0)) .column(COLUMN_PROCESS_INSTANCE_ID, COUNT, "Processes") .format(COLUMN_PROCESS_INSTANCE_ID, i18n.pendingProcesses(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,102
.filter(COLUMN_PROCESS_STATUS, equalsTo(4)) .column(COLUMN_PROCESS_INSTANCE_ID, COUNT, "Processes") .format(COLUMN_PROCESS_INSTANCE_ID, i18n.suspendedProcesses(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,103
.filter(COLUMN_PROCESS_STATUS, equalsTo(3)) .column(COLUMN_PROCESS_INSTANCE_ID, COUNT, "Processes") .format(COLUMN_PROCESS_INSTANCE_ID, i18n.abortedProcesses(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,104
.filter(COLUMN_PROCESS_STATUS, equalsTo(2)) .column(COLUMN_PROCESS_INSTANCE_ID, COUNT, "Processes") .format(COLUMN_PROCESS_INSTANCE_ID, i18n.completedProcesses(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,105
.filter(notNull(COLUMN_TASK_ID)) .column(COLUMN_TASK_ID, COUNT, "Tasks") .format(COLUMN_TASK_ID, i18n.tasks(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,106
.filter(COLUMN_TASK_STATUS, equalsTo(TASK_STATUS_CREATED)) .column(COLUMN_TASK_ID, COUNT, "Tasks") .format(COLUMN_TASK_ID, i18n.tasksCreated(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,107
.filter(COLUMN_TASK_STATUS, equalsTo(TASK_STATUS_READY)) .column(COLUMN_TASK_ID, COUNT, "Tasks") .format(COLUMN_TASK_ID, i18n.tasksReady(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,108
.filter(COLUMN_TASK_STATUS, equalsTo(TASK_STATUS_RESERVED)) .column(COLUMN_TASK_ID, COUNT, "Tasks") .format(COLUMN_TASK_ID, i18n.tasksReserved(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,109
.filter(COLUMN_TASK_STATUS, equalsTo(TASK_STATUS_IN_PROGRESS)) .column(COLUMN_TASK_ID, COUNT, "Tasks") .format(COLUMN_TASK_ID, i18n.tasksInProgress(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,110
.filter(COLUMN_TASK_STATUS, equalsTo(TASK_STATUS_SUSPENDED)) .column(COLUMN_TASK_ID, COUNT, "Tasks") .format(COLUMN_TASK_ID, i18n.tasksSuspended(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,111
.filter(COLUMN_TASK_STATUS, equalsTo(TASK_STATUS_COMPLETED)) .column(COLUMN_TASK_ID, COUNT, "Tasks") .format(COLUMN_TASK_ID, i18n.tasksCompleted(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,112
.filter(COLUMN_TASK_STATUS, equalsTo(TASK_STATUS_FAILED)) .column(COLUMN_TASK_ID, COUNT, "Tasks") .format(COLUMN_TASK_ID, i18n.tasksFailed(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,113
.filter(COLUMN_TASK_STATUS, equalsTo(TASK_STATUS_ERROR)) .column(COLUMN_TASK_ID, COUNT, "Tasks") .format(COLUMN_TASK_ID, i18n.tasksError(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,114
.filter(COLUMN_TASK_STATUS, equalsTo(TASK_STATUS_EXITED)) .column(COLUMN_TASK_ID, COUNT, "Tasks") .format(COLUMN_TASK_ID, i18n.tasksExited(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,115
.filter(COLUMN_TASK_STATUS, equalsTo(TASK_STATUS_OBSOLETE)) .column(COLUMN_TASK_ID, COUNT, "Tasks") .format(COLUMN_TASK_ID, i18n.tasksObsolete(), NO_DECIMALS) .width(METRIC_WIDTH).height(METRIC_HEIGHT) .margins(0, 0, 0, 0) <BUG>.backgroundColor(BG_COLOR) .filterOn(false, true, true)</BUG> .refreshOn() .buildSettings();
.backgroundColor(METRIC_BG) .htmlTemplate(METRIC_HTML) .jsTemplate(METRIC_JS) .filterOn(false, true, true)
9,116
gameRequestContent.getData()); if (gameRequestContent.getActionType() != null) { Utility.putNonEmptyString( webParams, ShareConstants.WEB_DIALOG_PARAM_ACTION_TYPE, <BUG>gameRequestContent.getActionType().toString().toLowerCase(Locale.ENGLISH)); }</BUG> Utility.putNonEmptyString( webParams, ShareConstants.WEB_DIALOG_PARAM_OBJECT_ID,
gameRequestContent.getActionType().getValue()); }
9,117
gameRequestContent.getObjectId()); if (gameRequestContent.getFilters() != null) { Utility.putNonEmptyString( webParams, ShareConstants.WEB_DIALOG_PARAM_FILTERS, <BUG>gameRequestContent.getFilters().toString().toLowerCase(Locale.ENGLISH)); }</BUG> Utility.putCommaSeparatedStringList( webParams, ShareConstants.WEB_DIALOG_PARAM_SUGGESTIONS,
gameRequestContent.getFilters().getValue()); }
9,118
this.filters = builder.filters; this.suggestions = builder.suggestions; } GameRequestContent(final Parcel in) { this.message = in.readString(); <BUG>this.to = in.readString(); this.title = in.readString();</BUG> this.data = in.readString(); this.actionType = in.readParcelable(ActionType.class.getClassLoader()); this.objectId = in.readString();
this.recipients = in.createStringArrayList(); this.title = in.readString();
9,119
this.title = in.readString();</BUG> this.data = in.readString(); this.actionType = in.readParcelable(ActionType.class.getClassLoader()); this.objectId = in.readString(); this.filters = in.readParcelable(Filters.class.getClassLoader()); <BUG>this.suggestions = new ArrayList<>(); in.readStringList(this.suggestions);</BUG> } public String getMessage() {
this.filters = builder.filters; this.suggestions = builder.suggestions; GameRequestContent(final Parcel in) { this.message = in.readString(); this.recipients = in.createStringArrayList(); this.title = in.readString(); this.suggestions = in.createStringArrayList();
9,120
return this.objectId; } public Filters getFilters() { return this.filters; } <BUG>public ArrayList<String> getSuggestions() { return this.suggestions;</BUG> } public int describeContents() { return 0;
public List<String> getSuggestions() { return this.suggestions;
9,121
public int describeContents() { return 0; } public void writeToParcel(final Parcel out, final int flags) { out.writeString(this.message); <BUG>out.writeString(this.to); </BUG> out.writeString(this.title); out.writeString(this.data); out.writeParcelable(this.actionType, flags);
out.writeStringList(this.recipients);
9,122
if (content == null) { return this; } return this .setMessage(content.getMessage()) <BUG>.setTo(content.getTo()) .setTitle(content.getTitle())</BUG> .setData(content.getData()) .setActionType(content.getActionType()) .setObjectId(content.getObjectId())
.setRecipients(content.getRecipients()) .setTitle(content.getTitle())
9,123
public static void putNonEmptyString(Bundle b, String key, String value) { if (!Utility.isNullOrEmpty(value)) { b.putString(key, value); } } <BUG>public static void putCommaSeparatedStringList(Bundle b, String key, ArrayList<String> list) { if (list != null) {</BUG> StringBuilder builder = new StringBuilder(); for (String string : list) { builder.append(string);
public static void putCommaSeparatedStringList(Bundle b, String key, List<String> list) { if (list != null) {
9,124
|| content.getActionType() == GameRequestContent.ActionType.SEND)) { throw new IllegalArgumentException( "Object id should be provided if and only if action type is send or askfor"); } int mutex = 0; <BUG>if (content.getTo() != null) { </BUG> mutex++; } if (content.getSuggestions() != null) {
if (content.getRecipients() != null) {
9,125
package net.java.sip.communicator.plugin.otr; <BUG>import java.io.UnsupportedEncodingException; import java.net.URLEncoder;</BUG> import java.security.KeyFactory; import java.security.KeyPair; import java.security.KeyPairGenerator;
[DELETED]
9,126
{ e.printStackTrace(); return null; } } <BUG>private String getSessionNS(SessionID sessionID, String function) { try { return "net.java.sip.comunicator.plugin.otr." + URLEncoder.encode(sessionID.toString(), "UTF-8") + "." + function;</BUG> }
private List<ScOtrEngineListener> listeners = new Vector<ScOtrEngineListener>(); public void addListener(ScOtrEngineListener l)
9,127
OtrActivator.bundleContext.getService(ref); service.openURL(OtrActivator.resourceService .getI18NString("plugin.otr.authbuddydialog.HELP_URI")); } public OtrPolicy getContactPolicy(Contact contact) <BUG>{ String id = getSessionNS(getSessionID(contact), "policy"); if (id == null || id.length() < 1) return getGlobalPolicy(); int policy = OtrActivator.configService.getInt(id, -1);</BUG> if (policy < 0)
int policy = this.configurator.getPropertyInt(getSessionID(contact) + "policy", -1);
9,128
return null; } Object b64PubKey = OtrActivator.configService.getProperty(idPubKey);</BUG> if (b64PubKey == null) <BUG>return null; X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(Base64.decode((String) b64PubKey));</BUG> PublicKey publicKey; PrivateKey privateKey; KeyFactory keyFactory;
PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(b64PrivKey); byte[] b64PubKey = this.configurator.getPropertyBytes(accountID + ".publicKey"); X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(b64PubKey);
9,129
private File antiLockingDocBase = null; protected final Map<ServletContainerInitializer, Set<Class<?>>> initializerClassMap = new LinkedHashMap<>(); protected final Map<Class<?>, Set<ServletContainerInitializer>> typeInitializerMap = new HashMap<>(); <BUG>protected final Map<String,JavaClassCacheEntry> javaClassCache = new HashMap<>();</BUG> protected boolean handlesTypesAnnotations = false; protected boolean handlesTypesNonAnnotations = false; public String getDefaultWebXml() {
[DELETED]
9,130
orderedFragments = WebXml.orderWebFragments(webXml, fragments, sContext); if (ok) { processServletContainerInitializers(); } <BUG>if (!webXml.isMetadataComplete() || typeInitializerMap.size() > 0) { if (ok) {</BUG> WebResource[] webResources = context.getResources().listResources("/WEB-INF/classes"); for (WebResource webResource : webResources) {
Map<String,JavaClassCacheEntry> javaClassCache = new HashMap<>();
9,131
boolean htOnly = handlesTypesOnly || !fragment.getWebappJar() || fragment.isMetadataComplete(); WebXml annotations = new WebXml(); annotations.setDistributable(true); URL url = fragment.getURL(); <BUG>processAnnotationsUrl(url, annotations, htOnly); </BUG> Set<WebXml> set = new HashSet<>(); set.add(annotations); fragment.merge(set);
processAnnotationsUrl(url, annotations, htOnly, javaClassCache);
9,132
set.add(annotations); fragment.merge(set); } } protected void processAnnotationsWebResource(WebResource webResource, <BUG>WebXml fragment, boolean handlesTypesOnly) { if (webResource.isDirectory()) {</BUG> WebResource[] webResources = webResource.getWebResourceRoot().listResources(
WebXml fragment, boolean handlesTypesOnly, Map<String,JavaClassCacheEntry> javaClassCache) { if (webResource.isDirectory()) {
9,133
log.debug(sm.getString( "contextConfig.processAnnotationsWebDir.debug", webResource.getURL())); } for (WebResource r : webResources) { <BUG>processAnnotationsWebResource(r, fragment, handlesTypesOnly); </BUG> } } } else if (webResource.isFile() &&
processAnnotationsWebResource(r, fragment, handlesTypesOnly, javaClassCache);
9,134
} } } else if (webResource.isFile() && webResource.getName().endsWith(".class")) { try (InputStream is = webResource.getInputStream()) { <BUG>processAnnotationsStream(is, fragment, handlesTypesOnly); </BUG> } catch (IOException e) { log.error(sm.getString("contextConfig.inputStreamWebResource", webResource.getWebappPath()),e);
for (WebResource r : webResources) { processAnnotationsWebResource(r, fragment, handlesTypesOnly, javaClassCache); processAnnotationsStream(is, fragment, handlesTypesOnly, javaClassCache);
9,135
log.error(sm.getString("contextConfig.unknownUrlProtocol", url.getProtocol(), url)); } } protected void processAnnotationsJar(URL url, WebXml fragment, <BUG>boolean handlesTypesOnly) { try (Jar jar = JarFactory.newInstance(url)) {</BUG> if (log.isDebugEnabled()) { log.debug(sm.getString( "contextConfig.processAnnotationsJar.debug", url));
boolean handlesTypesOnly, Map<String,JavaClassCacheEntry> javaClassCache) { try (Jar jar = JarFactory.newInstance(url)) {
9,136
log.debug(sm.getString( "contextConfig.processAnnotationsDir.debug", file)); } for (String dir : dirs) { processAnnotationsFile( <BUG>new File(file,dir), fragment, handlesTypesOnly); </BUG> } } } else if (file.getName().endsWith(".class") && file.canRead()) {
new File(file,dir), fragment, handlesTypesOnly, javaClassCache);
9,137
</BUG> } } } else if (file.getName().endsWith(".class") && file.canRead()) { try (FileInputStream fis = new FileInputStream(file)) { <BUG>processAnnotationsStream(fis, fragment, handlesTypesOnly); </BUG> } catch (IOException e) { log.error(sm.getString("contextConfig.inputStreamFile", file.getAbsolutePath()),e);
log.debug(sm.getString( "contextConfig.processAnnotationsDir.debug", file)); for (String dir : dirs) { processAnnotationsFile( new File(file,dir), fragment, handlesTypesOnly, javaClassCache); processAnnotationsStream(fis, fragment, handlesTypesOnly, javaClassCache);
9,138
} else { } } } } <BUG>protected void checkHandlesTypes(JavaClass javaClass) { if (typeInitializerMap.size() == 0) {</BUG> return; }
protected void checkHandlesTypes(JavaClass javaClass, Map<String,JavaClassCacheEntry> javaClassCache) { if (typeInitializerMap.size() == 0) {
9,139
} catch (StackOverflowError soe) { throw new IllegalStateException(sm.getString( "contextConfig.annotationsStackOverflow", context.getName(), <BUG>classHierarchyToString(className, entry))); </BUG> } } if (!entry.getSciSet().isEmpty()) { clazz = Introspection.loadClass(context, className);
classHierarchyToString(className, entry, javaClassCache)));
9,140
parent = javaClassCache.get(parentName); } msg.append(parentName); return msg.toString(); } <BUG>private void populateJavaClassCache(String className, JavaClass javaClass) { if (javaClassCache.containsKey(className)) {</BUG> return; }
private void populateJavaClassCache(String className, JavaClass javaClass, Map<String,JavaClassCacheEntry> javaClassCache) { if (javaClassCache.containsKey(className)) {
9,141
if (is == null) { return; } ClassParser parser = new ClassParser(is); JavaClass clazz = parser.parse(); <BUG>populateJavaClassCache(clazz.getClassName(), clazz); </BUG> } catch (ClassFormatException e) { log.debug(sm.getString("contextConfig.invalidSciHandlesTypes", className), e);
populateJavaClassCache(clazz.getClassName(), clazz, javaClassCache);
9,142
log.debug(sm.getString("contextConfig.invalidSciHandlesTypes", className), e); } } } <BUG>private void populateSCIsForCacheEntry(JavaClassCacheEntry cacheEntry) { Set<ServletContainerInitializer> result = new HashSet<>();</BUG> String superClassName = cacheEntry.getSuperclassName(); JavaClassCacheEntry superClassCacheEntry =
} catch (IOException e) { private void populateSCIsForCacheEntry(JavaClassCacheEntry cacheEntry, Map<String,JavaClassCacheEntry> javaClassCache) { Set<ServletContainerInitializer> result = new HashSet<>();
9,143
cacheEntry.setSciSet(EMPTY_SCI_SET); return; } if (superClassCacheEntry != null) { if (superClassCacheEntry.getSciSet() == null) { <BUG>populateSCIsForCacheEntry(superClassCacheEntry); </BUG> } result.addAll(superClassCacheEntry.getSciSet()); }
populateSCIsForCacheEntry(superClassCacheEntry, javaClassCache);
9,144
for (String interfaceName : cacheEntry.getInterfaceNames()) { JavaClassCacheEntry interfaceEntry = javaClassCache.get(interfaceName); if (interfaceEntry != null) { if (interfaceEntry.getSciSet() == null) { <BUG>populateSCIsForCacheEntry(interfaceEntry); </BUG> } result.addAll(interfaceEntry.getSciSet()); }
populateSCIsForCacheEntry(interfaceEntry, javaClassCache);
9,145
import com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil; import com.liferay.portlet.messageboards.service.permission.MBMessagePermission; import com.liferay.portlet.social.model.BaseSocialActivityInterpreter; import com.liferay.portlet.social.model.SocialActivity; import com.liferay.portlet.social.model.SocialActivityConstants; <BUG>import com.liferay.portlet.trash.util.TrashUtil; public class MBActivityInterpreter extends BaseSocialActivityInterpreter {</BUG> public String[] getClassNames() { return _CLASS_NAMES; }
import javax.portlet.PortletURL; public class MBActivityInterpreter extends BaseSocialActivityInterpreter {
9,146
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portlet.social.service.SocialActivityLocalServiceUtil; import com.liferay.portlet.trash.util.TrashUtil; <BUG>import java.util.List; public abstract class BaseSocialActivityInterpreter</BUG> implements SocialActivityInterpreter { public long getActivitySetId(long activityId) { return 0;
import javax.portlet.PortletURL; public abstract class BaseSocialActivityInterpreter
9,147
TrashHandler trashHandler = TrashHandlerRegistryUtil.getTrashHandler( getClassName(activity)); long classPK = getClassPK(activity); if ((trashHandler != null) && (trashHandler.isInTrash(classPK) || trashHandler.isInTrashContainer(classPK))) { <BUG>return TrashUtil.getViewContentURL( getClassName(activity), classPK, serviceContext.getThemeDisplay()); }</BUG> StringBundler sb = new StringBundler(4);
PortletURL portletURL = TrashUtil.getViewContentURL( getClassName(activity), classPK, serviceContext.getRequest()); return portletURL.toString(); }
9,148
import com.liferay.portlet.journal.service.permission.JournalArticlePermission; import com.liferay.portlet.journal.service.permission.JournalPermission; import com.liferay.portlet.social.model.BaseSocialActivityInterpreter; import com.liferay.portlet.social.model.SocialActivity; import com.liferay.portlet.social.model.SocialActivityConstants; <BUG>import com.liferay.portlet.trash.util.TrashUtil; public class JournalActivityInterpreter extends BaseSocialActivityInterpreter {</BUG> public String[] getClassNames() { return _CLASS_NAMES; }
import javax.portlet.PortletURL; public class JournalActivityInterpreter extends BaseSocialActivityInterpreter {
9,149
} if (json.getValue("heartbeat") instanceof JsonObject) { obj.setHeartbeat(((JsonObject)json.getValue("heartbeat")).copy()); } if (json.getValue("maxBodyLength") instanceof Number) { <BUG>obj.setMaxBodyLength(((Number)json.getValue("maxBodyLength")).intValue()); }</BUG> if (json.getValue("maxHeaderLength") instanceof Number) { obj.setMaxHeaderLength(((Number)json.getValue("maxHeaderLength")).intValue()); }
if (json.getValue("maxFrameInTransaction") instanceof Number) { obj.setMaxFrameInTransaction(((Number)json.getValue("maxFrameInTransaction")).intValue());
9,150
public static void toJson(StompServerOptions obj, JsonObject json) { json.put("ackTimeout", obj.getAckTimeout()); if (obj.getHeartbeat() != null) { json.put("heartbeat", obj.getHeartbeat()); } <BUG>json.put("maxBodyLength", obj.getMaxBodyLength()); json.put("maxHeaderLength", obj.getMaxHeaderLength());</BUG> json.put("maxHeaders", obj.getMaxHeaders()); json.put("secured", obj.isSecured()); json.put("sendErrorOnNoSubscriptions", obj.isSendErrorOnNoSubscriptions());
json.put("maxFrameInTransaction", obj.getMaxFrameInTransaction()); json.put("maxHeaderLength", obj.getMaxHeaderLength());
9,151
chart.addYAxisLabels(AxisLabelsFactory.newAxisLabels(labels)); chart.addXAxisLabels(AxisLabelsFactory.newNumericRangeAxisLabels(0, max)); chart.setBarWidth(BarChart.AUTO_RESIZE); chart.setSize(600, 500); chart.setHorizontal(true); <BUG>chart.setTitle("Total Evaluations by User"); showChartImg(resp, chart.toURLString()); }</BUG> private List<Entry<String, Integer>> sortEntries(Collection<Entry<String, Integer>> entries) { List<Entry<String, Integer>> result = new ArrayList<Entry<String, Integer>>(entries);
chart.setDataEncoding(DataEncoding.TEXT); return chart; }
9,152
checkEvaluationsEqual(eval4, foundissueProto.getEvaluations(0)); checkEvaluationsEqual(eval5, foundissueProto.getEvaluations(1)); } public void testGetRecentEvaluationsNoneFound() throws Exception { DbIssue issue = createDbIssue("fad", persistenceHelper); <BUG>DbEvaluation eval1 = createEvaluation(issue, "someone", 100); DbEvaluation eval2 = createEvaluation(issue, "someone", 200); DbEvaluation eval3 = createEvaluation(issue, "someone", 300); issue.addEvaluations(eval1, eval2, eval3);</BUG> getPersistenceManager().makePersistent(issue);
[DELETED]
9,153
public int read() throws IOException { return inputStream.read(); } }); } <BUG>} protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {</BUG> DbUser user; Query query = getPersistenceManager().newQuery("select from " + persistenceHelper.getDbUserClass().getName() + " where openid == :myopenid");
@SuppressWarnings({"unchecked"}) protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {
9,154
eval.setComment("my comment"); eval.setDesignation("MUST_FIX"); eval.setIssue(issue); eval.setWhen(when); eval.setWho(user.createKeyObject()); <BUG>eval.setEmail(who); return eval;</BUG> } protected PersistenceManager getPersistenceManager() { return testHelper.getPersistenceManager();
issue.addEvaluation(eval); return eval;
9,155
package org.glowroot.agent.config; import com.google.common.collect.ImmutableList; <BUG>import org.immutables.value.Value; import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;</BUG> @Value.Immutable public abstract class UiConfig { @Value.Default
import org.glowroot.common.config.ConfigDefaults; import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
9,156
class RepoAdminImpl implements RepoAdmin { private final DataSource dataSource; private final List<CappedDatabase> rollupCappedDatabases; private final CappedDatabase traceCappedDatabase; private final ConfigRepository configRepository; <BUG>private final AgentDao agentDao; </BUG> private final GaugeValueDao gaugeValueDao; private final GaugeNameDao gaugeNameDao; private final TransactionTypeDao transactionTypeDao;
private final EnvironmentDao agentDao;
9,157
private final TransactionTypeDao transactionTypeDao; private final FullQueryTextDao fullQueryTextDao; private final TraceAttributeNameDao traceAttributeNameDao; RepoAdminImpl(DataSource dataSource, List<CappedDatabase> rollupCappedDatabases, CappedDatabase traceCappedDatabase, ConfigRepository configRepository, <BUG>AgentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao, </BUG> TransactionTypeDao transactionTypeDao, FullQueryTextDao fullQueryTextDao, TraceAttributeNameDao traceAttributeNameDao) { this.dataSource = dataSource;
EnvironmentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao,
9,158
this.fullQueryTextDao = fullQueryTextDao; this.traceAttributeNameDao = traceAttributeNameDao; } @Override public void deleteAllData() throws Exception { <BUG>Environment environment = agentDao.readEnvironment(""); dataSource.deleteAll();</BUG> agentDao.reinitAfterDeletingDatabase(); gaugeValueDao.reinitAfterDeletingDatabase(); gaugeNameDao.invalidateCache();
Environment environment = agentDao.read(""); dataSource.deleteAll();
9,159
public class SimpleRepoModule { private static final long SNAPSHOT_REAPER_PERIOD_MINUTES = 5; private final DataSource dataSource; private final ImmutableList<CappedDatabase> rollupCappedDatabases; private final CappedDatabase traceCappedDatabase; <BUG>private final AgentDao agentDao; private final TransactionTypeDao transactionTypeDao;</BUG> private final AggregateDao aggregateDao; private final TraceAttributeNameDao traceAttributeNameDao; private final TraceDao traceDao;
private final EnvironmentDao environmentDao; private final TransactionTypeDao transactionTypeDao;
9,160
rollupCappedDatabases.add(new CappedDatabase(file, sizeKb, ticker)); } this.rollupCappedDatabases = ImmutableList.copyOf(rollupCappedDatabases); traceCappedDatabase = new CappedDatabase(new File(dataDir, "trace-detail.capped.db"), storageConfig.traceCappedDatabaseSizeMb() * 1024, ticker); <BUG>agentDao = new AgentDao(dataSource); </BUG> transactionTypeDao = new TransactionTypeDao(dataSource); rollupLevelService = new RollupLevelService(configRepository, clock); FullQueryTextDao fullQueryTextDao = new FullQueryTextDao(dataSource);
environmentDao = new EnvironmentDao(dataSource);
9,161
traceDao = new TraceDao(dataSource, traceCappedDatabase, transactionTypeDao, fullQueryTextDao, traceAttributeNameDao); GaugeNameDao gaugeNameDao = new GaugeNameDao(dataSource); gaugeValueDao = new GaugeValueDao(dataSource, gaugeNameDao, clock); repoAdmin = new RepoAdminImpl(dataSource, rollupCappedDatabases, traceCappedDatabase, <BUG>configRepository, agentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao, </BUG> fullQueryTextDao, traceAttributeNameDao); if (backgroundExecutor == null) { reaperRunnable = null;
configRepository, environmentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao,
9,162
new TraceCappedDatabaseStats(traceCappedDatabase), "org.glowroot:type=TraceCappedDatabase"); platformMBeanServerLifecycle.lazyRegisterMBean(new H2DatabaseStats(dataSource), "org.glowroot:type=H2Database"); } <BUG>public AgentDao getAgentDao() { return agentDao; </BUG> } public TransactionTypeRepository getTransactionTypeRepository() {
public EnvironmentDao getEnvironmentDao() { return environmentDao;
9,163
package org.glowroot.agent.embedded.init; import java.io.Closeable; import java.io.File; <BUG>import java.lang.instrument.Instrumentation; import java.util.Map;</BUG> import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService;
import java.util.List; import java.util.Map;
9,164
import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Nullable; import com.google.common.base.MoreObjects; import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; <BUG>import com.google.common.base.Ticker; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;</BUG> import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.glowroot.agent.collector.Collector.AgentConfigUpdater;
import com.google.common.collect.ImmutableList; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
9,165
import org.glowroot.agent.init.EnvironmentCreator; import org.glowroot.agent.init.GlowrootThinAgentInit; import org.glowroot.agent.init.JRebelWorkaround; import org.glowroot.agent.util.LazyPlatformMBeanServer; import org.glowroot.common.live.LiveAggregateRepository.LiveAggregateRepositoryNop; <BUG>import org.glowroot.common.live.LiveTraceRepository.LiveTraceRepositoryNop; import org.glowroot.common.repo.ConfigRepository; import org.glowroot.common.util.Clock;</BUG> import org.glowroot.common.util.OnlyUsedByTests; import org.glowroot.ui.CreateUiModuleBuilder;
import org.glowroot.common.repo.AgentRepository; import org.glowroot.common.repo.ImmutableAgentRollup; import org.glowroot.common.util.Clock;
9,166
SimpleRepoModule simpleRepoModule = new SimpleRepoModule(dataSource, dataDir, clock, ticker, configRepository, backgroundExecutor); simpleRepoModule.registerMBeans(new PlatformMBeanServerLifecycleImpl( agentModule.getLazyPlatformMBeanServer())); CollectorImpl collectorImpl = new CollectorImpl( <BUG>simpleRepoModule.getAgentDao(), simpleRepoModule.getAggregateDao(), simpleRepoModule.getTraceDao(),</BUG> simpleRepoModule.getGaugeValueDao()); collectorProxy.setInstance(collectorImpl); collectorImpl.init(baseDir, EnvironmentCreator.create(glowrootVersion),
simpleRepoModule.getEnvironmentDao(), simpleRepoModule.getTraceDao(),
9,167
.baseDir(baseDir) .glowrootDir(glowrootDir) .ticker(ticker) .clock(clock) .liveJvmService(agentModule.getLiveJvmService()) <BUG>.configRepository(simpleRepoModule.getConfigRepository()) .agentRepository(simpleRepoModule.getAgentDao()) </BUG> .transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository()) .traceAttributeNameRepository(
.agentRepository(new AgentRepositoryImpl()) .environmentRepository(simpleRepoModule.getEnvironmentDao())
9,168
.baseDir(baseDir) .glowrootDir(glowrootDir) .ticker(ticker) .clock(clock) .liveJvmService(null) <BUG>.configRepository(simpleRepoModule.getConfigRepository()) .agentRepository(simpleRepoModule.getAgentDao()) </BUG> .transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository()) .traceAttributeNameRepository(
.liveJvmService(agentModule.getLiveJvmService()) .agentRepository(new AgentRepositoryImpl()) .environmentRepository(simpleRepoModule.getEnvironmentDao())
9,169
} @Override public void lazyRegisterMBean(Object object, String name) { lazyPlatformMBeanServer.lazyRegisterMBean(object, name); } <BUG>} } </BUG>
void initEmbeddedServer() throws Exception { if (simpleRepoModule == null) { return;
9,170
List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs()); for (GaugeConfig loopConfig : configs) { if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) { throw new DuplicateMBeanObjectNameException(); } <BUG>} String version = Versions.getVersion(gaugeConfig); for (GaugeConfig loopConfig : configs) { if (Versions.getVersion(loopConfig.toProto()).equals(version)) { throw new IllegalStateException("This exact gauge already exists"); } } configs.add(GaugeConfig.create(gaugeConfig));</BUG> configService.updateGaugeConfigs(configs);
[DELETED]
9,171
configService.updateGaugeConfigs(configs); } } @Override public void updateGaugeConfig(String agentId, AgentConfig.GaugeConfig gaugeConfig, <BUG>String priorVersion) throws Exception { synchronized (writeLock) {</BUG> List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs()); boolean found = false; for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
GaugeConfig config = GaugeConfig.create(gaugeConfig); synchronized (writeLock) {
9,172
boolean found = false; for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) { GaugeConfig loopConfig = i.next(); String loopVersion = Versions.getVersion(loopConfig.toProto()); if (loopVersion.equals(priorVersion)) { <BUG>i.set(GaugeConfig.create(gaugeConfig)); found = true; break;</BUG> } else if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) { throw new DuplicateMBeanObjectNameException();
i.set(config);
9,173
boolean found = false; for (ListIterator<PluginConfig> i = configs.listIterator(); i.hasNext();) { PluginConfig loopPluginConfig = i.next(); if (pluginId.equals(loopPluginConfig.id())) { String loopVersion = Versions.getVersion(loopPluginConfig.toProto()); <BUG>checkVersionsEqual(loopVersion, priorVersion); PluginDescriptor pluginDescriptor = getPluginDescriptor(pluginId); i.set(PluginConfig.create(pluginDescriptor, properties));</BUG> found = true; break;
for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) { GaugeConfig loopConfig = i.next(); String loopVersion = Versions.getVersion(loopConfig.toProto()); if (loopVersion.equals(version)) { i.remove();
9,174
boolean found = false; for (ListIterator<InstrumentationConfig> i = configs.listIterator(); i.hasNext();) { InstrumentationConfig loopConfig = i.next(); String loopVersion = Versions.getVersion(loopConfig.toProto()); if (loopVersion.equals(priorVersion)) { <BUG>i.set(InstrumentationConfig.create(instrumentationConfig)); found = true; break; }</BUG> }
i.set(config); } else if (loopConfig.equals(config)) { throw new IllegalStateException("This exact instrumentation already exists");
9,175
package org.glowroot.agent.embedded.init; import java.io.File; import java.util.List; import org.glowroot.agent.collector.Collector; <BUG>import org.glowroot.agent.embedded.repo.AgentDao; import org.glowroot.agent.embedded.repo.AggregateDao; import org.glowroot.agent.embedded.repo.GaugeValueDao;</BUG> import org.glowroot.agent.embedded.repo.TraceDao; import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
import org.glowroot.agent.embedded.repo.EnvironmentDao; import org.glowroot.agent.embedded.repo.GaugeValueDao;
9,176
</BUG> private final AggregateDao aggregateDao; private final TraceDao traceDao; private final GaugeValueDao gaugeValueDao; <BUG>CollectorImpl(AgentDao agentDao, AggregateDao aggregateRepository, TraceDao traceRepository, GaugeValueDao gaugeValueRepository) { this.agentDao = agentDao;</BUG> this.aggregateDao = aggregateRepository; this.traceDao = traceRepository;
import org.glowroot.wire.api.model.CollectorServiceOuterClass.Environment; import org.glowroot.wire.api.model.CollectorServiceOuterClass.GaugeValue; import org.glowroot.wire.api.model.CollectorServiceOuterClass.LogEvent; import org.glowroot.wire.api.model.TraceOuterClass.Trace; class CollectorImpl implements Collector { private final EnvironmentDao agentDao; CollectorImpl(EnvironmentDao agentDao, AggregateDao aggregateRepository, TraceDao traceRepository, GaugeValueDao gaugeValueRepository) { this.agentDao = agentDao;
9,177
Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.tab_qibla, container, false); final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass); qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north), ((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla)); <BUG>sOrientationListener = new SensorListener() { </BUG> public void onSensorChanged(int s, float v[]) { float northDirection = v[SensorManager.DATA_X]; qiblaCompassView.setDirections(northDirection, sQiblaDirection);
sOrientationListener = new android.hardware.SensorListener() {
9,178
package org.glowroot.agent.config; import com.google.common.collect.ImmutableList; <BUG>import org.immutables.value.Value; import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;</BUG> @Value.Immutable public abstract class UiConfig { @Value.Default
import org.glowroot.common.config.ConfigDefaults; import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
9,179
class RepoAdminImpl implements RepoAdmin { private final DataSource dataSource; private final List<CappedDatabase> rollupCappedDatabases; private final CappedDatabase traceCappedDatabase; private final ConfigRepository configRepository; <BUG>private final AgentDao agentDao; </BUG> private final GaugeValueDao gaugeValueDao; private final GaugeNameDao gaugeNameDao; private final TransactionTypeDao transactionTypeDao;
private final EnvironmentDao agentDao;
9,180
private final TransactionTypeDao transactionTypeDao; private final FullQueryTextDao fullQueryTextDao; private final TraceAttributeNameDao traceAttributeNameDao; RepoAdminImpl(DataSource dataSource, List<CappedDatabase> rollupCappedDatabases, CappedDatabase traceCappedDatabase, ConfigRepository configRepository, <BUG>AgentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao, </BUG> TransactionTypeDao transactionTypeDao, FullQueryTextDao fullQueryTextDao, TraceAttributeNameDao traceAttributeNameDao) { this.dataSource = dataSource;
EnvironmentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao,
9,181
this.fullQueryTextDao = fullQueryTextDao; this.traceAttributeNameDao = traceAttributeNameDao; } @Override public void deleteAllData() throws Exception { <BUG>Environment environment = agentDao.readEnvironment(""); dataSource.deleteAll();</BUG> agentDao.reinitAfterDeletingDatabase(); gaugeValueDao.reinitAfterDeletingDatabase(); gaugeNameDao.invalidateCache();
Environment environment = agentDao.read(""); dataSource.deleteAll();
9,182
public class SimpleRepoModule { private static final long SNAPSHOT_REAPER_PERIOD_MINUTES = 5; private final DataSource dataSource; private final ImmutableList<CappedDatabase> rollupCappedDatabases; private final CappedDatabase traceCappedDatabase; <BUG>private final AgentDao agentDao; private final TransactionTypeDao transactionTypeDao;</BUG> private final AggregateDao aggregateDao; private final TraceAttributeNameDao traceAttributeNameDao; private final TraceDao traceDao;
private final EnvironmentDao environmentDao; private final TransactionTypeDao transactionTypeDao;
9,183
rollupCappedDatabases.add(new CappedDatabase(file, sizeKb, ticker)); } this.rollupCappedDatabases = ImmutableList.copyOf(rollupCappedDatabases); traceCappedDatabase = new CappedDatabase(new File(dataDir, "trace-detail.capped.db"), storageConfig.traceCappedDatabaseSizeMb() * 1024, ticker); <BUG>agentDao = new AgentDao(dataSource); </BUG> transactionTypeDao = new TransactionTypeDao(dataSource); rollupLevelService = new RollupLevelService(configRepository, clock); FullQueryTextDao fullQueryTextDao = new FullQueryTextDao(dataSource);
environmentDao = new EnvironmentDao(dataSource);
9,184
traceDao = new TraceDao(dataSource, traceCappedDatabase, transactionTypeDao, fullQueryTextDao, traceAttributeNameDao); GaugeNameDao gaugeNameDao = new GaugeNameDao(dataSource); gaugeValueDao = new GaugeValueDao(dataSource, gaugeNameDao, clock); repoAdmin = new RepoAdminImpl(dataSource, rollupCappedDatabases, traceCappedDatabase, <BUG>configRepository, agentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao, </BUG> fullQueryTextDao, traceAttributeNameDao); if (backgroundExecutor == null) { reaperRunnable = null;
configRepository, environmentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao,
9,185
new TraceCappedDatabaseStats(traceCappedDatabase), "org.glowroot:type=TraceCappedDatabase"); platformMBeanServerLifecycle.lazyRegisterMBean(new H2DatabaseStats(dataSource), "org.glowroot:type=H2Database"); } <BUG>public AgentDao getAgentDao() { return agentDao; </BUG> } public TransactionTypeRepository getTransactionTypeRepository() {
public EnvironmentDao getEnvironmentDao() { return environmentDao;
9,186
package org.glowroot.agent.embedded.init; import java.io.Closeable; import java.io.File; <BUG>import java.lang.instrument.Instrumentation; import java.util.Map;</BUG> import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService;
import java.util.List; import java.util.Map;
9,187
import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Nullable; import com.google.common.base.MoreObjects; import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; <BUG>import com.google.common.base.Ticker; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;</BUG> import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.glowroot.agent.collector.Collector.AgentConfigUpdater;
import com.google.common.collect.ImmutableList; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
9,188
import org.glowroot.agent.init.EnvironmentCreator; import org.glowroot.agent.init.GlowrootThinAgentInit; import org.glowroot.agent.init.JRebelWorkaround; import org.glowroot.agent.util.LazyPlatformMBeanServer; import org.glowroot.common.live.LiveAggregateRepository.LiveAggregateRepositoryNop; <BUG>import org.glowroot.common.live.LiveTraceRepository.LiveTraceRepositoryNop; import org.glowroot.common.repo.ConfigRepository; import org.glowroot.common.util.Clock;</BUG> import org.glowroot.common.util.OnlyUsedByTests; import org.glowroot.ui.CreateUiModuleBuilder;
import org.glowroot.common.repo.AgentRepository; import org.glowroot.common.repo.ImmutableAgentRollup; import org.glowroot.common.util.Clock;
9,189
SimpleRepoModule simpleRepoModule = new SimpleRepoModule(dataSource, dataDir, clock, ticker, configRepository, backgroundExecutor); simpleRepoModule.registerMBeans(new PlatformMBeanServerLifecycleImpl( agentModule.getLazyPlatformMBeanServer())); CollectorImpl collectorImpl = new CollectorImpl( <BUG>simpleRepoModule.getAgentDao(), simpleRepoModule.getAggregateDao(), simpleRepoModule.getTraceDao(),</BUG> simpleRepoModule.getGaugeValueDao()); collectorProxy.setInstance(collectorImpl); collectorImpl.init(baseDir, EnvironmentCreator.create(glowrootVersion),
simpleRepoModule.getEnvironmentDao(), simpleRepoModule.getTraceDao(),
9,190
.baseDir(baseDir) .glowrootDir(glowrootDir) .ticker(ticker) .clock(clock) .liveJvmService(agentModule.getLiveJvmService()) <BUG>.configRepository(simpleRepoModule.getConfigRepository()) .agentRepository(simpleRepoModule.getAgentDao()) </BUG> .transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository()) .traceAttributeNameRepository(
.agentRepository(new AgentRepositoryImpl()) .environmentRepository(simpleRepoModule.getEnvironmentDao())
9,191
.baseDir(baseDir) .glowrootDir(glowrootDir) .ticker(ticker) .clock(clock) .liveJvmService(null) <BUG>.configRepository(simpleRepoModule.getConfigRepository()) .agentRepository(simpleRepoModule.getAgentDao()) </BUG> .transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository()) .traceAttributeNameRepository(
.liveJvmService(agentModule.getLiveJvmService()) .agentRepository(new AgentRepositoryImpl()) .environmentRepository(simpleRepoModule.getEnvironmentDao())
9,192
} @Override public void lazyRegisterMBean(Object object, String name) { lazyPlatformMBeanServer.lazyRegisterMBean(object, name); } <BUG>} } </BUG>
void initEmbeddedServer() throws Exception { if (simpleRepoModule == null) { return;
9,193
List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs()); for (GaugeConfig loopConfig : configs) { if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) { throw new DuplicateMBeanObjectNameException(); } <BUG>} String version = Versions.getVersion(gaugeConfig); for (GaugeConfig loopConfig : configs) { if (Versions.getVersion(loopConfig.toProto()).equals(version)) { throw new IllegalStateException("This exact gauge already exists"); } } configs.add(GaugeConfig.create(gaugeConfig));</BUG> configService.updateGaugeConfigs(configs);
[DELETED]
9,194
configService.updateGaugeConfigs(configs); } } @Override public void updateGaugeConfig(String agentId, AgentConfig.GaugeConfig gaugeConfig, <BUG>String priorVersion) throws Exception { synchronized (writeLock) {</BUG> List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs()); boolean found = false; for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
GaugeConfig config = GaugeConfig.create(gaugeConfig); synchronized (writeLock) {
9,195
boolean found = false; for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) { GaugeConfig loopConfig = i.next(); String loopVersion = Versions.getVersion(loopConfig.toProto()); if (loopVersion.equals(priorVersion)) { <BUG>i.set(GaugeConfig.create(gaugeConfig)); found = true; break;</BUG> } else if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) { throw new DuplicateMBeanObjectNameException();
i.set(config);
9,196
boolean found = false; for (ListIterator<PluginConfig> i = configs.listIterator(); i.hasNext();) { PluginConfig loopPluginConfig = i.next(); if (pluginId.equals(loopPluginConfig.id())) { String loopVersion = Versions.getVersion(loopPluginConfig.toProto()); <BUG>checkVersionsEqual(loopVersion, priorVersion); PluginDescriptor pluginDescriptor = getPluginDescriptor(pluginId); i.set(PluginConfig.create(pluginDescriptor, properties));</BUG> found = true; break;
for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) { GaugeConfig loopConfig = i.next(); String loopVersion = Versions.getVersion(loopConfig.toProto()); if (loopVersion.equals(version)) { i.remove();
9,197
boolean found = false; for (ListIterator<InstrumentationConfig> i = configs.listIterator(); i.hasNext();) { InstrumentationConfig loopConfig = i.next(); String loopVersion = Versions.getVersion(loopConfig.toProto()); if (loopVersion.equals(priorVersion)) { <BUG>i.set(InstrumentationConfig.create(instrumentationConfig)); found = true; break; }</BUG> }
i.set(config); } else if (loopConfig.equals(config)) { throw new IllegalStateException("This exact instrumentation already exists");
9,198
package org.glowroot.agent.embedded.init; import java.io.File; import java.util.List; import org.glowroot.agent.collector.Collector; <BUG>import org.glowroot.agent.embedded.repo.AgentDao; import org.glowroot.agent.embedded.repo.AggregateDao; import org.glowroot.agent.embedded.repo.GaugeValueDao;</BUG> import org.glowroot.agent.embedded.repo.TraceDao; import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
import org.glowroot.agent.embedded.repo.EnvironmentDao; import org.glowroot.agent.embedded.repo.GaugeValueDao;
9,199
</BUG> private final AggregateDao aggregateDao; private final TraceDao traceDao; private final GaugeValueDao gaugeValueDao; <BUG>CollectorImpl(AgentDao agentDao, AggregateDao aggregateRepository, TraceDao traceRepository, GaugeValueDao gaugeValueRepository) { this.agentDao = agentDao;</BUG> this.aggregateDao = aggregateRepository; this.traceDao = traceRepository;
import org.glowroot.wire.api.model.CollectorServiceOuterClass.Environment; import org.glowroot.wire.api.model.CollectorServiceOuterClass.GaugeValue; import org.glowroot.wire.api.model.CollectorServiceOuterClass.LogEvent; import org.glowroot.wire.api.model.TraceOuterClass.Trace; class CollectorImpl implements Collector { private final EnvironmentDao agentDao; CollectorImpl(EnvironmentDao agentDao, AggregateDao aggregateRepository, TraceDao traceRepository, GaugeValueDao gaugeValueRepository) { this.agentDao = agentDao;
9,200
import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.io.FileAttributes; <BUG>import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil;</BUG> import com.intellij.openapi.vfs.*; import com.intellij.openapi.vfs.newvfs.*; import com.intellij.openapi.vfs.newvfs.events.VFileEvent;
import com.intellij.openapi.util.io.ZipFileCache; import com.intellij.openapi.util.text.StringUtil;