diff options
66 files changed, 7408 insertions, 4110 deletions
diff --git a/server/sonar-server/src/main/gen-java/org/sonarqube/ws/Rules.java b/server/sonar-server/src/main/gen-java/org/sonarqube/ws/Rules.java deleted file mode 100644 index 346793fee19..00000000000 --- a/server/sonar-server/src/main/gen-java/org/sonarqube/ws/Rules.java +++ /dev/null @@ -1,1537 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: ws-rules.proto - -package org.sonarqube.ws; - -public final class Rules { - private Rules() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - public interface ListResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:sonarqube.ws.rules.ListResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - java.util.List<org.sonarqube.ws.Rules.ListResponse.Rule> - getRulesList(); - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - org.sonarqube.ws.Rules.ListResponse.Rule getRules(int index); - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - int getRulesCount(); - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - java.util.List<? extends org.sonarqube.ws.Rules.ListResponse.RuleOrBuilder> - getRulesOrBuilderList(); - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - org.sonarqube.ws.Rules.ListResponse.RuleOrBuilder getRulesOrBuilder( - int index); - } - /** - * Protobuf type {@code sonarqube.ws.rules.ListResponse} - * - * <pre> - * WS api/rules/list for internal use only - * </pre> - */ - public static final class ListResponse extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:sonarqube.ws.rules.ListResponse) - ListResponseOrBuilder { - // Use ListResponse.newBuilder() to construct. - private ListResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private ListResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final ListResponse defaultInstance; - public static ListResponse getDefaultInstance() { - return defaultInstance; - } - - public ListResponse getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - rules_ = new java.util.ArrayList<org.sonarqube.ws.Rules.ListResponse.Rule>(); - mutable_bitField0_ |= 0x00000001; - } - rules_.add(input.readMessage(org.sonarqube.ws.Rules.ListResponse.Rule.PARSER, extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - rules_ = java.util.Collections.unmodifiableList(rules_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.sonarqube.ws.Rules.internal_static_sonarqube_ws_rules_ListResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.sonarqube.ws.Rules.internal_static_sonarqube_ws_rules_ListResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.sonarqube.ws.Rules.ListResponse.class, org.sonarqube.ws.Rules.ListResponse.Builder.class); - } - - public static com.google.protobuf.Parser<ListResponse> PARSER = - new com.google.protobuf.AbstractParser<ListResponse>() { - public ListResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListResponse(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser<ListResponse> getParserForType() { - return PARSER; - } - - public interface RuleOrBuilder extends - // @@protoc_insertion_point(interface_extends:sonarqube.ws.rules.ListResponse.Rule) - com.google.protobuf.MessageOrBuilder { - - /** - * <code>optional string repository = 1;</code> - */ - boolean hasRepository(); - /** - * <code>optional string repository = 1;</code> - */ - java.lang.String getRepository(); - /** - * <code>optional string repository = 1;</code> - */ - com.google.protobuf.ByteString - getRepositoryBytes(); - - /** - * <code>optional string key = 2;</code> - */ - boolean hasKey(); - /** - * <code>optional string key = 2;</code> - */ - java.lang.String getKey(); - /** - * <code>optional string key = 2;</code> - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * <code>optional string internal_key = 3;</code> - */ - boolean hasInternalKey(); - /** - * <code>optional string internal_key = 3;</code> - */ - java.lang.String getInternalKey(); - /** - * <code>optional string internal_key = 3;</code> - */ - com.google.protobuf.ByteString - getInternalKeyBytes(); - } - /** - * Protobuf type {@code sonarqube.ws.rules.ListResponse.Rule} - */ - public static final class Rule extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:sonarqube.ws.rules.ListResponse.Rule) - RuleOrBuilder { - // Use Rule.newBuilder() to construct. - private Rule(com.google.protobuf.GeneratedMessage.Builder<?> builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Rule(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Rule defaultInstance; - public static Rule getDefaultInstance() { - return defaultInstance; - } - - public Rule getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Rule( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - repository_ = bs; - break; - } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - key_ = bs; - break; - } - case 26: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - internalKey_ = bs; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.sonarqube.ws.Rules.internal_static_sonarqube_ws_rules_ListResponse_Rule_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.sonarqube.ws.Rules.internal_static_sonarqube_ws_rules_ListResponse_Rule_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.sonarqube.ws.Rules.ListResponse.Rule.class, org.sonarqube.ws.Rules.ListResponse.Rule.Builder.class); - } - - public static com.google.protobuf.Parser<Rule> PARSER = - new com.google.protobuf.AbstractParser<Rule>() { - public Rule parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Rule(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser<Rule> getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int REPOSITORY_FIELD_NUMBER = 1; - private java.lang.Object repository_; - /** - * <code>optional string repository = 1;</code> - */ - public boolean hasRepository() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * <code>optional string repository = 1;</code> - */ - public java.lang.String getRepository() { - java.lang.Object ref = repository_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - repository_ = s; - } - return s; - } - } - /** - * <code>optional string repository = 1;</code> - */ - public com.google.protobuf.ByteString - getRepositoryBytes() { - java.lang.Object ref = repository_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - repository_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEY_FIELD_NUMBER = 2; - private java.lang.Object key_; - /** - * <code>optional string key = 2;</code> - */ - public boolean hasKey() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * <code>optional string key = 2;</code> - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - key_ = s; - } - return s; - } - } - /** - * <code>optional string key = 2;</code> - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INTERNAL_KEY_FIELD_NUMBER = 3; - private java.lang.Object internalKey_; - /** - * <code>optional string internal_key = 3;</code> - */ - public boolean hasInternalKey() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * <code>optional string internal_key = 3;</code> - */ - public java.lang.String getInternalKey() { - java.lang.Object ref = internalKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - internalKey_ = s; - } - return s; - } - } - /** - * <code>optional string internal_key = 3;</code> - */ - public com.google.protobuf.ByteString - getInternalKeyBytes() { - java.lang.Object ref = internalKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - internalKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - repository_ = ""; - key_ = ""; - internalKey_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getRepositoryBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getKeyBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, getInternalKeyBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getRepositoryBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getKeyBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, getInternalKeyBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static org.sonarqube.ws.Rules.ListResponse.Rule parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.sonarqube.ws.Rules.ListResponse.Rule parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.sonarqube.ws.Rules.ListResponse.Rule parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.sonarqube.ws.Rules.ListResponse.Rule parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.sonarqube.ws.Rules.ListResponse.Rule parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.sonarqube.ws.Rules.ListResponse.Rule parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.sonarqube.ws.Rules.ListResponse.Rule parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.sonarqube.ws.Rules.ListResponse.Rule parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.sonarqube.ws.Rules.ListResponse.Rule parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.sonarqube.ws.Rules.ListResponse.Rule parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.sonarqube.ws.Rules.ListResponse.Rule prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code sonarqube.ws.rules.ListResponse.Rule} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:sonarqube.ws.rules.ListResponse.Rule) - org.sonarqube.ws.Rules.ListResponse.RuleOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.sonarqube.ws.Rules.internal_static_sonarqube_ws_rules_ListResponse_Rule_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.sonarqube.ws.Rules.internal_static_sonarqube_ws_rules_ListResponse_Rule_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.sonarqube.ws.Rules.ListResponse.Rule.class, org.sonarqube.ws.Rules.ListResponse.Rule.Builder.class); - } - - // Construct using org.sonarqube.ws.Rules.ListResponse.Rule.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - repository_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - key_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - internalKey_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.sonarqube.ws.Rules.internal_static_sonarqube_ws_rules_ListResponse_Rule_descriptor; - } - - public org.sonarqube.ws.Rules.ListResponse.Rule getDefaultInstanceForType() { - return org.sonarqube.ws.Rules.ListResponse.Rule.getDefaultInstance(); - } - - public org.sonarqube.ws.Rules.ListResponse.Rule build() { - org.sonarqube.ws.Rules.ListResponse.Rule result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.sonarqube.ws.Rules.ListResponse.Rule buildPartial() { - org.sonarqube.ws.Rules.ListResponse.Rule result = new org.sonarqube.ws.Rules.ListResponse.Rule(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.repository_ = repository_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.key_ = key_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.internalKey_ = internalKey_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.sonarqube.ws.Rules.ListResponse.Rule) { - return mergeFrom((org.sonarqube.ws.Rules.ListResponse.Rule)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.sonarqube.ws.Rules.ListResponse.Rule other) { - if (other == org.sonarqube.ws.Rules.ListResponse.Rule.getDefaultInstance()) return this; - if (other.hasRepository()) { - bitField0_ |= 0x00000001; - repository_ = other.repository_; - onChanged(); - } - if (other.hasKey()) { - bitField0_ |= 0x00000002; - key_ = other.key_; - onChanged(); - } - if (other.hasInternalKey()) { - bitField0_ |= 0x00000004; - internalKey_ = other.internalKey_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.sonarqube.ws.Rules.ListResponse.Rule parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.sonarqube.ws.Rules.ListResponse.Rule) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object repository_ = ""; - /** - * <code>optional string repository = 1;</code> - */ - public boolean hasRepository() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * <code>optional string repository = 1;</code> - */ - public java.lang.String getRepository() { - java.lang.Object ref = repository_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - repository_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * <code>optional string repository = 1;</code> - */ - public com.google.protobuf.ByteString - getRepositoryBytes() { - java.lang.Object ref = repository_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - repository_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * <code>optional string repository = 1;</code> - */ - public Builder setRepository( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - repository_ = value; - onChanged(); - return this; - } - /** - * <code>optional string repository = 1;</code> - */ - public Builder clearRepository() { - bitField0_ = (bitField0_ & ~0x00000001); - repository_ = getDefaultInstance().getRepository(); - onChanged(); - return this; - } - /** - * <code>optional string repository = 1;</code> - */ - public Builder setRepositoryBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - repository_ = value; - onChanged(); - return this; - } - - private java.lang.Object key_ = ""; - /** - * <code>optional string key = 2;</code> - */ - public boolean hasKey() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * <code>optional string key = 2;</code> - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - key_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * <code>optional string key = 2;</code> - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * <code>optional string key = 2;</code> - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - key_ = value; - onChanged(); - return this; - } - /** - * <code>optional string key = 2;</code> - */ - public Builder clearKey() { - bitField0_ = (bitField0_ & ~0x00000002); - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * <code>optional string key = 2;</code> - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - key_ = value; - onChanged(); - return this; - } - - private java.lang.Object internalKey_ = ""; - /** - * <code>optional string internal_key = 3;</code> - */ - public boolean hasInternalKey() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * <code>optional string internal_key = 3;</code> - */ - public java.lang.String getInternalKey() { - java.lang.Object ref = internalKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - internalKey_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * <code>optional string internal_key = 3;</code> - */ - public com.google.protobuf.ByteString - getInternalKeyBytes() { - java.lang.Object ref = internalKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - internalKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * <code>optional string internal_key = 3;</code> - */ - public Builder setInternalKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - internalKey_ = value; - onChanged(); - return this; - } - /** - * <code>optional string internal_key = 3;</code> - */ - public Builder clearInternalKey() { - bitField0_ = (bitField0_ & ~0x00000004); - internalKey_ = getDefaultInstance().getInternalKey(); - onChanged(); - return this; - } - /** - * <code>optional string internal_key = 3;</code> - */ - public Builder setInternalKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - internalKey_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:sonarqube.ws.rules.ListResponse.Rule) - } - - static { - defaultInstance = new Rule(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:sonarqube.ws.rules.ListResponse.Rule) - } - - public static final int RULES_FIELD_NUMBER = 1; - private java.util.List<org.sonarqube.ws.Rules.ListResponse.Rule> rules_; - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public java.util.List<org.sonarqube.ws.Rules.ListResponse.Rule> getRulesList() { - return rules_; - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public java.util.List<? extends org.sonarqube.ws.Rules.ListResponse.RuleOrBuilder> - getRulesOrBuilderList() { - return rules_; - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public int getRulesCount() { - return rules_.size(); - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public org.sonarqube.ws.Rules.ListResponse.Rule getRules(int index) { - return rules_.get(index); - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public org.sonarqube.ws.Rules.ListResponse.RuleOrBuilder getRulesOrBuilder( - int index) { - return rules_.get(index); - } - - private void initFields() { - rules_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < rules_.size(); i++) { - output.writeMessage(1, rules_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < rules_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, rules_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static org.sonarqube.ws.Rules.ListResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.sonarqube.ws.Rules.ListResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.sonarqube.ws.Rules.ListResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.sonarqube.ws.Rules.ListResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.sonarqube.ws.Rules.ListResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.sonarqube.ws.Rules.ListResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.sonarqube.ws.Rules.ListResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.sonarqube.ws.Rules.ListResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.sonarqube.ws.Rules.ListResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.sonarqube.ws.Rules.ListResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.sonarqube.ws.Rules.ListResponse prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code sonarqube.ws.rules.ListResponse} - * - * <pre> - * WS api/rules/list for internal use only - * </pre> - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:sonarqube.ws.rules.ListResponse) - org.sonarqube.ws.Rules.ListResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.sonarqube.ws.Rules.internal_static_sonarqube_ws_rules_ListResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.sonarqube.ws.Rules.internal_static_sonarqube_ws_rules_ListResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.sonarqube.ws.Rules.ListResponse.class, org.sonarqube.ws.Rules.ListResponse.Builder.class); - } - - // Construct using org.sonarqube.ws.Rules.ListResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getRulesFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - if (rulesBuilder_ == null) { - rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - rulesBuilder_.clear(); - } - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.sonarqube.ws.Rules.internal_static_sonarqube_ws_rules_ListResponse_descriptor; - } - - public org.sonarqube.ws.Rules.ListResponse getDefaultInstanceForType() { - return org.sonarqube.ws.Rules.ListResponse.getDefaultInstance(); - } - - public org.sonarqube.ws.Rules.ListResponse build() { - org.sonarqube.ws.Rules.ListResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.sonarqube.ws.Rules.ListResponse buildPartial() { - org.sonarqube.ws.Rules.ListResponse result = new org.sonarqube.ws.Rules.ListResponse(this); - int from_bitField0_ = bitField0_; - if (rulesBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - rules_ = java.util.Collections.unmodifiableList(rules_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.rules_ = rules_; - } else { - result.rules_ = rulesBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.sonarqube.ws.Rules.ListResponse) { - return mergeFrom((org.sonarqube.ws.Rules.ListResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.sonarqube.ws.Rules.ListResponse other) { - if (other == org.sonarqube.ws.Rules.ListResponse.getDefaultInstance()) return this; - if (rulesBuilder_ == null) { - if (!other.rules_.isEmpty()) { - if (rules_.isEmpty()) { - rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureRulesIsMutable(); - rules_.addAll(other.rules_); - } - onChanged(); - } - } else { - if (!other.rules_.isEmpty()) { - if (rulesBuilder_.isEmpty()) { - rulesBuilder_.dispose(); - rulesBuilder_ = null; - rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000001); - rulesBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getRulesFieldBuilder() : null; - } else { - rulesBuilder_.addAllMessages(other.rules_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.sonarqube.ws.Rules.ListResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.sonarqube.ws.Rules.ListResponse) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List<org.sonarqube.ws.Rules.ListResponse.Rule> rules_ = - java.util.Collections.emptyList(); - private void ensureRulesIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - rules_ = new java.util.ArrayList<org.sonarqube.ws.Rules.ListResponse.Rule>(rules_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - org.sonarqube.ws.Rules.ListResponse.Rule, org.sonarqube.ws.Rules.ListResponse.Rule.Builder, org.sonarqube.ws.Rules.ListResponse.RuleOrBuilder> rulesBuilder_; - - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public java.util.List<org.sonarqube.ws.Rules.ListResponse.Rule> getRulesList() { - if (rulesBuilder_ == null) { - return java.util.Collections.unmodifiableList(rules_); - } else { - return rulesBuilder_.getMessageList(); - } - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public int getRulesCount() { - if (rulesBuilder_ == null) { - return rules_.size(); - } else { - return rulesBuilder_.getCount(); - } - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public org.sonarqube.ws.Rules.ListResponse.Rule getRules(int index) { - if (rulesBuilder_ == null) { - return rules_.get(index); - } else { - return rulesBuilder_.getMessage(index); - } - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public Builder setRules( - int index, org.sonarqube.ws.Rules.ListResponse.Rule value) { - if (rulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRulesIsMutable(); - rules_.set(index, value); - onChanged(); - } else { - rulesBuilder_.setMessage(index, value); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public Builder setRules( - int index, org.sonarqube.ws.Rules.ListResponse.Rule.Builder builderForValue) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.set(index, builderForValue.build()); - onChanged(); - } else { - rulesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public Builder addRules(org.sonarqube.ws.Rules.ListResponse.Rule value) { - if (rulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRulesIsMutable(); - rules_.add(value); - onChanged(); - } else { - rulesBuilder_.addMessage(value); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public Builder addRules( - int index, org.sonarqube.ws.Rules.ListResponse.Rule value) { - if (rulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRulesIsMutable(); - rules_.add(index, value); - onChanged(); - } else { - rulesBuilder_.addMessage(index, value); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public Builder addRules( - org.sonarqube.ws.Rules.ListResponse.Rule.Builder builderForValue) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.add(builderForValue.build()); - onChanged(); - } else { - rulesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public Builder addRules( - int index, org.sonarqube.ws.Rules.ListResponse.Rule.Builder builderForValue) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.add(index, builderForValue.build()); - onChanged(); - } else { - rulesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public Builder addAllRules( - java.lang.Iterable<? extends org.sonarqube.ws.Rules.ListResponse.Rule> values) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, rules_); - onChanged(); - } else { - rulesBuilder_.addAllMessages(values); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public Builder clearRules() { - if (rulesBuilder_ == null) { - rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - rulesBuilder_.clear(); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public Builder removeRules(int index) { - if (rulesBuilder_ == null) { - ensureRulesIsMutable(); - rules_.remove(index); - onChanged(); - } else { - rulesBuilder_.remove(index); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public org.sonarqube.ws.Rules.ListResponse.Rule.Builder getRulesBuilder( - int index) { - return getRulesFieldBuilder().getBuilder(index); - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public org.sonarqube.ws.Rules.ListResponse.RuleOrBuilder getRulesOrBuilder( - int index) { - if (rulesBuilder_ == null) { - return rules_.get(index); } else { - return rulesBuilder_.getMessageOrBuilder(index); - } - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public java.util.List<? extends org.sonarqube.ws.Rules.ListResponse.RuleOrBuilder> - getRulesOrBuilderList() { - if (rulesBuilder_ != null) { - return rulesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(rules_); - } - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public org.sonarqube.ws.Rules.ListResponse.Rule.Builder addRulesBuilder() { - return getRulesFieldBuilder().addBuilder( - org.sonarqube.ws.Rules.ListResponse.Rule.getDefaultInstance()); - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public org.sonarqube.ws.Rules.ListResponse.Rule.Builder addRulesBuilder( - int index) { - return getRulesFieldBuilder().addBuilder( - index, org.sonarqube.ws.Rules.ListResponse.Rule.getDefaultInstance()); - } - /** - * <code>repeated .sonarqube.ws.rules.ListResponse.Rule rules = 1;</code> - */ - public java.util.List<org.sonarqube.ws.Rules.ListResponse.Rule.Builder> - getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - org.sonarqube.ws.Rules.ListResponse.Rule, org.sonarqube.ws.Rules.ListResponse.Rule.Builder, org.sonarqube.ws.Rules.ListResponse.RuleOrBuilder> - getRulesFieldBuilder() { - if (rulesBuilder_ == null) { - rulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - org.sonarqube.ws.Rules.ListResponse.Rule, org.sonarqube.ws.Rules.ListResponse.Rule.Builder, org.sonarqube.ws.Rules.ListResponse.RuleOrBuilder>( - rules_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - rules_ = null; - } - return rulesBuilder_; - } - - // @@protoc_insertion_point(builder_scope:sonarqube.ws.rules.ListResponse) - } - - static { - defaultInstance = new ListResponse(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:sonarqube.ws.rules.ListResponse) - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_sonarqube_ws_rules_ListResponse_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_sonarqube_ws_rules_ListResponse_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_sonarqube_ws_rules_ListResponse_Rule_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_sonarqube_ws_rules_ListResponse_Rule_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\016ws-rules.proto\022\022sonarqube.ws.rules\"\203\001\n" + - "\014ListResponse\0224\n\005rules\030\001 \003(\0132%.sonarqube" + - ".ws.rules.ListResponse.Rule\032=\n\004Rule\022\022\n\nr" + - "epository\030\001 \001(\t\022\013\n\003key\030\002 \001(\t\022\024\n\014internal" + - "_key\030\003 \001(\tB\033\n\020org.sonarqube.wsB\005RulesH\001" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - internal_static_sonarqube_ws_rules_ListResponse_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_sonarqube_ws_rules_ListResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_sonarqube_ws_rules_ListResponse_descriptor, - new java.lang.String[] { "Rules", }); - internal_static_sonarqube_ws_rules_ListResponse_Rule_descriptor = - internal_static_sonarqube_ws_rules_ListResponse_descriptor.getNestedTypes().get(0); - internal_static_sonarqube_ws_rules_ListResponse_Rule_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_sonarqube_ws_rules_ListResponse_Rule_descriptor, - new java.lang.String[] { "Repository", "Key", "InternalKey", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/Facets.java b/server/sonar-server/src/main/java/org/sonar/server/es/Facets.java index 9bc8519608e..9f0bed117e8 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/es/Facets.java +++ b/server/sonar-server/src/main/java/org/sonar/server/es/Facets.java @@ -28,6 +28,7 @@ import org.apache.commons.lang.builder.ReflectionToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.search.aggregations.Aggregation; +import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.HasAggregations; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogram; import org.elasticsearch.search.aggregations.bucket.missing.Missing; @@ -38,20 +39,22 @@ public class Facets { public static final String TOTAL = "total"; - private final Map<String, LinkedHashMap<String, Long>> facetsByName = new LinkedHashMap<>(); + private final LinkedHashMap<String, LinkedHashMap<String, Long>> facetsByName; + + public Facets(LinkedHashMap<String, LinkedHashMap<String, Long>> facetsByName) { + this.facetsByName = facetsByName; + } public Facets(SearchResponse response) { - if (response.getAggregations() != null) { - for (Aggregation facet : response.getAggregations()) { + this.facetsByName = new LinkedHashMap<>(); + Aggregations aggregations = response.getAggregations(); + if (aggregations != null) { + for (Aggregation facet : aggregations) { processAggregation(facet); } } } - public Facets(Terms terms) { - processTermsAggregation(terms); - } - private void processAggregation(Aggregation aggregation) { if (Missing.class.isAssignableFrom(aggregation.getClass())) { processMissingAggregation((Missing) aggregation); diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ActionService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ActionService.java index f9947d7314d..42da9fd1b8e 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ActionService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ActionService.java @@ -20,29 +20,10 @@ package org.sonar.server.issue; -import com.google.common.base.Preconditions; -import com.google.common.base.Predicate; -import com.google.common.base.Strings; -import com.google.common.collect.Iterables; -import java.util.Date; import java.util.List; -import javax.annotation.CheckForNull; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import org.sonar.api.component.Component; -import org.sonar.api.config.Settings; -import org.sonar.api.issue.Issue; -import org.sonar.api.issue.action.Action; -import org.sonar.api.issue.action.Actions; -import org.sonar.api.issue.action.Function; import org.sonar.api.server.ServerSide; -import org.sonar.core.issue.DefaultIssue; -import org.sonar.core.issue.IssueChangeContext; -import org.sonar.core.issue.IssueUpdater; -import org.sonar.db.DbClient; -import org.sonar.db.DbSession; -import org.sonar.db.property.PropertiesDao; -import org.sonar.db.property.PropertyDto; +import org.sonar.api.web.UserRole; +import org.sonar.db.issue.IssueDto; import org.sonar.server.user.UserSession; import static com.google.common.collect.Lists.newArrayList; @@ -53,144 +34,30 @@ import static com.google.common.collect.Lists.newArrayList; @ServerSide public class ActionService { - private final DbClient dbClient; - private final IssueService issueService; - private final IssueStorage issueStorage; - private final IssueUpdater updater; - private final Settings settings; - private final PropertiesDao propertiesDao; - private final Actions actions; - - public ActionService(DbClient dbClient, IssueService issueService, IssueStorage issueStorage, IssueUpdater updater, Settings settings, PropertiesDao propertiesDao, - Actions actions) { - this.dbClient = dbClient; - this.issueService = issueService; - this.issueStorage = issueStorage; - this.updater = updater; - this.settings = settings; - this.propertiesDao = propertiesDao; - this.actions = actions; - } - - public List<Action> listAllActions() { - return actions.list(); - } - - public List<Action> listAvailableActions(String issueKey) { - DbSession session = dbClient.openSession(false); - try { - return listAvailableActions(issueService.getByKeyForUpdate(session, issueKey).toDefaultIssue()); - } finally { - session.close(); - } - } - - public List<Action> listAvailableActions(Issue issue) { - return newArrayList(Iterables.filter(actions.list(), new SupportIssue(issue))); - } - - public Issue execute(String issueKey, String actionKey, UserSession userSession) { - Preconditions.checkArgument(!Strings.isNullOrEmpty(actionKey), "Missing action"); - - DbSession session = dbClient.openSession(false); - try { - DefaultIssue issue = issueService.getByKeyForUpdate(session, issueKey).toDefaultIssue(); - Action action = getAction(actionKey); - if (action == null) { - throw new IllegalArgumentException("Action is not found : " + actionKey); + private final UserSession userSession; + + public ActionService(UserSession userSession) { + this.userSession = userSession; + } + + public List<String> listAvailableActions(IssueDto issue) { + List<String> actions = newArrayList(); + String login = userSession.getLogin(); + if (login != null) { + actions.add("comment"); + if (issue.getResolution() == null) { + actions.add("assign"); + actions.add("set_tags"); + if (!login.equals(issue.getAssignee())) { + actions.add("assign_to_me"); + } + actions.add("plan"); + String projectUuid = issue.getProjectUuid(); + if (projectUuid != null && userSession.hasProjectPermissionByUuid(UserRole.ISSUE_ADMIN, projectUuid)) { + actions.add("set_severity"); + } } - if (!action.supports(issue)) { - throw new IllegalStateException("A condition is not respected"); - } - - IssueChangeContext changeContext = IssueChangeContext.createUser(new Date(), userSession.getLogin()); - Component project = dbClient.componentDao().selectOrFailByKey(session, issue.projectKey()); - FunctionContext functionContext = new FunctionContext(issue, updater, changeContext, getProjectSettings(project)); - for (Function function : action.functions()) { - function.execute(functionContext); - } - issueStorage.save(issue); - return issue; - } finally { - session.close(); - } - } - - @CheckForNull - private Action getAction(final String actionKey) { - return Iterables.find(actions.list(), new ActionMatchKey(actionKey), null); - } - - // TODO org.sonar.server.properties.ProjectSettings should be used instead - public Settings getProjectSettings(Component project) { - Settings projectSettings = new Settings(settings); - List<PropertyDto> properties = propertiesDao.selectProjectProperties(project.key()); - for (PropertyDto dto : properties) { - projectSettings.setProperty(dto.getKey(), dto.getValue()); - } - return projectSettings; - } - - static class FunctionContext implements Function.Context { - - private final DefaultIssue issue; - private final IssueUpdater updater; - private final IssueChangeContext changeContext; - private final Settings projectSettings; - - FunctionContext(DefaultIssue issue, IssueUpdater updater, IssueChangeContext changeContext, Settings projectSettings) { - this.updater = updater; - this.issue = issue; - this.changeContext = changeContext; - this.projectSettings = projectSettings; - } - - @Override - public Issue issue() { - return issue; - } - - @Override - public Settings projectSettings() { - return projectSettings; - } - - @Override - public Function.Context setAttribute(String key, @Nullable String value) { - updater.setAttribute(issue, key, value, changeContext); - return this; - } - - @Override - public Function.Context addComment(String text) { - updater.addComment(issue, text, changeContext); - return this; - } - } - - private static class SupportIssue implements Predicate<Action> { - private final Issue issue; - - public SupportIssue(Issue issue) { - this.issue = issue; - } - - @Override - public boolean apply(@Nonnull Action action) { - return action.supports(issue); - } - } - - private static class ActionMatchKey implements Predicate<Action> { - private final String key; - - public ActionMatchKey(String key) { - this.key = key; - } - - @Override - public boolean apply(@Nonnull Action action) { - return action.key().equals(key); } + return actions; } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java index 8244370a01b..2690882d762 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java @@ -27,7 +27,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -81,7 +80,6 @@ import org.sonar.server.user.ws.UserJsonWriter; import org.sonar.server.util.RubyUtils; import org.sonar.server.util.Validation; -import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Maps.newHashMap; /** @@ -176,10 +174,6 @@ public class InternalRubyIssueService { return changelogService.formatDiffs(diffs); } - public List<String> listPluginActions() { - return newArrayList(Iterables.transform(actionService.listAllActions(), ActionToKey.INSTANCE)); - } - public List<DefaultIssueComment> findComments(String issueKey) { return commentService.findComments(issueKey); } @@ -231,7 +225,7 @@ public class InternalRubyIssueService { public Result<IssueComment> addComment(String issueKey, String text) { Result<IssueComment> result = Result.of(); try { - result.set(commentService.addComment(issueKey, text, userSession)); + result.set(commentService.addComment(issueKey, text)); } catch (Exception e) { result.addError(e.getMessage()); } @@ -239,13 +233,13 @@ public class InternalRubyIssueService { } public IssueComment deleteComment(String commentKey) { - return commentService.deleteComment(commentKey, userSession); + return commentService.deleteComment(commentKey); } public Result<IssueComment> editComment(String commentKey, String newText) { Result<IssueComment> result = Result.of(); try { - result.set(commentService.editComment(commentKey, newText, userSession)); + result.set(commentService.editComment(commentKey, newText)); } catch (Exception e) { result.addError(e.getMessage()); } @@ -434,24 +428,6 @@ public class InternalRubyIssueService { return result; } - public Result<Issue> executeAction(String issueKey, String actionKey) { - Result<Issue> result = Result.of(); - try { - result.set(actionService.execute(issueKey, actionKey, userSession)); - } catch (Exception e) { - result.addError(e.getMessage()); - } - return result; - } - - public List<Action> listActions(String issueKey) { - return actionService.listAvailableActions(issueKey); - } - - public List<Action> listActions(Issue issue) { - return actionService.listAvailableActions(issue); - } - public IssueQuery emptyIssueQuery() { return issueQueryService.createFromMap(Maps.<String, Object>newHashMap()); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueCommentService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueCommentService.java index d821248ac6b..b6f511e18b7 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueCommentService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueCommentService.java @@ -44,28 +44,26 @@ import java.util.List; import static com.google.common.collect.Lists.newArrayList; -/** - * @since 3.6 - */ -@ServerSide public class IssueCommentService { private final DbClient dbClient; private final IssueService issueService; private final IssueUpdater updater; + private final UserSession userSession; - public IssueCommentService(DbClient dbClient, IssueService issueService, IssueUpdater updater) { + public IssueCommentService(DbClient dbClient, IssueService issueService, IssueUpdater updater, UserSession userSession) { this.dbClient = dbClient; this.issueService = issueService; this.updater = updater; + this.userSession = userSession; } public List<DefaultIssueComment> findComments(String issueKey) { return findComments(newArrayList(issueKey)); } - public List<DefaultIssueComment> findComments(DbSession session, String issueKey) { - return findComments(session, newArrayList(issueKey)); + public List<DefaultIssueComment> findComments(DbSession dbSession, String issueKey) { + return findComments(dbSession, newArrayList(issueKey)); } public List<DefaultIssueComment> findComments(Collection<String> issueKeys) { @@ -85,7 +83,7 @@ public class IssueCommentService { return dbClient.issueChangeDao().selectCommentByKey(commentKey); } - public IssueComment addComment(String issueKey, String text, UserSession userSession) { + public IssueComment addComment(String issueKey, String text) { verifyLoggedIn(userSession); if (StringUtils.isBlank(text)) { throw new BadRequestException("Cannot add empty comments to an issue"); @@ -110,7 +108,7 @@ public class IssueCommentService { } } - public IssueComment deleteComment(String commentKey, UserSession userSession) { + public IssueComment deleteComment(String commentKey) { DefaultIssueComment comment = dbClient.issueChangeDao().selectCommentByKey(commentKey); if (comment == null) { throw new NotFoundException("Comment not found: " + commentKey); @@ -126,7 +124,7 @@ public class IssueCommentService { return comment; } - public IssueComment editComment(String commentKey, String text, UserSession userSession) { + public IssueComment editComment(String commentKey, String text) { DefaultIssueComment comment = dbClient.issueChangeDao().selectCommentByKey(commentKey); if (StringUtils.isBlank(text)) { throw new BadRequestException("Cannot add empty comments to an issue"); @@ -149,6 +147,10 @@ public class IssueCommentService { return comment; } + public boolean canEditOrDelete(IssueChangeDto dto) { + return userSession.isLoggedIn() && userSession.getLogin().equals(dto.getUserLogin()); + } + private void verifyLoggedIn(UserSession userSession) { if (!userSession.isLoggedIn()) { throw new UnauthorizedException("User is not logged in"); diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java index 64faa57caad..88409c3bcce 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java @@ -135,7 +135,7 @@ public class IssueService { List<Transition> allowedTransitions = new ArrayList<>(); for (Transition transition : outTransitions) { String projectUuid = issue.projectUuid(); - if (StringUtils.isBlank(transition.requiredProjectPermission()) || + if (userSession.isLoggedIn() && StringUtils.isBlank(transition.requiredProjectPermission()) || (projectUuid != null && userSession.hasProjectPermissionByUuid(transition.requiredProjectPermission(), projectUuid))) { allowedTransitions.add(transition); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueActionsWriter.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueActionsWriter.java index 705f45de7e1..d9023ea75ae 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueActionsWriter.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueActionsWriter.java @@ -80,9 +80,6 @@ public class IssueActionsWriter { if (projectUuid != null && userSession.hasProjectPermissionByUuid(UserRole.ISSUE_ADMIN, projectUuid)) { actions.add("set_severity"); } - for (Action action : actionService.listAvailableActions(issue)) { - actions.add(action.key()); - } } } return actions; diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/Search2Action.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/Search2Action.java new file mode 100644 index 00000000000..7b49c1c3ad2 --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/Search2Action.java @@ -0,0 +1,369 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.server.issue.ws; + +import com.google.common.base.Function; +import com.google.common.collect.Lists; +import com.google.common.io.Resources; +import java.util.Collection; +import java.util.EnumSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.annotation.Nullable; +import org.sonar.api.issue.Issue; +import org.sonar.api.rule.Severity; +import org.sonar.api.server.ws.Request; +import org.sonar.api.server.ws.Response; +import org.sonar.api.server.ws.WebService; +import org.sonar.api.server.ws.WebService.Param; +import org.sonar.api.utils.Paging; +import org.sonar.core.rule.RuleKeyFunctions; +import org.sonar.server.es.Facets; +import org.sonar.server.es.SearchOptions; +import org.sonar.server.es.SearchResult; +import org.sonar.server.issue.IssueQuery; +import org.sonar.server.issue.IssueQueryService; +import org.sonar.server.issue.IssueService; +import org.sonar.server.issue.filter.IssueFilterParameters; +import org.sonar.server.issue.index.IssueDoc; +import org.sonar.server.issue.index.IssueIndex; +import org.sonar.server.user.UserSession; +import org.sonar.server.ws.WsUtils; +import org.sonarqube.ws.Issues; + +import static com.google.common.collect.FluentIterable.from; +import static com.google.common.collect.Iterables.concat; +import static java.util.Collections.singletonList; + +public class Search2Action implements IssuesWsAction { + + private static final String INTERNAL_PARAMETER_DISCLAIMER = "This parameter is mostly used by the Issues page, please prefer usage of the componentKeys parameter. "; + public static final String ADDITIONAL_FIELDS = "additionalFields"; + public static final String SEARCH_ACTION = "search2"; + + private final UserSession userSession; + private final IssueService service; + private final IssueQueryService issueQueryService; + private final SearchResponseLoader searchResponseLoader; + private final SearchResponseFormat searchResponseFormat; + + public Search2Action(UserSession userSession, IssueService service, IssueQueryService issueQueryService, + SearchResponseLoader searchResponseLoader, SearchResponseFormat searchResponseFormat) { + this.userSession = userSession; + this.service = service; + this.issueQueryService = issueQueryService; + this.searchResponseLoader = searchResponseLoader; + this.searchResponseFormat = searchResponseFormat; + } + + @Override + public void define(WebService.NewController controller) { + WebService.NewAction action = controller + .createAction(SEARCH_ACTION) + .setHandler(this) + .setDescription( + "Search for issues. Requires Browse permission on project(s)") + .setSince("3.6") + .setResponseExample(Resources.getResource(this.getClass(), "example-search.json")); + + action.addPagingParams(100); + action.createParam(Param.FACETS) + .setDescription("Comma-separated list of the facets to be computed. No facet is computed by default.") + .setPossibleValues(IssueIndex.SUPPORTED_FACETS); + action.createParam(IssueFilterParameters.FACET_MODE) + .setDefaultValue(IssueFilterParameters.FACET_MODE_COUNT) + .setDescription("Choose the returned value for facet items, either count of issues or sum of debt.") + .setPossibleValues(IssueFilterParameters.FACET_MODE_COUNT, IssueFilterParameters.FACET_MODE_DEBT); + action.addSortParams(IssueQuery.SORTS, null, true); + action.createParam(ADDITIONAL_FIELDS) + .setDescription("Comma-separated list of the optional fields to be returned in response.") + .setPossibleValues(SearchAdditionalField.possibleValues()); + addComponentRelatedParams(action); + action.createParam(IssueFilterParameters.ISSUES) + .setDescription("Comma-separated list of issue keys") + .setExampleValue("5bccd6e8-f525-43a2-8d76-fcb13dde79ef"); + action.createParam(IssueFilterParameters.SEVERITIES) + .setDescription("Comma-separated list of severities") + .setExampleValue(Severity.BLOCKER + "," + Severity.CRITICAL) + .setPossibleValues(Severity.ALL); + action.createParam(IssueFilterParameters.STATUSES) + .setDescription("Comma-separated list of statuses") + .setExampleValue(Issue.STATUS_OPEN + "," + Issue.STATUS_REOPENED) + .setPossibleValues(Issue.STATUSES); + action.createParam(IssueFilterParameters.RESOLUTIONS) + .setDescription("Comma-separated list of resolutions") + .setExampleValue(Issue.RESOLUTION_FIXED + "," + Issue.RESOLUTION_REMOVED) + .setPossibleValues(Issue.RESOLUTIONS); + action.createParam(IssueFilterParameters.RESOLVED) + .setDescription("To match resolved or unresolved issues") + .setBooleanPossibleValues(); + action.createParam(IssueFilterParameters.RULES) + .setDescription("Comma-separated list of coding rule keys. Format is <repository>:<rule>") + .setExampleValue("squid:AvoidCycles"); + action.createParam(IssueFilterParameters.TAGS) + .setDescription("Comma-separated list of tags.") + .setExampleValue("security,convention"); + action.createParam(IssueFilterParameters.ACTION_PLANS) + .setDescription("Comma-separated list of action plan keys (not names)") + .setExampleValue("3f19de90-1521-4482-a737-a311758ff513"); + action.createParam(IssueFilterParameters.PLANNED) + .setDescription("To retrieve issues associated to an action plan or not") + .setBooleanPossibleValues(); + action.createParam(IssueFilterParameters.REPORTERS) + .setDescription("Comma-separated list of reporter logins") + .setExampleValue("admin"); + action.createParam(IssueFilterParameters.AUTHORS) + .setDescription("Comma-separated list of SCM accounts") + .setExampleValue("torvalds@linux-foundation.org"); + action.createParam(IssueFilterParameters.ASSIGNEES) + .setDescription("Comma-separated list of assignee logins. The value '__me__' can be used as a placeholder for user who performs the request") + .setExampleValue("admin,usera,__me__"); + action.createParam(IssueFilterParameters.ASSIGNED) + .setDescription("To retrieve assigned or unassigned issues") + .setBooleanPossibleValues(); + action.createParam(IssueFilterParameters.LANGUAGES) + .setDescription("Comma-separated list of languages. Available since 4.4") + .setExampleValue("java,js"); + action.createParam(IssueFilterParameters.CREATED_AT) + .setDescription("To retrieve issues created at a given date. Format: date or datetime ISO formats") + .setExampleValue("2013-05-01 (or 2013-05-01T13:00:00+0100)"); + action.createParam(IssueFilterParameters.CREATED_AFTER) + .setDescription("To retrieve issues created after the given date (exclusive). Format: date or datetime ISO formats. If this parameter is set, createdSince must not be set") + .setExampleValue("2013-05-01 (or 2013-05-01T13:00:00+0100)"); + action.createParam(IssueFilterParameters.CREATED_BEFORE) + .setDescription("To retrieve issues created before the given date (exclusive). Format: date or datetime ISO formats") + .setExampleValue("2013-05-01 (or 2013-05-01T13:00:00+0100)"); + action.createParam(IssueFilterParameters.CREATED_IN_LAST) + .setDescription("To retrieve issues created during a time span before the current time (exclusive). " + + "Accepted units are 'y' for year, 'm' for month, 'w' for week and 'd' for day. " + + "If this parameter is set, createdAfter must not be set") + .setExampleValue("1m2w (1 month 2 weeks)"); + } + + private static void addComponentRelatedParams(WebService.NewAction action) { + action.createParam(IssueFilterParameters.ON_COMPONENT_ONLY) + .setDescription("Return only issues at a component's level, not on its descendants (modules, directories, files, etc). " + + "This parameter is only considered when componentKeys or componentUuids is set. " + + "Using the deprecated componentRoots or componentRootUuids parameters will set this parameter to false. " + + "Using the deprecated components parameter will set this parameter to true.") + .setBooleanPossibleValues() + .setDefaultValue("false"); + + action.createParam(IssueFilterParameters.COMPONENT_KEYS) + .setDescription("To retrieve issues associated to a specific list of components sub-components (comma-separated list of component keys). " + + "A component can be a view, developer, project, module, directory or file. " + + "If this parameter is set, componentUuids must not be set.") + .setExampleValue("org.apache.struts:struts:org.apache.struts.Action"); + action.createParam(IssueFilterParameters.COMPONENTS) + .setDescription("Deprecated since 5.1. If used, will have the same meaning as componentKeys AND onComponentOnly=true."); + action.createParam(IssueFilterParameters.COMPONENT_UUIDS) + .setDescription("To retrieve issues associated to a specific list of components their sub-components (comma-separated list of component UUIDs). " + + INTERNAL_PARAMETER_DISCLAIMER + + "A component can be a project, module, directory or file. " + + "If this parameter is set, componentKeys must not be set.") + .setExampleValue("584a89f2-8037-4f7b-b82c-8b45d2d63fb2"); + + action.createParam(IssueFilterParameters.COMPONENT_ROOTS) + .setDescription("Deprecated since 5.1. If used, will have the same meaning as componentKeys AND onComponentOnly=false."); + action.createParam(IssueFilterParameters.COMPONENT_ROOT_UUIDS) + .setDescription("Deprecated since 5.1. If used, will have the same meaning as componentUuids AND onComponentOnly=false."); + + action.createParam(IssueFilterParameters.PROJECTS) + .setDescription("Deprecated since 5.1. See projectKeys"); + action.createParam(IssueFilterParameters.PROJECT_KEYS) + .setDescription("To retrieve issues associated to a specific list of projects (comma-separated list of project keys). " + + INTERNAL_PARAMETER_DISCLAIMER + + "If this parameter is set, projectUuids must not be set.") + .setDeprecatedKey(IssueFilterParameters.PROJECTS) + .setExampleValue("org.apache.struts:struts:org.apache.struts.Action"); + action.createParam(IssueFilterParameters.PROJECT_UUIDS) + .setDescription("To retrieve issues associated to a specific list of projects (comma-separated list of project UUIDs). " + + INTERNAL_PARAMETER_DISCLAIMER + + "Views are not supported. If this parameter is set, projectKeys must not be set.") + .setExampleValue("7d8749e8-3070-4903-9188-bdd82933bb92"); + + action.createParam(IssueFilterParameters.MODULE_UUIDS) + .setDescription("To retrieve issues associated to a specific list of modules (comma-separated list of module UUIDs). " + + INTERNAL_PARAMETER_DISCLAIMER + + "Views are not supported. If this parameter is set, moduleKeys must not be set.") + .setExampleValue("7d8749e8-3070-4903-9188-bdd82933bb92"); + + action.createParam(IssueFilterParameters.DIRECTORIES) + .setDescription("Since 5.1. To retrieve issues associated to a specific list of directories (comma-separated list of directory paths). " + + "This parameter is only meaningful when a module is selected. " + + INTERNAL_PARAMETER_DISCLAIMER) + .setExampleValue("src/main/java/org/sonar/server/"); + + action.createParam(IssueFilterParameters.FILE_UUIDS) + .setDescription("To retrieve issues associated to a specific list of files (comma-separated list of file UUIDs). " + + INTERNAL_PARAMETER_DISCLAIMER) + .setExampleValue("bdd82933-3070-4903-9188-7d8749e8bb92"); + } + + @Override + public final void handle(Request request, Response response) throws Exception { + // prepare the Elasticsearch request + SearchOptions options = new SearchOptions(); + options.setPage(request.mandatoryParamAsInt(Param.PAGE), request.mandatoryParamAsInt(Param.PAGE_SIZE)); + options.addFacets(request.paramAsStrings(Param.FACETS)); + EnumSet<SearchAdditionalField> additionalFields = SearchAdditionalField.getFromRequest(request); + IssueQuery query = issueQueryService.createFromRequest(request); + + // execute request + SearchResult<IssueDoc> result = service.search(query, options); + List<String> issueKeys = from(result.getDocs()).transform(IssueDocToKey.INSTANCE).toList(); + + // load the additional information to be returned in response + SearchResponseLoader.Collector collector = new SearchResponseLoader.Collector(additionalFields, issueKeys); + collectLoggedInUser(collector); + collectRequestParams(collector, request); + Facets facets = null; + if (!options.getFacets().isEmpty()) { + facets = result.getFacets(); + // add missing values to facets. For example if assignee "john" and facet on "assignees" are requested, then + // "john" should always be listed in the facet. If it is not present, then it is added with value zero. + // This is a constraint from webapp UX. + completeFacets(facets, options, request); + collectFacets(collector, facets); + } + SearchResponseData data = searchResponseLoader.load(collector, facets); + + // format response + + // Filter and reorder facets according to the requested ordered names. + // Must be done after loading of data as the "hidden" facet "debt" + // can be used to get total debt. + facets = reorderFacets(facets, options.getFacets()); + + // FIXME allow long in Paging + Paging paging = Paging.create(options.getLimit(), options.getPage(), (int) result.getTotal()); + Issues.Search responseBody = searchResponseFormat.format(additionalFields, data, paging, facets); + WsUtils.writeProtobuf(responseBody, request, response); + } + + private Facets reorderFacets(@Nullable Facets facets, Collection<String> orderedNames) { + if (facets == null) { + return null; + } + LinkedHashMap<String, LinkedHashMap<String, Long>> orderedFacets = new LinkedHashMap<>(); + for (String facetName : orderedNames) { + LinkedHashMap<String, Long> facet = facets.get(facetName); + if (facet != null) { + orderedFacets.put(facetName, facet); + } + } + return new Facets(orderedFacets); + } + + private void completeFacets(Facets facets, SearchOptions options, Request request) { + addMandatoryValuesToFacet(facets, IssueFilterParameters.SEVERITIES, Severity.ALL); + addMandatoryValuesToFacet(facets, IssueFilterParameters.STATUSES, Issue.STATUSES); + addMandatoryValuesToFacet(facets, IssueFilterParameters.RESOLUTIONS, concat(singletonList(""), Issue.RESOLUTIONS)); + addMandatoryValuesToFacet(facets, IssueFilterParameters.PROJECT_UUIDS, request.paramAsStrings(IssueFilterParameters.PROJECT_UUIDS)); + + List<String> assignees = Lists.newArrayList(""); + List<String> assigneesFromRequest = request.paramAsStrings(IssueFilterParameters.ASSIGNEES); + if (assigneesFromRequest != null) { + assignees.addAll(assigneesFromRequest); + assignees.remove(IssueQueryService.LOGIN_MYSELF); + } + addMandatoryValuesToFacet(facets, IssueFilterParameters.ASSIGNEES, assignees); + addMandatoryValuesToFacet(facets, IssueFilterParameters.FACET_ASSIGNED_TO_ME, singletonList(userSession.getLogin())); + addMandatoryValuesToFacet(facets, IssueFilterParameters.REPORTERS, request.paramAsStrings(IssueFilterParameters.REPORTERS)); + addMandatoryValuesToFacet(facets, IssueFilterParameters.RULES, request.paramAsStrings(IssueFilterParameters.RULES)); + addMandatoryValuesToFacet(facets, IssueFilterParameters.LANGUAGES, request.paramAsStrings(IssueFilterParameters.LANGUAGES)); + addMandatoryValuesToFacet(facets, IssueFilterParameters.TAGS, request.paramAsStrings(IssueFilterParameters.TAGS)); + List<String> actionPlans = Lists.newArrayList(""); + List<String> actionPlansFromRequest = request.paramAsStrings(IssueFilterParameters.ACTION_PLANS); + if (actionPlansFromRequest != null) { + actionPlans.addAll(actionPlansFromRequest); + } + addMandatoryValuesToFacet(facets, IssueFilterParameters.ACTION_PLANS, actionPlans); + addMandatoryValuesToFacet(facets, IssueFilterParameters.COMPONENT_UUIDS, request.paramAsStrings(IssueFilterParameters.COMPONENT_UUIDS)); + + for (String facetName : options.getFacets()) { + LinkedHashMap<String, Long> buckets = facets.get(facetName); + if (!IssueFilterParameters.FACET_ASSIGNED_TO_ME.equals(facetName)) { + if (buckets != null) { + List<String> requestParams = request.paramAsStrings(facetName); + if (requestParams != null) { + for (String param : requestParams) { + if (!buckets.containsKey(param) && !IssueQueryService.LOGIN_MYSELF.equals(param)) { + // Prevent appearance of a glitch value due to dedicated parameter for this facet + buckets.put(param, 0L); + } + } + } + } + } + } + } + + private void addMandatoryValuesToFacet(Facets facets, String facetName, @Nullable Iterable<String> mandatoryValues) { + Map<String, Long> buckets = facets.get(facetName); + if (buckets != null && mandatoryValues != null) { + for (String mandatoryValue : mandatoryValues) { + if (!buckets.containsKey(mandatoryValue)) { + buckets.put(mandatoryValue, 0L); + } + } + } + } + + private void collectLoggedInUser(SearchResponseLoader.Collector collector) { + if (userSession.isLoggedIn()) { + collector.add(SearchAdditionalField.USERS, userSession.getLogin()); + } + } + + private void collectFacets(SearchResponseLoader.Collector collector, Facets facets) { + Set<String> facetRules = facets.getBucketKeys(IssueFilterParameters.RULES); + if (facetRules != null) { + collector.addAll(SearchAdditionalField.RULES, from(facetRules).transform(RuleKeyFunctions.stringToRuleKey())); + } + collector.addProjectUuids(facets.getBucketKeys(IssueFilterParameters.PROJECT_UUIDS)); + collector.addComponentUuids(facets.getBucketKeys(IssueFilterParameters.COMPONENT_UUIDS)); + collector.addComponentUuids(facets.getBucketKeys(IssueFilterParameters.FILE_UUIDS)); + collector.addComponentUuids(facets.getBucketKeys(IssueFilterParameters.MODULE_UUIDS)); + collector.addAll(SearchAdditionalField.USERS, facets.getBucketKeys(IssueFilterParameters.ASSIGNEES)); + collector.addAll(SearchAdditionalField.USERS, facets.getBucketKeys(IssueFilterParameters.REPORTERS)); + collector.addAll(SearchAdditionalField.ACTION_PLANS, facets.getBucketKeys(IssueFilterParameters.ACTION_PLANS)); + } + + private void collectRequestParams(SearchResponseLoader.Collector collector, Request request) { + collector.addProjectUuids(request.paramAsStrings(IssueFilterParameters.PROJECT_UUIDS)); + collector.addComponentUuids(request.paramAsStrings(IssueFilterParameters.FILE_UUIDS)); + collector.addComponentUuids(request.paramAsStrings(IssueFilterParameters.MODULE_UUIDS)); + collector.addComponentUuids(request.paramAsStrings(IssueFilterParameters.COMPONENT_ROOT_UUIDS)); + collector.addAll(SearchAdditionalField.USERS, request.paramAsStrings(IssueFilterParameters.ASSIGNEES)); + collector.addAll(SearchAdditionalField.USERS, request.paramAsStrings(IssueFilterParameters.REPORTERS)); + collector.addAll(SearchAdditionalField.ACTION_PLANS, request.paramAsStrings(IssueFilterParameters.ACTION_PLANS)); + } + + private enum IssueDocToKey implements Function<IssueDoc, String> { + INSTANCE; + @Override + public String apply(IssueDoc input) { + return input.key(); + } + } +} diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java index d0958780989..d9729d25d67 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java @@ -273,7 +273,7 @@ public class SearchAction implements IssuesWsAction { options.addFacets(request.paramAsStrings(WebService.Param.FACETS)); IssueQuery query = issueQueryService.createFromRequest(request); - SearchResult<IssueDoc> result = execute(query, options); + SearchResult<IssueDoc> result = service.search(query, options); JsonWriter json = response.newJsonWriter().beginObject(); options.writeJson(json, result.getTotal()); @@ -286,10 +286,6 @@ public class SearchAction implements IssuesWsAction { json.endObject().close(); } - private SearchResult<IssueDoc> execute(IssueQuery query, SearchOptions options) { - return service.search(query, options); - } - private void writeResponse(Request request, SearchResult<IssueDoc> result, JsonWriter json) { Map<String, Long> debtFacet = result.getFacets().get(IssueIndex.DEBT_AGGREGATION_NAME); if (debtFacet != null) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java new file mode 100644 index 00000000000..25a553b908f --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAdditionalField.java @@ -0,0 +1,83 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.server.issue.ws; + +import com.google.common.collect.Lists; +import java.util.Collection; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.CheckForNull; +import org.sonar.api.server.ws.Request; + +public enum SearchAdditionalField { + + ACTIONS("actions"), + ACTION_PLANS("actionPlans"), + COMMENTS("comments"), + LANGUAGES("languages"), + RULES("rules"), + TRANSITIONS("transitions"), + USERS("users"); + + public static final String ALL_ALIAS = "_all"; + public static final EnumSet<SearchAdditionalField> ALL_ADDITIONAL_FIELDS = EnumSet.allOf(SearchAdditionalField.class); + + private final String label; + + SearchAdditionalField(String label) { + this.label = label; + } + + private static final Map<String, SearchAdditionalField> BY_LABELS = new HashMap<>(); + + static { + for (SearchAdditionalField f : values()) { + BY_LABELS.put(f.label, f); + } + } + + @CheckForNull + public static SearchAdditionalField findByLabel(String label) { + return BY_LABELS.get(label); + } + + public static Collection<String> possibleValues() { + List<String> possibles = Lists.newArrayList(ALL_ALIAS); + possibles.addAll(BY_LABELS.keySet()); + return possibles; + } + + public static EnumSet<SearchAdditionalField> getFromRequest(Request request) { + List<String> labels = request.paramAsStrings(Search2Action.ADDITIONAL_FIELDS); + if (labels == null) { + return EnumSet.noneOf(SearchAdditionalField.class); + } + EnumSet<SearchAdditionalField> fields = EnumSet.noneOf(SearchAdditionalField.class); + for (String label : labels) { + if (label.equals(ALL_ALIAS)) { + return EnumSet.allOf(SearchAdditionalField.class); + } + fields.add(findByLabel(label)); + } + return fields; + } +} diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseData.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseData.java new file mode 100644 index 00000000000..0c51f2742d5 --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseData.java @@ -0,0 +1,167 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.server.issue.ws; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ListMultimap; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.annotation.CheckForNull; +import javax.annotation.Nullable; +import org.sonar.core.issue.workflow.Transition; +import org.sonar.db.component.ComponentDto; +import org.sonar.db.issue.ActionPlanDto; +import org.sonar.db.issue.IssueChangeDto; +import org.sonar.db.issue.IssueDto; +import org.sonar.db.rule.RuleDto; +import org.sonar.db.user.UserDto; + +import static com.google.common.base.Preconditions.checkNotNull; + +/** + * All the data required to write response of api/issues/search + */ +public class SearchResponseData { + + private final List<IssueDto> issues; + + private Long debtTotal = null; + private List<UserDto> users = null; + private List<RuleDto> rules = null; + private List<ActionPlanDto> actionPlans = null; + private final Map<String, ComponentDto> componentsByUuid = new HashMap<>(); + private final ListMultimap<String, IssueChangeDto> commentsByIssueKey = ArrayListMultimap.create(); + private final ListMultimap<String, String> actionsByIssueKey = ArrayListMultimap.create(); + private final ListMultimap<String, Transition> transitionsByIssueKey = ArrayListMultimap.create(); + private final Set<String> updatableComments = new HashSet<>(); + + public SearchResponseData(List<IssueDto> issues) { + checkNotNull(issues); + this.issues = issues; + } + + public List<IssueDto> getIssues() { + return issues; + } + + @CheckForNull + public Collection<ComponentDto> getComponents() { + return componentsByUuid.values(); + } + + @CheckForNull + public ComponentDto getComponentByUuid(String uuid) { + return componentsByUuid.get(uuid); + } + + @CheckForNull + public List<UserDto> getUsers() { + return users; + } + + @CheckForNull + public List<RuleDto> getRules() { + return rules; + } + + @CheckForNull + public List<ActionPlanDto> getActionPlans() { + return actionPlans; + } + + @CheckForNull + public List<IssueChangeDto> getCommentsForIssueKey(String issueKey) { + if (commentsByIssueKey.containsKey(issueKey)) { + return commentsByIssueKey.get(issueKey); + } + return null; + } + + @CheckForNull + public List<String> getActionsForIssueKey(String issueKey) { + if (actionsByIssueKey.containsKey(issueKey)) { + return actionsByIssueKey.get(issueKey); + } + return null; + } + + @CheckForNull + public List<Transition> getTransitionsForIssueKey(String issueKey) { + if (transitionsByIssueKey.containsKey(issueKey)) { + return transitionsByIssueKey.get(issueKey); + } + return null; + } + + public void setUsers(@Nullable List<UserDto> users) { + this.users = users; + } + + public void setRules(@Nullable List<RuleDto> rules) { + this.rules = rules; + } + + public void setActionPlans(@Nullable List<ActionPlanDto> actionPlans) { + this.actionPlans = actionPlans; + } + + public void setComments(@Nullable List<IssueChangeDto> comments) { + for (IssueChangeDto comment : comments) { + commentsByIssueKey.put(comment.getIssueKey(), comment); + } + } + + public void addComponents(@Nullable Collection<ComponentDto> dtos) { + if (dtos != null) { + for (ComponentDto dto : dtos) { + componentsByUuid.put(dto.uuid(), dto); + } + } + } + + public void addActions(String issueKey, List<String> actions) { + actionsByIssueKey.putAll(issueKey, actions); + } + + public void addTransitions(String issueKey, List<Transition> transitions) { + transitionsByIssueKey.putAll(issueKey, transitions); + } + + public void addUpdatableComment(String commentKey) { + updatableComments.add(commentKey); + } + + public boolean isUpdatableComment(String commentKey) { + return updatableComments.contains(commentKey); + } + + @CheckForNull + public Long getDebtTotal() { + return debtTotal; + } + + public void setDebtTotal(@Nullable Long debtTotal) { + this.debtTotal = debtTotal; + } +} diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java new file mode 100644 index 00000000000..29c1a79b398 --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java @@ -0,0 +1,291 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.server.issue.ws; + +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.annotation.Nullable; +import org.sonar.api.resources.Language; +import org.sonar.api.resources.Languages; +import org.sonar.api.utils.DateUtils; +import org.sonar.api.utils.Duration; +import org.sonar.api.utils.Durations; +import org.sonar.api.utils.Paging; +import org.sonar.core.issue.workflow.Transition; +import org.sonar.db.component.ComponentDto; +import org.sonar.db.issue.ActionPlanDto; +import org.sonar.db.issue.IssueChangeDto; +import org.sonar.db.issue.IssueDto; +import org.sonar.db.rule.RuleDto; +import org.sonar.db.user.UserDto; +import org.sonar.markdown.Markdown; +import org.sonar.server.es.Facets; +import org.sonar.server.ws.WsResponseCommonFormat; +import org.sonarqube.ws.Common; +import org.sonarqube.ws.Issues; + +import static com.google.common.base.Strings.nullToEmpty; + +public class SearchResponseFormat { + + private final Durations durations; + private final WsResponseCommonFormat commonFormat; + private final Languages languages; + + public SearchResponseFormat(Durations durations, WsResponseCommonFormat commonFormat, Languages languages) { + this.durations = durations; + this.commonFormat = commonFormat; + this.languages = languages; + } + + public Issues.Search format(Set<SearchAdditionalField> fields, SearchResponseData data, + @Nullable Paging paging, @Nullable Facets facets) { + Issues.Search.Builder response = Issues.Search.newBuilder(); + + if (paging != null) { + formatPaging(paging, response); + } + formatDebtTotal(data, response); + formatIssues(fields, data, response); + formatComponents(data, response); + if (facets != null) { + formatFacets(facets, response); + } + if (fields.contains(SearchAdditionalField.RULES)) { + formatRules(data, response); + } + if (fields.contains(SearchAdditionalField.USERS)) { + formatUsers(data, response); + } + if (fields.contains(SearchAdditionalField.ACTION_PLANS)) { + formatActionPlans(data, response); + } + if (fields.contains(SearchAdditionalField.LANGUAGES)) { + formatLanguages(response); + } + return response.build(); + } + + private void formatDebtTotal(SearchResponseData data, Issues.Search.Builder response) { + Long debt = data.getDebtTotal(); + if (debt != null) { + response.setDebtTotal(debt); + } + } + + private void formatPaging(Paging paging, Issues.Search.Builder response) { + response.setP(paging.pageIndex()); + response.setPs(paging.pageSize()); + response.setTotal(paging.total()); + response.setPaging(commonFormat.formatPaging(paging)); + } + + private void formatIssues(Set<SearchAdditionalField> fields, SearchResponseData data, Issues.Search.Builder response) { + Issues.Issue.Builder issueBuilder = Issues.Issue.newBuilder(); + for (IssueDto dto : data.getIssues()) { + issueBuilder.clear(); + formatIssue(issueBuilder, dto, data); + if (fields.contains(SearchAdditionalField.ACTIONS)) { + formatIssueActions(data, issueBuilder, dto); + } + if (fields.contains(SearchAdditionalField.TRANSITIONS)) { + formatIssueTransitions(data, issueBuilder, dto); + } + if (fields.contains(SearchAdditionalField.COMMENTS)) { + formatIssueComments(data, issueBuilder, dto); + } + // TODO attributes + response.addIssues(issueBuilder.build()); + } + } + + private void formatIssue(Issues.Issue.Builder issueBuilder, IssueDto dto, SearchResponseData data) { + issueBuilder.setKey(dto.getKey()); + ComponentDto component = data.getComponentByUuid(dto.getComponentUuid()); + issueBuilder.setComponent(dto.getComponentUuid()); + // Only used for the compatibility with the Issues Java WS Client <= 4.4 used by Eclipse + issueBuilder.setComponentId(component.getId()); + + ComponentDto project = data.getComponentByUuid(dto.getProjectUuid()); + if (project != null) { + issueBuilder.setProject(project.uuid()); + } + issueBuilder.setRule(dto.getRuleKey().toString()); + issueBuilder.setSeverity(Common.Severity.valueOf(dto.getSeverity())); + issueBuilder.setAssignee(nullToEmpty(dto.getAssignee())); + issueBuilder.setReporter(nullToEmpty(dto.getReporter())); + issueBuilder.setResolution(nullToEmpty(dto.getResolution())); + issueBuilder.setStatus(nullToEmpty(dto.getStatus())); + issueBuilder.setActionPlan(nullToEmpty(dto.getActionPlanKey())); + issueBuilder.setMessage(nullToEmpty(dto.getMessage())); + issueBuilder.addAllTags(dto.getTags()); + Long debt = dto.getDebt(); + if (debt != null) { + issueBuilder.setDebt(durations.encode(Duration.create(debt))); + } + Integer line = dto.getLine(); + if (line != null) { + issueBuilder.setLine(line); + } + issueBuilder.setAuthor(nullToEmpty(dto.getAuthorLogin())); + Date date = dto.getIssueCreationDate(); + if (date != null) { + issueBuilder.setCreationDate(DateUtils.formatDateTime(date)); + } + date = dto.getIssueUpdateDate(); + if (date != null) { + issueBuilder.setUpdateDate(DateUtils.formatDateTime(date)); + } + date = dto.getIssueCloseDate(); + if (date != null) { + issueBuilder.setCloseDate(DateUtils.formatDateTime(date)); + } + } + + private void formatIssueTransitions(SearchResponseData data, Issues.Issue.Builder issueBuilder, IssueDto dto) { + issueBuilder.setTransitionsPresentIfEmpty(true); + List<Transition> transitions = data.getTransitionsForIssueKey(dto.getKey()); + if (transitions != null) { + for (Transition transition : transitions) { + issueBuilder.addTransitions(transition.key()); + } + } + } + + private void formatIssueActions(SearchResponseData data, Issues.Issue.Builder issueBuilder, IssueDto dto) { + issueBuilder.setActionsPresentIfEmpty(true); + List<String> actions = data.getActionsForIssueKey(dto.getKey()); + if (actions != null) { + issueBuilder.addAllActions(actions); + } + } + + private void formatIssueComments(SearchResponseData data, Issues.Issue.Builder issueBuilder, IssueDto dto) { + issueBuilder.setCommentsPresentIfEmpty(true); + List<IssueChangeDto> comments = data.getCommentsForIssueKey(dto.getKey()); + if (comments != null) { + Issues.Comment.Builder commentBuilder = Issues.Comment.newBuilder(); + for (IssueChangeDto comment : comments) { + String markdown = comment.getChangeData(); + commentBuilder + .clear() + .setKey(comment.getKey()) + .setLogin(nullToEmpty(comment.getUserLogin())) + .setUpdatable(data.isUpdatableComment(comment.getKey())) + .setCreatedAt(DateUtils.formatDateTime(new Date(comment.getCreatedAt()))); + if (markdown != null) { + commentBuilder + .setHtmlText(Markdown.convertToHtml(markdown)) + .setMarkdown(markdown); + } + issueBuilder.addComments(commentBuilder.build()); + } + } + } + + private void formatRules(SearchResponseData data, Issues.Search.Builder response) { + response.setRulesPresentIfEmpty(true); + List<RuleDto> rules = data.getRules(); + if (rules != null) { + for (RuleDto rule : rules) { + response.addRules(commonFormat.formatRule(rule)); + } + } + } + + private void formatComponents(SearchResponseData data, Issues.Search.Builder response) { + response.setComponentsPresentIfEmpty(true); + Collection<ComponentDto> components = data.getComponents(); + if (components != null) { + for (ComponentDto dto : components) { + response.addComponents(commonFormat.formatComponent(dto)); + } + } + } + + private void formatUsers(SearchResponseData data, Issues.Search.Builder response) { + response.setUsersPresentIfEmpty(true); + List<UserDto> users = data.getUsers(); + if (users != null) { + for (UserDto user : users) { + response.addUsers(commonFormat.formatUser(user)); + } + } + } + + private void formatActionPlans(SearchResponseData data, Issues.Search.Builder response) { + response.setActionPlansPresentIfEmpty(true); + List<ActionPlanDto> actionPlans = data.getActionPlans(); + if (actionPlans != null) { + Issues.ActionPlan.Builder planBuilder = Issues.ActionPlan.newBuilder(); + for (ActionPlanDto actionPlan : actionPlans) { + planBuilder + .clear() + .setKey(actionPlan.getKey()) + .setName(nullToEmpty(actionPlan.getName())) + .setStatus(nullToEmpty(actionPlan.getStatus())) + .setProject(nullToEmpty(actionPlan.getProjectUuid())); + Date deadLine = actionPlan.getDeadLine(); + if (deadLine != null) { + planBuilder.setDeadLine(DateUtils.formatDateTime(deadLine)); + } + response.addActionPlans(planBuilder.build()); + } + } + } + + private void formatLanguages(Issues.Search.Builder response) { + response.setLanguagesPresentIfEmpty(true); + Issues.Language.Builder builder = Issues.Language.newBuilder(); + for (Language lang : languages.all()) { + builder + .clear() + .setKey(lang.getKey()) + .setName(lang.getName()); + response.addLanguages(builder.build()); + } + } + + private void formatFacets(Facets facets, Issues.Search.Builder response) { + response.setFacetsPresentIfEmpty(true); + Common.Facet.Builder facetBuilder = Common.Facet.newBuilder(); + for (Map.Entry<String, LinkedHashMap<String, Long>> facet : facets.getAll().entrySet()) { + facetBuilder.clear(); + facetBuilder.setProperty(facet.getKey()); + LinkedHashMap<String, Long> buckets = facet.getValue(); + if (buckets != null) { + for (Map.Entry<String, Long> bucket : buckets.entrySet()) { + Common.FacetValue.Builder valueBuilder = facetBuilder.addValuesBuilder(); + valueBuilder.setVal(bucket.getKey()); + valueBuilder.setCount(bucket.getValue()); + valueBuilder.build(); + } + } else { + facetBuilder.addAllValues(Collections.<Common.FacetValue>emptyList()); + } + response.addFacets(facetBuilder.build()); + } + } +} diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseLoader.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseLoader.java new file mode 100644 index 00000000000..1a4a9ac98a7 --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseLoader.java @@ -0,0 +1,241 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.server.issue.ws; + +import com.google.common.collect.MultimapBuilder; +import com.google.common.collect.SetMultimap; +import java.util.Collection; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.annotation.Nullable; +import org.sonar.api.rule.RuleKey; +import org.sonar.core.issue.DefaultIssue; +import org.sonar.db.DbClient; +import org.sonar.db.DbSession; +import org.sonar.db.component.ComponentDto; +import org.sonar.db.issue.IssueChangeDto; +import org.sonar.db.issue.IssueDto; +import org.sonar.server.es.Facets; +import org.sonar.server.issue.ActionService; +import org.sonar.server.issue.IssueCommentService; +import org.sonar.server.issue.IssueService; +import org.sonar.server.issue.index.IssueIndex; + +import static com.google.common.collect.Lists.newArrayList; +import static org.sonar.server.issue.ws.SearchAdditionalField.ACTIONS; +import static org.sonar.server.issue.ws.SearchAdditionalField.ACTION_PLANS; +import static org.sonar.server.issue.ws.SearchAdditionalField.COMMENTS; +import static org.sonar.server.issue.ws.SearchAdditionalField.RULES; +import static org.sonar.server.issue.ws.SearchAdditionalField.TRANSITIONS; +import static org.sonar.server.issue.ws.SearchAdditionalField.USERS; + +/** + * Loads all the information required for the response of api/issues/search. + */ +public class SearchResponseLoader { + + private final DbClient dbClient; + private final IssueService issueService; + private final ActionService actionService; + private final IssueCommentService commentService; + + public SearchResponseLoader(DbClient dbClient, IssueService issueService, ActionService actionService, IssueCommentService commentService) { + this.dbClient = dbClient; + this.issueService = issueService; + this.actionService = actionService; + this.commentService = commentService; + } + + /** + * The issue keys are given by the multi-criteria search in Elasticsearch index. + */ + public SearchResponseData load(Collector collector, @Nullable Facets facets) { + DbSession dbSession = dbClient.openSession(false); + try { + SearchResponseData result = new SearchResponseData(dbClient.issueDao().selectByOrderedKeys(dbSession, collector.getIssueKeys())); + collector.collect(result.getIssues()); + + loadRules(collector, dbSession, result); + // order is important - loading of comments complete the list of users: loadComments() is + // before loadUsers() + loadComments(collector, dbSession, result); + loadUsers(collector, dbSession, result); + loadActionPlans(collector, dbSession, result); + loadComponents(collector, dbSession, result); + loadActionsAndTransitions(collector, result); + completeTotalDebtFromFacet(facets, result); + return result; + } finally { + dbClient.closeSession(dbSession); + } + } + + private void loadUsers(Collector collector, DbSession dbSession, SearchResponseData result) { + if (collector.contains(USERS)) { + result.setUsers(dbClient.userDao().selectByLogins(dbSession, collector.<String>get(USERS))); + } + } + + private void loadComments(Collector collector, DbSession dbSession, SearchResponseData result) { + if (collector.contains(COMMENTS)) { + List<IssueChangeDto> comments = dbClient.issueChangeDao().selectByTypeAndIssueKeys(dbSession, collector.getIssueKeys(), IssueChangeDto.TYPE_COMMENT); + result.setComments(comments); + for (IssueChangeDto comment : comments) { + collector.add(USERS, comment.getUserLogin()); + if (commentService.canEditOrDelete(comment)) { + result.addUpdatableComment(comment.getKey()); + } + } + } + } + + private void loadActionPlans(Collector collector, DbSession dbSession, SearchResponseData result) { + if (collector.contains(ACTION_PLANS)) { + result.setActionPlans(dbClient.actionPlanDao().selectByKeys(dbSession, collector.<String>get(ACTION_PLANS))); + } + } + + private void loadRules(Collector collector, DbSession dbSession, SearchResponseData result) { + if (collector.contains(RULES)) { + result.setRules(dbClient.ruleDao().selectByKeys(dbSession, collector.<RuleKey>get(RULES))); + } + } + + private void loadComponents(Collector collector, DbSession dbSession, SearchResponseData result) { + // always load components and projects, because some issue fields still relate to component ids/keys. + // They should be dropped but are kept for backward-compatibility (see SearchResponseFormat) + result.addComponents(dbClient.componentDao().selectByUuids(dbSession, collector.getComponentUuids())); + result.addComponents(dbClient.componentDao().selectSubProjectsByComponentUuids(dbSession, collector.getComponentUuids())); + for (ComponentDto component : result.getComponents()) { + collector.addProjectUuid(component.projectUuid()); + } + List<ComponentDto> projects = dbClient.componentDao().selectByUuids(dbSession, collector.getProjectUuids()); + result.addComponents(projects); + } + + private void loadActionsAndTransitions(Collector collector, SearchResponseData result) { + if (collector.contains(ACTIONS) || collector.contains(TRANSITIONS)) { + for (IssueDto dto : result.getIssues()) { + // so that IssueDto can be used. + if (collector.contains(ACTIONS)) { + result.addActions(dto.getKey(), actionService.listAvailableActions(dto)); + } + if (collector.contains(TRANSITIONS)) { + // TODO workflow and action engines must not depend on org.sonar.api.issue.Issue but on a generic interface + DefaultIssue issue = dto.toDefaultIssue(); + result.addTransitions(issue.key(), issueService.listTransitions(issue)); + } + } + } + } + + private void completeTotalDebtFromFacet(@Nullable Facets facets, SearchResponseData result) { + if (facets != null) { + Map<String, Long> debtFacet = facets.get(IssueIndex.DEBT_AGGREGATION_NAME); + if (debtFacet != null) { + result.setDebtTotal(debtFacet.get(Facets.TOTAL)); + } + } + } + + /** + * Collects the keys of all the data to be loaded (users, rules, ...) + */ + public static class Collector { + private final EnumSet<SearchAdditionalField> fields; + private final SetMultimap<SearchAdditionalField, Object> fieldValues = MultimapBuilder.enumKeys(SearchAdditionalField.class).hashSetValues().build(); + private final Set<String> componentUuids = new HashSet<>(); + private final Set<String> projectUuids = new HashSet<>(); + private final List<String> issueKeys; + + public Collector(EnumSet<SearchAdditionalField> fields, List<String> issueKeys) { + this.fields = fields; + this.issueKeys = issueKeys; + } + + void collect(List<IssueDto> issues) { + for (IssueDto issue : issues) { + componentUuids.add(issue.getComponentUuid()); + projectUuids.add(issue.getProjectUuid()); + add(ACTION_PLANS, issue.getActionPlanKey()); + add(RULES, issue.getRuleKey()); + add(USERS, issue.getReporter()); + add(USERS, issue.getAssignee()); + } + } + + public void add(SearchAdditionalField key, @Nullable Object value) { + if (value != null) { + fieldValues.put(key, value); + } + } + + public void addComponentUuid(String uuid) { + this.componentUuids.add(uuid); + } + + public void addComponentUuids(@Nullable Collection<String> uuids) { + if (uuids != null) { + this.componentUuids.addAll(uuids); + } + } + + public void addProjectUuid(String uuid) { + this.projectUuids.add(uuid); + } + + public void addProjectUuids(@Nullable Collection<String> uuids) { + if (uuids != null) { + this.projectUuids.addAll(uuids); + } + } + + public void addAll(SearchAdditionalField key, @Nullable Iterable values) { + if (values != null) { + for (Object value : values) { + add(key, value); + } + } + } + + <T> List<T> get(SearchAdditionalField key) { + return newArrayList((Set<T>) fieldValues.get(key)); + } + + boolean contains(SearchAdditionalField field) { + return fields.contains(field); + } + + public List<String> getIssueKeys() { + return issueKeys; + } + + public Set<String> getComponentUuids() { + return componentUuids; + } + + public Set<String> getProjectUuids() { + return projectUuids; + } + } +} diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java index b79fb1fba47..b4e68e63bb3 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java @@ -158,6 +158,8 @@ import org.sonar.server.issue.ws.IssueActionsWriter; import org.sonar.server.issue.ws.IssueComponentHelper; import org.sonar.server.issue.ws.IssueJsonWriter; import org.sonar.server.issue.ws.IssuesWs; +import org.sonar.server.issue.ws.SearchResponseFormat; +import org.sonar.server.issue.ws.SearchResponseLoader; import org.sonar.server.issue.ws.SetTagsAction; import org.sonar.server.language.ws.LanguageWs; import org.sonar.server.measure.MeasureFilterEngine; @@ -321,6 +323,7 @@ import org.sonar.server.view.index.ViewIndexDefinition; import org.sonar.server.view.index.ViewIndexer; import org.sonar.server.ws.ListingWs; import org.sonar.server.ws.WebServiceEngine; +import org.sonar.server.ws.WsResponseCommonFormat; public class PlatformLevel4 extends PlatformLevel { @@ -602,8 +605,12 @@ public class PlatformLevel4 extends PlatformLevel { IssuesWs.class, IssueJsonWriter.class, IssueComponentHelper.class, + WsResponseCommonFormat.class, + SearchResponseLoader.class, + SearchResponseFormat.class, org.sonar.server.issue.ws.ShowAction.class, org.sonar.server.issue.ws.SearchAction.class, + org.sonar.server.issue.ws.Search2Action.class, org.sonar.server.issue.ws.TagsAction.class, SetTagsAction.class, ComponentTagsAction.class, diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/ListAction.java b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/ListAction.java index 52be58caef3..ffef9a8e601 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/ListAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/ListAction.java @@ -31,6 +31,8 @@ import org.sonar.db.rule.RuleDto; import org.sonar.server.plugins.MimeTypes; import org.sonarqube.ws.Rules.ListResponse; +import static com.google.common.base.Strings.nullToEmpty; + public class ListAction implements RulesWsAction { private final DbClient dbClient; @@ -62,11 +64,9 @@ public class ListAction implements RulesWsAction { ruleBuilder .clear() .setRepository(dto.getRepositoryKey()) - .setKey(dto.getRuleKey()); - String internalKey = dto.getConfigKey(); - if (!Strings.isNullOrEmpty(internalKey)) { - ruleBuilder.setInternalKey(internalKey); - } + .setKey(dto.getRuleKey()) + .setName(nullToEmpty(dto.getName())) + .setInternalKey(nullToEmpty(dto.getConfigKey())); listResponseBuilder.addRules(ruleBuilder.build()); } }); diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/WsResponseCommonFormat.java b/server/sonar-server/src/main/java/org/sonar/server/ws/WsResponseCommonFormat.java new file mode 100644 index 00000000000..04fc387b615 --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/ws/WsResponseCommonFormat.java @@ -0,0 +1,111 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.server.ws; + +import com.google.common.base.Strings; +import org.sonar.api.resources.Language; +import org.sonar.api.resources.Languages; +import org.sonar.api.utils.Paging; +import org.sonar.db.component.ComponentDto; +import org.sonar.db.rule.RuleDto; +import org.sonar.db.user.UserDto; +import org.sonar.markdown.Markdown; +import org.sonarqube.ws.Common; + +import static com.google.common.base.Strings.nullToEmpty; +import static java.lang.String.format; + +public class WsResponseCommonFormat { + + private final Languages languages; + + public WsResponseCommonFormat(Languages languages) { + this.languages = languages; + } + + public Common.Paging.Builder formatPaging(Paging paging) { + return Common.Paging.newBuilder() + .setPageIndex(paging.pageIndex()) + .setPages(paging.pages()) + .setPageSize(paging.pageSize()) + .setTotal(paging.total()); + } + + public Common.Rule.Builder formatRule(RuleDto rule) { + Common.Rule.Builder builder = Common.Rule.newBuilder() + .setKey(rule.getKey().toString()) + .setDesc(nullToEmpty(rule.getDescription())) + .setStatus(Common.RuleStatus.valueOf(rule.getStatus().name())); + + builder.setLang(nullToEmpty(rule.getLanguage())); + Language lang = languages.get(rule.getLanguage()); + if (lang != null) { + builder.setLangName(lang.getName()); + } + + String desc = rule.getDescription(); + if (desc != null) { + switch (rule.getDescriptionFormat()) { + case HTML: + builder.setDesc(desc); + break; + case MARKDOWN: + builder.setDesc(Markdown.convertToHtml(desc)); + break; + default: + throw new IllegalArgumentException(format("Unknown description format '%s' on rule '%s'", rule.getDescriptionFormat(), rule.getKey())); + } + } + return builder; + } + + public Common.Component.Builder formatComponent(ComponentDto dto) { + Common.Component.Builder builder = Common.Component.newBuilder() + .setId(dto.uuid()) + .setKey(dto.key()) + .setQualifier(dto.qualifier()) + .setName(nullToEmpty(dto.name())) + .setLongName(nullToEmpty(dto.longName())) + .setEnabled(dto.isEnabled()); + String path = dto.path(); + // path is not applicable to the components that are not files. + // Value must not be "" in this case. + if (!Strings.isNullOrEmpty(path)) { + builder.setPath(path); + } + + // On a root project, parentProjectId is null but projectId is equal to itself, which make no sense. + if (dto.projectUuid() != null && dto.parentProjectId() != null) { + builder.setProject(dto.projectUuid()); + } + if (dto.parentProjectId() != null) { + builder.setSubProject(dto.moduleUuid()); + } + return builder; + } + + public Common.User.Builder formatUser(UserDto user) { + return Common.User.newBuilder() + .setLogin(user.getLogin()) + .setName(nullToEmpty(user.getName())) + .setEmail(nullToEmpty(user.getEmail())) + .setActive(user.isActive()); + } +} diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/WsUtils.java b/server/sonar-server/src/main/java/org/sonar/server/ws/WsUtils.java new file mode 100644 index 00000000000..a075735b391 --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/ws/WsUtils.java @@ -0,0 +1,54 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.server.ws; + +import com.google.protobuf.Message; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import org.apache.commons.io.IOUtils; +import org.sonar.api.server.ws.Request; +import org.sonar.api.server.ws.Response; +import org.sonar.api.utils.text.JsonWriter; +import org.sonar.core.util.ProtobufJsonFormat; +import org.sonar.server.plugins.MimeTypes; + +public class WsUtils { + + private WsUtils() { + // only statics + } + + public static void writeProtobuf(Message msg, Request request, Response response) throws Exception { + OutputStream output = response.stream().output(); + try { + if (request.getMediaType().equals(MimeTypes.PROTOBUF)) { + response.stream().setMediaType(MimeTypes.PROTOBUF); + msg.writeTo(output); + } else { + response.stream().setMediaType(MimeTypes.JSON); + try (OutputStreamWriter writer = new OutputStreamWriter(output)) { + ProtobufJsonFormat.write(msg, JsonWriter.of(writer)); + } + } + } finally { + IOUtils.closeQuietly(output); + } + } +} diff --git a/server/sonar-server/src/main/protobuf/ws-rules.proto b/server/sonar-server/src/main/protobuf/ws-rules.proto deleted file mode 100644 index 43a04956ebb..00000000000 --- a/server/sonar-server/src/main/protobuf/ws-rules.proto +++ /dev/null @@ -1,39 +0,0 @@ -// SonarQube, open source software quality management tool. -// Copyright (C) 2008-2015 SonarSource -// mailto:contact AT sonarsource DOT com -// -// SonarQube is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 3 of the License, or (at your option) any later version. -// -// SonarQube is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -syntax = "proto2"; - -package sonarqube.ws.rules; - -option java_package = "org.sonarqube.ws"; -option java_outer_classname = "Rules"; -option optimize_for = SPEED; - -// WS api/rules/list for internal use only -message ListResponse { - - message Rule { - optional string repository = 1; - optional string key = 2; - optional string internal_key = 3; - optional string name = 4; - } - - repeated Rule rules = 1; - -} diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ActionServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ActionServiceTest.java deleted file mode 100644 index 85f01b75a75..00000000000 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ActionServiceTest.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.sonar.server.issue; - -import java.util.List; -import org.junit.Before; -import org.junit.Test; -import org.sonar.api.component.Component; -import org.sonar.api.config.Settings; -import org.sonar.api.issue.Issue; -import org.sonar.api.issue.action.Actions; -import org.sonar.api.issue.action.Function; -import org.sonar.api.issue.condition.Condition; -import org.sonar.core.issue.DefaultIssue; -import org.sonar.core.issue.IssueChangeContext; -import org.sonar.core.issue.IssueUpdater; -import org.sonar.db.DbClient; -import org.sonar.db.DbSession; -import org.sonar.db.component.ComponentDao; -import org.sonar.db.component.ComponentDto; -import org.sonar.db.issue.IssueDto; -import org.sonar.db.property.PropertiesDao; -import org.sonar.db.property.PropertyDto; -import org.sonar.db.rule.RuleTesting; -import org.sonar.server.component.ComponentTesting; -import org.sonar.server.user.ThreadLocalUserSession; -import org.sonar.server.user.UserSession; - -import static com.google.common.collect.Lists.newArrayList; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.fail; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.anyString; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.verifyZeroInteractions; -import static org.mockito.Mockito.when; - -public class ActionServiceTest { - - DbClient dbClient; - DbSession session; - - ComponentDao componentDao; - IssueService issueService; - IssueStorage issueStorage; - IssueUpdater updater; - PropertiesDao propertiesDao; - Settings settings; - Actions actions; - ActionService actionService; - - IssueDto issue; - - @Before - public void before() { - dbClient = mock(DbClient.class); - session = mock(DbSession.class); - when(dbClient.openSession(false)).thenReturn(session); - - componentDao = mock(ComponentDao.class); - when(dbClient.componentDao()).thenReturn(componentDao); - issueService = mock(IssueService.class); - issueStorage = mock(IssueStorage.class); - updater = mock(IssueUpdater.class); - propertiesDao = mock(PropertiesDao.class); - settings = new Settings(); - actions = new Actions(); - - ComponentDto project = ComponentTesting.newProjectDto(); - issue = IssueTesting.newDto(RuleTesting.newXooX1().setId(10), ComponentTesting.newFileDto(project), project).setKee("ABCD"); - - actionService = new ActionService(dbClient, issueService, issueStorage, updater, settings, propertiesDao, actions); - } - - @Test - public void execute_functions() { - Function function1 = mock(Function.class); - Function function2 = mock(Function.class); - - when(componentDao.selectOrFailByKey(eq(session), anyString())).thenReturn(mock(ComponentDto.class)); - when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issue); - - actions.add("link-to-jira").setConditions(new AlwaysMatch()).setFunctions(function1, function2); - - assertThat(actionService.execute("ABCD", "link-to-jira", mock(ThreadLocalUserSession.class))).isNotNull(); - - verify(function1).execute(any(Function.Context.class)); - verify(function2).execute(any(Function.Context.class)); - verifyNoMoreInteractions(function1, function2); - } - - @Test - public void modify_issue_when_executing_a_function() { - Function function = new TweetFunction(); - - UserSession userSession = mock(ThreadLocalUserSession.class); - when(userSession.getLogin()).thenReturn("arthur"); - - when(componentDao.selectOrFailByKey(eq(session), anyString())).thenReturn(mock(ComponentDto.class)); - when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issue); - - actions.add("link-to-jira").setConditions(new AlwaysMatch()).setFunctions(function); - assertThat(actionService.execute("ABCD", "link-to-jira", userSession)).isNotNull(); - - verify(updater).addComment(any(DefaultIssue.class), eq("New tweet on issue ABCD"), any(IssueChangeContext.class)); - verify(updater).setAttribute(any(DefaultIssue.class), eq("tweet"), eq("tweet sent"), any(IssueChangeContext.class)); - } - - @Test - public void inject_project_settings_when_executing_a_function() { - Function function = new TweetFunction(); - - UserSession userSession = mock(ThreadLocalUserSession.class); - when(userSession.getLogin()).thenReturn("arthur"); - - when(componentDao.selectOrFailByKey(session, "struts")).thenReturn(new ComponentDto().setKey("struts")); - when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issue.setProjectKey("struts")); - - actions.add("link-to-jira").setConditions(new AlwaysMatch()).setFunctions(function); - assertThat(actionService.execute("ABCD", "link-to-jira", userSession)).isNotNull(); - - verify(propertiesDao).selectProjectProperties(eq("struts")); - } - - @Test - public void not_execute_function_if_action_not_found() { - Function function = mock(Function.class); - - when(componentDao.selectOrFailByKey(eq(session), anyString())).thenReturn(mock(ComponentDto.class)); - when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issue); - - actions.add("link-to-jira").setConditions(new AlwaysMatch()).setFunctions(function); - try { - actionService.execute("ABCD", "tweet", mock(ThreadLocalUserSession.class)); - fail(); - } catch (Exception e) { - assertThat(e).isInstanceOf(IllegalArgumentException.class).hasMessage("Action is not found : tweet"); - } - verifyZeroInteractions(function); - } - - @Test - public void not_execute_function_if_action_is_not_supported() { - Function function = mock(Function.class); - - when(componentDao.selectOrFailByKey(eq(session), anyString())).thenReturn(mock(ComponentDto.class)); - when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issue); - - actions.add("link-to-jira").setConditions(new NeverMatch()).setFunctions(function); - try { - actionService.execute("ABCD", "link-to-jira", mock(ThreadLocalUserSession.class)); - fail(); - } catch (Exception e) { - assertThat(e).isInstanceOf(IllegalStateException.class).hasMessage("A condition is not respected"); - } - verifyZeroInteractions(function); - } - - @Test - public void list_available_supported_actions() { - when(componentDao.selectOrFailByKey(eq(session), anyString())).thenReturn(mock(ComponentDto.class)); - when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issue); - - actions.add("link-to-jira").setConditions(new AlwaysMatch()); - actions.add("tweet").setConditions(new NeverMatch()); - assertThat(actionService.listAvailableActions("ABCD")).hasSize(1); - } - - @Test - public void return_no_action() { - when(componentDao.selectOrFailByKey(eq(session), anyString())).thenReturn(mock(ComponentDto.class)); - when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issue); - - assertThat(actionService.listAvailableActions("ABCD")).isEmpty(); - } - - @Test - public void get_project_settings() { - Component project = mock(Component.class); - when(project.key()).thenReturn("struts"); - - // Global property - settings.appendProperty("sonar.core.version", "3.6"); - - // Project property - List<PropertyDto> projectProperties = newArrayList(new PropertyDto().setKey("sonar.jira.project.key").setValue("STRUTS")); - when(propertiesDao.selectProjectProperties("struts")).thenReturn(projectProperties); - - Settings result = actionService.getProjectSettings(project); - assertThat(result).isNotNull(); - assertThat(result.hasKey("sonar.core.version")).isTrue(); - assertThat(result.hasKey("sonar.jira.project.key")).isTrue(); - } - - @Test - public void list_all_actions() { - actions.add("link-to-jira").setConditions(new AlwaysMatch()); - assertThat(actionService.listAllActions()).hasSize(1); - } - - public class AlwaysMatch implements Condition { - @Override - public boolean matches(Issue issue) { - return true; - } - } - - public class NeverMatch implements Condition { - @Override - public boolean matches(Issue issue) { - return false; - } - } - - public class TweetFunction implements Function { - @Override - public void execute(Context context) { - context.addComment("New tweet on issue " + context.issue().key()); - context.setAttribute("tweet", "tweet sent"); - } - } -} diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java index bde40d2a12a..51022792640 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java @@ -159,16 +159,6 @@ public class InternalRubyIssueServiceTest { } @Test - public void list_plugin_actions() { - Action action = mock(Action.class); - when(action.key()).thenReturn("link-to-jira"); - - when(actionService.listAllActions()).thenReturn(newArrayList(action)); - - assertThat(service.listPluginActions()).containsOnly("link-to-jira"); - } - - @Test public void find_comments_by_issue_key() { service.findComments("ABCD"); verify(commentService).findComments("ABCD"); diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceMediumTest.java index 96bb512ae24..2834e980860 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceMediumTest.java @@ -114,7 +114,7 @@ public class IssueCommentServiceMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - service.addComment(issue.getKey(), "my comment", userSessionRule); + service.addComment(issue.getKey(), "my comment"); List<DefaultIssueComment> comments = service.findComments(issue.getKey()); assertThat(comments).hasSize(1); @@ -131,7 +131,7 @@ public class IssueCommentServiceMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - service.addComment(issue.getKey(), "my comment", userSessionRule); + service.addComment(issue.getKey(), "my comment"); List<DefaultIssueComment> comments = service.findComments(issue.getKey()); assertThat(comments).hasSize(1); diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceTest.java index 45881b463cf..daa60c94211 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceTest.java @@ -88,7 +88,7 @@ public class IssueCommentServiceTest { when(dbClient.openSession(false)).thenReturn(session); when(dbClient.issueChangeDao()).thenReturn(changeDao); - issueCommentService = new IssueCommentService(dbClient, issueService, updater); + issueCommentService = new IssueCommentService(dbClient, issueService, updater, userSessionRule); } @Test @@ -109,7 +109,7 @@ public class IssueCommentServiceTest { when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issueDto); when(issueCommentService.findComments(session, "ABCD")).thenReturn(newArrayList(new DefaultIssueComment())); - issueCommentService.addComment("ABCD", "my comment", userSessionRule); + issueCommentService.addComment("ABCD", "my comment"); verify(updater).addComment(eq(issueDto.toDefaultIssue()), eq("my comment"), any(IssueChangeContext.class)); verify(issueService).saveIssue(eq(session), eq(issueDto.toDefaultIssue()), any(IssueChangeContext.class), eq("my comment")); @@ -120,7 +120,7 @@ public class IssueCommentServiceTest { throwable.expect(UnauthorizedException.class); userSessionRule.anonymous(); - issueCommentService.addComment("myIssue", "my comment", userSessionRule); + issueCommentService.addComment("myIssue", "my comment"); verify(updater, never()).addComment(any(DefaultIssue.class), anyString(), any(IssueChangeContext.class)); verifyZeroInteractions(issueService); @@ -130,7 +130,7 @@ public class IssueCommentServiceTest { public void should_prevent_adding_empty_comment() { throwable.expect(BadRequestException.class); - issueCommentService.addComment("myIssue", " ", userSessionRule); + issueCommentService.addComment("myIssue", " "); verify(updater, never()).addComment(any(DefaultIssue.class), anyString(), any(IssueChangeContext.class)); verifyZeroInteractions(issueService); @@ -140,7 +140,7 @@ public class IssueCommentServiceTest { public void should_prevent_adding_null_comment() { throwable.expect(BadRequestException.class); - issueCommentService.addComment("myIssue", null, userSessionRule); + issueCommentService.addComment("myIssue", null); verify(updater, never()).addComment(any(DefaultIssue.class), anyString(), any(IssueChangeContext.class)); verifyZeroInteractions(issueService); @@ -154,7 +154,7 @@ public class IssueCommentServiceTest { when(issueCommentService.findComments(session, "ABCD")).thenReturn(Collections.<DefaultIssueComment>emptyList()); try { - issueCommentService.addComment("ABCD", "my comment", userSessionRule); + issueCommentService.addComment("ABCD", "my comment"); fail(); } catch (Exception e) { assertThat(e).isInstanceOf(BadRequestException.class).hasMessage("Fail to add a comment on issue ABCD"); @@ -165,7 +165,7 @@ public class IssueCommentServiceTest { public void should_delete_comment() { when(changeDao.selectCommentByKey("ABCD")).thenReturn(new DefaultIssueComment().setUserLogin("admin").setIssueKey("EFGH")); - issueCommentService.deleteComment("ABCD", userSessionRule); + issueCommentService.deleteComment("ABCD"); verify(changeDao).delete("ABCD"); verify(issueService).getByKey("EFGH"); @@ -177,7 +177,7 @@ public class IssueCommentServiceTest { when(changeDao.selectCommentByKey("ABCD")).thenReturn(null); - issueCommentService.deleteComment("ABCD", userSessionRule); + issueCommentService.deleteComment("ABCD"); verify(changeDao, never()).delete(anyString()); } @@ -188,7 +188,7 @@ public class IssueCommentServiceTest { when(changeDao.selectCommentByKey("ABCD")).thenReturn(new DefaultIssueComment().setUserLogin("julien")); - issueCommentService.deleteComment("ABCD", userSessionRule); + issueCommentService.deleteComment("ABCD"); verify(changeDao, never()).delete(anyString()); } @@ -197,7 +197,7 @@ public class IssueCommentServiceTest { public void should_update_comment() { when(changeDao.selectCommentByKey("ABCD")).thenReturn(new DefaultIssueComment().setIssueKey("EFGH").setUserLogin("admin")); - issueCommentService.editComment("ABCD", "updated comment", userSessionRule); + issueCommentService.editComment("ABCD", "updated comment"); verify(changeDao).update(any(IssueChangeDto.class)); verify(issueService).getByKey("EFGH"); @@ -209,7 +209,7 @@ public class IssueCommentServiceTest { when(changeDao.selectCommentByKey("ABCD")).thenReturn(null); - issueCommentService.editComment("ABCD", "updated comment", userSessionRule); + issueCommentService.editComment("ABCD", "updated comment"); verify(changeDao, never()).update(any(IssueChangeDto.class)); } @@ -218,7 +218,7 @@ public class IssueCommentServiceTest { public void should_prevent_updating_empty_comment() { throwable.expect(BadRequestException.class); - issueCommentService.editComment("ABCD", "", userSessionRule); + issueCommentService.editComment("ABCD", ""); verify(changeDao, never()).update(any(IssueChangeDto.class)); } @@ -227,7 +227,7 @@ public class IssueCommentServiceTest { public void should_prevent_updating_null_comment() { throwable.expect(BadRequestException.class); - issueCommentService.editComment("ABCD", null, userSessionRule); + issueCommentService.editComment("ABCD", null); verify(changeDao, never()).update(any(IssueChangeDto.class)); } @@ -238,7 +238,7 @@ public class IssueCommentServiceTest { when(changeDao.selectCommentByKey("ABCD")).thenReturn(new DefaultIssueComment().setUserLogin("julien")); - issueCommentService.editComment("ABCD", "updated comment", userSessionRule); + issueCommentService.editComment("ABCD", "updated comment"); verify(changeDao, never()).update(any(IssueChangeDto.class)); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueServiceMediumTest.java index 7e6004f5be6..82d29ebb5a8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueServiceMediumTest.java @@ -59,6 +59,7 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.issue.index.IssueDoc; import org.sonar.server.issue.index.IssueIndex; +import org.sonar.server.issue.index.IssueIndexDefinition; import org.sonar.server.issue.index.IssueIndexer; import org.sonar.server.permission.PermissionService; import org.sonar.server.permission.PermissionChange; @@ -478,7 +479,7 @@ public class IssueServiceMediumTest { ComponentDto file = newFile(project); saveIssue(IssueTesting.newDto(rule, file, project)); - List<IssueDoc> result = service.search(IssueQuery.builder(userSessionRule).build(), new SearchOptions()).getDocs(); + List<IssueDoc> result = service.search(IssueQuery.builder(userSessionRule).build(), new SearchOptions().addFields(IssueIndexDefinition.FIELD_ISSUE_KEY)).getDocs(); assertThat(result).hasSize(1); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueActionsWriterTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueActionsWriterTest.java index d80a5470154..7e9eb3d2d57 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueActionsWriterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueActionsWriterTest.java @@ -28,11 +28,10 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.sonar.api.issue.Issue; -import org.sonar.api.issue.action.Action; -import org.sonar.core.issue.DefaultIssue; import org.sonar.api.rule.RuleKey; import org.sonar.api.utils.text.JsonWriter; import org.sonar.api.web.UserRole; +import org.sonar.core.issue.DefaultIssue; import org.sonar.core.issue.workflow.Transition; import org.sonar.server.issue.ActionService; import org.sonar.server.issue.IssueService; @@ -41,7 +40,6 @@ import org.sonar.test.JsonAssert; import static com.google.common.collect.Lists.newArrayList; import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) @@ -82,26 +80,6 @@ public class IssueActionsWriterTest { } @Test - public void write_plugin_actions() { - Issue issue = new DefaultIssue() - .setKey("ABCD") - .setComponentKey("sample:src/main/xoo/sample/Sample.xoo") - .setProjectKey("sample") - .setRuleKey(RuleKey.of("squid", "AvoidCycle")); - - userSessionRule.login("john"); - Action action = mock(Action.class); - when(action.key()).thenReturn("link-to-jira"); - when(actionService.listAvailableActions(eq(issue))).thenReturn(newArrayList(action)); - - testActions(issue, - "{\"actions\": " + - "[" + - "\"comment\", \"assign\", \"set_tags\", \"assign_to_me\", \"plan\", \"link-to-jira\"\n" + - "]}"); - } - - @Test public void write_only_comment_action() { Issue issue = new DefaultIssue() .setKey("ABCD") diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsMediumTest.java index f43c95315dd..c14fe737f41 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsMediumTest.java @@ -43,8 +43,8 @@ import org.sonar.server.component.ComponentTesting; import org.sonar.server.issue.IssueTesting; import org.sonar.server.issue.filter.IssueFilterParameters; import org.sonar.server.issue.index.IssueIndexer; -import org.sonar.server.permission.PermissionService; import org.sonar.server.permission.PermissionChange; +import org.sonar.server.permission.PermissionService; import org.sonar.server.rule.db.RuleDao; import org.sonar.server.tester.ServerTester; import org.sonar.server.tester.UserSessionRule; @@ -83,9 +83,9 @@ public class SearchActionComponentsMediumTest { @Test public void issues_on_different_projects() throws Exception { RuleDto rule = newRule(); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent")); IssueDto issue = IssueTesting.newDto(rule, file, project) .setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2") .setStatus("OPEN").setResolution("OPEN") @@ -94,9 +94,9 @@ public class SearchActionComponentsMediumTest { .setIssueUpdateDate(DateUtils.parseDateTime("2017-12-04T00:00:00+0100")); db.issueDao().insert(session, issue); - ComponentDto project2 = insertComponent(ComponentTesting.newProjectDto("DBCA").setKey("MyProject2")); + ComponentDto project2 = insertComponent(ComponentTesting.newProjectDto("P2").setKey("MyProject2")); setDefaultProjectPermission(project2); - ComponentDto file2 = insertComponent(ComponentTesting.newFileDto(project2, "EDCB").setKey("MyComponent2")); + ComponentDto file2 = insertComponent(ComponentTesting.newFileDto(project2, "F2").setKey("MyComponent2")); IssueDto issue2 = IssueTesting.newDto(rule, file2, project2) .setKee("92fd47d4-b650-4037-80bc-7b112bd4eac2") .setStatus("OPEN").setResolution("OPEN") @@ -107,36 +107,36 @@ public class SearchActionComponentsMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION).execute(); + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION).execute(); result.assertJson(this.getClass(), "issues_on_different_projects.json"); } @Test public void search_by_project_uuid() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent")); IssueDto issue = IssueTesting.newDto(newRule(), file, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2"); db.issueDao().insert(session, issue); session.commit(); tester.get(IssueIndexer.class).indexAll(); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.PROJECT_UUIDS, project.uuid()) .execute() .assertJson(this.getClass(), "search_by_project_uuid.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.PROJECT_UUIDS, "unknown") .execute() .assertJson(this.getClass(), "no_issue.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, project.uuid()) .execute() .assertJson(this.getClass(), "search_by_project_uuid.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, "unknown") .execute() .assertJson(this.getClass(), "no_issue.json"); @@ -144,15 +144,15 @@ public class SearchActionComponentsMediumTest { @Test public void project_facet_is_sticky() throws Exception { - ComponentDto project1 = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject1")); - ComponentDto project2 = insertComponent(ComponentTesting.newProjectDto("BCDE").setKey("MyProject2")); - ComponentDto project3 = insertComponent(ComponentTesting.newProjectDto("CDEF").setKey("MyProject3")); + ComponentDto project1 = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject1")); + ComponentDto project2 = insertComponent(ComponentTesting.newProjectDto("P2").setKey("MyProject2")); + ComponentDto project3 = insertComponent(ComponentTesting.newProjectDto("P3").setKey("MyProject3")); setDefaultProjectPermission(project1); setDefaultProjectPermission(project2); setDefaultProjectPermission(project3); - ComponentDto file1 = insertComponent(ComponentTesting.newFileDto(project1, "FEDC").setKey("MyComponent1")); - ComponentDto file2 = insertComponent(ComponentTesting.newFileDto(project2, "EDCB").setKey("MyComponent2")); - ComponentDto file3 = insertComponent(ComponentTesting.newFileDto(project3, "DCBA").setKey("MyComponent3")); + ComponentDto file1 = insertComponent(ComponentTesting.newFileDto(project1, "F1").setKey("MyComponent1")); + ComponentDto file2 = insertComponent(ComponentTesting.newFileDto(project2, "F2").setKey("MyComponent2")); + ComponentDto file3 = insertComponent(ComponentTesting.newFileDto(project3, "F3").setKey("MyComponent3")); RuleDto rule = newRule(); IssueDto issue1 = IssueTesting.newDto(rule, file1, project1).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2"); IssueDto issue2 = IssueTesting.newDto(rule, file2, project2).setKee("2bd4eac2-b650-4037-80bc-7b1182fd47d4"); @@ -161,7 +161,7 @@ public class SearchActionComponentsMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.PROJECT_UUIDS, project1.uuid()) .setParam(WebService.Param.FACETS, "projectUuids") .execute() @@ -170,30 +170,30 @@ public class SearchActionComponentsMediumTest { @Test public void search_by_file_uuid() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent")); IssueDto issue = IssueTesting.newDto(newRule(), file, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2"); db.issueDao().insert(session, issue); session.commit(); tester.get(IssueIndexer.class).indexAll(); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.FILE_UUIDS, file.uuid()) .execute() .assertJson(this.getClass(), "search_by_file_uuid.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.FILE_UUIDS, "unknown") .execute() .assertJson(this.getClass(), "no_issue.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, file.uuid()) .execute() .assertJson(this.getClass(), "search_by_file_uuid.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, "unknown") .execute() .assertJson(this.getClass(), "no_issue.json"); @@ -201,10 +201,10 @@ public class SearchActionComponentsMediumTest { @Test public void search_by_file_key() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); - ComponentDto unitTest = insertComponent(ComponentTesting.newFileDto(project, "CDEF").setQualifier(Qualifiers.UNIT_TEST_FILE).setKey("MyComponentTest")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent")); + ComponentDto unitTest = insertComponent(ComponentTesting.newFileDto(project, "F2").setQualifier(Qualifiers.UNIT_TEST_FILE).setKey("MyComponentTest")); RuleDto rule = newRule(); IssueDto issueOnFile = IssueTesting.newDto(rule, file, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2"); IssueDto issueOnTest = IssueTesting.newDto(rule, unitTest, project).setKee("2bd4eac2-b650-4037-80bc-7b1182fd47d4"); @@ -212,12 +212,12 @@ public class SearchActionComponentsMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENTS, file.key()) .execute() .assertJson(this.getClass(), "search_by_file_key.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENTS, unitTest.key()) .execute() .assertJson(this.getClass(), "search_by_test_key.json"); @@ -226,11 +226,11 @@ public class SearchActionComponentsMediumTest { @Test public void display_file_facet() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file1 = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent1")); - ComponentDto file2 = insertComponent(ComponentTesting.newFileDto(project, "CDEF").setKey("MyComponent2")); - ComponentDto file3 = insertComponent(ComponentTesting.newFileDto(project, "DEFA").setKey("MyComponent3")); + ComponentDto file1 = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent1")); + ComponentDto file2 = insertComponent(ComponentTesting.newFileDto(project, "F2").setKey("MyComponent2")); + ComponentDto file3 = insertComponent(ComponentTesting.newFileDto(project, "F3").setKey("MyComponent3")); RuleDto newRule = newRule(); IssueDto issue1 = IssueTesting.newDto(newRule, file1, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2"); IssueDto issue2 = IssueTesting.newDto(newRule, file2, project).setKee("2bd4eac2-b650-4037-80bc-7b1182fd47d4"); @@ -238,7 +238,7 @@ public class SearchActionComponentsMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, project.uuid()) .setParam(IssueFilterParameters.FILE_UUIDS, file1.uuid() + "," + file3.uuid()) .setParam(WebService.Param.FACETS, "fileUuids") @@ -248,31 +248,31 @@ public class SearchActionComponentsMediumTest { @Test public void search_by_directory_path() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto directory = insertComponent(ComponentTesting.newDirectory(project, "src/main/java/dir")); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent").setPath(directory.path() + "/MyComponent.java")); + ComponentDto directory = insertComponent(ComponentTesting.newDirectory(project, "D1", "src/main/java/dir")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent").setPath(directory.path() + "/MyComponent.java")); IssueDto issue = IssueTesting.newDto(newRule(), file, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2"); db.issueDao().insert(session, issue); session.commit(); tester.get(IssueIndexer.class).indexAll(); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, directory.uuid()) .execute() .assertJson(this.getClass(), "search_by_file_uuid.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, "unknown") .execute() .assertJson(this.getClass(), "no_issue.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java/dir") .execute() .assertJson(this.getClass(), "search_by_file_uuid.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java") .execute() .assertJson(this.getClass(), "no_issue.json"); @@ -280,14 +280,14 @@ public class SearchActionComponentsMediumTest { @Test public void search_by_directory_path_in_different_modules() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto module1 = insertComponent(ComponentTesting.newModuleDto(project).setKey("module1")); - ComponentDto module2 = insertComponent(ComponentTesting.newModuleDto(project).setKey("module2")); - ComponentDto directory1 = insertComponent(ComponentTesting.newDirectory(module1, "src/main/java/dir")); - ComponentDto directory2 = insertComponent(ComponentTesting.newDirectory(module2, "src/main/java/dir")); - ComponentDto file1 = insertComponent(ComponentTesting.newFileDto(module1, "BCDE").setKey("module1:MyComponent").setPath(directory1.path() + "/MyComponent.java")); - insertComponent(ComponentTesting.newFileDto(module2, "CDEF").setKey("module2:MyComponent").setPath(directory2.path() + "/MyComponent.java")); + ComponentDto module1 = insertComponent(ComponentTesting.newModuleDto("M1", project).setKey("module1")); + ComponentDto module2 = insertComponent(ComponentTesting.newModuleDto("M2", project).setKey("module2")); + ComponentDto directory1 = insertComponent(ComponentTesting.newDirectory(module1, "D1", "src/main/java/dir")); + ComponentDto directory2 = insertComponent(ComponentTesting.newDirectory(module2, "D2", "src/main/java/dir")); + ComponentDto file1 = insertComponent(ComponentTesting.newFileDto(module1, "F1").setKey("module1:MyComponent").setPath(directory1.path() + "/MyComponent.java")); + insertComponent(ComponentTesting.newFileDto(module2, "F2").setKey("module2:MyComponent").setPath(directory2.path() + "/MyComponent.java")); RuleDto rule = newRule(); IssueDto issue1 = IssueTesting.newDto(rule, file1, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2"); db.issueDao().insert(session, issue1); @@ -295,34 +295,34 @@ public class SearchActionComponentsMediumTest { tester.get(IssueIndexer.class).indexAll(); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, directory1.uuid()) .execute() .assertJson(this.getClass(), "search_by_directory_uuid.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, directory2.uuid()) .execute() .assertJson(this.getClass(), "no_issue.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.MODULE_UUIDS, module1.uuid()) .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java/dir") .execute() .assertJson(this.getClass(), "search_by_directory_uuid.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.MODULE_UUIDS, module2.uuid()) .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java/dir") .execute() .assertJson(this.getClass(), "no_issue.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java/dir") .execute() .assertJson(this.getClass(), "search_by_directory_uuid.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.DIRECTORIES, "src/main/java") .execute() .assertJson(this.getClass(), "no_issue.json"); @@ -330,14 +330,14 @@ public class SearchActionComponentsMediumTest { @Test public void display_module_facet() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto module = insertComponent(ComponentTesting.newModuleDto("BCDE", project).setKey("MyModule")); - ComponentDto subModule1 = insertComponent(ComponentTesting.newModuleDto("CDEF", module).setKey("MySubModule1")); - ComponentDto subModule2 = insertComponent(ComponentTesting.newModuleDto("DEFA", module).setKey("MySubModule2")); - ComponentDto subModule3 = insertComponent(ComponentTesting.newModuleDto("EFAB", module).setKey("MySubModule3")); - ComponentDto file1 = insertComponent(ComponentTesting.newFileDto(subModule1, "FEDC").setKey("MyComponent1")); - ComponentDto file2 = insertComponent(ComponentTesting.newFileDto(subModule2, "EDCB").setKey("MyComponent2")); + ComponentDto module = insertComponent(ComponentTesting.newModuleDto("M1", project).setKey("MyModule")); + ComponentDto subModule1 = insertComponent(ComponentTesting.newModuleDto("SUBM1", module).setKey("MySubModule1")); + ComponentDto subModule2 = insertComponent(ComponentTesting.newModuleDto("SUBM2", module).setKey("MySubModule2")); + ComponentDto subModule3 = insertComponent(ComponentTesting.newModuleDto("SUBM3", module).setKey("MySubModule3")); + ComponentDto file1 = insertComponent(ComponentTesting.newFileDto(subModule1, "F1").setKey("MyComponent1")); + ComponentDto file2 = insertComponent(ComponentTesting.newFileDto(subModule2, "F2").setKey("MyComponent2")); RuleDto newRule = newRule(); IssueDto issue1 = IssueTesting.newDto(newRule, file1, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2"); IssueDto issue2 = IssueTesting.newDto(newRule, file2, project).setKee("2bd4eac2-b650-4037-80bc-7b1182fd47d4"); @@ -345,7 +345,7 @@ public class SearchActionComponentsMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, module.uuid()) .setParam(IssueFilterParameters.MODULE_UUIDS, subModule1.uuid() + "," + subModule3.uuid()) .setParam(WebService.Param.FACETS, "moduleUuids") @@ -355,17 +355,17 @@ public class SearchActionComponentsMediumTest { @Test public void display_directory_facet() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto directory = insertComponent(ComponentTesting.newDirectory(project, "src/main/java/dir")); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent").setPath(directory.path() + "/MyComponent.java")); + ComponentDto directory = insertComponent(ComponentTesting.newDirectory(project, "D1", "src/main/java/dir")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent").setPath(directory.path() + "/MyComponent.java")); IssueDto issue = IssueTesting.newDto(newRule(), file, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2"); db.issueDao().insert(session, issue); session.commit(); tester.get(IssueIndexer.class).indexAll(); userSessionRule.login("john"); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam("resolved", "false") .setParam(WebService.Param.FACETS, "directories") .execute(); @@ -374,18 +374,18 @@ public class SearchActionComponentsMediumTest { @Test public void search_by_view_uuid() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent")); insertIssue(IssueTesting.newDto(newRule(), file, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2")); - ComponentDto view = insertComponent(ComponentTesting.newProjectDto("CDEF").setQualifier(Qualifiers.VIEW).setKey("MyView")); + ComponentDto view = insertComponent(ComponentTesting.newProjectDto("V1").setQualifier(Qualifiers.VIEW).setKey("MyView")); indexView(view.uuid(), newArrayList(project.uuid())); setAnyoneProjectPermission(view, UserRole.USER); userSessionRule.login("john").addProjectUuidPermissions(UserRole.USER, view.uuid()); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, view.uuid()) .execute() .assertJson(this.getClass(), "search_by_view_uuid.json"); @@ -393,19 +393,19 @@ public class SearchActionComponentsMediumTest { @Test public void search_by_view_uuid_return_only_authorized_view() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent")); insertIssue(IssueTesting.newDto(newRule(), file, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2")); - ComponentDto view = insertComponent(ComponentTesting.newProjectDto("CDEF").setQualifier(Qualifiers.VIEW).setKey("MyView")); + ComponentDto view = insertComponent(ComponentTesting.newProjectDto("V1").setQualifier(Qualifiers.VIEW).setKey("MyView")); indexView(view.uuid(), newArrayList(project.uuid())); setAnyoneProjectPermission(view, UserRole.USER); // User has wrong permission on the view, no issue will be returned userSessionRule.login("john").addProjectUuidPermissions(UserRole.CODEVIEWER, view.uuid()); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, view.uuid()) .execute() .assertJson(this.getClass(), "no_issue.json"); @@ -413,20 +413,20 @@ public class SearchActionComponentsMediumTest { @Test public void search_by_sub_view_uuid() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent")); insertIssue(IssueTesting.newDto(newRule(), file, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2")); - ComponentDto view = insertComponent(ComponentTesting.newProjectDto("CDEF").setQualifier(Qualifiers.VIEW).setKey("MyView")); + ComponentDto view = insertComponent(ComponentTesting.newProjectDto("V1").setQualifier(Qualifiers.VIEW).setKey("MyView")); indexView(view.uuid(), newArrayList(project.uuid())); - ComponentDto subView = insertComponent(ComponentTesting.newProjectDto("DEFG").setQualifier(Qualifiers.SUBVIEW).setKey("MySubView")); + ComponentDto subView = insertComponent(ComponentTesting.newProjectDto("SV1").setQualifier(Qualifiers.SUBVIEW).setKey("MySubView")); indexView(subView.uuid(), newArrayList(project.uuid())); setAnyoneProjectPermission(view, UserRole.USER); userSessionRule.login("john").addComponentUuidPermission(UserRole.USER, view.uuid(), subView.uuid()); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, subView.uuid()) .execute() .assertJson(this.getClass(), "search_by_view_uuid.json"); @@ -434,30 +434,31 @@ public class SearchActionComponentsMediumTest { @Test public void search_by_sub_view_uuid_return_only_authorized_view() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent")); insertIssue(IssueTesting.newDto(newRule(), file, project).setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2")); - ComponentDto view = insertComponent(ComponentTesting.newProjectDto("CDEF").setQualifier(Qualifiers.VIEW).setKey("MyView")); + ComponentDto view = insertComponent(ComponentTesting.newProjectDto("V1").setQualifier(Qualifiers.VIEW).setKey("MyView")); indexView(view.uuid(), newArrayList(project.uuid())); - ComponentDto subView = insertComponent(ComponentTesting.newProjectDto("DEFG").setQualifier(Qualifiers.SUBVIEW).setKey("MySubView")); + ComponentDto subView = insertComponent(ComponentTesting.newProjectDto("SV1").setQualifier(Qualifiers.SUBVIEW).setKey("MySubView")); indexView(subView.uuid(), newArrayList(project.uuid())); setAnyoneProjectPermission(view, UserRole.USER); // User has wrong permission on the view, no issue will be returned userSessionRule.login("john").addComponentUuidPermission(UserRole.CODEVIEWER, view.uuid(), subView.uuid()); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, subView.uuid()) .execute() .assertJson(this.getClass(), "no_issue.json"); } + @Test public void search_by_author() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent")); RuleDto newRule = newRule(); IssueDto issue1 = IssueTesting.newDto(newRule, file, project).setAuthorLogin("leia").setKee("2bd4eac2-b650-4037-80bc-7b112bd4eac2"); IssueDto issue2 = IssueTesting.newDto(newRule, file, project).setAuthorLogin("luke@skywalker.name").setKee("82fd47d4-b650-4037-80bc-7b1182fd47d4"); @@ -466,13 +467,13 @@ public class SearchActionComponentsMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.AUTHORS, "leia") .setParam(WebService.Param.FACETS, "authors") .execute() .assertJson(this.getClass(), "search_by_authors.json"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.AUTHORS, "unknown") .execute() .assertJson(this.getClass(), "no_issue.json"); @@ -481,9 +482,9 @@ public class SearchActionComponentsMediumTest { @Test public void search_by_developer() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent")); ComponentDto developer = insertComponent(ComponentTesting.newDeveloper("Anakin Skywalker")); db.authorDao().insertAuthor("vader", developer.getId()); db.authorDao().insertAuthor("anakin@skywalker.name", developer.getId()); @@ -495,7 +496,7 @@ public class SearchActionComponentsMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, developer.uuid()) .execute() .assertJson(this.getClass(), "search_by_developer.json"); @@ -503,17 +504,17 @@ public class SearchActionComponentsMediumTest { @Test public void search_by_developer_technical_project() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("P1").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "F1").setKey("MyComponent")); - ComponentDto otherProject = insertComponent(ComponentTesting.newProjectDto("XXXX").setKey("OtherProject")); + ComponentDto otherProject = insertComponent(ComponentTesting.newProjectDto("P2").setKey("OtherProject")); setDefaultProjectPermission(otherProject); - ComponentDto otherFile = insertComponent(ComponentTesting.newFileDto(otherProject, "YYYY").setKey("OtherComponent")); + ComponentDto otherFile = insertComponent(ComponentTesting.newFileDto(otherProject, "F2").setKey("OtherComponent")); ComponentDto developer = insertComponent(ComponentTesting.newDeveloper("Anakin Skywalker")); - ComponentDto technicalProject = insertComponent(ComponentTesting.newDevProjectCopy("CDEF", project, developer)); - insertComponent(ComponentTesting.newDevProjectCopy("DEFG", otherProject, developer)); + ComponentDto technicalProject = insertComponent(ComponentTesting.newDevProjectCopy("COPY_P1", project, developer)); + insertComponent(ComponentTesting.newDevProjectCopy("COPY_P2", otherProject, developer)); db.authorDao().insertAuthor("vader", developer.getId()); db.authorDao().insertAuthor("anakin@skywalker.name", developer.getId()); @@ -527,7 +528,7 @@ public class SearchActionComponentsMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam(IssueFilterParameters.COMPONENT_UUIDS, technicalProject.uuid()) .execute(); result diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java index 617f4d675a5..739e7cbdc46 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java @@ -24,8 +24,10 @@ import com.google.common.collect.ImmutableMap; import org.junit.After; import org.junit.Before; import org.junit.ClassRule; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; +import org.sonar.api.issue.Issue; import org.sonar.api.rule.RuleStatus; import org.sonar.api.security.DefaultGroups; import org.sonar.api.server.ws.WebService; @@ -50,14 +52,15 @@ import org.sonar.server.issue.IssueQuery; import org.sonar.server.issue.IssueTesting; import org.sonar.server.issue.filter.IssueFilterParameters; import org.sonar.server.issue.index.IssueIndexer; -import org.sonar.server.permission.PermissionService; import org.sonar.server.permission.PermissionChange; +import org.sonar.server.permission.PermissionService; import org.sonar.server.rule.db.RuleDao; import org.sonar.server.search.QueryContext; import org.sonar.server.tester.ServerTester; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; +import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; public class SearchActionMediumTest { @@ -89,19 +92,19 @@ public class SearchActionMediumTest { public void define_action() { WebService.Controller controller = wsTester.controller("api/issues"); - WebService.Action show = controller.action("search"); + WebService.Action show = controller.action("search2"); assertThat(show).isNotNull(); assertThat(show.handler()).isNotNull(); assertThat(show.since()).isEqualTo("3.6"); assertThat(show.isPost()).isFalse(); assertThat(show.isInternal()).isFalse(); assertThat(show.responseExampleAsString()).isNotEmpty(); - assertThat(show.params()).hasSize(40); + assertThat(show.params()).hasSize(37); } @Test public void empty_search() throws Exception { - WsTester.TestRequest request = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION); + WsTester.TestRequest request = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION); WsTester.Result result = request.execute(); assertThat(result).isNotNull(); @@ -109,40 +112,43 @@ public class SearchActionMediumTest { } @Test - public void issue() throws Exception { + public void response_contains_all_fields_except_additional_fields() throws Exception { db.userDao().insert(session, new UserDto().setLogin("simon").setName("Simon").setEmail("simon@email.com")); db.userDao().insert(session, new UserDto().setLogin("fabrice").setName("Fabrice").setEmail("fabrice@email.com")); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); IssueDto issue = IssueTesting.newDto(newRule(), file, project) - .setDebt(10L) - .setStatus("OPEN").setResolution("OPEN") .setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2") + .setDebt(10L) + .setMessage("the message") + .setStatus(Issue.STATUS_RESOLVED) + .setResolution(Issue.RESOLUTION_FIXED) .setSeverity("MAJOR") .setAuthorLogin("John") .setAssignee("simon") .setReporter("fabrice") .setActionPlanKey("AP-ABCD") + .setTags(asList("bug", "owasp")) .setIssueCreationDate(DateUtils.parseDateTime("2014-09-04T00:00:00+0100")) .setIssueUpdateDate(DateUtils.parseDateTime("2017-12-04T00:00:00+0100")); db.issueDao().insert(session, issue); session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION).execute(); - result.assertJson(this.getClass(), "issue.json"); + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION).execute(); + result.assertJson(this.getClass(), "response_contains_all_fields_except_additional_fields.json"); } @Test - public void issue_with_comment() throws Exception { + public void issue_with_comments() throws Exception { db.userDao().insert(session, new UserDto().setLogin("john").setName("John")); db.userDao().insert(session, new UserDto().setLogin("fabrice").setName("Fabrice").setEmail("fabrice@email.com")); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); IssueDto issue = IssueTesting.newDto(newRule(), file, project) .setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2"); db.issueDao().insert(session, issue); @@ -153,20 +159,22 @@ public class SearchActionMediumTest { .setChangeData("*My comment*") .setChangeType(IssueChangeDto.TYPE_COMMENT) .setUserLogin("john") - .setCreatedAt(DateUtils.parseDate("2014-09-09").getTime())); + .setCreatedAt(DateUtils.parseDateTime("2014-09-09T12:00:00+0000").getTime())); tester.get(IssueChangeDao.class).insert(session, new IssueChangeDto().setIssueKey(issue.getKey()) .setKey("COMMENT-ABCE") .setChangeData("Another comment") .setChangeType(IssueChangeDto.TYPE_COMMENT) .setUserLogin("fabrice") - .setCreatedAt(DateUtils.parseDate("2014-09-10").getTime())); + .setCreatedAt(DateUtils.parseDateTime("2014-09-10T12:00:00+0000").getTime())); session.commit(); tester.get(IssueIndexer.class).indexAll(); userSessionRule.login("john"); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION).execute(); - result.assertJson(this.getClass(), "issue_with_comment.json"); + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) + .setParam("additionalFields", "comments,users") + .execute(); + result.assertJson(this.getClass(), "issue_with_comments.json"); } @Test @@ -174,9 +182,9 @@ public class SearchActionMediumTest { db.userDao().insert(session, new UserDto().setLogin("john").setName("John").setEmail("john@email.com")); db.userDao().insert(session, new UserDto().setLogin("fabrice").setName("Fabrice").setEmail("fabrice@email.com")); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); IssueDto issue = IssueTesting.newDto(newRule(), file, project) .setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2"); db.issueDao().insert(session, issue); @@ -187,28 +195,28 @@ public class SearchActionMediumTest { .setChangeData("*My comment*") .setChangeType(IssueChangeDto.TYPE_COMMENT) .setUserLogin("john") - .setCreatedAt(DateUtils.parseDate("2014-09-09").getTime())); + .setCreatedAt(DateUtils.parseDateTime("2014-09-09T12:00:00+0000").getTime())); tester.get(IssueChangeDao.class).insert(session, new IssueChangeDto().setIssueKey(issue.getKey()) .setKey("COMMENT-ABCE") .setChangeData("Another comment") .setChangeType(IssueChangeDto.TYPE_COMMENT) .setUserLogin("fabrice") - .setCreatedAt(DateUtils.parseDate("2014-09-10").getTime())); + .setCreatedAt(DateUtils.parseDateTime("2014-09-10T19:10:03+0000").getTime())); session.commit(); tester.get(IssueIndexer.class).indexAll(); userSessionRule.login("john"); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION).setParam(IssueFilterParameters.HIDE_COMMENTS, "true").execute(); + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION).setParam(IssueFilterParameters.HIDE_COMMENTS, "true").execute(); result.assertJson(this.getClass(), "issue_with_comment_hidden.json"); assertThat(result.outputAsString()).doesNotContain("fabrice"); } @Test public void issue_with_action_plan() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); tester.get(ActionPlanDao.class).save(new ActionPlanDto() .setKey("AP-ABCD") @@ -227,15 +235,18 @@ public class SearchActionMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION).execute(); + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) + .setParam("additionalFields", "actionPlans") + .execute(); result.assertJson(this.getClass(), "issue_with_action_plan.json"); } + @Ignore("temporarily disabled") @Test public void issue_with_attributes() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); IssueDto issue = IssueTesting.newDto(newRule(), file, project) .setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2") .setIssueAttributes(KeyValueFormat.format(ImmutableMap.of("jira-issue-key", "SONAR-1234"))); @@ -243,17 +254,18 @@ public class SearchActionMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION).execute(); + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) + .execute(); result.assertJson(this.getClass(), "issue_with_attributes.json"); } @Test - public void issue_with_extra_fields() throws Exception { + public void load_additional_fields() throws Exception { db.userDao().insert(session, new UserDto().setLogin("simon").setName("Simon").setEmail("simon@email.com")); db.userDao().insert(session, new UserDto().setLogin("fabrice").setName("Fabrice").setEmail("fabrice@email.com")); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); tester.get(ActionPlanDao.class).save(new ActionPlanDto() .setKey("AP-ABCD") @@ -273,17 +285,17 @@ public class SearchActionMediumTest { tester.get(IssueIndexer.class).indexAll(); userSessionRule.login("john"); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) - .setParam("f", "assignee,reporter,actionPlan,actions,transitions,actionPlanName").execute(); - result.assertJson(this.getClass(), "issue_with_extra_fields.json"); + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) + .setParam("additionalFields", "_all").execute(); + result.assertJson(this.getClass(), "load_additional_fields.json"); } @Test - public void issue_linked_on_removed_file() throws Exception { + public void issue_on_removed_file() throws Exception { RuleDto rule = newRule(); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto removedFile = insertComponent(ComponentTesting.newFileDto(project).setUuid("EDCB") + ComponentDto removedFile = insertComponent(ComponentTesting.newFileDto(project).setUuid("REMOVED_FILE_ID") .setEnabled(false) .setKey("RemovedComponent")); @@ -298,30 +310,31 @@ public class SearchActionMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION).execute(); - result.assertJson(this.getClass(), "issue_linked_on_removed_file.json"); + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) + .execute(); + result.assertJson(this.getClass(), "issue_on_removed_file.json"); } @Test public void issue_contains_component_id_for_eclipse() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); IssueDto issue = IssueTesting.newDto(newRule(), file, project); db.issueDao().insert(session, issue); session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION).execute(); + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION).execute(); assertThat(result.outputAsString()).contains("\"componentId\":" + file.getId() + ","); } @Test public void apply_paging_with_one_component() throws Exception { RuleDto rule = newRule(); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); for (int i = 0; i < QueryContext.MAX_LIMIT + 1; i++) { IssueDto issue = IssueTesting.newDto(rule, file, project); tester.get(IssueDao.class).insert(session, issue); @@ -329,13 +342,13 @@ public class SearchActionMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION).setParam(IssueFilterParameters.COMPONENTS, file.getKey()).execute(); + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION).setParam(IssueFilterParameters.COMPONENTS, file.getKey()).execute(); result.assertJson(this.getClass(), "apply_paging_with_one_component.json"); } @Test public void components_contains_sub_projects() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("ProjectHavingModule")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("ProjectHavingModule")); setDefaultProjectPermission(project); ComponentDto module = insertComponent(ComponentTesting.newModuleDto(project).setKey("ModuleHavingFile")); ComponentDto file = insertComponent(ComponentTesting.newFileDto(module, "BCDE").setKey("FileLinkedToModule")); @@ -344,15 +357,15 @@ public class SearchActionMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION).execute(); + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION).setParam(Search2Action.ADDITIONAL_FIELDS, "_all").execute(); result.assertJson(this.getClass(), "components_contains_sub_projects.json"); } @Test public void display_facets() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); IssueDto issue = IssueTesting.newDto(newRule(), file, project) .setIssueCreationDate(DateUtils.parseDate("2014-09-04")) .setIssueUpdateDate(DateUtils.parseDate("2017-12-04")) @@ -365,7 +378,7 @@ public class SearchActionMediumTest { tester.get(IssueIndexer.class).indexAll(); userSessionRule.login("john"); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam("resolved", "false") .setParam(WebService.Param.FACETS, "statuses,severities,resolutions,projectUuids,rules,fileUuids,assignees,languages,actionPlans") .execute(); @@ -374,9 +387,9 @@ public class SearchActionMediumTest { @Test public void display_facets_in_debt_mode() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); IssueDto issue = IssueTesting.newDto(newRule(), file, project) .setIssueCreationDate(DateUtils.parseDate("2014-09-04")) .setIssueUpdateDate(DateUtils.parseDate("2017-12-04")) @@ -389,7 +402,7 @@ public class SearchActionMediumTest { tester.get(IssueIndexer.class).indexAll(); userSessionRule.login("john"); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam("resolved", "false") .setParam(WebService.Param.FACETS, "statuses,severities,resolutions,projectUuids,rules,fileUuids,assignees,languages,actionPlans") .setParam("facetMode", "debt") @@ -399,9 +412,9 @@ public class SearchActionMediumTest { @Test public void display_zero_valued_facets_for_selected_items() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); IssueDto issue = IssueTesting.newDto(newRule(), file, project) .setIssueCreationDate(DateUtils.parseDate("2014-09-04")) .setIssueUpdateDate(DateUtils.parseDate("2017-12-04")) @@ -414,7 +427,7 @@ public class SearchActionMediumTest { tester.get(IssueIndexer.class).indexAll(); userSessionRule.login("john"); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam("resolved", "false") .setParam("severities", "MAJOR,MINOR") .setParam("languages", "xoo,polop,palap") @@ -427,9 +440,9 @@ public class SearchActionMediumTest { public void filter_by_assigned_to_me() throws Exception { db.userDao().insert(session, new UserDto().setLogin("john").setName("John").setEmail("john@email.com")); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); RuleDto rule = newRule(); IssueDto issue1 = IssueTesting.newDto(rule, file, project) .setIssueCreationDate(DateUtils.parseDate("2014-09-04")) @@ -459,7 +472,7 @@ public class SearchActionMediumTest { tester.get(IssueIndexer.class).indexAll(); userSessionRule.login("john"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam("resolved", "false") .setParam("assignees", "__me__") .setParam(WebService.Param.FACETS, "assignees,assigned_to_me") @@ -471,9 +484,9 @@ public class SearchActionMediumTest { public void filter_by_assigned_to_me_unauthenticated() throws Exception { userSessionRule.login(); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); RuleDto rule = newRule(); IssueDto issue1 = IssueTesting.newDto(rule, file, project) .setStatus("OPEN") @@ -490,7 +503,7 @@ public class SearchActionMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam("resolved", "false") .setParam("assignees", "__me__") .execute() @@ -501,9 +514,9 @@ public class SearchActionMediumTest { public void assigned_to_me_facet_is_sticky_relative_to_assignees() throws Exception { db.userDao().insert(session, new UserDto().setLogin("alice").setName("Alice").setEmail("alice@email.com")); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyFile")); RuleDto rule = newRule(); IssueDto issue1 = IssueTesting.newDto(rule, file, project) .setIssueCreationDate(DateUtils.parseDate("2014-09-04")) @@ -533,7 +546,7 @@ public class SearchActionMediumTest { tester.get(IssueIndexer.class).indexAll(); userSessionRule.login("john-bob.polop"); - wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam("resolved", "false") .setParam("assignees", "alice") .setParam(WebService.Param.FACETS, "assignees,assigned_to_me") @@ -542,31 +555,11 @@ public class SearchActionMediumTest { } @Test - public void hide_rules() throws Exception { - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); - setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); - IssueDto issue = IssueTesting.newDto(newRule(), file, project) - .setIssueCreationDate(DateUtils.parseDate("2014-09-04")) - .setIssueUpdateDate(DateUtils.parseDate("2017-12-04")) - .setDebt(10L) - .setStatus("OPEN") - .setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2") - .setSeverity("MAJOR"); - db.issueDao().insert(session, issue); - session.commit(); - tester.get(IssueIndexer.class).indexAll(); - - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION).setParam(IssueFilterParameters.HIDE_RULES, "true").execute(); - result.assertJson(this.getClass(), "hide_rules.json"); - } - - @Test public void sort_by_updated_at() throws Exception { RuleDto rule = newRule(); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); db.issueDao().insert(session, IssueTesting.newDto(rule, file, project) .setKee("82fd47d4-b650-4037-80bc-7b112bd4eac1") .setIssueUpdateDate(DateUtils.parseDateTime("2014-11-02T00:00:00+0100"))); @@ -579,7 +572,7 @@ public class SearchActionMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION) + WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION) .setParam("sort", IssueQuery.SORT_BY_UPDATE_DATE) .setParam("asc", "false") .execute(); @@ -589,9 +582,9 @@ public class SearchActionMediumTest { @Test public void paging() throws Exception { RuleDto rule = newRule(); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); for (int i = 0; i < 12; i++) { IssueDto issue = IssueTesting.newDto(rule, file, project); tester.get(IssueDao.class).insert(session, issue); @@ -599,7 +592,7 @@ public class SearchActionMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.TestRequest request = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION); + WsTester.TestRequest request = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION); request.setParam(WebService.Param.PAGE, "2"); request.setParam(WebService.Param.PAGE_SIZE, "9"); @@ -610,9 +603,9 @@ public class SearchActionMediumTest { @Test public void paging_with_page_size_to_minus_one() throws Exception { RuleDto rule = newRule(); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); for (int i = 0; i < 12; i++) { IssueDto issue = IssueTesting.newDto(rule, file, project); tester.get(IssueDao.class).insert(session, issue); @@ -620,7 +613,7 @@ public class SearchActionMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.TestRequest request = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION); + WsTester.TestRequest request = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION); request.setParam(WebService.Param.PAGE, "1"); request.setParam(WebService.Param.PAGE_SIZE, "-1"); @@ -631,9 +624,9 @@ public class SearchActionMediumTest { @Test public void deprecated_paging() throws Exception { RuleDto rule = newRule(); - ComponentDto project = insertComponent(ComponentTesting.newProjectDto("ABCD").setKey("MyProject")); + ComponentDto project = insertComponent(ComponentTesting.newProjectDto("PROJECT_ID").setKey("MyProject")); setDefaultProjectPermission(project); - ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "BCDE").setKey("MyComponent")); + ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, "FILE_ID").setKey("MyComponent")); for (int i = 0; i < 12; i++) { IssueDto issue = IssueTesting.newDto(rule, file, project); tester.get(IssueDao.class).insert(session, issue); @@ -641,7 +634,7 @@ public class SearchActionMediumTest { session.commit(); tester.get(IssueIndexer.class).indexAll(); - WsTester.TestRequest request = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION); + WsTester.TestRequest request = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION); request.setParam(IssueFilterParameters.PAGE_INDEX, "2"); request.setParam(IssueFilterParameters.PAGE_SIZE, "9"); @@ -651,7 +644,7 @@ public class SearchActionMediumTest { @Test public void default_page_size_is_100() throws Exception { - WsTester.TestRequest request = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION); + WsTester.TestRequest request = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, Search2Action.SEARCH_ACTION); WsTester.Result result = request.execute(); result.assertJson(this.getClass(), "default_page_size_is_100.json"); diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/ListActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/ListActionTest.java index 21578d44051..e11b6aada87 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/ws/ListActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/ws/ListActionTest.java @@ -55,7 +55,7 @@ public class ListActionTest { dbTester.getSession().commit(); TestResponse response = tester.newRequest() - .setMimeType(MimeTypes.PROTOBUF) + .setMediaType(MimeTypes.PROTOBUF) .execute(); assertThat(response.getMediaType()).isEqualTo(MimeTypes.PROTOBUF); @@ -63,8 +63,8 @@ public class ListActionTest { assertThat(listResponse.getRulesCount()).isEqualTo(2); assertThat(listResponse.getRules(0).getKey()).isEqualTo("S001"); - assertThat(listResponse.getRules(0).hasInternalKey()).isFalse(); - assertThat(listResponse.getRules(0).hasName()).isFalse(); + assertThat(listResponse.getRules(0).getInternalKey()).isEqualTo(""); + assertThat(listResponse.getRules(0).getName()).isEqualTo(""); assertThat(listResponse.getRules(1).getKey()).isEqualTo("S002"); assertThat(listResponse.getRules(1).getInternalKey()).isEqualTo("I002"); assertThat(listResponse.getRules(1).getName()).isEqualTo("Rule Two"); diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/TestRequest.java b/server/sonar-server/src/test/java/org/sonar/server/ws/TestRequest.java index aa62a432457..3405e132459 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ws/TestRequest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ws/TestRequest.java @@ -64,7 +64,7 @@ public class TestRequest extends ValidatingRequest { return mimeType; } - public TestRequest setMimeType(String type) { + public TestRequest setMediaType(String type) { checkNotNull(type); this.mimeType = type; return this; diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/WsUtilsTest.java b/server/sonar-server/src/test/java/org/sonar/server/ws/WsUtilsTest.java new file mode 100644 index 00000000000..0edfbecb6fd --- /dev/null +++ b/server/sonar-server/src/test/java/org/sonar/server/ws/WsUtilsTest.java @@ -0,0 +1,38 @@ +package org.sonar.server.ws; + +import org.junit.Test; +import org.sonar.server.plugins.MimeTypes; +import org.sonarqube.ws.Issues; + +import static org.assertj.core.api.Assertions.assertThat; + +public class WsUtilsTest { + + @Test + public void write_json_by_default() throws Exception { + TestRequest request = new TestRequest(); + DumbResponse response = new DumbResponse(); + + Issues.Issue msg = Issues.Issue.newBuilder().setKey("I1").build(); + WsUtils.writeProtobuf(msg, request, response); + + assertThat(response.stream().mediaType()).isEqualTo(MimeTypes.JSON); + assertThat(response.outputAsString()) + .startsWith("{") + .contains("\"key\":\"I1\"") + .endsWith("}"); + } + + @Test + public void write_protobuf() throws Exception { + TestRequest request = new TestRequest(); + request.setMediaType(MimeTypes.PROTOBUF); + DumbResponse response = new DumbResponse(); + + Issues.Issue msg = Issues.Issue.newBuilder().setKey("I1").build(); + WsUtils.writeProtobuf(msg, request, response); + + assertThat(response.stream().mediaType()).isEqualTo(MimeTypes.PROTOBUF); + assertThat(Issues.Issue.parseFrom(response.getFlushedOutput()).getKey()).isEqualTo("I1"); + } +} diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_file_facet.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_file_facet.json index 8f3aca136ca..67be53937cf 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_file_facet.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_file_facet.json @@ -1,37 +1,34 @@ { "total": 1, "p": 1, - "projects": [ - { "key": "MyProject" } - ], - "components": [ - { "key": "MyProject" }, - { "key": "MyComponent1" }, - { "key": "MyComponent2" }, - { "key": "MyComponent3" } - ], "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent1", - "project": "MyProject", + "component": "F1", + "project": "P1", "rule": "xoo:x1" } ], + "components": [ + { "id": "P1" }, + { "id": "F1" }, + { "id": "F2" }, + { "id": "F3" } + ], "facets": [ { "property": "fileUuids", "values": [ { - "val": "BCDE", + "val": "F1", "count": 1 }, { - "val": "CDEF", + "val": "F2", "count": 1 }, { - "val": "DEFA", + "val": "F3", "count": 0 } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_module_facet.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_module_facet.json index 8b86025ab6f..cfaa3280998 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_module_facet.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_module_facet.json @@ -1,39 +1,34 @@ { - "total": 1, - "p": 1, - "projects": [ - { "key": "MyProject" } - ], - "components": [ - { "key": "MyProject" }, - { "key": "MyModule" }, - { "key": "MySubModule1" }, - { "key": "MySubModule2" }, - { "key": "MySubModule3" }, - { "key": "MyComponent1" } - ], "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent1", - "project": "MyProject", + "component": "F1", + "project": "P1", "rule": "xoo:x1" } ], + "components": [ + { "id": "P1" }, + { "id": "M1" }, + { "id": "SUBM1" }, + { "id": "SUBM2" }, + { "id": "SUBM3" }, + { "id": "F1" } + ], "facets": [ { "property": "moduleUuids", "values": [ { - "val": "CDEF", + "val": "SUBM1", "count": 1 }, { - "val": "DEFA", + "val": "SUBM2", "count": 1 }, { - "val": "EFAB", + "val": "SUBM3", "count": 0 } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_non_sticky_project_facet.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_non_sticky_project_facet.json index 78cb166c195..e9152aa560a 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_non_sticky_project_facet.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_non_sticky_project_facet.json @@ -1,13 +1,6 @@ { "total": 1, "p": 1, - "projects": [ - { "key": "MyProject1" } - ], - "components": [ - { "key": "MyProject1" }, - { "key": "MyComponent1" } - ], "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", @@ -16,6 +9,10 @@ "rule": "xoo:x1" } ], + "components": [ + { "key": "MyProject1" }, + { "key": "MyComponent1" } + ], "facets": [ { "property": "projectUuids", diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_sticky_project_facet.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_sticky_project_facet.json index 99d1729a9c8..cd421f8cdc8 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_sticky_project_facet.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/display_sticky_project_facet.json @@ -1,39 +1,32 @@ { - "total": 1, - "p": 1, - "projects": [ - { "key": "MyProject1" }, - { "key": "MyProject2" }, - { "key": "MyProject3" } - ], - "components": [ - { "key": "MyProject1" }, - { "key": "MyProject2" }, - { "key": "MyProject3" }, - { "key": "MyComponent1" } - ], "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent1", - "project": "MyProject1", + "component": "F1", + "project": "P1", "rule": "xoo:x1" } ], + "components": [ + { "id": "P1" }, + { "id": "P2" }, + { "id": "P3" }, + { "id": "F1" } + ], "facets": [ { "property": "projectUuids", "values": [ { - "val": "ABCD", + "val": "P1", "count": 1 }, { - "val": "BCDE", + "val": "P2", "count": 1 }, { - "val": "CDEF", + "val": "P3", "count": 1 } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/issues_on_different_projects.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/issues_on_different_projects.json index 675106c1fec..4bebe01e405 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/issues_on_different_projects.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/issues_on_different_projects.json @@ -2,8 +2,8 @@ "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "F1", + "project": "P1", "rule": "xoo:x1", "status": "OPEN", "resolution": "OPEN", @@ -12,8 +12,8 @@ }, { "key": "92fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent2", - "project": "MyProject2", + "component": "F2", + "project": "P2", "rule": "xoo:x1", "status": "OPEN", "resolution": "OPEN", @@ -23,34 +23,24 @@ ], "components": [ { - "uuid": "BCDE", + "id": "F1", "key": "MyComponent", "enabled" : true }, { - "uuid": "ABCD", + "id": "P1", "key": "MyProject", "enabled" : true }, { - "uuid": "EDCB", + "id": "F2", "key": "MyComponent2", "enabled" : true }, { - "uuid": "DBCA", + "id": "P2", "key": "MyProject2", "enabled" : true } - ], - "projects": [ - { - "uuid": "ABCD", - "key": "MyProject" - }, - { - "uuid": "DBCA", - "key": "MyProject2" - } ] } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_authors.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_authors.json index 3be7b368db8..f571e170ee7 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_authors.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_authors.json @@ -4,8 +4,8 @@ "issues": [ { "key": "2bd4eac2-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "F1", + "project": "P1", "rule": "xoo:x1", "author": "leia" } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_developer.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_developer.json index 0f0bc742c5e..b47c430630b 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_developer.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_developer.json @@ -1,18 +1,16 @@ { - "total": 2, - "p": 1, "issues": [ { "key": "2bd4eac2-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "F1", + "project": "P1", "rule": "xoo:x1", "author": "vader" }, { "key": "82fd47d4-b650-4037-80bc-7b1182fd47d4", - "component": "MyComponent", - "project": "MyProject", + "component": "F1", + "project": "P1", "rule": "xoo:x1", "author": "anakin@skywalker.name" } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_directory_uuid.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_directory_uuid.json index d74af4ff53b..d7c4e98d8cc 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_directory_uuid.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_directory_uuid.json @@ -1,11 +1,9 @@ { - "total": 1, - "p": 1, "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "module1:MyComponent", - "project": "MyProject", + "component": "F1", + "project": "P1", "rule": "xoo:x1" } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_file_key.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_file_key.json index f13cd2e997f..d7c4e98d8cc 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_file_key.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_file_key.json @@ -1,11 +1,9 @@ { - "total": 1, - "p": 1, "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "F1", + "project": "P1", "rule": "xoo:x1" } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_file_uuid.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_file_uuid.json index f13cd2e997f..d7c4e98d8cc 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_file_uuid.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_file_uuid.json @@ -1,11 +1,9 @@ { - "total": 1, - "p": 1, "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "F1", + "project": "P1", "rule": "xoo:x1" } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_project_uuid.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_project_uuid.json index 5df35493a30..d7c4e98d8cc 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_project_uuid.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_project_uuid.json @@ -1,12 +1,9 @@ { - "total": 1, - "p": 1, - "ps": 100, "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "F1", + "project": "P1", "rule": "xoo:x1" } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_test_key.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_test_key.json index 76968cec9a8..56b3be12a0b 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_test_key.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_test_key.json @@ -1,11 +1,9 @@ { - "total": 1, - "p": 1, "issues": [ { "key": "2bd4eac2-b650-4037-80bc-7b1182fd47d4", - "component": "MyComponentTest", - "project": "MyProject", + "component": "F2", + "project": "P1", "rule": "xoo:x1" } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_view_uuid.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_view_uuid.json index 5df35493a30..d7c4e98d8cc 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_view_uuid.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionComponentsMediumTest/search_by_view_uuid.json @@ -1,12 +1,9 @@ { - "total": 1, - "p": 1, - "ps": 100, "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "F1", + "project": "P1", "rule": "xoo:x1" } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/assigned_to_me_facet_sticky.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/assigned_to_me_facet_sticky.json index 6d5b660ddc3..48cdd00481b 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/assigned_to_me_facet_sticky.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/assigned_to_me_facet_sticky.json @@ -2,8 +2,7 @@ "issues": [ { "key": "7b112bd4-b650-4037-80bc-82fd47d4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "FILE_ID", "rule": "xoo:x1", "status": "OPEN", "severity": "MAJOR", diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/components_contains_sub_projects.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/components_contains_sub_projects.json index e9d286cc09a..5ff9016c910 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/components_contains_sub_projects.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/components_contains_sub_projects.json @@ -9,10 +9,5 @@ { "key": "ProjectHavingModule" } - ], - "projects": [ - { - "key": "ProjectHavingModule" - } ] } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/default_page_size_is_100.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/default_page_size_is_100.json index a4dc9a53ed5..55e445b3297 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/default_page_size_is_100.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/default_page_size_is_100.json @@ -6,7 +6,6 @@ "pageIndex": 1, "pageSize": 100, "total": 0, - "fTotal": "0", "pages": 0 } } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/deprecated_paging.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/deprecated_paging.json index 1ecb54f2622..35ed37d52a4 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/deprecated_paging.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/deprecated_paging.json @@ -3,7 +3,6 @@ "pageIndex": 2, "pageSize": 9, "total": 12, - "fTotal": "12", "pages": 2 } } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets.json index 66a0626b7e8..5fcdf33eca1 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets.json @@ -2,8 +2,7 @@ "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "FILE_ID", "rule": "xoo:x1", "status": "OPEN", "severity": "MAJOR", @@ -90,7 +89,7 @@ "property": "projectUuids", "values": [ { - "val": "ABCD", + "val": "PROJECT_ID", "count": 1 } ] @@ -108,7 +107,7 @@ "property": "fileUuids", "values": [ { - "val": "BCDE", + "val": "FILE_ID", "count": 1 } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets_debt.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets_debt.json index 1917038f24e..d521c725924 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets_debt.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets_debt.json @@ -3,8 +3,8 @@ "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "FILE_ID", + "project": "PROJECT_ID", "rule": "xoo:x1", "status": "OPEN", "severity": "MAJOR", @@ -41,6 +41,10 @@ "property": "severities", "values": [ { + "val": "MAJOR", + "count": 10 + }, + { "val": "INFO", "count": 0 }, @@ -49,10 +53,6 @@ "count": 0 }, { - "val": "MAJOR", - "count": 10 - }, - { "val": "CRITICAL", "count": 0 }, @@ -91,7 +91,7 @@ "property": "projectUuids", "values": [ { - "val": "ABCD", + "val": "PROJECT_ID", "count": 10 } ] @@ -109,7 +109,7 @@ "property": "fileUuids", "values": [ { - "val": "BCDE", + "val": "FILE_ID", "count": 10 } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_zero_facets.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_zero_facets.json index 2102d260f27..cdd12a3d9f0 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_zero_facets.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_zero_facets.json @@ -2,8 +2,8 @@ "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "FILE_ID", + "project": "PROJECT_ID", "rule": "xoo:x1", "status": "OPEN", "severity": "MAJOR", @@ -90,7 +90,7 @@ "property": "projectUuids", "values": [ { - "val": "ABCD", + "val": "PROJECT_ID", "count": 1 } ] @@ -108,7 +108,7 @@ "property": "fileUuids", "values": [ { - "val": "BCDE", + "val": "FILE_ID", "count": 1 } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/empty_result.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/empty_result.json index 787b0028a29..0448735ef0c 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/empty_result.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/empty_result.json @@ -6,10 +6,7 @@ "pageIndex": 1, "pageSize": 100, "total": 0, - "fTotal": "0", "pages": 0 }, - "issues": [], - "components": [], - "projects": [] + "issues": [] } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/filter_by_assigned_to_me.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/filter_by_assigned_to_me.json index 2f5a071fcfa..6e01c4f53b9 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/filter_by_assigned_to_me.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/filter_by_assigned_to_me.json @@ -2,8 +2,8 @@ "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "FILE_ID", + "project": "PROJECT_ID", "rule": "xoo:x1", "status": "OPEN", "severity": "MAJOR", diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/hide_rules.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/hide_rules.json index 0d6efbb4a8b..18d24788450 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/hide_rules.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/hide_rules.json @@ -2,8 +2,8 @@ "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "FILE_ID", + "project": "PROJECT_ID", "rule": "xoo:x1", "status": "OPEN", "severity": "MAJOR", diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue.json deleted file mode 100644 index c5240ceca80..00000000000 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "total": 1, - "p": 1, - "ps": 100, - "issues": [ - { - "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", - "rule": "xoo:x1", - "status": "OPEN", - "resolution": "OPEN", - "severity": "MAJOR", - "debt": "10min", - "author": "John", - "assignee": "simon", - "reporter": "fabrice", - "actionPlan": "AP-ABCD", - "updateDate": "2017-12-04T00:00:00+0100" - } - ], - "rules": [ - { - "key": "xoo:x1", - "name": "Rule name", - "desc": "Rule desc", - "status": "READY" - } - ], - "components": [ - { - "uuid": "BCDE", - "key": "MyComponent", - "enabled" : true - }, - { - "uuid": "ABCD", - "key": "MyProject", - "enabled" : true - } - ], - "projects": [ - { - "uuid": "ABCD", - "key": "MyProject" - } - ], - "users": [ - { - "login": "simon", - "name": "Simon", - "active": true, - "email": "simon@email.com" - }, - { - "login": "fabrice", - "name": "Fabrice", - "active": true, - "email": "fabrice@email.com" - } - ] -} diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_linked_on_removed_file.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_on_removed_file.json index 6906c6d1081..4fd658fe4c2 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_linked_on_removed_file.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_on_removed_file.json @@ -2,8 +2,8 @@ "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "RemovedComponent", - "project": "MyProject", + "component": "REMOVED_FILE_ID", + "project": "PROJECT_ID", "rule": "xoo:x1", "status": "OPEN", "resolution": "OPEN", @@ -13,12 +13,12 @@ ], "components": [ { - "uuid": "EDCB", + "id": "REMOVED_FILE_ID", "key": "RemovedComponent", "enabled" : false }, { - "uuid": "ABCD", + "id": "PROJECT_ID", "key": "MyProject", "enabled" : true } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_action_plan.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_action_plan.json index 67836dba67f..bf74bc21d89 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_action_plan.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_action_plan.json @@ -10,11 +10,8 @@ "key": "AP-ABCD", "name": "1.0", "status": "OPEN", - "project": "MyProject", - "userLogin": "simon", "deadLine": "2014-01-24T19:10:03+0000", - "createdAt": "2014-01-22T19:10:03+0000", - "updatedAt": "2014-01-23T19:10:03+0000" + "project": "PROJECT_ID" } ] } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_comment.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_comment.json deleted file mode 100644 index 22f83f1021c..00000000000 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_comment.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "issues": [ - { - "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "comments": [ - { - "key": "COMMENT-ABCD", - "login": "john", - "userName": "John", - "htmlText": "<em>My comment</em>", - "markdown": "*My comment*", - "updatable": true - }, - { - "key": "COMMENT-ABCE", - "login": "fabrice", - "userName": "Fabrice", - "email": "fabrice@email.com", - "htmlText": "Another comment", - "markdown": "Another comment", - "updatable": false - } - ] - } - ] -} diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_comments.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_comments.json new file mode 100644 index 00000000000..09515d61e50 --- /dev/null +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_comments.json @@ -0,0 +1,41 @@ +{ + "issues": [ + { + "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", + "rule": "xoo:x1", + "severity": "MAJOR", + "comments": [ + { + "key": "COMMENT-ABCD", + "login": "john", + "htmlText": "\u003cem\u003eMy comment\u003c/em\u003e", + "markdown": "*My comment*", + "updatable": true, + "createdAt": "2014-09-09T12:00:00+0000" + }, + { + "key": "COMMENT-ABCE", + "login": "fabrice", + "htmlText": "Another comment", + "markdown": "Another comment", + "updatable": false, + "createdAt": "2014-09-10T12:00:00+0000" + } + ] + } + ], + "users": [ + { + "login": "fabrice", + "name": "Fabrice", + "email": "fabrice@email.com", + "active": true + }, + { + "login": "john", + "name": "John", + "email": "", + "active": true + } + ] +} diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_snippet.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_snippet.json deleted file mode 100644 index b78cbecd441..00000000000 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_snippet.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "maxResultsReached": false, - "total": 1, - "p": 1, - "ps": 100, - "issues": [ - { - "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", - "line": 3, - "rule": "xoo:x1", - "status": "OPEN", - "resolution": "OPEN", - "severity": "MAJOR", - "debt": "10min", - "author": "John", - "assignee": "simon", - "reporter": "fabrice", - "updateDate": "2014-12-04T00:00:00+0100" - } - ], - "rules": [ - { - "key": "xoo:x1", - "name": "Rule name", - "desc": "Rule desc", - "status": "READY" - } - ], - "components": [ - { - "key": "MyComponent" - }, - { - "key": "MyProject" - } - ], - "projects": [ - { - "key": "MyProject" - } - ], - "users": [ - { - "login": "simon", - "name": "Simon", - "active": true, - "email": "simon@email.com" - }, - { - "login": "fabrice", - "name": "Fabrice", - "active": true, - "email": "fabrice@email.com" - } - ] -} diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_extra_fields.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/load_additional_fields.json index ecd938c0876..6aa8270c21f 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/issue_with_extra_fields.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/load_additional_fields.json @@ -5,7 +5,6 @@ "assignee": "simon", "reporter": "fabrice", "actionPlan": "AP-ABCD", - "actionPlanName": "1.0", "actions": [ "comment", "assign", "set_tags", "assign_to_me", "plan" ], @@ -13,5 +12,12 @@ "confirm", "resolve" ] } + ], + "actionPlans": [ + { + "key": "AP-ABCD", + "name": "1.0", + "status": "OPEN" + } ] } diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/response_contains_all_fields_except_additional_fields.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/response_contains_all_fields_except_additional_fields.json new file mode 100644 index 00000000000..d806527edc4 --- /dev/null +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/response_contains_all_fields_except_additional_fields.json @@ -0,0 +1,24 @@ +{ + "issues": [ + { + "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", + "rule": "xoo:x1", + "severity": "MAJOR", + "component": "FILE_ID", + "resolution": "FIXED", + "status": "RESOLVED", + "message": "the message", + "debt": "10min", + "assignee": "simon", + "reporter": "fabrice", + "author": "John", + "actionPlan": "AP-ABCD", + "tags": [ + "bug", + "owasp" + ], + "creationDate": "2014-09-04T01:00:00+0200", + "updateDate": "2017-12-04T00:00:00+0100" + } + ] +} diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/sort_by_updated_at.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/sort_by_updated_at.json index 6711ed00118..7f40edc0ad3 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/sort_by_updated_at.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/sort_by_updated_at.json @@ -2,22 +2,22 @@ "issues": [ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", - "component": "MyComponent", - "project": "MyProject", + "component": "FILE_ID", + "project": "PROJECT_ID", "rule": "xoo:x1", "updateDate": "2014-11-01T00:00:00+0100" }, { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac1", - "component": "MyComponent", - "project": "MyProject", + "component": "FILE_ID", + "project": "PROJECT_ID", "rule": "xoo:x1", "updateDate": "2014-11-02T00:00:00+0100" }, { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac3", - "component": "MyComponent", - "project": "MyProject", + "component": "FILE_ID", + "project": "PROJECT_ID", "rule": "xoo:x1", "updateDate": "2014-11-03T00:00:00+0100" } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java index f4758c9abd8..864b537f82a 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java @@ -45,4 +45,6 @@ public class Actions { public List<Action> list() { return actions; } + + } diff --git a/sonar-ws/src/main/gen-java/org/sonarqube/ws/Common.java b/sonar-ws/src/main/gen-java/org/sonarqube/ws/Common.java index 75b15ce98ea..2a0bbf35bc1 100644 --- a/sonar-ws/src/main/gen-java/org/sonarqube/ws/Common.java +++ b/sonar-ws/src/main/gen-java/org/sonarqube/ws/Common.java @@ -9,6 +9,115 @@ public final class Common { com.google.protobuf.ExtensionRegistry registry) { } /** + * Protobuf enum {@code sonarqube.ws.Severity} + */ + public enum Severity + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <code>INFO = 0;</code> + */ + INFO(0, 0), + /** + * <code>MINOR = 1;</code> + */ + MINOR(1, 1), + /** + * <code>MAJOR = 2;</code> + */ + MAJOR(2, 2), + /** + * <code>CRITICAL = 3;</code> + */ + CRITICAL(3, 3), + /** + * <code>BLOCKER = 4;</code> + */ + BLOCKER(4, 4), + ; + + /** + * <code>INFO = 0;</code> + */ + public static final int INFO_VALUE = 0; + /** + * <code>MINOR = 1;</code> + */ + public static final int MINOR_VALUE = 1; + /** + * <code>MAJOR = 2;</code> + */ + public static final int MAJOR_VALUE = 2; + /** + * <code>CRITICAL = 3;</code> + */ + public static final int CRITICAL_VALUE = 3; + /** + * <code>BLOCKER = 4;</code> + */ + public static final int BLOCKER_VALUE = 4; + + + public final int getNumber() { return value; } + + public static Severity valueOf(int value) { + switch (value) { + case 0: return INFO; + case 1: return MINOR; + case 2: return MAJOR; + case 3: return CRITICAL; + case 4: return BLOCKER; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<Severity> + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap<Severity> + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<Severity>() { + public Severity findValueByNumber(int number) { + return Severity.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.sonarqube.ws.Common.getDescriptor().getEnumTypes().get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private Severity(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:sonarqube.ws.Severity) + } + + /** * Protobuf enum {@code sonarqube.ws.RuleStatus} */ public enum RuleStatus @@ -83,7 +192,7 @@ public final class Common { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return org.sonarqube.ws.Common.getDescriptor().getEnumTypes().get(0); + return org.sonarqube.ws.Common.getDescriptor().getEnumTypes().get(1); } private static final RuleStatus[] VALUES = values(); @@ -113,20 +222,20 @@ public final class Common { com.google.protobuf.MessageOrBuilder { /** - * <code>optional int32 page_index = 1;</code> + * <code>optional int32 pageIndex = 1;</code> */ boolean hasPageIndex(); /** - * <code>optional int32 page_index = 1;</code> + * <code>optional int32 pageIndex = 1;</code> */ int getPageIndex(); /** - * <code>optional int32 page_size = 2;</code> + * <code>optional int32 pageSize = 2;</code> */ boolean hasPageSize(); /** - * <code>optional int32 page_size = 2;</code> + * <code>optional int32 pageSize = 2;</code> */ int getPageSize(); @@ -260,31 +369,31 @@ public final class Common { } private int bitField0_; - public static final int PAGE_INDEX_FIELD_NUMBER = 1; + public static final int PAGEINDEX_FIELD_NUMBER = 1; private int pageIndex_; /** - * <code>optional int32 page_index = 1;</code> + * <code>optional int32 pageIndex = 1;</code> */ public boolean hasPageIndex() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * <code>optional int32 page_index = 1;</code> + * <code>optional int32 pageIndex = 1;</code> */ public int getPageIndex() { return pageIndex_; } - public static final int PAGE_SIZE_FIELD_NUMBER = 2; + public static final int PAGESIZE_FIELD_NUMBER = 2; private int pageSize_; /** - * <code>optional int32 page_size = 2;</code> + * <code>optional int32 pageSize = 2;</code> */ public boolean hasPageSize() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * <code>optional int32 page_size = 2;</code> + * <code>optional int32 pageSize = 2;</code> */ public int getPageSize() { return pageSize_; @@ -602,19 +711,19 @@ public final class Common { private int pageIndex_ ; /** - * <code>optional int32 page_index = 1;</code> + * <code>optional int32 pageIndex = 1;</code> */ public boolean hasPageIndex() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * <code>optional int32 page_index = 1;</code> + * <code>optional int32 pageIndex = 1;</code> */ public int getPageIndex() { return pageIndex_; } /** - * <code>optional int32 page_index = 1;</code> + * <code>optional int32 pageIndex = 1;</code> */ public Builder setPageIndex(int value) { bitField0_ |= 0x00000001; @@ -623,7 +732,7 @@ public final class Common { return this; } /** - * <code>optional int32 page_index = 1;</code> + * <code>optional int32 pageIndex = 1;</code> */ public Builder clearPageIndex() { bitField0_ = (bitField0_ & ~0x00000001); @@ -634,19 +743,19 @@ public final class Common { private int pageSize_ ; /** - * <code>optional int32 page_size = 2;</code> + * <code>optional int32 pageSize = 2;</code> */ public boolean hasPageSize() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * <code>optional int32 page_size = 2;</code> + * <code>optional int32 pageSize = 2;</code> */ public int getPageSize() { return pageSize_; } /** - * <code>optional int32 page_size = 2;</code> + * <code>optional int32 pageSize = 2;</code> */ public Builder setPageSize(int value) { bitField0_ |= 0x00000002; @@ -655,7 +764,7 @@ public final class Common { return this; } /** - * <code>optional int32 page_size = 2;</code> + * <code>optional int32 pageSize = 2;</code> */ public Builder clearPageSize() { bitField0_ = (bitField0_ & ~0x00000002); @@ -2182,18 +2291,18 @@ public final class Common { com.google.protobuf.MessageOrBuilder { /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ - boolean hasUuid(); + boolean hasId(); /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ - java.lang.String getUuid(); + java.lang.String getId(); /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ com.google.protobuf.ByteString - getUuidBytes(); + getIdBytes(); /** * <code>optional string key = 2;</code> @@ -2210,96 +2319,97 @@ public final class Common { getKeyBytes(); /** - * <code>optional int32 id = 3;</code> - */ - boolean hasId(); - /** - * <code>optional int32 id = 3;</code> - */ - int getId(); - - /** - * <code>optional bool enabled = 4;</code> + * <code>optional bool enabled = 3;</code> */ boolean hasEnabled(); /** - * <code>optional bool enabled = 4;</code> + * <code>optional bool enabled = 3;</code> */ boolean getEnabled(); /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ boolean hasQualifier(); /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ java.lang.String getQualifier(); /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ com.google.protobuf.ByteString getQualifierBytes(); /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ boolean hasName(); /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ java.lang.String getName(); /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ com.google.protobuf.ByteString getNameBytes(); /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ boolean hasLongName(); /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ java.lang.String getLongName(); /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ com.google.protobuf.ByteString getLongNameBytes(); /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ boolean hasPath(); /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ java.lang.String getPath(); /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ com.google.protobuf.ByteString getPathBytes(); /** - * <code>optional int32 projectId = 9;</code> + * <code>optional string project = 8;</code> */ - boolean hasProjectId(); + boolean hasProject(); /** - * <code>optional int32 projectId = 9;</code> + * <code>optional string project = 8;</code> */ - int getProjectId(); + java.lang.String getProject(); + /** + * <code>optional string project = 8;</code> + */ + com.google.protobuf.ByteString + getProjectBytes(); /** - * <code>optional int32 subProjectId = 10;</code> + * <code>optional string subProject = 9;</code> */ - boolean hasSubProjectId(); + boolean hasSubProject(); /** - * <code>optional int32 subProjectId = 10;</code> + * <code>optional string subProject = 9;</code> */ - int getSubProjectId(); + java.lang.String getSubProject(); + /** + * <code>optional string subProject = 9;</code> + */ + com.google.protobuf.ByteString + getSubProjectBytes(); } /** * Protobuf type {@code sonarqube.ws.Component} @@ -2356,7 +2466,7 @@ public final class Common { case 10: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000001; - uuid_ = bs; + id_ = bs; break; } case 18: { @@ -2367,46 +2477,43 @@ public final class Common { } case 24: { bitField0_ |= 0x00000004; - id_ = input.readInt32(); + enabled_ = input.readBool(); break; } - case 32: { + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000008; - enabled_ = input.readBool(); + qualifier_ = bs; break; } case 42: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000010; - qualifier_ = bs; + name_ = bs; break; } case 50: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000020; - name_ = bs; + longName_ = bs; break; } case 58: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000040; - longName_ = bs; + path_ = bs; break; } case 66: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000080; - path_ = bs; + project_ = bs; break; } - case 72: { + case 74: { + com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000100; - projectId_ = input.readInt32(); - break; - } - case 80: { - bitField0_ |= 0x00000200; - subProjectId_ = input.readInt32(); + subProject_ = bs; break; } } @@ -2449,19 +2556,19 @@ public final class Common { } private int bitField0_; - public static final int UUID_FIELD_NUMBER = 1; - private java.lang.Object uuid_; + public static final int ID_FIELD_NUMBER = 1; + private java.lang.Object id_; /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ - public boolean hasUuid() { + public boolean hasId() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; + public java.lang.String getId() { + java.lang.Object ref = id_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { @@ -2469,22 +2576,22 @@ public final class Common { (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { - uuid_ = s; + id_ = s; } return s; } } /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; + getIdBytes() { + java.lang.Object ref = id_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - uuid_ = b; + id_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -2533,46 +2640,31 @@ public final class Common { } } - public static final int ID_FIELD_NUMBER = 3; - private int id_; - /** - * <code>optional int32 id = 3;</code> - */ - public boolean hasId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * <code>optional int32 id = 3;</code> - */ - public int getId() { - return id_; - } - - public static final int ENABLED_FIELD_NUMBER = 4; + public static final int ENABLED_FIELD_NUMBER = 3; private boolean enabled_; /** - * <code>optional bool enabled = 4;</code> + * <code>optional bool enabled = 3;</code> */ public boolean hasEnabled() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * <code>optional bool enabled = 4;</code> + * <code>optional bool enabled = 3;</code> */ public boolean getEnabled() { return enabled_; } - public static final int QUALIFIER_FIELD_NUMBER = 5; + public static final int QUALIFIER_FIELD_NUMBER = 4; private java.lang.Object qualifier_; /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ public boolean hasQualifier() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ public java.lang.String getQualifier() { java.lang.Object ref = qualifier_; @@ -2589,7 +2681,7 @@ public final class Common { } } /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ public com.google.protobuf.ByteString getQualifierBytes() { @@ -2605,16 +2697,16 @@ public final class Common { } } - public static final int NAME_FIELD_NUMBER = 6; + public static final int NAME_FIELD_NUMBER = 5; private java.lang.Object name_; /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ public boolean hasName() { - return ((bitField0_ & 0x00000020) == 0x00000020); + return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ public java.lang.String getName() { java.lang.Object ref = name_; @@ -2631,7 +2723,7 @@ public final class Common { } } /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ public com.google.protobuf.ByteString getNameBytes() { @@ -2647,16 +2739,16 @@ public final class Common { } } - public static final int LONGNAME_FIELD_NUMBER = 7; + public static final int LONGNAME_FIELD_NUMBER = 6; private java.lang.Object longName_; /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ public boolean hasLongName() { - return ((bitField0_ & 0x00000040) == 0x00000040); + return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ public java.lang.String getLongName() { java.lang.Object ref = longName_; @@ -2673,7 +2765,7 @@ public final class Common { } } /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ public com.google.protobuf.ByteString getLongNameBytes() { @@ -2689,16 +2781,16 @@ public final class Common { } } - public static final int PATH_FIELD_NUMBER = 8; + public static final int PATH_FIELD_NUMBER = 7; private java.lang.Object path_; /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ public boolean hasPath() { - return ((bitField0_ & 0x00000080) == 0x00000080); + return ((bitField0_ & 0x00000040) == 0x00000040); } /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ public java.lang.String getPath() { java.lang.Object ref = path_; @@ -2715,7 +2807,7 @@ public final class Common { } } /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ public com.google.protobuf.ByteString getPathBytes() { @@ -2731,47 +2823,100 @@ public final class Common { } } - public static final int PROJECTID_FIELD_NUMBER = 9; - private int projectId_; + public static final int PROJECT_FIELD_NUMBER = 8; + private java.lang.Object project_; /** - * <code>optional int32 projectId = 9;</code> + * <code>optional string project = 8;</code> */ - public boolean hasProjectId() { - return ((bitField0_ & 0x00000100) == 0x00000100); + public boolean hasProject() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * <code>optional string project = 8;</code> + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + project_ = s; + } + return s; + } } /** - * <code>optional int32 projectId = 9;</code> + * <code>optional string project = 8;</code> */ - public int getProjectId() { - return projectId_; + public com.google.protobuf.ByteString + getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - public static final int SUBPROJECTID_FIELD_NUMBER = 10; - private int subProjectId_; + public static final int SUBPROJECT_FIELD_NUMBER = 9; + private java.lang.Object subProject_; /** - * <code>optional int32 subProjectId = 10;</code> + * <code>optional string subProject = 9;</code> */ - public boolean hasSubProjectId() { - return ((bitField0_ & 0x00000200) == 0x00000200); + public boolean hasSubProject() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * <code>optional string subProject = 9;</code> + */ + public java.lang.String getSubProject() { + java.lang.Object ref = subProject_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + subProject_ = s; + } + return s; + } } /** - * <code>optional int32 subProjectId = 10;</code> + * <code>optional string subProject = 9;</code> */ - public int getSubProjectId() { - return subProjectId_; + public com.google.protobuf.ByteString + getSubProjectBytes() { + java.lang.Object ref = subProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + subProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private void initFields() { - uuid_ = ""; + id_ = ""; key_ = ""; - id_ = 0; enabled_ = false; qualifier_ = ""; name_ = ""; longName_ = ""; path_ = ""; - projectId_ = 0; - subProjectId_ = 0; + project_ = ""; + subProject_ = ""; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -2787,34 +2932,31 @@ public final class Common { throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getUuidBytes()); + output.writeBytes(1, getIdBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, getKeyBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(3, id_); + output.writeBool(3, enabled_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBool(4, enabled_); + output.writeBytes(4, getQualifierBytes()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(5, getQualifierBytes()); + output.writeBytes(5, getNameBytes()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBytes(6, getNameBytes()); + output.writeBytes(6, getLongNameBytes()); } if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeBytes(7, getLongNameBytes()); + output.writeBytes(7, getPathBytes()); } if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeBytes(8, getPathBytes()); + output.writeBytes(8, getProjectBytes()); } if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeInt32(9, projectId_); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - output.writeInt32(10, subProjectId_); + output.writeBytes(9, getSubProjectBytes()); } getUnknownFields().writeTo(output); } @@ -2827,7 +2969,7 @@ public final class Common { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getUuidBytes()); + .computeBytesSize(1, getIdBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream @@ -2835,35 +2977,31 @@ public final class Common { } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, id_); + .computeBoolSize(3, enabled_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, enabled_); + .computeBytesSize(4, getQualifierBytes()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, getQualifierBytes()); + .computeBytesSize(5, getNameBytes()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(6, getNameBytes()); + .computeBytesSize(6, getLongNameBytes()); } if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(7, getLongNameBytes()); + .computeBytesSize(7, getPathBytes()); } if (((bitField0_ & 0x00000080) == 0x00000080)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(8, getPathBytes()); + .computeBytesSize(8, getProjectBytes()); } if (((bitField0_ & 0x00000100) == 0x00000100)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(9, projectId_); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(10, subProjectId_); + .computeBytesSize(9, getSubProjectBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -2982,26 +3120,24 @@ public final class Common { public Builder clear() { super.clear(); - uuid_ = ""; + id_ = ""; bitField0_ = (bitField0_ & ~0x00000001); key_ = ""; bitField0_ = (bitField0_ & ~0x00000002); - id_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); enabled_ = false; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); qualifier_ = ""; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000008); name_ = ""; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000010); longName_ = ""; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000020); path_ = ""; + bitField0_ = (bitField0_ & ~0x00000040); + project_ = ""; bitField0_ = (bitField0_ & ~0x00000080); - projectId_ = 0; + subProject_ = ""; bitField0_ = (bitField0_ & ~0x00000100); - subProjectId_ = 0; - bitField0_ = (bitField0_ & ~0x00000200); return this; } @@ -3033,7 +3169,7 @@ public final class Common { if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - result.uuid_ = uuid_; + result.id_ = id_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } @@ -3041,35 +3177,31 @@ public final class Common { if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } - result.id_ = id_; + result.enabled_ = enabled_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } - result.enabled_ = enabled_; + result.qualifier_ = qualifier_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } - result.qualifier_ = qualifier_; + result.name_ = name_; if (((from_bitField0_ & 0x00000020) == 0x00000020)) { to_bitField0_ |= 0x00000020; } - result.name_ = name_; + result.longName_ = longName_; if (((from_bitField0_ & 0x00000040) == 0x00000040)) { to_bitField0_ |= 0x00000040; } - result.longName_ = longName_; + result.path_ = path_; if (((from_bitField0_ & 0x00000080) == 0x00000080)) { to_bitField0_ |= 0x00000080; } - result.path_ = path_; + result.project_ = project_; if (((from_bitField0_ & 0x00000100) == 0x00000100)) { to_bitField0_ |= 0x00000100; } - result.projectId_ = projectId_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000200; - } - result.subProjectId_ = subProjectId_; + result.subProject_ = subProject_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -3086,9 +3218,9 @@ public final class Common { public Builder mergeFrom(org.sonarqube.ws.Common.Component other) { if (other == org.sonarqube.ws.Common.Component.getDefaultInstance()) return this; - if (other.hasUuid()) { + if (other.hasId()) { bitField0_ |= 0x00000001; - uuid_ = other.uuid_; + id_ = other.id_; onChanged(); } if (other.hasKey()) { @@ -3096,37 +3228,38 @@ public final class Common { key_ = other.key_; onChanged(); } - if (other.hasId()) { - setId(other.getId()); - } if (other.hasEnabled()) { setEnabled(other.getEnabled()); } if (other.hasQualifier()) { - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000008; qualifier_ = other.qualifier_; onChanged(); } if (other.hasName()) { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000010; name_ = other.name_; onChanged(); } if (other.hasLongName()) { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000020; longName_ = other.longName_; onChanged(); } if (other.hasPath()) { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000040; path_ = other.path_; onChanged(); } - if (other.hasProjectId()) { - setProjectId(other.getProjectId()); + if (other.hasProject()) { + bitField0_ |= 0x00000080; + project_ = other.project_; + onChanged(); } - if (other.hasSubProjectId()) { - setSubProjectId(other.getSubProjectId()); + if (other.hasSubProject()) { + bitField0_ |= 0x00000100; + subProject_ = other.subProject_; + onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; @@ -3155,24 +3288,24 @@ public final class Common { } private int bitField0_; - private java.lang.Object uuid_ = ""; + private java.lang.Object id_ = ""; /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ - public boolean hasUuid() { + public boolean hasId() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; + public java.lang.String getId() { + java.lang.Object ref = id_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { - uuid_ = s; + id_ = s; } return s; } else { @@ -3180,53 +3313,53 @@ public final class Common { } } /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; + getIdBytes() { + java.lang.Object ref = id_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - uuid_ = b; + id_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ - public Builder setUuid( + public Builder setId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; - uuid_ = value; + id_ = value; onChanged(); return this; } /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ - public Builder clearUuid() { + public Builder clearId() { bitField0_ = (bitField0_ & ~0x00000001); - uuid_ = getDefaultInstance().getUuid(); + id_ = getDefaultInstance().getId(); onChanged(); return this; } /** - * <code>optional string uuid = 1;</code> + * <code>optional string id = 1;</code> */ - public Builder setUuidBytes( + public Builder setIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; - uuid_ = value; + id_ = value; onChanged(); return this; } @@ -3307,65 +3440,33 @@ public final class Common { return this; } - private int id_ ; - /** - * <code>optional int32 id = 3;</code> - */ - public boolean hasId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * <code>optional int32 id = 3;</code> - */ - public int getId() { - return id_; - } - /** - * <code>optional int32 id = 3;</code> - */ - public Builder setId(int value) { - bitField0_ |= 0x00000004; - id_ = value; - onChanged(); - return this; - } - /** - * <code>optional int32 id = 3;</code> - */ - public Builder clearId() { - bitField0_ = (bitField0_ & ~0x00000004); - id_ = 0; - onChanged(); - return this; - } - private boolean enabled_ ; /** - * <code>optional bool enabled = 4;</code> + * <code>optional bool enabled = 3;</code> */ public boolean hasEnabled() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * <code>optional bool enabled = 4;</code> + * <code>optional bool enabled = 3;</code> */ public boolean getEnabled() { return enabled_; } /** - * <code>optional bool enabled = 4;</code> + * <code>optional bool enabled = 3;</code> */ public Builder setEnabled(boolean value) { - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000004; enabled_ = value; onChanged(); return this; } /** - * <code>optional bool enabled = 4;</code> + * <code>optional bool enabled = 3;</code> */ public Builder clearEnabled() { - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); enabled_ = false; onChanged(); return this; @@ -3373,13 +3474,13 @@ public final class Common { private java.lang.Object qualifier_ = ""; /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ public boolean hasQualifier() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ public java.lang.String getQualifier() { java.lang.Object ref = qualifier_; @@ -3396,7 +3497,7 @@ public final class Common { } } /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ public com.google.protobuf.ByteString getQualifierBytes() { @@ -3412,36 +3513,36 @@ public final class Common { } } /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ public Builder setQualifier( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000008; qualifier_ = value; onChanged(); return this; } /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ public Builder clearQualifier() { - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000008); qualifier_ = getDefaultInstance().getQualifier(); onChanged(); return this; } /** - * <code>optional string qualifier = 5;</code> + * <code>optional string qualifier = 4;</code> */ public Builder setQualifierBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000008; qualifier_ = value; onChanged(); return this; @@ -3449,13 +3550,13 @@ public final class Common { private java.lang.Object name_ = ""; /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ public boolean hasName() { - return ((bitField0_ & 0x00000020) == 0x00000020); + return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ public java.lang.String getName() { java.lang.Object ref = name_; @@ -3472,7 +3573,7 @@ public final class Common { } } /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ public com.google.protobuf.ByteString getNameBytes() { @@ -3488,36 +3589,36 @@ public final class Common { } } /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000010; name_ = value; onChanged(); return this; } /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000010); name_ = getDefaultInstance().getName(); onChanged(); return this; } /** - * <code>optional string name = 6;</code> + * <code>optional string name = 5;</code> */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000010; name_ = value; onChanged(); return this; @@ -3525,13 +3626,13 @@ public final class Common { private java.lang.Object longName_ = ""; /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ public boolean hasLongName() { - return ((bitField0_ & 0x00000040) == 0x00000040); + return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ public java.lang.String getLongName() { java.lang.Object ref = longName_; @@ -3548,7 +3649,7 @@ public final class Common { } } /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ public com.google.protobuf.ByteString getLongNameBytes() { @@ -3564,36 +3665,36 @@ public final class Common { } } /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ public Builder setLongName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000020; longName_ = value; onChanged(); return this; } /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ public Builder clearLongName() { - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000020); longName_ = getDefaultInstance().getLongName(); onChanged(); return this; } /** - * <code>optional string longName = 7;</code> + * <code>optional string longName = 6;</code> */ public Builder setLongNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000020; longName_ = value; onChanged(); return this; @@ -3601,13 +3702,13 @@ public final class Common { private java.lang.Object path_ = ""; /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ public boolean hasPath() { - return ((bitField0_ & 0x00000080) == 0x00000080); + return ((bitField0_ & 0x00000040) == 0x00000040); } /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ public java.lang.String getPath() { java.lang.Object ref = path_; @@ -3624,7 +3725,7 @@ public final class Common { } } /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ public com.google.protobuf.ByteString getPathBytes() { @@ -3640,101 +3741,189 @@ public final class Common { } } /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ public Builder setPath( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000040; path_ = value; onChanged(); return this; } /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ public Builder clearPath() { - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000040); path_ = getDefaultInstance().getPath(); onChanged(); return this; } /** - * <code>optional string path = 8;</code> + * <code>optional string path = 7;</code> */ public Builder setPathBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000040; path_ = value; onChanged(); return this; } - private int projectId_ ; + private java.lang.Object project_ = ""; /** - * <code>optional int32 projectId = 9;</code> + * <code>optional string project = 8;</code> */ - public boolean hasProjectId() { - return ((bitField0_ & 0x00000100) == 0x00000100); + public boolean hasProject() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * <code>optional string project = 8;</code> + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + project_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } } /** - * <code>optional int32 projectId = 9;</code> + * <code>optional string project = 8;</code> */ - public int getProjectId() { - return projectId_; + public com.google.protobuf.ByteString + getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** - * <code>optional int32 projectId = 9;</code> + * <code>optional string project = 8;</code> */ - public Builder setProjectId(int value) { - bitField0_ |= 0x00000100; - projectId_ = value; + public Builder setProject( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + project_ = value; onChanged(); return this; } /** - * <code>optional int32 projectId = 9;</code> + * <code>optional string project = 8;</code> */ - public Builder clearProjectId() { - bitField0_ = (bitField0_ & ~0x00000100); - projectId_ = 0; + public Builder clearProject() { + bitField0_ = (bitField0_ & ~0x00000080); + project_ = getDefaultInstance().getProject(); + onChanged(); + return this; + } + /** + * <code>optional string project = 8;</code> + */ + public Builder setProjectBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + project_ = value; onChanged(); return this; } - private int subProjectId_ ; + private java.lang.Object subProject_ = ""; + /** + * <code>optional string subProject = 9;</code> + */ + public boolean hasSubProject() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * <code>optional string subProject = 9;</code> + */ + public java.lang.String getSubProject() { + java.lang.Object ref = subProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + subProject_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } /** - * <code>optional int32 subProjectId = 10;</code> + * <code>optional string subProject = 9;</code> */ - public boolean hasSubProjectId() { - return ((bitField0_ & 0x00000200) == 0x00000200); + public com.google.protobuf.ByteString + getSubProjectBytes() { + java.lang.Object ref = subProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + subProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** - * <code>optional int32 subProjectId = 10;</code> + * <code>optional string subProject = 9;</code> */ - public int getSubProjectId() { - return subProjectId_; + public Builder setSubProject( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + subProject_ = value; + onChanged(); + return this; } /** - * <code>optional int32 subProjectId = 10;</code> + * <code>optional string subProject = 9;</code> */ - public Builder setSubProjectId(int value) { - bitField0_ |= 0x00000200; - subProjectId_ = value; + public Builder clearSubProject() { + bitField0_ = (bitField0_ & ~0x00000100); + subProject_ = getDefaultInstance().getSubProject(); onChanged(); return this; } /** - * <code>optional int32 subProjectId = 10;</code> + * <code>optional string subProject = 9;</code> */ - public Builder clearSubProjectId() { - bitField0_ = (bitField0_ & ~0x00000200); - subProjectId_ = 0; + public Builder setSubProjectBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + subProject_ = value; onChanged(); return this; } @@ -5944,24 +6133,25 @@ public final class Common { descriptor; static { java.lang.String[] descriptorData = { - "\n\017ws-common.proto\022\014sonarqube.ws\"M\n\006Pagin" + - "g\022\022\n\npage_index\030\001 \001(\005\022\021\n\tpage_size\030\002 \001(\005" + - "\022\r\n\005total\030\003 \001(\005\022\r\n\005pages\030\004 \001(\005\"C\n\005Facet\022" + - "\020\n\010property\030\001 \001(\t\022(\n\006values\030\002 \003(\0132\030.sona" + - "rqube.ws.FacetValue\"(\n\nFacetValue\022\013\n\003val" + - "\030\001 \001(\t\022\r\n\005count\030\002 \001(\003\"\255\001\n\tComponent\022\014\n\004u" + - "uid\030\001 \001(\t\022\013\n\003key\030\002 \001(\t\022\n\n\002id\030\003 \001(\005\022\017\n\007en" + - "abled\030\004 \001(\010\022\021\n\tqualifier\030\005 \001(\t\022\014\n\004name\030\006" + - " \001(\t\022\020\n\010longName\030\007 \001(\t\022\014\n\004path\030\010 \001(\t\022\021\n\t" + - "projectId\030\t \001(\005\022\024\n\014subProjectId\030\n \001(\005\"y\n", - "\004Rule\022\013\n\003key\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022\014\n\004lang" + - "\030\003 \001(\t\022\014\n\004desc\030\004 \001(\t\022(\n\006status\030\005 \001(\0162\030.s" + - "onarqube.ws.RuleStatus\022\020\n\010langName\030\006 \001(\t" + - "\"B\n\004User\022\r\n\005login\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022\r\n" + - "\005email\030\003 \001(\t\022\016\n\006active\030\004 \001(\010*>\n\nRuleStat" + - "us\022\010\n\004BETA\020\000\022\016\n\nDEPRECATED\020\001\022\t\n\005READY\020\002\022" + - "\013\n\007REMOVED\020\003B\034\n\020org.sonarqube.wsB\006Common" + - "H\001" + "\n\017ws-common.proto\022\014sonarqube.ws\"K\n\006Pagin" + + "g\022\021\n\tpageIndex\030\001 \001(\005\022\020\n\010pageSize\030\002 \001(\005\022\r" + + "\n\005total\030\003 \001(\005\022\r\n\005pages\030\004 \001(\005\"C\n\005Facet\022\020\n" + + "\010property\030\001 \001(\t\022(\n\006values\030\002 \003(\0132\030.sonarq" + + "ube.ws.FacetValue\"(\n\nFacetValue\022\013\n\003val\030\001" + + " \001(\t\022\r\n\005count\030\002 \001(\003\"\233\001\n\tComponent\022\n\n\002id\030" + + "\001 \001(\t\022\013\n\003key\030\002 \001(\t\022\017\n\007enabled\030\003 \001(\010\022\021\n\tq" + + "ualifier\030\004 \001(\t\022\014\n\004name\030\005 \001(\t\022\020\n\010longName" + + "\030\006 \001(\t\022\014\n\004path\030\007 \001(\t\022\017\n\007project\030\010 \001(\t\022\022\n" + + "\nsubProject\030\t \001(\t\"y\n\004Rule\022\013\n\003key\030\001 \001(\t\022\014", + "\n\004name\030\002 \001(\t\022\014\n\004lang\030\003 \001(\t\022\014\n\004desc\030\004 \001(\t" + + "\022(\n\006status\030\005 \001(\0162\030.sonarqube.ws.RuleStat" + + "us\022\020\n\010langName\030\006 \001(\t\"B\n\004User\022\r\n\005login\030\001 " + + "\001(\t\022\014\n\004name\030\002 \001(\t\022\r\n\005email\030\003 \001(\t\022\016\n\006acti" + + "ve\030\004 \001(\010*E\n\010Severity\022\010\n\004INFO\020\000\022\t\n\005MINOR\020" + + "\001\022\t\n\005MAJOR\020\002\022\014\n\010CRITICAL\020\003\022\013\n\007BLOCKER\020\004*" + + ">\n\nRuleStatus\022\010\n\004BETA\020\000\022\016\n\nDEPRECATED\020\001\022" + + "\t\n\005READY\020\002\022\013\n\007REMOVED\020\003B\034\n\020org.sonarqube" + + ".wsB\006CommonH\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -5998,7 +6188,7 @@ public final class Common { internal_static_sonarqube_ws_Component_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_sonarqube_ws_Component_descriptor, - new java.lang.String[] { "Uuid", "Key", "Id", "Enabled", "Qualifier", "Name", "LongName", "Path", "ProjectId", "SubProjectId", }); + new java.lang.String[] { "Id", "Key", "Enabled", "Qualifier", "Name", "LongName", "Path", "Project", "SubProject", }); internal_static_sonarqube_ws_Rule_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_sonarqube_ws_Rule_fieldAccessorTable = new diff --git a/sonar-ws/src/main/gen-java/org/sonarqube/ws/Issues.java b/sonar-ws/src/main/gen-java/org/sonarqube/ws/Issues.java index fe73098304a..15fb9df79dc 100644 --- a/sonar-ws/src/main/gen-java/org/sonarqube/ws/Issues.java +++ b/sonar-ws/src/main/gen-java/org/sonarqube/ws/Issues.java @@ -13,173 +13,316 @@ public final class Issues { com.google.protobuf.MessageOrBuilder { /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> - * - * <pre> - * TODO errors - * </pre> + * <code>optional int64 total = 1;</code> + */ + boolean hasTotal(); + /** + * <code>optional int64 total = 1;</code> + */ + long getTotal(); + + /** + * <code>optional int64 p = 2;</code> + */ + boolean hasP(); + /** + * <code>optional int64 p = 2;</code> + */ + long getP(); + + /** + * <code>optional int32 ps = 3;</code> + */ + boolean hasPs(); + /** + * <code>optional int32 ps = 3;</code> + */ + int getPs(); + + /** + * <code>optional .sonarqube.ws.Paging paging = 4;</code> */ boolean hasPaging(); /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> + * <code>optional .sonarqube.ws.Paging paging = 4;</code> + */ + org.sonarqube.ws.Common.Paging getPaging(); + /** + * <code>optional .sonarqube.ws.Paging paging = 4;</code> + */ + org.sonarqube.ws.Common.PagingOrBuilder getPagingOrBuilder(); + + /** + * <code>optional int64 debtTotal = 5;</code> * * <pre> - * TODO errors + * Total amount of debt, only when the facet "total" is enabled * </pre> */ - org.sonarqube.ws.Common.Paging getPaging(); + boolean hasDebtTotal(); /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> + * <code>optional int64 debtTotal = 5;</code> * * <pre> - * TODO errors + * Total amount of debt, only when the facet "total" is enabled * </pre> */ - org.sonarqube.ws.Common.PagingOrBuilder getPagingOrBuilder(); + long getDebtTotal(); /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ java.util.List<org.sonarqube.ws.Issues.Issue> getIssuesList(); /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ org.sonarqube.ws.Issues.Issue getIssues(int index); /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ int getIssuesCount(); /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ java.util.List<? extends org.sonarqube.ws.Issues.IssueOrBuilder> getIssuesOrBuilderList(); /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ org.sonarqube.ws.Issues.IssueOrBuilder getIssuesOrBuilder( int index); /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - java.util.List<org.sonarqube.ws.Common.Facet> - getFacetsList(); - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - org.sonarqube.ws.Common.Facet getFacets(int index); - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> + * <code>optional bool projectsPresentIfEmpty = 8;</code> */ - int getFacetsCount(); + boolean hasProjectsPresentIfEmpty(); /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> + * <code>optional bool projectsPresentIfEmpty = 8;</code> */ - java.util.List<? extends org.sonarqube.ws.Common.FacetOrBuilder> - getFacetsOrBuilderList(); - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - org.sonarqube.ws.Common.FacetOrBuilder getFacetsOrBuilder( - int index); + boolean getProjectsPresentIfEmpty(); /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ java.util.List<org.sonarqube.ws.Common.Component> getProjectsList(); /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ org.sonarqube.ws.Common.Component getProjects(int index); /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ int getProjectsCount(); /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ java.util.List<? extends org.sonarqube.ws.Common.ComponentOrBuilder> getProjectsOrBuilderList(); /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ org.sonarqube.ws.Common.ComponentOrBuilder getProjectsOrBuilder( int index); /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>optional bool componentsPresentIfEmpty = 10;</code> + */ + boolean hasComponentsPresentIfEmpty(); + /** + * <code>optional bool componentsPresentIfEmpty = 10;</code> + */ + boolean getComponentsPresentIfEmpty(); + + /** + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ java.util.List<org.sonarqube.ws.Common.Component> getComponentsList(); /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ org.sonarqube.ws.Common.Component getComponents(int index); /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ int getComponentsCount(); /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ java.util.List<? extends org.sonarqube.ws.Common.ComponentOrBuilder> getComponentsOrBuilderList(); /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ org.sonarqube.ws.Common.ComponentOrBuilder getComponentsOrBuilder( int index); /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>optional bool rulesPresentIfEmpty = 12;</code> + */ + boolean hasRulesPresentIfEmpty(); + /** + * <code>optional bool rulesPresentIfEmpty = 12;</code> + */ + boolean getRulesPresentIfEmpty(); + + /** + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ java.util.List<org.sonarqube.ws.Common.Rule> getRulesList(); /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ org.sonarqube.ws.Common.Rule getRules(int index); /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ int getRulesCount(); /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ java.util.List<? extends org.sonarqube.ws.Common.RuleOrBuilder> getRulesOrBuilderList(); /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ org.sonarqube.ws.Common.RuleOrBuilder getRulesOrBuilder( int index); /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>optional bool usersPresentIfEmpty = 14;</code> + */ + boolean hasUsersPresentIfEmpty(); + /** + * <code>optional bool usersPresentIfEmpty = 14;</code> + */ + boolean getUsersPresentIfEmpty(); + + /** + * <code>repeated .sonarqube.ws.User users = 15;</code> */ java.util.List<org.sonarqube.ws.Common.User> getUsersList(); /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ org.sonarqube.ws.Common.User getUsers(int index); /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ int getUsersCount(); /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ java.util.List<? extends org.sonarqube.ws.Common.UserOrBuilder> getUsersOrBuilderList(); /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ org.sonarqube.ws.Common.UserOrBuilder getUsersOrBuilder( int index); + + /** + * <code>optional bool actionPlansPresentIfEmpty = 16;</code> + */ + boolean hasActionPlansPresentIfEmpty(); + /** + * <code>optional bool actionPlansPresentIfEmpty = 16;</code> + */ + boolean getActionPlansPresentIfEmpty(); + + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + java.util.List<org.sonarqube.ws.Issues.ActionPlan> + getActionPlansList(); + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + org.sonarqube.ws.Issues.ActionPlan getActionPlans(int index); + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + int getActionPlansCount(); + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + java.util.List<? extends org.sonarqube.ws.Issues.ActionPlanOrBuilder> + getActionPlansOrBuilderList(); + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + org.sonarqube.ws.Issues.ActionPlanOrBuilder getActionPlansOrBuilder( + int index); + + /** + * <code>optional bool languagesPresentIfEmpty = 18;</code> + */ + boolean hasLanguagesPresentIfEmpty(); + /** + * <code>optional bool languagesPresentIfEmpty = 18;</code> + */ + boolean getLanguagesPresentIfEmpty(); + + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + java.util.List<org.sonarqube.ws.Issues.Language> + getLanguagesList(); + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + org.sonarqube.ws.Issues.Language getLanguages(int index); + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + int getLanguagesCount(); + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + java.util.List<? extends org.sonarqube.ws.Issues.LanguageOrBuilder> + getLanguagesOrBuilderList(); + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + org.sonarqube.ws.Issues.LanguageOrBuilder getLanguagesOrBuilder( + int index); + + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + java.util.List<org.sonarqube.ws.Common.Facet> + getFacetsList(); + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + org.sonarqube.ws.Common.Facet getFacets(int index); + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + int getFacetsCount(); + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + java.util.List<? extends org.sonarqube.ws.Common.FacetOrBuilder> + getFacetsOrBuilderList(); + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + org.sonarqube.ws.Common.FacetOrBuilder getFacetsOrBuilder( + int index); + + /** + * <code>optional bool facetsPresentIfEmpty = 21;</code> + */ + boolean hasFacetsPresentIfEmpty(); + /** + * <code>optional bool facetsPresentIfEmpty = 21;</code> + */ + boolean getFacetsPresentIfEmpty(); } /** * Protobuf type {@code sonarqube.ws.issues.Search} @@ -237,9 +380,24 @@ public final class Issues { } break; } - case 10: { + case 8: { + bitField0_ |= 0x00000001; + total_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + p_ = input.readInt64(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + ps_ = input.readInt32(); + break; + } + case 34: { org.sonarqube.ws.Common.Paging.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { subBuilder = paging_.toBuilder(); } paging_ = input.readMessage(org.sonarqube.ws.Common.Paging.PARSER, extensionRegistry); @@ -247,57 +405,113 @@ public final class Issues { subBuilder.mergeFrom(paging_); paging_ = subBuilder.buildPartial(); } - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000008; break; } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + case 40: { + bitField0_ |= 0x00000010; + debtTotal_ = input.readInt64(); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { issues_ = new java.util.ArrayList<org.sonarqube.ws.Issues.Issue>(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000020; } issues_.add(input.readMessage(org.sonarqube.ws.Issues.Issue.PARSER, extensionRegistry)); break; } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - facets_ = new java.util.ArrayList<org.sonarqube.ws.Common.Facet>(); - mutable_bitField0_ |= 0x00000004; - } - facets_.add(input.readMessage(org.sonarqube.ws.Common.Facet.PARSER, extensionRegistry)); + case 64: { + bitField0_ |= 0x00000020; + projectsPresentIfEmpty_ = input.readBool(); break; } - case 34: { - if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + case 74: { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { projects_ = new java.util.ArrayList<org.sonarqube.ws.Common.Component>(); - mutable_bitField0_ |= 0x00000008; + mutable_bitField0_ |= 0x00000080; } projects_.add(input.readMessage(org.sonarqube.ws.Common.Component.PARSER, extensionRegistry)); break; } - case 42: { - if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + case 80: { + bitField0_ |= 0x00000040; + componentsPresentIfEmpty_ = input.readBool(); + break; + } + case 90: { + if (!((mutable_bitField0_ & 0x00000200) == 0x00000200)) { components_ = new java.util.ArrayList<org.sonarqube.ws.Common.Component>(); - mutable_bitField0_ |= 0x00000010; + mutable_bitField0_ |= 0x00000200; } components_.add(input.readMessage(org.sonarqube.ws.Common.Component.PARSER, extensionRegistry)); break; } - case 50: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + case 96: { + bitField0_ |= 0x00000080; + rulesPresentIfEmpty_ = input.readBool(); + break; + } + case 106: { + if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { rules_ = new java.util.ArrayList<org.sonarqube.ws.Common.Rule>(); - mutable_bitField0_ |= 0x00000020; + mutable_bitField0_ |= 0x00000800; } rules_.add(input.readMessage(org.sonarqube.ws.Common.Rule.PARSER, extensionRegistry)); break; } - case 58: { - if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + case 112: { + bitField0_ |= 0x00000100; + usersPresentIfEmpty_ = input.readBool(); + break; + } + case 122: { + if (!((mutable_bitField0_ & 0x00002000) == 0x00002000)) { users_ = new java.util.ArrayList<org.sonarqube.ws.Common.User>(); - mutable_bitField0_ |= 0x00000040; + mutable_bitField0_ |= 0x00002000; } users_.add(input.readMessage(org.sonarqube.ws.Common.User.PARSER, extensionRegistry)); break; } + case 128: { + bitField0_ |= 0x00000200; + actionPlansPresentIfEmpty_ = input.readBool(); + break; + } + case 138: { + if (!((mutable_bitField0_ & 0x00008000) == 0x00008000)) { + actionPlans_ = new java.util.ArrayList<org.sonarqube.ws.Issues.ActionPlan>(); + mutable_bitField0_ |= 0x00008000; + } + actionPlans_.add(input.readMessage(org.sonarqube.ws.Issues.ActionPlan.PARSER, extensionRegistry)); + break; + } + case 144: { + bitField0_ |= 0x00000400; + languagesPresentIfEmpty_ = input.readBool(); + break; + } + case 154: { + if (!((mutable_bitField0_ & 0x00020000) == 0x00020000)) { + languages_ = new java.util.ArrayList<org.sonarqube.ws.Issues.Language>(); + mutable_bitField0_ |= 0x00020000; + } + languages_.add(input.readMessage(org.sonarqube.ws.Issues.Language.PARSER, extensionRegistry)); + break; + } + case 162: { + if (!((mutable_bitField0_ & 0x00040000) == 0x00040000)) { + facets_ = new java.util.ArrayList<org.sonarqube.ws.Common.Facet>(); + mutable_bitField0_ |= 0x00040000; + } + facets_.add(input.readMessage(org.sonarqube.ws.Common.Facet.PARSER, extensionRegistry)); + break; + } + case 168: { + bitField0_ |= 0x00000800; + facetsPresentIfEmpty_ = input.readBool(); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -306,24 +520,30 @@ public final class Issues { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { issues_ = java.util.Collections.unmodifiableList(issues_); } - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - facets_ = java.util.Collections.unmodifiableList(facets_); - } - if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { projects_ = java.util.Collections.unmodifiableList(projects_); } - if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + if (((mutable_bitField0_ & 0x00000200) == 0x00000200)) { components_ = java.util.Collections.unmodifiableList(components_); } - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { rules_ = java.util.Collections.unmodifiableList(rules_); } - if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + if (((mutable_bitField0_ & 0x00002000) == 0x00002000)) { users_ = java.util.Collections.unmodifiableList(users_); } + if (((mutable_bitField0_ & 0x00008000) == 0x00008000)) { + actionPlans_ = java.util.Collections.unmodifiableList(actionPlans_); + } + if (((mutable_bitField0_ & 0x00020000) == 0x00020000)) { + languages_ = java.util.Collections.unmodifiableList(languages_); + } + if (((mutable_bitField0_ & 0x00040000) == 0x00040000)) { + facets_ = java.util.Collections.unmodifiableList(facets_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -356,257 +576,501 @@ public final class Issues { } private int bitField0_; - public static final int PAGING_FIELD_NUMBER = 1; + public static final int TOTAL_FIELD_NUMBER = 1; + private long total_; + /** + * <code>optional int64 total = 1;</code> + */ + public boolean hasTotal() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional int64 total = 1;</code> + */ + public long getTotal() { + return total_; + } + + public static final int P_FIELD_NUMBER = 2; + private long p_; + /** + * <code>optional int64 p = 2;</code> + */ + public boolean hasP() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional int64 p = 2;</code> + */ + public long getP() { + return p_; + } + + public static final int PS_FIELD_NUMBER = 3; + private int ps_; + /** + * <code>optional int32 ps = 3;</code> + */ + public boolean hasPs() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional int32 ps = 3;</code> + */ + public int getPs() { + return ps_; + } + + public static final int PAGING_FIELD_NUMBER = 4; private org.sonarqube.ws.Common.Paging paging_; /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> - * - * <pre> - * TODO errors - * </pre> + * <code>optional .sonarqube.ws.Paging paging = 4;</code> */ public boolean hasPaging() { - return ((bitField0_ & 0x00000001) == 0x00000001); + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional .sonarqube.ws.Paging paging = 4;</code> + */ + public org.sonarqube.ws.Common.Paging getPaging() { + return paging_; + } + /** + * <code>optional .sonarqube.ws.Paging paging = 4;</code> + */ + public org.sonarqube.ws.Common.PagingOrBuilder getPagingOrBuilder() { + return paging_; } + + public static final int DEBTTOTAL_FIELD_NUMBER = 5; + private long debtTotal_; /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> + * <code>optional int64 debtTotal = 5;</code> * * <pre> - * TODO errors + * Total amount of debt, only when the facet "total" is enabled * </pre> */ - public org.sonarqube.ws.Common.Paging getPaging() { - return paging_; + public boolean hasDebtTotal() { + return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> + * <code>optional int64 debtTotal = 5;</code> * * <pre> - * TODO errors + * Total amount of debt, only when the facet "total" is enabled * </pre> */ - public org.sonarqube.ws.Common.PagingOrBuilder getPagingOrBuilder() { - return paging_; + public long getDebtTotal() { + return debtTotal_; } - public static final int ISSUES_FIELD_NUMBER = 2; + public static final int ISSUES_FIELD_NUMBER = 6; private java.util.List<org.sonarqube.ws.Issues.Issue> issues_; /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public java.util.List<org.sonarqube.ws.Issues.Issue> getIssuesList() { return issues_; } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public java.util.List<? extends org.sonarqube.ws.Issues.IssueOrBuilder> getIssuesOrBuilderList() { return issues_; } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public int getIssuesCount() { return issues_.size(); } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public org.sonarqube.ws.Issues.Issue getIssues(int index) { return issues_.get(index); } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public org.sonarqube.ws.Issues.IssueOrBuilder getIssuesOrBuilder( int index) { return issues_.get(index); } - public static final int FACETS_FIELD_NUMBER = 3; - private java.util.List<org.sonarqube.ws.Common.Facet> facets_; + public static final int PROJECTSPRESENTIFEMPTY_FIELD_NUMBER = 8; + private boolean projectsPresentIfEmpty_; /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> + * <code>optional bool projectsPresentIfEmpty = 8;</code> */ - public java.util.List<org.sonarqube.ws.Common.Facet> getFacetsList() { - return facets_; - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public java.util.List<? extends org.sonarqube.ws.Common.FacetOrBuilder> - getFacetsOrBuilderList() { - return facets_; - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public int getFacetsCount() { - return facets_.size(); - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public org.sonarqube.ws.Common.Facet getFacets(int index) { - return facets_.get(index); + public boolean hasProjectsPresentIfEmpty() { + return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> + * <code>optional bool projectsPresentIfEmpty = 8;</code> */ - public org.sonarqube.ws.Common.FacetOrBuilder getFacetsOrBuilder( - int index) { - return facets_.get(index); + public boolean getProjectsPresentIfEmpty() { + return projectsPresentIfEmpty_; } - public static final int PROJECTS_FIELD_NUMBER = 4; + public static final int PROJECTS_FIELD_NUMBER = 9; private java.util.List<org.sonarqube.ws.Common.Component> projects_; /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public java.util.List<org.sonarqube.ws.Common.Component> getProjectsList() { return projects_; } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public java.util.List<? extends org.sonarqube.ws.Common.ComponentOrBuilder> getProjectsOrBuilderList() { return projects_; } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public int getProjectsCount() { return projects_.size(); } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public org.sonarqube.ws.Common.Component getProjects(int index) { return projects_.get(index); } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public org.sonarqube.ws.Common.ComponentOrBuilder getProjectsOrBuilder( int index) { return projects_.get(index); } - public static final int COMPONENTS_FIELD_NUMBER = 5; + public static final int COMPONENTSPRESENTIFEMPTY_FIELD_NUMBER = 10; + private boolean componentsPresentIfEmpty_; + /** + * <code>optional bool componentsPresentIfEmpty = 10;</code> + */ + public boolean hasComponentsPresentIfEmpty() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * <code>optional bool componentsPresentIfEmpty = 10;</code> + */ + public boolean getComponentsPresentIfEmpty() { + return componentsPresentIfEmpty_; + } + + public static final int COMPONENTS_FIELD_NUMBER = 11; private java.util.List<org.sonarqube.ws.Common.Component> components_; /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public java.util.List<org.sonarqube.ws.Common.Component> getComponentsList() { return components_; } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public java.util.List<? extends org.sonarqube.ws.Common.ComponentOrBuilder> getComponentsOrBuilderList() { return components_; } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public int getComponentsCount() { return components_.size(); } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public org.sonarqube.ws.Common.Component getComponents(int index) { return components_.get(index); } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public org.sonarqube.ws.Common.ComponentOrBuilder getComponentsOrBuilder( int index) { return components_.get(index); } - public static final int RULES_FIELD_NUMBER = 6; + public static final int RULESPRESENTIFEMPTY_FIELD_NUMBER = 12; + private boolean rulesPresentIfEmpty_; + /** + * <code>optional bool rulesPresentIfEmpty = 12;</code> + */ + public boolean hasRulesPresentIfEmpty() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * <code>optional bool rulesPresentIfEmpty = 12;</code> + */ + public boolean getRulesPresentIfEmpty() { + return rulesPresentIfEmpty_; + } + + public static final int RULES_FIELD_NUMBER = 13; private java.util.List<org.sonarqube.ws.Common.Rule> rules_; /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public java.util.List<org.sonarqube.ws.Common.Rule> getRulesList() { return rules_; } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public java.util.List<? extends org.sonarqube.ws.Common.RuleOrBuilder> getRulesOrBuilderList() { return rules_; } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public int getRulesCount() { return rules_.size(); } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public org.sonarqube.ws.Common.Rule getRules(int index) { return rules_.get(index); } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public org.sonarqube.ws.Common.RuleOrBuilder getRulesOrBuilder( int index) { return rules_.get(index); } - public static final int USERS_FIELD_NUMBER = 7; + public static final int USERSPRESENTIFEMPTY_FIELD_NUMBER = 14; + private boolean usersPresentIfEmpty_; + /** + * <code>optional bool usersPresentIfEmpty = 14;</code> + */ + public boolean hasUsersPresentIfEmpty() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * <code>optional bool usersPresentIfEmpty = 14;</code> + */ + public boolean getUsersPresentIfEmpty() { + return usersPresentIfEmpty_; + } + + public static final int USERS_FIELD_NUMBER = 15; private java.util.List<org.sonarqube.ws.Common.User> users_; /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public java.util.List<org.sonarqube.ws.Common.User> getUsersList() { return users_; } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public java.util.List<? extends org.sonarqube.ws.Common.UserOrBuilder> getUsersOrBuilderList() { return users_; } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public int getUsersCount() { return users_.size(); } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public org.sonarqube.ws.Common.User getUsers(int index) { return users_.get(index); } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public org.sonarqube.ws.Common.UserOrBuilder getUsersOrBuilder( int index) { return users_.get(index); } + public static final int ACTIONPLANSPRESENTIFEMPTY_FIELD_NUMBER = 16; + private boolean actionPlansPresentIfEmpty_; + /** + * <code>optional bool actionPlansPresentIfEmpty = 16;</code> + */ + public boolean hasActionPlansPresentIfEmpty() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * <code>optional bool actionPlansPresentIfEmpty = 16;</code> + */ + public boolean getActionPlansPresentIfEmpty() { + return actionPlansPresentIfEmpty_; + } + + public static final int ACTIONPLANS_FIELD_NUMBER = 17; + private java.util.List<org.sonarqube.ws.Issues.ActionPlan> actionPlans_; + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public java.util.List<org.sonarqube.ws.Issues.ActionPlan> getActionPlansList() { + return actionPlans_; + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public java.util.List<? extends org.sonarqube.ws.Issues.ActionPlanOrBuilder> + getActionPlansOrBuilderList() { + return actionPlans_; + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public int getActionPlansCount() { + return actionPlans_.size(); + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public org.sonarqube.ws.Issues.ActionPlan getActionPlans(int index) { + return actionPlans_.get(index); + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public org.sonarqube.ws.Issues.ActionPlanOrBuilder getActionPlansOrBuilder( + int index) { + return actionPlans_.get(index); + } + + public static final int LANGUAGESPRESENTIFEMPTY_FIELD_NUMBER = 18; + private boolean languagesPresentIfEmpty_; + /** + * <code>optional bool languagesPresentIfEmpty = 18;</code> + */ + public boolean hasLanguagesPresentIfEmpty() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * <code>optional bool languagesPresentIfEmpty = 18;</code> + */ + public boolean getLanguagesPresentIfEmpty() { + return languagesPresentIfEmpty_; + } + + public static final int LANGUAGES_FIELD_NUMBER = 19; + private java.util.List<org.sonarqube.ws.Issues.Language> languages_; + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public java.util.List<org.sonarqube.ws.Issues.Language> getLanguagesList() { + return languages_; + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public java.util.List<? extends org.sonarqube.ws.Issues.LanguageOrBuilder> + getLanguagesOrBuilderList() { + return languages_; + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public int getLanguagesCount() { + return languages_.size(); + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public org.sonarqube.ws.Issues.Language getLanguages(int index) { + return languages_.get(index); + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public org.sonarqube.ws.Issues.LanguageOrBuilder getLanguagesOrBuilder( + int index) { + return languages_.get(index); + } + + public static final int FACETS_FIELD_NUMBER = 20; + private java.util.List<org.sonarqube.ws.Common.Facet> facets_; + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public java.util.List<org.sonarqube.ws.Common.Facet> getFacetsList() { + return facets_; + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public java.util.List<? extends org.sonarqube.ws.Common.FacetOrBuilder> + getFacetsOrBuilderList() { + return facets_; + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public int getFacetsCount() { + return facets_.size(); + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public org.sonarqube.ws.Common.Facet getFacets(int index) { + return facets_.get(index); + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public org.sonarqube.ws.Common.FacetOrBuilder getFacetsOrBuilder( + int index) { + return facets_.get(index); + } + + public static final int FACETSPRESENTIFEMPTY_FIELD_NUMBER = 21; + private boolean facetsPresentIfEmpty_; + /** + * <code>optional bool facetsPresentIfEmpty = 21;</code> + */ + public boolean hasFacetsPresentIfEmpty() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * <code>optional bool facetsPresentIfEmpty = 21;</code> + */ + public boolean getFacetsPresentIfEmpty() { + return facetsPresentIfEmpty_; + } + private void initFields() { + total_ = 0L; + p_ = 0L; + ps_ = 0; paging_ = org.sonarqube.ws.Common.Paging.getDefaultInstance(); + debtTotal_ = 0L; issues_ = java.util.Collections.emptyList(); - facets_ = java.util.Collections.emptyList(); + projectsPresentIfEmpty_ = false; projects_ = java.util.Collections.emptyList(); + componentsPresentIfEmpty_ = false; components_ = java.util.Collections.emptyList(); + rulesPresentIfEmpty_ = false; rules_ = java.util.Collections.emptyList(); + usersPresentIfEmpty_ = false; users_ = java.util.Collections.emptyList(); + actionPlansPresentIfEmpty_ = false; + actionPlans_ = java.util.Collections.emptyList(); + languagesPresentIfEmpty_ = false; + languages_ = java.util.Collections.emptyList(); + facets_ = java.util.Collections.emptyList(); + facetsPresentIfEmpty_ = false; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -622,25 +1086,64 @@ public final class Issues { throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, paging_); + output.writeInt64(1, total_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, p_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(3, ps_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeMessage(4, paging_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt64(5, debtTotal_); } for (int i = 0; i < issues_.size(); i++) { - output.writeMessage(2, issues_.get(i)); + output.writeMessage(6, issues_.get(i)); } - for (int i = 0; i < facets_.size(); i++) { - output.writeMessage(3, facets_.get(i)); + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBool(8, projectsPresentIfEmpty_); } for (int i = 0; i < projects_.size(); i++) { - output.writeMessage(4, projects_.get(i)); + output.writeMessage(9, projects_.get(i)); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeBool(10, componentsPresentIfEmpty_); } for (int i = 0; i < components_.size(); i++) { - output.writeMessage(5, components_.get(i)); + output.writeMessage(11, components_.get(i)); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeBool(12, rulesPresentIfEmpty_); } for (int i = 0; i < rules_.size(); i++) { - output.writeMessage(6, rules_.get(i)); + output.writeMessage(13, rules_.get(i)); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeBool(14, usersPresentIfEmpty_); } for (int i = 0; i < users_.size(); i++) { - output.writeMessage(7, users_.get(i)); + output.writeMessage(15, users_.get(i)); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeBool(16, actionPlansPresentIfEmpty_); + } + for (int i = 0; i < actionPlans_.size(); i++) { + output.writeMessage(17, actionPlans_.get(i)); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + output.writeBool(18, languagesPresentIfEmpty_); + } + for (int i = 0; i < languages_.size(); i++) { + output.writeMessage(19, languages_.get(i)); + } + for (int i = 0; i < facets_.size(); i++) { + output.writeMessage(20, facets_.get(i)); + } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + output.writeBool(21, facetsPresentIfEmpty_); } getUnknownFields().writeTo(output); } @@ -653,31 +1156,83 @@ public final class Issues { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, paging_); + .computeInt64Size(1, total_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, p_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, ps_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, paging_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, debtTotal_); } for (int i = 0; i < issues_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, issues_.get(i)); + .computeMessageSize(6, issues_.get(i)); } - for (int i = 0; i < facets_.size(); i++) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, facets_.get(i)); + .computeBoolSize(8, projectsPresentIfEmpty_); } for (int i = 0; i < projects_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, projects_.get(i)); + .computeMessageSize(9, projects_.get(i)); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(10, componentsPresentIfEmpty_); } for (int i = 0; i < components_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, components_.get(i)); + .computeMessageSize(11, components_.get(i)); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(12, rulesPresentIfEmpty_); } for (int i = 0; i < rules_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, rules_.get(i)); + .computeMessageSize(13, rules_.get(i)); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(14, usersPresentIfEmpty_); } for (int i = 0; i < users_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, users_.get(i)); + .computeMessageSize(15, users_.get(i)); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(16, actionPlansPresentIfEmpty_); + } + for (int i = 0; i < actionPlans_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(17, actionPlans_.get(i)); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(18, languagesPresentIfEmpty_); + } + for (int i = 0; i < languages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(19, languages_.get(i)); + } + for (int i = 0; i < facets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(20, facets_.get(i)); + } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(21, facetsPresentIfEmpty_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -794,11 +1349,13 @@ public final class Issues { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getPagingFieldBuilder(); getIssuesFieldBuilder(); - getFacetsFieldBuilder(); getProjectsFieldBuilder(); getComponentsFieldBuilder(); getRulesFieldBuilder(); getUsersFieldBuilder(); + getActionPlansFieldBuilder(); + getLanguagesFieldBuilder(); + getFacetsFieldBuilder(); } } private static Builder create() { @@ -807,48 +1364,82 @@ public final class Issues { public Builder clear() { super.clear(); + total_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + p_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + ps_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); if (pagingBuilder_ == null) { paging_ = org.sonarqube.ws.Common.Paging.getDefaultInstance(); } else { pagingBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); + debtTotal_ = 0L; + bitField0_ = (bitField0_ & ~0x00000010); if (issuesBuilder_ == null) { issues_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000020); } else { issuesBuilder_.clear(); } - if (facetsBuilder_ == null) { - facets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - facetsBuilder_.clear(); - } + projectsPresentIfEmpty_ = false; + bitField0_ = (bitField0_ & ~0x00000040); if (projectsBuilder_ == null) { projects_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000080); } else { projectsBuilder_.clear(); } + componentsPresentIfEmpty_ = false; + bitField0_ = (bitField0_ & ~0x00000100); if (componentsBuilder_ == null) { components_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000200); } else { componentsBuilder_.clear(); } + rulesPresentIfEmpty_ = false; + bitField0_ = (bitField0_ & ~0x00000400); if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000800); } else { rulesBuilder_.clear(); } + usersPresentIfEmpty_ = false; + bitField0_ = (bitField0_ & ~0x00001000); if (usersBuilder_ == null) { users_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00002000); } else { usersBuilder_.clear(); } + actionPlansPresentIfEmpty_ = false; + bitField0_ = (bitField0_ & ~0x00004000); + if (actionPlansBuilder_ == null) { + actionPlans_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00008000); + } else { + actionPlansBuilder_.clear(); + } + languagesPresentIfEmpty_ = false; + bitField0_ = (bitField0_ & ~0x00010000); + if (languagesBuilder_ == null) { + languages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00020000); + } else { + languagesBuilder_.clear(); + } + if (facetsBuilder_ == null) { + facets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00040000); + } else { + facetsBuilder_.clear(); + } + facetsPresentIfEmpty_ = false; + bitField0_ = (bitField0_ & ~0x00080000); return this; } @@ -880,65 +1471,127 @@ public final class Issues { if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } + result.total_ = total_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.p_ = p_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.ps_ = ps_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } if (pagingBuilder_ == null) { result.paging_ = paging_; } else { result.paging_ = pagingBuilder_.build(); } + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.debtTotal_ = debtTotal_; if (issuesBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { issues_ = java.util.Collections.unmodifiableList(issues_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000020); } result.issues_ = issues_; } else { result.issues_ = issuesBuilder_.build(); } - if (facetsBuilder_ == null) { - if (((bitField0_ & 0x00000004) == 0x00000004)) { - facets_ = java.util.Collections.unmodifiableList(facets_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.facets_ = facets_; - } else { - result.facets_ = facetsBuilder_.build(); + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000020; } + result.projectsPresentIfEmpty_ = projectsPresentIfEmpty_; if (projectsBuilder_ == null) { - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { projects_ = java.util.Collections.unmodifiableList(projects_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000080); } result.projects_ = projects_; } else { result.projects_ = projectsBuilder_.build(); } + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000040; + } + result.componentsPresentIfEmpty_ = componentsPresentIfEmpty_; if (componentsBuilder_ == null) { - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (((bitField0_ & 0x00000200) == 0x00000200)) { components_ = java.util.Collections.unmodifiableList(components_); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000200); } result.components_ = components_; } else { result.components_ = componentsBuilder_.build(); } + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000080; + } + result.rulesPresentIfEmpty_ = rulesPresentIfEmpty_; if (rulesBuilder_ == null) { - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (((bitField0_ & 0x00000800) == 0x00000800)) { rules_ = java.util.Collections.unmodifiableList(rules_); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000800); } result.rules_ = rules_; } else { result.rules_ = rulesBuilder_.build(); } + if (((from_bitField0_ & 0x00001000) == 0x00001000)) { + to_bitField0_ |= 0x00000100; + } + result.usersPresentIfEmpty_ = usersPresentIfEmpty_; if (usersBuilder_ == null) { - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (((bitField0_ & 0x00002000) == 0x00002000)) { users_ = java.util.Collections.unmodifiableList(users_); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00002000); } result.users_ = users_; } else { result.users_ = usersBuilder_.build(); } + if (((from_bitField0_ & 0x00004000) == 0x00004000)) { + to_bitField0_ |= 0x00000200; + } + result.actionPlansPresentIfEmpty_ = actionPlansPresentIfEmpty_; + if (actionPlansBuilder_ == null) { + if (((bitField0_ & 0x00008000) == 0x00008000)) { + actionPlans_ = java.util.Collections.unmodifiableList(actionPlans_); + bitField0_ = (bitField0_ & ~0x00008000); + } + result.actionPlans_ = actionPlans_; + } else { + result.actionPlans_ = actionPlansBuilder_.build(); + } + if (((from_bitField0_ & 0x00010000) == 0x00010000)) { + to_bitField0_ |= 0x00000400; + } + result.languagesPresentIfEmpty_ = languagesPresentIfEmpty_; + if (languagesBuilder_ == null) { + if (((bitField0_ & 0x00020000) == 0x00020000)) { + languages_ = java.util.Collections.unmodifiableList(languages_); + bitField0_ = (bitField0_ & ~0x00020000); + } + result.languages_ = languages_; + } else { + result.languages_ = languagesBuilder_.build(); + } + if (facetsBuilder_ == null) { + if (((bitField0_ & 0x00040000) == 0x00040000)) { + facets_ = java.util.Collections.unmodifiableList(facets_); + bitField0_ = (bitField0_ & ~0x00040000); + } + result.facets_ = facets_; + } else { + result.facets_ = facetsBuilder_.build(); + } + if (((from_bitField0_ & 0x00080000) == 0x00080000)) { + to_bitField0_ |= 0x00000800; + } + result.facetsPresentIfEmpty_ = facetsPresentIfEmpty_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -955,14 +1608,26 @@ public final class Issues { public Builder mergeFrom(org.sonarqube.ws.Issues.Search other) { if (other == org.sonarqube.ws.Issues.Search.getDefaultInstance()) return this; + if (other.hasTotal()) { + setTotal(other.getTotal()); + } + if (other.hasP()) { + setP(other.getP()); + } + if (other.hasPs()) { + setPs(other.getPs()); + } if (other.hasPaging()) { mergePaging(other.getPaging()); } + if (other.hasDebtTotal()) { + setDebtTotal(other.getDebtTotal()); + } if (issuesBuilder_ == null) { if (!other.issues_.isEmpty()) { if (issues_.isEmpty()) { issues_ = other.issues_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000020); } else { ensureIssuesIsMutable(); issues_.addAll(other.issues_); @@ -975,7 +1640,7 @@ public final class Issues { issuesBuilder_.dispose(); issuesBuilder_ = null; issues_ = other.issues_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000020); issuesBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getIssuesFieldBuilder() : null; @@ -984,37 +1649,14 @@ public final class Issues { } } } - if (facetsBuilder_ == null) { - if (!other.facets_.isEmpty()) { - if (facets_.isEmpty()) { - facets_ = other.facets_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureFacetsIsMutable(); - facets_.addAll(other.facets_); - } - onChanged(); - } - } else { - if (!other.facets_.isEmpty()) { - if (facetsBuilder_.isEmpty()) { - facetsBuilder_.dispose(); - facetsBuilder_ = null; - facets_ = other.facets_; - bitField0_ = (bitField0_ & ~0x00000004); - facetsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getFacetsFieldBuilder() : null; - } else { - facetsBuilder_.addAllMessages(other.facets_); - } - } + if (other.hasProjectsPresentIfEmpty()) { + setProjectsPresentIfEmpty(other.getProjectsPresentIfEmpty()); } if (projectsBuilder_ == null) { if (!other.projects_.isEmpty()) { if (projects_.isEmpty()) { projects_ = other.projects_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000080); } else { ensureProjectsIsMutable(); projects_.addAll(other.projects_); @@ -1027,7 +1669,7 @@ public final class Issues { projectsBuilder_.dispose(); projectsBuilder_ = null; projects_ = other.projects_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000080); projectsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getProjectsFieldBuilder() : null; @@ -1036,11 +1678,14 @@ public final class Issues { } } } + if (other.hasComponentsPresentIfEmpty()) { + setComponentsPresentIfEmpty(other.getComponentsPresentIfEmpty()); + } if (componentsBuilder_ == null) { if (!other.components_.isEmpty()) { if (components_.isEmpty()) { components_ = other.components_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000200); } else { ensureComponentsIsMutable(); components_.addAll(other.components_); @@ -1053,7 +1698,7 @@ public final class Issues { componentsBuilder_.dispose(); componentsBuilder_ = null; components_ = other.components_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000200); componentsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getComponentsFieldBuilder() : null; @@ -1062,11 +1707,14 @@ public final class Issues { } } } + if (other.hasRulesPresentIfEmpty()) { + setRulesPresentIfEmpty(other.getRulesPresentIfEmpty()); + } if (rulesBuilder_ == null) { if (!other.rules_.isEmpty()) { if (rules_.isEmpty()) { rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000800); } else { ensureRulesIsMutable(); rules_.addAll(other.rules_); @@ -1079,7 +1727,7 @@ public final class Issues { rulesBuilder_.dispose(); rulesBuilder_ = null; rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000800); rulesBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getRulesFieldBuilder() : null; @@ -1088,11 +1736,14 @@ public final class Issues { } } } + if (other.hasUsersPresentIfEmpty()) { + setUsersPresentIfEmpty(other.getUsersPresentIfEmpty()); + } if (usersBuilder_ == null) { if (!other.users_.isEmpty()) { if (users_.isEmpty()) { users_ = other.users_; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00002000); } else { ensureUsersIsMutable(); users_.addAll(other.users_); @@ -1105,7 +1756,7 @@ public final class Issues { usersBuilder_.dispose(); usersBuilder_ = null; users_ = other.users_; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00002000); usersBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getUsersFieldBuilder() : null; @@ -1114,6 +1765,93 @@ public final class Issues { } } } + if (other.hasActionPlansPresentIfEmpty()) { + setActionPlansPresentIfEmpty(other.getActionPlansPresentIfEmpty()); + } + if (actionPlansBuilder_ == null) { + if (!other.actionPlans_.isEmpty()) { + if (actionPlans_.isEmpty()) { + actionPlans_ = other.actionPlans_; + bitField0_ = (bitField0_ & ~0x00008000); + } else { + ensureActionPlansIsMutable(); + actionPlans_.addAll(other.actionPlans_); + } + onChanged(); + } + } else { + if (!other.actionPlans_.isEmpty()) { + if (actionPlansBuilder_.isEmpty()) { + actionPlansBuilder_.dispose(); + actionPlansBuilder_ = null; + actionPlans_ = other.actionPlans_; + bitField0_ = (bitField0_ & ~0x00008000); + actionPlansBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getActionPlansFieldBuilder() : null; + } else { + actionPlansBuilder_.addAllMessages(other.actionPlans_); + } + } + } + if (other.hasLanguagesPresentIfEmpty()) { + setLanguagesPresentIfEmpty(other.getLanguagesPresentIfEmpty()); + } + if (languagesBuilder_ == null) { + if (!other.languages_.isEmpty()) { + if (languages_.isEmpty()) { + languages_ = other.languages_; + bitField0_ = (bitField0_ & ~0x00020000); + } else { + ensureLanguagesIsMutable(); + languages_.addAll(other.languages_); + } + onChanged(); + } + } else { + if (!other.languages_.isEmpty()) { + if (languagesBuilder_.isEmpty()) { + languagesBuilder_.dispose(); + languagesBuilder_ = null; + languages_ = other.languages_; + bitField0_ = (bitField0_ & ~0x00020000); + languagesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getLanguagesFieldBuilder() : null; + } else { + languagesBuilder_.addAllMessages(other.languages_); + } + } + } + if (facetsBuilder_ == null) { + if (!other.facets_.isEmpty()) { + if (facets_.isEmpty()) { + facets_ = other.facets_; + bitField0_ = (bitField0_ & ~0x00040000); + } else { + ensureFacetsIsMutable(); + facets_.addAll(other.facets_); + } + onChanged(); + } + } else { + if (!other.facets_.isEmpty()) { + if (facetsBuilder_.isEmpty()) { + facetsBuilder_.dispose(); + facetsBuilder_ = null; + facets_ = other.facets_; + bitField0_ = (bitField0_ & ~0x00040000); + facetsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getFacetsFieldBuilder() : null; + } else { + facetsBuilder_.addAllMessages(other.facets_); + } + } + } + if (other.hasFacetsPresentIfEmpty()) { + setFacetsPresentIfEmpty(other.getFacetsPresentIfEmpty()); + } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -1141,25 +1879,113 @@ public final class Issues { } private int bitField0_; + private long total_ ; + /** + * <code>optional int64 total = 1;</code> + */ + public boolean hasTotal() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional int64 total = 1;</code> + */ + public long getTotal() { + return total_; + } + /** + * <code>optional int64 total = 1;</code> + */ + public Builder setTotal(long value) { + bitField0_ |= 0x00000001; + total_ = value; + onChanged(); + return this; + } + /** + * <code>optional int64 total = 1;</code> + */ + public Builder clearTotal() { + bitField0_ = (bitField0_ & ~0x00000001); + total_ = 0L; + onChanged(); + return this; + } + + private long p_ ; + /** + * <code>optional int64 p = 2;</code> + */ + public boolean hasP() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional int64 p = 2;</code> + */ + public long getP() { + return p_; + } + /** + * <code>optional int64 p = 2;</code> + */ + public Builder setP(long value) { + bitField0_ |= 0x00000002; + p_ = value; + onChanged(); + return this; + } + /** + * <code>optional int64 p = 2;</code> + */ + public Builder clearP() { + bitField0_ = (bitField0_ & ~0x00000002); + p_ = 0L; + onChanged(); + return this; + } + + private int ps_ ; + /** + * <code>optional int32 ps = 3;</code> + */ + public boolean hasPs() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional int32 ps = 3;</code> + */ + public int getPs() { + return ps_; + } + /** + * <code>optional int32 ps = 3;</code> + */ + public Builder setPs(int value) { + bitField0_ |= 0x00000004; + ps_ = value; + onChanged(); + return this; + } + /** + * <code>optional int32 ps = 3;</code> + */ + public Builder clearPs() { + bitField0_ = (bitField0_ & ~0x00000004); + ps_ = 0; + onChanged(); + return this; + } + private org.sonarqube.ws.Common.Paging paging_ = org.sonarqube.ws.Common.Paging.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.sonarqube.ws.Common.Paging, org.sonarqube.ws.Common.Paging.Builder, org.sonarqube.ws.Common.PagingOrBuilder> pagingBuilder_; /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> - * - * <pre> - * TODO errors - * </pre> + * <code>optional .sonarqube.ws.Paging paging = 4;</code> */ public boolean hasPaging() { - return ((bitField0_ & 0x00000001) == 0x00000001); + return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> - * - * <pre> - * TODO errors - * </pre> + * <code>optional .sonarqube.ws.Paging paging = 4;</code> */ public org.sonarqube.ws.Common.Paging getPaging() { if (pagingBuilder_ == null) { @@ -1169,11 +1995,7 @@ public final class Issues { } } /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> - * - * <pre> - * TODO errors - * </pre> + * <code>optional .sonarqube.ws.Paging paging = 4;</code> */ public Builder setPaging(org.sonarqube.ws.Common.Paging value) { if (pagingBuilder_ == null) { @@ -1185,15 +2007,11 @@ public final class Issues { } else { pagingBuilder_.setMessage(value); } - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000008; return this; } /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> - * - * <pre> - * TODO errors - * </pre> + * <code>optional .sonarqube.ws.Paging paging = 4;</code> */ public Builder setPaging( org.sonarqube.ws.Common.Paging.Builder builderForValue) { @@ -1203,19 +2021,15 @@ public final class Issues { } else { pagingBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000008; return this; } /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> - * - * <pre> - * TODO errors - * </pre> + * <code>optional .sonarqube.ws.Paging paging = 4;</code> */ public Builder mergePaging(org.sonarqube.ws.Common.Paging value) { if (pagingBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) && + if (((bitField0_ & 0x00000008) == 0x00000008) && paging_ != org.sonarqube.ws.Common.Paging.getDefaultInstance()) { paging_ = org.sonarqube.ws.Common.Paging.newBuilder(paging_).mergeFrom(value).buildPartial(); @@ -1226,15 +2040,11 @@ public final class Issues { } else { pagingBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000008; return this; } /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> - * - * <pre> - * TODO errors - * </pre> + * <code>optional .sonarqube.ws.Paging paging = 4;</code> */ public Builder clearPaging() { if (pagingBuilder_ == null) { @@ -1243,27 +2053,19 @@ public final class Issues { } else { pagingBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); return this; } /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> - * - * <pre> - * TODO errors - * </pre> + * <code>optional .sonarqube.ws.Paging paging = 4;</code> */ public org.sonarqube.ws.Common.Paging.Builder getPagingBuilder() { - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000008; onChanged(); return getPagingFieldBuilder().getBuilder(); } /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> - * - * <pre> - * TODO errors - * </pre> + * <code>optional .sonarqube.ws.Paging paging = 4;</code> */ public org.sonarqube.ws.Common.PagingOrBuilder getPagingOrBuilder() { if (pagingBuilder_ != null) { @@ -1273,11 +2075,7 @@ public final class Issues { } } /** - * <code>optional .sonarqube.ws.Paging paging = 1;</code> - * - * <pre> - * TODO errors - * </pre> + * <code>optional .sonarqube.ws.Paging paging = 4;</code> */ private com.google.protobuf.SingleFieldBuilder< org.sonarqube.ws.Common.Paging, org.sonarqube.ws.Common.Paging.Builder, org.sonarqube.ws.Common.PagingOrBuilder> @@ -1293,12 +2091,60 @@ public final class Issues { return pagingBuilder_; } + private long debtTotal_ ; + /** + * <code>optional int64 debtTotal = 5;</code> + * + * <pre> + * Total amount of debt, only when the facet "total" is enabled + * </pre> + */ + public boolean hasDebtTotal() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional int64 debtTotal = 5;</code> + * + * <pre> + * Total amount of debt, only when the facet "total" is enabled + * </pre> + */ + public long getDebtTotal() { + return debtTotal_; + } + /** + * <code>optional int64 debtTotal = 5;</code> + * + * <pre> + * Total amount of debt, only when the facet "total" is enabled + * </pre> + */ + public Builder setDebtTotal(long value) { + bitField0_ |= 0x00000010; + debtTotal_ = value; + onChanged(); + return this; + } + /** + * <code>optional int64 debtTotal = 5;</code> + * + * <pre> + * Total amount of debt, only when the facet "total" is enabled + * </pre> + */ + public Builder clearDebtTotal() { + bitField0_ = (bitField0_ & ~0x00000010); + debtTotal_ = 0L; + onChanged(); + return this; + } + private java.util.List<org.sonarqube.ws.Issues.Issue> issues_ = java.util.Collections.emptyList(); private void ensureIssuesIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { issues_ = new java.util.ArrayList<org.sonarqube.ws.Issues.Issue>(issues_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000020; } } @@ -1306,7 +2152,7 @@ public final class Issues { org.sonarqube.ws.Issues.Issue, org.sonarqube.ws.Issues.Issue.Builder, org.sonarqube.ws.Issues.IssueOrBuilder> issuesBuilder_; /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public java.util.List<org.sonarqube.ws.Issues.Issue> getIssuesList() { if (issuesBuilder_ == null) { @@ -1316,7 +2162,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public int getIssuesCount() { if (issuesBuilder_ == null) { @@ -1326,7 +2172,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public org.sonarqube.ws.Issues.Issue getIssues(int index) { if (issuesBuilder_ == null) { @@ -1336,7 +2182,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public Builder setIssues( int index, org.sonarqube.ws.Issues.Issue value) { @@ -1353,7 +2199,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public Builder setIssues( int index, org.sonarqube.ws.Issues.Issue.Builder builderForValue) { @@ -1367,7 +2213,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public Builder addIssues(org.sonarqube.ws.Issues.Issue value) { if (issuesBuilder_ == null) { @@ -1383,7 +2229,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public Builder addIssues( int index, org.sonarqube.ws.Issues.Issue value) { @@ -1400,7 +2246,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public Builder addIssues( org.sonarqube.ws.Issues.Issue.Builder builderForValue) { @@ -1414,7 +2260,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public Builder addIssues( int index, org.sonarqube.ws.Issues.Issue.Builder builderForValue) { @@ -1428,7 +2274,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public Builder addAllIssues( java.lang.Iterable<? extends org.sonarqube.ws.Issues.Issue> values) { @@ -1443,12 +2289,12 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public Builder clearIssues() { if (issuesBuilder_ == null) { issues_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { issuesBuilder_.clear(); @@ -1456,7 +2302,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public Builder removeIssues(int index) { if (issuesBuilder_ == null) { @@ -1469,14 +2315,14 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public org.sonarqube.ws.Issues.Issue.Builder getIssuesBuilder( int index) { return getIssuesFieldBuilder().getBuilder(index); } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public org.sonarqube.ws.Issues.IssueOrBuilder getIssuesOrBuilder( int index) { @@ -1486,7 +2332,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public java.util.List<? extends org.sonarqube.ws.Issues.IssueOrBuilder> getIssuesOrBuilderList() { @@ -1497,14 +2343,14 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public org.sonarqube.ws.Issues.Issue.Builder addIssuesBuilder() { return getIssuesFieldBuilder().addBuilder( org.sonarqube.ws.Issues.Issue.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public org.sonarqube.ws.Issues.Issue.Builder addIssuesBuilder( int index) { @@ -1512,7 +2358,7 @@ public final class Issues { index, org.sonarqube.ws.Issues.Issue.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.issues.Issue issues = 2;</code> + * <code>repeated .sonarqube.ws.issues.Issue issues = 6;</code> */ public java.util.List<org.sonarqube.ws.Issues.Issue.Builder> getIssuesBuilderList() { @@ -1525,7 +2371,7 @@ public final class Issues { issuesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< org.sonarqube.ws.Issues.Issue, org.sonarqube.ws.Issues.Issue.Builder, org.sonarqube.ws.Issues.IssueOrBuilder>( issues_, - ((bitField0_ & 0x00000002) == 0x00000002), + ((bitField0_ & 0x00000020) == 0x00000020), getParentForChildren(), isClean()); issues_ = null; @@ -1533,252 +2379,44 @@ public final class Issues { return issuesBuilder_; } - private java.util.List<org.sonarqube.ws.Common.Facet> facets_ = - java.util.Collections.emptyList(); - private void ensureFacetsIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - facets_ = new java.util.ArrayList<org.sonarqube.ws.Common.Facet>(facets_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - org.sonarqube.ws.Common.Facet, org.sonarqube.ws.Common.Facet.Builder, org.sonarqube.ws.Common.FacetOrBuilder> facetsBuilder_; - - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public java.util.List<org.sonarqube.ws.Common.Facet> getFacetsList() { - if (facetsBuilder_ == null) { - return java.util.Collections.unmodifiableList(facets_); - } else { - return facetsBuilder_.getMessageList(); - } - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public int getFacetsCount() { - if (facetsBuilder_ == null) { - return facets_.size(); - } else { - return facetsBuilder_.getCount(); - } - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public org.sonarqube.ws.Common.Facet getFacets(int index) { - if (facetsBuilder_ == null) { - return facets_.get(index); - } else { - return facetsBuilder_.getMessage(index); - } - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public Builder setFacets( - int index, org.sonarqube.ws.Common.Facet value) { - if (facetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFacetsIsMutable(); - facets_.set(index, value); - onChanged(); - } else { - facetsBuilder_.setMessage(index, value); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public Builder setFacets( - int index, org.sonarqube.ws.Common.Facet.Builder builderForValue) { - if (facetsBuilder_ == null) { - ensureFacetsIsMutable(); - facets_.set(index, builderForValue.build()); - onChanged(); - } else { - facetsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public Builder addFacets(org.sonarqube.ws.Common.Facet value) { - if (facetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFacetsIsMutable(); - facets_.add(value); - onChanged(); - } else { - facetsBuilder_.addMessage(value); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public Builder addFacets( - int index, org.sonarqube.ws.Common.Facet value) { - if (facetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFacetsIsMutable(); - facets_.add(index, value); - onChanged(); - } else { - facetsBuilder_.addMessage(index, value); - } - return this; - } + private boolean projectsPresentIfEmpty_ ; /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> + * <code>optional bool projectsPresentIfEmpty = 8;</code> */ - public Builder addFacets( - org.sonarqube.ws.Common.Facet.Builder builderForValue) { - if (facetsBuilder_ == null) { - ensureFacetsIsMutable(); - facets_.add(builderForValue.build()); - onChanged(); - } else { - facetsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public Builder addFacets( - int index, org.sonarqube.ws.Common.Facet.Builder builderForValue) { - if (facetsBuilder_ == null) { - ensureFacetsIsMutable(); - facets_.add(index, builderForValue.build()); - onChanged(); - } else { - facetsBuilder_.addMessage(index, builderForValue.build()); - } - return this; + public boolean hasProjectsPresentIfEmpty() { + return ((bitField0_ & 0x00000040) == 0x00000040); } /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> + * <code>optional bool projectsPresentIfEmpty = 8;</code> */ - public Builder addAllFacets( - java.lang.Iterable<? extends org.sonarqube.ws.Common.Facet> values) { - if (facetsBuilder_ == null) { - ensureFacetsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, facets_); - onChanged(); - } else { - facetsBuilder_.addAllMessages(values); - } - return this; + public boolean getProjectsPresentIfEmpty() { + return projectsPresentIfEmpty_; } /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> + * <code>optional bool projectsPresentIfEmpty = 8;</code> */ - public Builder clearFacets() { - if (facetsBuilder_ == null) { - facets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - facetsBuilder_.clear(); - } + public Builder setProjectsPresentIfEmpty(boolean value) { + bitField0_ |= 0x00000040; + projectsPresentIfEmpty_ = value; + onChanged(); return this; } /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> + * <code>optional bool projectsPresentIfEmpty = 8;</code> */ - public Builder removeFacets(int index) { - if (facetsBuilder_ == null) { - ensureFacetsIsMutable(); - facets_.remove(index); - onChanged(); - } else { - facetsBuilder_.remove(index); - } + public Builder clearProjectsPresentIfEmpty() { + bitField0_ = (bitField0_ & ~0x00000040); + projectsPresentIfEmpty_ = false; + onChanged(); return this; } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public org.sonarqube.ws.Common.Facet.Builder getFacetsBuilder( - int index) { - return getFacetsFieldBuilder().getBuilder(index); - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public org.sonarqube.ws.Common.FacetOrBuilder getFacetsOrBuilder( - int index) { - if (facetsBuilder_ == null) { - return facets_.get(index); } else { - return facetsBuilder_.getMessageOrBuilder(index); - } - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public java.util.List<? extends org.sonarqube.ws.Common.FacetOrBuilder> - getFacetsOrBuilderList() { - if (facetsBuilder_ != null) { - return facetsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(facets_); - } - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public org.sonarqube.ws.Common.Facet.Builder addFacetsBuilder() { - return getFacetsFieldBuilder().addBuilder( - org.sonarqube.ws.Common.Facet.getDefaultInstance()); - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public org.sonarqube.ws.Common.Facet.Builder addFacetsBuilder( - int index) { - return getFacetsFieldBuilder().addBuilder( - index, org.sonarqube.ws.Common.Facet.getDefaultInstance()); - } - /** - * <code>repeated .sonarqube.ws.Facet facets = 3;</code> - */ - public java.util.List<org.sonarqube.ws.Common.Facet.Builder> - getFacetsBuilderList() { - return getFacetsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - org.sonarqube.ws.Common.Facet, org.sonarqube.ws.Common.Facet.Builder, org.sonarqube.ws.Common.FacetOrBuilder> - getFacetsFieldBuilder() { - if (facetsBuilder_ == null) { - facetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - org.sonarqube.ws.Common.Facet, org.sonarqube.ws.Common.Facet.Builder, org.sonarqube.ws.Common.FacetOrBuilder>( - facets_, - ((bitField0_ & 0x00000004) == 0x00000004), - getParentForChildren(), - isClean()); - facets_ = null; - } - return facetsBuilder_; - } private java.util.List<org.sonarqube.ws.Common.Component> projects_ = java.util.Collections.emptyList(); private void ensureProjectsIsMutable() { - if (!((bitField0_ & 0x00000008) == 0x00000008)) { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { projects_ = new java.util.ArrayList<org.sonarqube.ws.Common.Component>(projects_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000080; } } @@ -1786,7 +2424,7 @@ public final class Issues { org.sonarqube.ws.Common.Component, org.sonarqube.ws.Common.Component.Builder, org.sonarqube.ws.Common.ComponentOrBuilder> projectsBuilder_; /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public java.util.List<org.sonarqube.ws.Common.Component> getProjectsList() { if (projectsBuilder_ == null) { @@ -1796,7 +2434,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public int getProjectsCount() { if (projectsBuilder_ == null) { @@ -1806,7 +2444,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public org.sonarqube.ws.Common.Component getProjects(int index) { if (projectsBuilder_ == null) { @@ -1816,7 +2454,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public Builder setProjects( int index, org.sonarqube.ws.Common.Component value) { @@ -1833,7 +2471,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public Builder setProjects( int index, org.sonarqube.ws.Common.Component.Builder builderForValue) { @@ -1847,7 +2485,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public Builder addProjects(org.sonarqube.ws.Common.Component value) { if (projectsBuilder_ == null) { @@ -1863,7 +2501,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public Builder addProjects( int index, org.sonarqube.ws.Common.Component value) { @@ -1880,7 +2518,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public Builder addProjects( org.sonarqube.ws.Common.Component.Builder builderForValue) { @@ -1894,7 +2532,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public Builder addProjects( int index, org.sonarqube.ws.Common.Component.Builder builderForValue) { @@ -1908,7 +2546,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public Builder addAllProjects( java.lang.Iterable<? extends org.sonarqube.ws.Common.Component> values) { @@ -1923,12 +2561,12 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public Builder clearProjects() { if (projectsBuilder_ == null) { projects_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); } else { projectsBuilder_.clear(); @@ -1936,7 +2574,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public Builder removeProjects(int index) { if (projectsBuilder_ == null) { @@ -1949,14 +2587,14 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public org.sonarqube.ws.Common.Component.Builder getProjectsBuilder( int index) { return getProjectsFieldBuilder().getBuilder(index); } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public org.sonarqube.ws.Common.ComponentOrBuilder getProjectsOrBuilder( int index) { @@ -1966,7 +2604,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public java.util.List<? extends org.sonarqube.ws.Common.ComponentOrBuilder> getProjectsOrBuilderList() { @@ -1977,14 +2615,14 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public org.sonarqube.ws.Common.Component.Builder addProjectsBuilder() { return getProjectsFieldBuilder().addBuilder( org.sonarqube.ws.Common.Component.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public org.sonarqube.ws.Common.Component.Builder addProjectsBuilder( int index) { @@ -1992,7 +2630,7 @@ public final class Issues { index, org.sonarqube.ws.Common.Component.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.Component projects = 4;</code> + * <code>repeated .sonarqube.ws.Component projects = 9;</code> */ public java.util.List<org.sonarqube.ws.Common.Component.Builder> getProjectsBuilderList() { @@ -2005,7 +2643,7 @@ public final class Issues { projectsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< org.sonarqube.ws.Common.Component, org.sonarqube.ws.Common.Component.Builder, org.sonarqube.ws.Common.ComponentOrBuilder>( projects_, - ((bitField0_ & 0x00000008) == 0x00000008), + ((bitField0_ & 0x00000080) == 0x00000080), getParentForChildren(), isClean()); projects_ = null; @@ -2013,12 +2651,44 @@ public final class Issues { return projectsBuilder_; } + private boolean componentsPresentIfEmpty_ ; + /** + * <code>optional bool componentsPresentIfEmpty = 10;</code> + */ + public boolean hasComponentsPresentIfEmpty() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * <code>optional bool componentsPresentIfEmpty = 10;</code> + */ + public boolean getComponentsPresentIfEmpty() { + return componentsPresentIfEmpty_; + } + /** + * <code>optional bool componentsPresentIfEmpty = 10;</code> + */ + public Builder setComponentsPresentIfEmpty(boolean value) { + bitField0_ |= 0x00000100; + componentsPresentIfEmpty_ = value; + onChanged(); + return this; + } + /** + * <code>optional bool componentsPresentIfEmpty = 10;</code> + */ + public Builder clearComponentsPresentIfEmpty() { + bitField0_ = (bitField0_ & ~0x00000100); + componentsPresentIfEmpty_ = false; + onChanged(); + return this; + } + private java.util.List<org.sonarqube.ws.Common.Component> components_ = java.util.Collections.emptyList(); private void ensureComponentsIsMutable() { - if (!((bitField0_ & 0x00000010) == 0x00000010)) { + if (!((bitField0_ & 0x00000200) == 0x00000200)) { components_ = new java.util.ArrayList<org.sonarqube.ws.Common.Component>(components_); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000200; } } @@ -2026,7 +2696,7 @@ public final class Issues { org.sonarqube.ws.Common.Component, org.sonarqube.ws.Common.Component.Builder, org.sonarqube.ws.Common.ComponentOrBuilder> componentsBuilder_; /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public java.util.List<org.sonarqube.ws.Common.Component> getComponentsList() { if (componentsBuilder_ == null) { @@ -2036,7 +2706,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public int getComponentsCount() { if (componentsBuilder_ == null) { @@ -2046,7 +2716,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public org.sonarqube.ws.Common.Component getComponents(int index) { if (componentsBuilder_ == null) { @@ -2056,7 +2726,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public Builder setComponents( int index, org.sonarqube.ws.Common.Component value) { @@ -2073,7 +2743,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public Builder setComponents( int index, org.sonarqube.ws.Common.Component.Builder builderForValue) { @@ -2087,7 +2757,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public Builder addComponents(org.sonarqube.ws.Common.Component value) { if (componentsBuilder_ == null) { @@ -2103,7 +2773,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public Builder addComponents( int index, org.sonarqube.ws.Common.Component value) { @@ -2120,7 +2790,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public Builder addComponents( org.sonarqube.ws.Common.Component.Builder builderForValue) { @@ -2134,7 +2804,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public Builder addComponents( int index, org.sonarqube.ws.Common.Component.Builder builderForValue) { @@ -2148,7 +2818,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public Builder addAllComponents( java.lang.Iterable<? extends org.sonarqube.ws.Common.Component> values) { @@ -2163,12 +2833,12 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public Builder clearComponents() { if (componentsBuilder_ == null) { components_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000200); onChanged(); } else { componentsBuilder_.clear(); @@ -2176,7 +2846,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public Builder removeComponents(int index) { if (componentsBuilder_ == null) { @@ -2189,14 +2859,14 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public org.sonarqube.ws.Common.Component.Builder getComponentsBuilder( int index) { return getComponentsFieldBuilder().getBuilder(index); } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public org.sonarqube.ws.Common.ComponentOrBuilder getComponentsOrBuilder( int index) { @@ -2206,7 +2876,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public java.util.List<? extends org.sonarqube.ws.Common.ComponentOrBuilder> getComponentsOrBuilderList() { @@ -2217,14 +2887,14 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public org.sonarqube.ws.Common.Component.Builder addComponentsBuilder() { return getComponentsFieldBuilder().addBuilder( org.sonarqube.ws.Common.Component.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public org.sonarqube.ws.Common.Component.Builder addComponentsBuilder( int index) { @@ -2232,7 +2902,7 @@ public final class Issues { index, org.sonarqube.ws.Common.Component.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.Component components = 5;</code> + * <code>repeated .sonarqube.ws.Component components = 11;</code> */ public java.util.List<org.sonarqube.ws.Common.Component.Builder> getComponentsBuilderList() { @@ -2245,7 +2915,7 @@ public final class Issues { componentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< org.sonarqube.ws.Common.Component, org.sonarqube.ws.Common.Component.Builder, org.sonarqube.ws.Common.ComponentOrBuilder>( components_, - ((bitField0_ & 0x00000010) == 0x00000010), + ((bitField0_ & 0x00000200) == 0x00000200), getParentForChildren(), isClean()); components_ = null; @@ -2253,12 +2923,44 @@ public final class Issues { return componentsBuilder_; } + private boolean rulesPresentIfEmpty_ ; + /** + * <code>optional bool rulesPresentIfEmpty = 12;</code> + */ + public boolean hasRulesPresentIfEmpty() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * <code>optional bool rulesPresentIfEmpty = 12;</code> + */ + public boolean getRulesPresentIfEmpty() { + return rulesPresentIfEmpty_; + } + /** + * <code>optional bool rulesPresentIfEmpty = 12;</code> + */ + public Builder setRulesPresentIfEmpty(boolean value) { + bitField0_ |= 0x00000400; + rulesPresentIfEmpty_ = value; + onChanged(); + return this; + } + /** + * <code>optional bool rulesPresentIfEmpty = 12;</code> + */ + public Builder clearRulesPresentIfEmpty() { + bitField0_ = (bitField0_ & ~0x00000400); + rulesPresentIfEmpty_ = false; + onChanged(); + return this; + } + private java.util.List<org.sonarqube.ws.Common.Rule> rules_ = java.util.Collections.emptyList(); private void ensureRulesIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { + if (!((bitField0_ & 0x00000800) == 0x00000800)) { rules_ = new java.util.ArrayList<org.sonarqube.ws.Common.Rule>(rules_); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000800; } } @@ -2266,7 +2968,7 @@ public final class Issues { org.sonarqube.ws.Common.Rule, org.sonarqube.ws.Common.Rule.Builder, org.sonarqube.ws.Common.RuleOrBuilder> rulesBuilder_; /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public java.util.List<org.sonarqube.ws.Common.Rule> getRulesList() { if (rulesBuilder_ == null) { @@ -2276,7 +2978,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public int getRulesCount() { if (rulesBuilder_ == null) { @@ -2286,7 +2988,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public org.sonarqube.ws.Common.Rule getRules(int index) { if (rulesBuilder_ == null) { @@ -2296,7 +2998,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public Builder setRules( int index, org.sonarqube.ws.Common.Rule value) { @@ -2313,7 +3015,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public Builder setRules( int index, org.sonarqube.ws.Common.Rule.Builder builderForValue) { @@ -2327,7 +3029,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public Builder addRules(org.sonarqube.ws.Common.Rule value) { if (rulesBuilder_ == null) { @@ -2343,7 +3045,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public Builder addRules( int index, org.sonarqube.ws.Common.Rule value) { @@ -2360,7 +3062,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public Builder addRules( org.sonarqube.ws.Common.Rule.Builder builderForValue) { @@ -2374,7 +3076,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public Builder addRules( int index, org.sonarqube.ws.Common.Rule.Builder builderForValue) { @@ -2388,7 +3090,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public Builder addAllRules( java.lang.Iterable<? extends org.sonarqube.ws.Common.Rule> values) { @@ -2403,12 +3105,12 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public Builder clearRules() { if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000800); onChanged(); } else { rulesBuilder_.clear(); @@ -2416,7 +3118,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public Builder removeRules(int index) { if (rulesBuilder_ == null) { @@ -2429,14 +3131,14 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public org.sonarqube.ws.Common.Rule.Builder getRulesBuilder( int index) { return getRulesFieldBuilder().getBuilder(index); } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public org.sonarqube.ws.Common.RuleOrBuilder getRulesOrBuilder( int index) { @@ -2446,7 +3148,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public java.util.List<? extends org.sonarqube.ws.Common.RuleOrBuilder> getRulesOrBuilderList() { @@ -2457,14 +3159,14 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public org.sonarqube.ws.Common.Rule.Builder addRulesBuilder() { return getRulesFieldBuilder().addBuilder( org.sonarqube.ws.Common.Rule.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public org.sonarqube.ws.Common.Rule.Builder addRulesBuilder( int index) { @@ -2472,7 +3174,7 @@ public final class Issues { index, org.sonarqube.ws.Common.Rule.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.Rule rules = 6;</code> + * <code>repeated .sonarqube.ws.Rule rules = 13;</code> */ public java.util.List<org.sonarqube.ws.Common.Rule.Builder> getRulesBuilderList() { @@ -2485,7 +3187,7 @@ public final class Issues { rulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< org.sonarqube.ws.Common.Rule, org.sonarqube.ws.Common.Rule.Builder, org.sonarqube.ws.Common.RuleOrBuilder>( rules_, - ((bitField0_ & 0x00000020) == 0x00000020), + ((bitField0_ & 0x00000800) == 0x00000800), getParentForChildren(), isClean()); rules_ = null; @@ -2493,12 +3195,44 @@ public final class Issues { return rulesBuilder_; } + private boolean usersPresentIfEmpty_ ; + /** + * <code>optional bool usersPresentIfEmpty = 14;</code> + */ + public boolean hasUsersPresentIfEmpty() { + return ((bitField0_ & 0x00001000) == 0x00001000); + } + /** + * <code>optional bool usersPresentIfEmpty = 14;</code> + */ + public boolean getUsersPresentIfEmpty() { + return usersPresentIfEmpty_; + } + /** + * <code>optional bool usersPresentIfEmpty = 14;</code> + */ + public Builder setUsersPresentIfEmpty(boolean value) { + bitField0_ |= 0x00001000; + usersPresentIfEmpty_ = value; + onChanged(); + return this; + } + /** + * <code>optional bool usersPresentIfEmpty = 14;</code> + */ + public Builder clearUsersPresentIfEmpty() { + bitField0_ = (bitField0_ & ~0x00001000); + usersPresentIfEmpty_ = false; + onChanged(); + return this; + } + private java.util.List<org.sonarqube.ws.Common.User> users_ = java.util.Collections.emptyList(); private void ensureUsersIsMutable() { - if (!((bitField0_ & 0x00000040) == 0x00000040)) { + if (!((bitField0_ & 0x00002000) == 0x00002000)) { users_ = new java.util.ArrayList<org.sonarqube.ws.Common.User>(users_); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00002000; } } @@ -2506,7 +3240,7 @@ public final class Issues { org.sonarqube.ws.Common.User, org.sonarqube.ws.Common.User.Builder, org.sonarqube.ws.Common.UserOrBuilder> usersBuilder_; /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public java.util.List<org.sonarqube.ws.Common.User> getUsersList() { if (usersBuilder_ == null) { @@ -2516,7 +3250,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public int getUsersCount() { if (usersBuilder_ == null) { @@ -2526,7 +3260,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public org.sonarqube.ws.Common.User getUsers(int index) { if (usersBuilder_ == null) { @@ -2536,7 +3270,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public Builder setUsers( int index, org.sonarqube.ws.Common.User value) { @@ -2553,7 +3287,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public Builder setUsers( int index, org.sonarqube.ws.Common.User.Builder builderForValue) { @@ -2567,7 +3301,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public Builder addUsers(org.sonarqube.ws.Common.User value) { if (usersBuilder_ == null) { @@ -2583,7 +3317,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public Builder addUsers( int index, org.sonarqube.ws.Common.User value) { @@ -2600,7 +3334,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public Builder addUsers( org.sonarqube.ws.Common.User.Builder builderForValue) { @@ -2614,7 +3348,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public Builder addUsers( int index, org.sonarqube.ws.Common.User.Builder builderForValue) { @@ -2628,7 +3362,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public Builder addAllUsers( java.lang.Iterable<? extends org.sonarqube.ws.Common.User> values) { @@ -2643,12 +3377,12 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public Builder clearUsers() { if (usersBuilder_ == null) { users_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00002000); onChanged(); } else { usersBuilder_.clear(); @@ -2656,7 +3390,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public Builder removeUsers(int index) { if (usersBuilder_ == null) { @@ -2669,14 +3403,14 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public org.sonarqube.ws.Common.User.Builder getUsersBuilder( int index) { return getUsersFieldBuilder().getBuilder(index); } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public org.sonarqube.ws.Common.UserOrBuilder getUsersOrBuilder( int index) { @@ -2686,7 +3420,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public java.util.List<? extends org.sonarqube.ws.Common.UserOrBuilder> getUsersOrBuilderList() { @@ -2697,14 +3431,14 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public org.sonarqube.ws.Common.User.Builder addUsersBuilder() { return getUsersFieldBuilder().addBuilder( org.sonarqube.ws.Common.User.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public org.sonarqube.ws.Common.User.Builder addUsersBuilder( int index) { @@ -2712,7 +3446,7 @@ public final class Issues { index, org.sonarqube.ws.Common.User.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.User users = 7;</code> + * <code>repeated .sonarqube.ws.User users = 15;</code> */ public java.util.List<org.sonarqube.ws.Common.User.Builder> getUsersBuilderList() { @@ -2725,7 +3459,7 @@ public final class Issues { usersBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< org.sonarqube.ws.Common.User, org.sonarqube.ws.Common.User.Builder, org.sonarqube.ws.Common.UserOrBuilder>( users_, - ((bitField0_ & 0x00000040) == 0x00000040), + ((bitField0_ & 0x00002000) == 0x00002000), getParentForChildren(), isClean()); users_ = null; @@ -2733,6 +3467,822 @@ public final class Issues { return usersBuilder_; } + private boolean actionPlansPresentIfEmpty_ ; + /** + * <code>optional bool actionPlansPresentIfEmpty = 16;</code> + */ + public boolean hasActionPlansPresentIfEmpty() { + return ((bitField0_ & 0x00004000) == 0x00004000); + } + /** + * <code>optional bool actionPlansPresentIfEmpty = 16;</code> + */ + public boolean getActionPlansPresentIfEmpty() { + return actionPlansPresentIfEmpty_; + } + /** + * <code>optional bool actionPlansPresentIfEmpty = 16;</code> + */ + public Builder setActionPlansPresentIfEmpty(boolean value) { + bitField0_ |= 0x00004000; + actionPlansPresentIfEmpty_ = value; + onChanged(); + return this; + } + /** + * <code>optional bool actionPlansPresentIfEmpty = 16;</code> + */ + public Builder clearActionPlansPresentIfEmpty() { + bitField0_ = (bitField0_ & ~0x00004000); + actionPlansPresentIfEmpty_ = false; + onChanged(); + return this; + } + + private java.util.List<org.sonarqube.ws.Issues.ActionPlan> actionPlans_ = + java.util.Collections.emptyList(); + private void ensureActionPlansIsMutable() { + if (!((bitField0_ & 0x00008000) == 0x00008000)) { + actionPlans_ = new java.util.ArrayList<org.sonarqube.ws.Issues.ActionPlan>(actionPlans_); + bitField0_ |= 0x00008000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.Issues.ActionPlan, org.sonarqube.ws.Issues.ActionPlan.Builder, org.sonarqube.ws.Issues.ActionPlanOrBuilder> actionPlansBuilder_; + + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public java.util.List<org.sonarqube.ws.Issues.ActionPlan> getActionPlansList() { + if (actionPlansBuilder_ == null) { + return java.util.Collections.unmodifiableList(actionPlans_); + } else { + return actionPlansBuilder_.getMessageList(); + } + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public int getActionPlansCount() { + if (actionPlansBuilder_ == null) { + return actionPlans_.size(); + } else { + return actionPlansBuilder_.getCount(); + } + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public org.sonarqube.ws.Issues.ActionPlan getActionPlans(int index) { + if (actionPlansBuilder_ == null) { + return actionPlans_.get(index); + } else { + return actionPlansBuilder_.getMessage(index); + } + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public Builder setActionPlans( + int index, org.sonarqube.ws.Issues.ActionPlan value) { + if (actionPlansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionPlansIsMutable(); + actionPlans_.set(index, value); + onChanged(); + } else { + actionPlansBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public Builder setActionPlans( + int index, org.sonarqube.ws.Issues.ActionPlan.Builder builderForValue) { + if (actionPlansBuilder_ == null) { + ensureActionPlansIsMutable(); + actionPlans_.set(index, builderForValue.build()); + onChanged(); + } else { + actionPlansBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public Builder addActionPlans(org.sonarqube.ws.Issues.ActionPlan value) { + if (actionPlansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionPlansIsMutable(); + actionPlans_.add(value); + onChanged(); + } else { + actionPlansBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public Builder addActionPlans( + int index, org.sonarqube.ws.Issues.ActionPlan value) { + if (actionPlansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionPlansIsMutable(); + actionPlans_.add(index, value); + onChanged(); + } else { + actionPlansBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public Builder addActionPlans( + org.sonarqube.ws.Issues.ActionPlan.Builder builderForValue) { + if (actionPlansBuilder_ == null) { + ensureActionPlansIsMutable(); + actionPlans_.add(builderForValue.build()); + onChanged(); + } else { + actionPlansBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public Builder addActionPlans( + int index, org.sonarqube.ws.Issues.ActionPlan.Builder builderForValue) { + if (actionPlansBuilder_ == null) { + ensureActionPlansIsMutable(); + actionPlans_.add(index, builderForValue.build()); + onChanged(); + } else { + actionPlansBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public Builder addAllActionPlans( + java.lang.Iterable<? extends org.sonarqube.ws.Issues.ActionPlan> values) { + if (actionPlansBuilder_ == null) { + ensureActionPlansIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, actionPlans_); + onChanged(); + } else { + actionPlansBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public Builder clearActionPlans() { + if (actionPlansBuilder_ == null) { + actionPlans_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + } else { + actionPlansBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public Builder removeActionPlans(int index) { + if (actionPlansBuilder_ == null) { + ensureActionPlansIsMutable(); + actionPlans_.remove(index); + onChanged(); + } else { + actionPlansBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public org.sonarqube.ws.Issues.ActionPlan.Builder getActionPlansBuilder( + int index) { + return getActionPlansFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public org.sonarqube.ws.Issues.ActionPlanOrBuilder getActionPlansOrBuilder( + int index) { + if (actionPlansBuilder_ == null) { + return actionPlans_.get(index); } else { + return actionPlansBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public java.util.List<? extends org.sonarqube.ws.Issues.ActionPlanOrBuilder> + getActionPlansOrBuilderList() { + if (actionPlansBuilder_ != null) { + return actionPlansBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(actionPlans_); + } + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public org.sonarqube.ws.Issues.ActionPlan.Builder addActionPlansBuilder() { + return getActionPlansFieldBuilder().addBuilder( + org.sonarqube.ws.Issues.ActionPlan.getDefaultInstance()); + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public org.sonarqube.ws.Issues.ActionPlan.Builder addActionPlansBuilder( + int index) { + return getActionPlansFieldBuilder().addBuilder( + index, org.sonarqube.ws.Issues.ActionPlan.getDefaultInstance()); + } + /** + * <code>repeated .sonarqube.ws.issues.ActionPlan actionPlans = 17;</code> + */ + public java.util.List<org.sonarqube.ws.Issues.ActionPlan.Builder> + getActionPlansBuilderList() { + return getActionPlansFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.Issues.ActionPlan, org.sonarqube.ws.Issues.ActionPlan.Builder, org.sonarqube.ws.Issues.ActionPlanOrBuilder> + getActionPlansFieldBuilder() { + if (actionPlansBuilder_ == null) { + actionPlansBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.Issues.ActionPlan, org.sonarqube.ws.Issues.ActionPlan.Builder, org.sonarqube.ws.Issues.ActionPlanOrBuilder>( + actionPlans_, + ((bitField0_ & 0x00008000) == 0x00008000), + getParentForChildren(), + isClean()); + actionPlans_ = null; + } + return actionPlansBuilder_; + } + + private boolean languagesPresentIfEmpty_ ; + /** + * <code>optional bool languagesPresentIfEmpty = 18;</code> + */ + public boolean hasLanguagesPresentIfEmpty() { + return ((bitField0_ & 0x00010000) == 0x00010000); + } + /** + * <code>optional bool languagesPresentIfEmpty = 18;</code> + */ + public boolean getLanguagesPresentIfEmpty() { + return languagesPresentIfEmpty_; + } + /** + * <code>optional bool languagesPresentIfEmpty = 18;</code> + */ + public Builder setLanguagesPresentIfEmpty(boolean value) { + bitField0_ |= 0x00010000; + languagesPresentIfEmpty_ = value; + onChanged(); + return this; + } + /** + * <code>optional bool languagesPresentIfEmpty = 18;</code> + */ + public Builder clearLanguagesPresentIfEmpty() { + bitField0_ = (bitField0_ & ~0x00010000); + languagesPresentIfEmpty_ = false; + onChanged(); + return this; + } + + private java.util.List<org.sonarqube.ws.Issues.Language> languages_ = + java.util.Collections.emptyList(); + private void ensureLanguagesIsMutable() { + if (!((bitField0_ & 0x00020000) == 0x00020000)) { + languages_ = new java.util.ArrayList<org.sonarqube.ws.Issues.Language>(languages_); + bitField0_ |= 0x00020000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.Issues.Language, org.sonarqube.ws.Issues.Language.Builder, org.sonarqube.ws.Issues.LanguageOrBuilder> languagesBuilder_; + + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public java.util.List<org.sonarqube.ws.Issues.Language> getLanguagesList() { + if (languagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(languages_); + } else { + return languagesBuilder_.getMessageList(); + } + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public int getLanguagesCount() { + if (languagesBuilder_ == null) { + return languages_.size(); + } else { + return languagesBuilder_.getCount(); + } + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public org.sonarqube.ws.Issues.Language getLanguages(int index) { + if (languagesBuilder_ == null) { + return languages_.get(index); + } else { + return languagesBuilder_.getMessage(index); + } + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public Builder setLanguages( + int index, org.sonarqube.ws.Issues.Language value) { + if (languagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguagesIsMutable(); + languages_.set(index, value); + onChanged(); + } else { + languagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public Builder setLanguages( + int index, org.sonarqube.ws.Issues.Language.Builder builderForValue) { + if (languagesBuilder_ == null) { + ensureLanguagesIsMutable(); + languages_.set(index, builderForValue.build()); + onChanged(); + } else { + languagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public Builder addLanguages(org.sonarqube.ws.Issues.Language value) { + if (languagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguagesIsMutable(); + languages_.add(value); + onChanged(); + } else { + languagesBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public Builder addLanguages( + int index, org.sonarqube.ws.Issues.Language value) { + if (languagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguagesIsMutable(); + languages_.add(index, value); + onChanged(); + } else { + languagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public Builder addLanguages( + org.sonarqube.ws.Issues.Language.Builder builderForValue) { + if (languagesBuilder_ == null) { + ensureLanguagesIsMutable(); + languages_.add(builderForValue.build()); + onChanged(); + } else { + languagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public Builder addLanguages( + int index, org.sonarqube.ws.Issues.Language.Builder builderForValue) { + if (languagesBuilder_ == null) { + ensureLanguagesIsMutable(); + languages_.add(index, builderForValue.build()); + onChanged(); + } else { + languagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public Builder addAllLanguages( + java.lang.Iterable<? extends org.sonarqube.ws.Issues.Language> values) { + if (languagesBuilder_ == null) { + ensureLanguagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, languages_); + onChanged(); + } else { + languagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public Builder clearLanguages() { + if (languagesBuilder_ == null) { + languages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + } else { + languagesBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public Builder removeLanguages(int index) { + if (languagesBuilder_ == null) { + ensureLanguagesIsMutable(); + languages_.remove(index); + onChanged(); + } else { + languagesBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public org.sonarqube.ws.Issues.Language.Builder getLanguagesBuilder( + int index) { + return getLanguagesFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public org.sonarqube.ws.Issues.LanguageOrBuilder getLanguagesOrBuilder( + int index) { + if (languagesBuilder_ == null) { + return languages_.get(index); } else { + return languagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public java.util.List<? extends org.sonarqube.ws.Issues.LanguageOrBuilder> + getLanguagesOrBuilderList() { + if (languagesBuilder_ != null) { + return languagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(languages_); + } + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public org.sonarqube.ws.Issues.Language.Builder addLanguagesBuilder() { + return getLanguagesFieldBuilder().addBuilder( + org.sonarqube.ws.Issues.Language.getDefaultInstance()); + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public org.sonarqube.ws.Issues.Language.Builder addLanguagesBuilder( + int index) { + return getLanguagesFieldBuilder().addBuilder( + index, org.sonarqube.ws.Issues.Language.getDefaultInstance()); + } + /** + * <code>repeated .sonarqube.ws.issues.Language languages = 19;</code> + */ + public java.util.List<org.sonarqube.ws.Issues.Language.Builder> + getLanguagesBuilderList() { + return getLanguagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.Issues.Language, org.sonarqube.ws.Issues.Language.Builder, org.sonarqube.ws.Issues.LanguageOrBuilder> + getLanguagesFieldBuilder() { + if (languagesBuilder_ == null) { + languagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.Issues.Language, org.sonarqube.ws.Issues.Language.Builder, org.sonarqube.ws.Issues.LanguageOrBuilder>( + languages_, + ((bitField0_ & 0x00020000) == 0x00020000), + getParentForChildren(), + isClean()); + languages_ = null; + } + return languagesBuilder_; + } + + private java.util.List<org.sonarqube.ws.Common.Facet> facets_ = + java.util.Collections.emptyList(); + private void ensureFacetsIsMutable() { + if (!((bitField0_ & 0x00040000) == 0x00040000)) { + facets_ = new java.util.ArrayList<org.sonarqube.ws.Common.Facet>(facets_); + bitField0_ |= 0x00040000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.Common.Facet, org.sonarqube.ws.Common.Facet.Builder, org.sonarqube.ws.Common.FacetOrBuilder> facetsBuilder_; + + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public java.util.List<org.sonarqube.ws.Common.Facet> getFacetsList() { + if (facetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(facets_); + } else { + return facetsBuilder_.getMessageList(); + } + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public int getFacetsCount() { + if (facetsBuilder_ == null) { + return facets_.size(); + } else { + return facetsBuilder_.getCount(); + } + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public org.sonarqube.ws.Common.Facet getFacets(int index) { + if (facetsBuilder_ == null) { + return facets_.get(index); + } else { + return facetsBuilder_.getMessage(index); + } + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public Builder setFacets( + int index, org.sonarqube.ws.Common.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.set(index, value); + onChanged(); + } else { + facetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public Builder setFacets( + int index, org.sonarqube.ws.Common.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.set(index, builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public Builder addFacets(org.sonarqube.ws.Common.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.add(value); + onChanged(); + } else { + facetsBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public Builder addFacets( + int index, org.sonarqube.ws.Common.Facet value) { + if (facetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetsIsMutable(); + facets_.add(index, value); + onChanged(); + } else { + facetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public Builder addFacets( + org.sonarqube.ws.Common.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public Builder addFacets( + int index, org.sonarqube.ws.Common.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(index, builderForValue.build()); + onChanged(); + } else { + facetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public Builder addAllFacets( + java.lang.Iterable<? extends org.sonarqube.ws.Common.Facet> values) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, facets_); + onChanged(); + } else { + facetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public Builder clearFacets() { + if (facetsBuilder_ == null) { + facets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00040000); + onChanged(); + } else { + facetsBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public Builder removeFacets(int index) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.remove(index); + onChanged(); + } else { + facetsBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public org.sonarqube.ws.Common.Facet.Builder getFacetsBuilder( + int index) { + return getFacetsFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public org.sonarqube.ws.Common.FacetOrBuilder getFacetsOrBuilder( + int index) { + if (facetsBuilder_ == null) { + return facets_.get(index); } else { + return facetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public java.util.List<? extends org.sonarqube.ws.Common.FacetOrBuilder> + getFacetsOrBuilderList() { + if (facetsBuilder_ != null) { + return facetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(facets_); + } + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public org.sonarqube.ws.Common.Facet.Builder addFacetsBuilder() { + return getFacetsFieldBuilder().addBuilder( + org.sonarqube.ws.Common.Facet.getDefaultInstance()); + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public org.sonarqube.ws.Common.Facet.Builder addFacetsBuilder( + int index) { + return getFacetsFieldBuilder().addBuilder( + index, org.sonarqube.ws.Common.Facet.getDefaultInstance()); + } + /** + * <code>repeated .sonarqube.ws.Facet facets = 20;</code> + */ + public java.util.List<org.sonarqube.ws.Common.Facet.Builder> + getFacetsBuilderList() { + return getFacetsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.Common.Facet, org.sonarqube.ws.Common.Facet.Builder, org.sonarqube.ws.Common.FacetOrBuilder> + getFacetsFieldBuilder() { + if (facetsBuilder_ == null) { + facetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.Common.Facet, org.sonarqube.ws.Common.Facet.Builder, org.sonarqube.ws.Common.FacetOrBuilder>( + facets_, + ((bitField0_ & 0x00040000) == 0x00040000), + getParentForChildren(), + isClean()); + facets_ = null; + } + return facetsBuilder_; + } + + private boolean facetsPresentIfEmpty_ ; + /** + * <code>optional bool facetsPresentIfEmpty = 21;</code> + */ + public boolean hasFacetsPresentIfEmpty() { + return ((bitField0_ & 0x00080000) == 0x00080000); + } + /** + * <code>optional bool facetsPresentIfEmpty = 21;</code> + */ + public boolean getFacetsPresentIfEmpty() { + return facetsPresentIfEmpty_; + } + /** + * <code>optional bool facetsPresentIfEmpty = 21;</code> + */ + public Builder setFacetsPresentIfEmpty(boolean value) { + bitField0_ |= 0x00080000; + facetsPresentIfEmpty_ = value; + onChanged(); + return this; + } + /** + * <code>optional bool facetsPresentIfEmpty = 21;</code> + */ + public Builder clearFacetsPresentIfEmpty() { + bitField0_ = (bitField0_ & ~0x00080000); + facetsPresentIfEmpty_ = false; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:sonarqube.ws.issues.Search) } @@ -2777,57 +4327,52 @@ public final class Issues { getRuleBytes(); /** - * <code>optional string component = 3;</code> + * <code>optional .sonarqube.ws.Severity severity = 3;</code> + */ + boolean hasSeverity(); + /** + * <code>optional .sonarqube.ws.Severity severity = 3;</code> + */ + org.sonarqube.ws.Common.Severity getSeverity(); + + /** + * <code>optional string component = 4;</code> */ boolean hasComponent(); /** - * <code>optional string component = 3;</code> + * <code>optional string component = 4;</code> */ java.lang.String getComponent(); /** - * <code>optional string component = 3;</code> + * <code>optional string component = 4;</code> */ com.google.protobuf.ByteString getComponentBytes(); /** - * <code>optional int32 componentId = 4;</code> + * <code>optional int64 componentId = 5;</code> */ boolean hasComponentId(); /** - * <code>optional int32 componentId = 4;</code> + * <code>optional int64 componentId = 5;</code> */ - int getComponentId(); + long getComponentId(); /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ boolean hasProject(); /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ java.lang.String getProject(); /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ com.google.protobuf.ByteString getProjectBytes(); /** - * <code>optional string subProject = 6;</code> - */ - boolean hasSubProject(); - /** - * <code>optional string subProject = 6;</code> - */ - java.lang.String getSubProject(); - /** - * <code>optional string subProject = 6;</code> - */ - com.google.protobuf.ByteString - getSubProjectBytes(); - - /** * <code>optional int32 line = 7;</code> */ boolean hasLine(); @@ -2921,18 +4466,30 @@ public final class Issues { getReporterBytes(); /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ - boolean hasScmAuthor(); + boolean hasAuthor(); /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ - java.lang.String getScmAuthor(); + java.lang.String getAuthor(); /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ com.google.protobuf.ByteString - getScmAuthorBytes(); + getAuthorBytes(); /** * <code>optional string actionPlan = 15;</code> @@ -2996,119 +4553,162 @@ public final class Issues { getTagsBytes(int index); /** - * <code>repeated string transitions = 19;</code> + * <code>optional bool transitionsPresentIfEmpty = 19;</code> + * + * <pre> + * the transitions allowed for the requesting user. + * </pre> + */ + boolean hasTransitionsPresentIfEmpty(); + /** + * <code>optional bool transitionsPresentIfEmpty = 19;</code> + * + * <pre> + * the transitions allowed for the requesting user. + * </pre> + */ + boolean getTransitionsPresentIfEmpty(); + + /** + * <code>repeated string transitions = 20;</code> */ com.google.protobuf.ProtocolStringList getTransitionsList(); /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ int getTransitionsCount(); /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ java.lang.String getTransitions(int index); /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ com.google.protobuf.ByteString getTransitionsBytes(int index); /** - * <code>repeated string actions = 20;</code> + * <code>optional bool actionsPresentIfEmpty = 21;</code> + * + * <pre> + * the actions allowed for the requesting user. + * </pre> + */ + boolean hasActionsPresentIfEmpty(); + /** + * <code>optional bool actionsPresentIfEmpty = 21;</code> + * + * <pre> + * the actions allowed for the requesting user. + * </pre> + */ + boolean getActionsPresentIfEmpty(); + + /** + * <code>repeated string actions = 22;</code> */ com.google.protobuf.ProtocolStringList getActionsList(); /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ int getActionsCount(); /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ java.lang.String getActions(int index); /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ com.google.protobuf.ByteString getActionsBytes(int index); /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>optional bool commentsPresentIfEmpty = 23;</code> + */ + boolean hasCommentsPresentIfEmpty(); + /** + * <code>optional bool commentsPresentIfEmpty = 23;</code> + */ + boolean getCommentsPresentIfEmpty(); + + /** + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ java.util.List<org.sonarqube.ws.Issues.Comment> getCommentsList(); /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ org.sonarqube.ws.Issues.Comment getComments(int index); /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ int getCommentsCount(); /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ java.util.List<? extends org.sonarqube.ws.Issues.CommentOrBuilder> getCommentsOrBuilderList(); /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ org.sonarqube.ws.Issues.CommentOrBuilder getCommentsOrBuilder( int index); /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ boolean hasCreationDate(); /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ java.lang.String getCreationDate(); /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ com.google.protobuf.ByteString getCreationDateBytes(); /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ boolean hasUpdateDate(); /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ java.lang.String getUpdateDate(); /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ com.google.protobuf.ByteString getUpdateDateBytes(); /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ boolean hasFUpdateAge(); /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ java.lang.String getFUpdateAge(); /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ com.google.protobuf.ByteString getFUpdateAgeBytes(); /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ boolean hasCloseDate(); /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ java.lang.String getCloseDate(); /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ com.google.protobuf.ByteString getCloseDateBytes(); @@ -3177,27 +4777,32 @@ public final class Issues { rule_ = bs; break; } - case 26: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - component_ = bs; + case 24: { + int rawValue = input.readEnum(); + org.sonarqube.ws.Common.Severity value = org.sonarqube.ws.Common.Severity.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(3, rawValue); + } else { + bitField0_ |= 0x00000004; + severity_ = value; + } break; } - case 32: { + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000008; - componentId_ = input.readInt32(); + component_ = bs; break; } - case 42: { - com.google.protobuf.ByteString bs = input.readBytes(); + case 40: { bitField0_ |= 0x00000010; - project_ = bs; + componentId_ = input.readInt64(); break; } case 50: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000020; - subProject_ = bs; + project_ = bs; break; } case 56: { @@ -3244,7 +4849,7 @@ public final class Issues { case 114: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00002000; - scmAuthor_ = bs; + author_ = bs; break; } case 122: { @@ -3274,53 +4879,68 @@ public final class Issues { tags_.add(bs); break; } - case 154: { + case 152: { + bitField0_ |= 0x00020000; + transitionsPresentIfEmpty_ = input.readBool(); + break; + } + case 162: { com.google.protobuf.ByteString bs = input.readBytes(); - if (!((mutable_bitField0_ & 0x00040000) == 0x00040000)) { + if (!((mutable_bitField0_ & 0x00080000) == 0x00080000)) { transitions_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00040000; + mutable_bitField0_ |= 0x00080000; } transitions_.add(bs); break; } - case 162: { + case 168: { + bitField0_ |= 0x00040000; + actionsPresentIfEmpty_ = input.readBool(); + break; + } + case 178: { com.google.protobuf.ByteString bs = input.readBytes(); - if (!((mutable_bitField0_ & 0x00080000) == 0x00080000)) { + if (!((mutable_bitField0_ & 0x00200000) == 0x00200000)) { actions_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00080000; + mutable_bitField0_ |= 0x00200000; } actions_.add(bs); break; } - case 170: { - if (!((mutable_bitField0_ & 0x00100000) == 0x00100000)) { + case 184: { + bitField0_ |= 0x00080000; + commentsPresentIfEmpty_ = input.readBool(); + break; + } + case 194: { + if (!((mutable_bitField0_ & 0x00800000) == 0x00800000)) { comments_ = new java.util.ArrayList<org.sonarqube.ws.Issues.Comment>(); - mutable_bitField0_ |= 0x00100000; + mutable_bitField0_ |= 0x00800000; } comments_.add(input.readMessage(org.sonarqube.ws.Issues.Comment.PARSER, extensionRegistry)); break; } - case 178: { + case 202: { com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00020000; + bitField0_ |= 0x00100000; creationDate_ = bs; break; } - case 186: { + case 210: { com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00040000; + bitField0_ |= 0x00200000; updateDate_ = bs; break; } - case 194: { + case 218: { com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00080000; + bitField0_ |= 0x00400000; fUpdateAge_ = bs; break; } - case 202: { + case 226: { com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00100000; + bitField0_ |= 0x00800000; closeDate_ = bs; break; } @@ -3335,13 +4955,13 @@ public final class Issues { if (((mutable_bitField0_ & 0x00020000) == 0x00020000)) { tags_ = tags_.getUnmodifiableView(); } - if (((mutable_bitField0_ & 0x00040000) == 0x00040000)) { + if (((mutable_bitField0_ & 0x00080000) == 0x00080000)) { transitions_ = transitions_.getUnmodifiableView(); } - if (((mutable_bitField0_ & 0x00080000) == 0x00080000)) { + if (((mutable_bitField0_ & 0x00200000) == 0x00200000)) { actions_ = actions_.getUnmodifiableView(); } - if (((mutable_bitField0_ & 0x00100000) == 0x00100000)) { + if (((mutable_bitField0_ & 0x00800000) == 0x00800000)) { comments_ = java.util.Collections.unmodifiableList(comments_); } this.unknownFields = unknownFields.build(); @@ -3460,16 +5080,31 @@ public final class Issues { } } - public static final int COMPONENT_FIELD_NUMBER = 3; + public static final int SEVERITY_FIELD_NUMBER = 3; + private org.sonarqube.ws.Common.Severity severity_; + /** + * <code>optional .sonarqube.ws.Severity severity = 3;</code> + */ + public boolean hasSeverity() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional .sonarqube.ws.Severity severity = 3;</code> + */ + public org.sonarqube.ws.Common.Severity getSeverity() { + return severity_; + } + + public static final int COMPONENT_FIELD_NUMBER = 4; private java.lang.Object component_; /** - * <code>optional string component = 3;</code> + * <code>optional string component = 4;</code> */ public boolean hasComponent() { - return ((bitField0_ & 0x00000004) == 0x00000004); + return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * <code>optional string component = 3;</code> + * <code>optional string component = 4;</code> */ public java.lang.String getComponent() { java.lang.Object ref = component_; @@ -3486,7 +5121,7 @@ public final class Issues { } } /** - * <code>optional string component = 3;</code> + * <code>optional string component = 4;</code> */ public com.google.protobuf.ByteString getComponentBytes() { @@ -3502,31 +5137,31 @@ public final class Issues { } } - public static final int COMPONENTID_FIELD_NUMBER = 4; - private int componentId_; + public static final int COMPONENTID_FIELD_NUMBER = 5; + private long componentId_; /** - * <code>optional int32 componentId = 4;</code> + * <code>optional int64 componentId = 5;</code> */ public boolean hasComponentId() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * <code>optional int32 componentId = 4;</code> + * <code>optional int64 componentId = 5;</code> */ - public int getComponentId() { + public long getComponentId() { return componentId_; } - public static final int PROJECT_FIELD_NUMBER = 5; + public static final int PROJECT_FIELD_NUMBER = 6; private java.lang.Object project_; /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ public boolean hasProject() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ public java.lang.String getProject() { java.lang.Object ref = project_; @@ -3543,7 +5178,7 @@ public final class Issues { } } /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ public com.google.protobuf.ByteString getProjectBytes() { @@ -3559,48 +5194,6 @@ public final class Issues { } } - public static final int SUBPROJECT_FIELD_NUMBER = 6; - private java.lang.Object subProject_; - /** - * <code>optional string subProject = 6;</code> - */ - public boolean hasSubProject() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * <code>optional string subProject = 6;</code> - */ - public java.lang.String getSubProject() { - java.lang.Object ref = subProject_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - subProject_ = s; - } - return s; - } - } - /** - * <code>optional string subProject = 6;</code> - */ - public com.google.protobuf.ByteString - getSubProjectBytes() { - java.lang.Object ref = subProject_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - subProject_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - public static final int LINE_FIELD_NUMBER = 7; private int line_; /** @@ -3868,19 +5461,27 @@ public final class Issues { } } - public static final int SCMAUTHOR_FIELD_NUMBER = 14; - private java.lang.Object scmAuthor_; + public static final int AUTHOR_FIELD_NUMBER = 14; + private java.lang.Object author_; /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ - public boolean hasScmAuthor() { + public boolean hasAuthor() { return ((bitField0_ & 0x00002000) == 0x00002000); } /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ - public java.lang.String getScmAuthor() { - java.lang.Object ref = scmAuthor_; + public java.lang.String getAuthor() { + java.lang.Object ref = author_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { @@ -3888,22 +5489,26 @@ public final class Issues { (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { - scmAuthor_ = s; + author_ = s; } return s; } } /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ public com.google.protobuf.ByteString - getScmAuthorBytes() { - java.lang.Object ref = scmAuthor_; + getAuthorBytes() { + java.lang.Object ref = author_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - scmAuthor_ = b; + author_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -4065,109 +5670,170 @@ public final class Issues { return tags_.getByteString(index); } - public static final int TRANSITIONS_FIELD_NUMBER = 19; + public static final int TRANSITIONSPRESENTIFEMPTY_FIELD_NUMBER = 19; + private boolean transitionsPresentIfEmpty_; + /** + * <code>optional bool transitionsPresentIfEmpty = 19;</code> + * + * <pre> + * the transitions allowed for the requesting user. + * </pre> + */ + public boolean hasTransitionsPresentIfEmpty() { + return ((bitField0_ & 0x00020000) == 0x00020000); + } + /** + * <code>optional bool transitionsPresentIfEmpty = 19;</code> + * + * <pre> + * the transitions allowed for the requesting user. + * </pre> + */ + public boolean getTransitionsPresentIfEmpty() { + return transitionsPresentIfEmpty_; + } + + public static final int TRANSITIONS_FIELD_NUMBER = 20; private com.google.protobuf.LazyStringList transitions_; /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public com.google.protobuf.ProtocolStringList getTransitionsList() { return transitions_; } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public int getTransitionsCount() { return transitions_.size(); } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public java.lang.String getTransitions(int index) { return transitions_.get(index); } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public com.google.protobuf.ByteString getTransitionsBytes(int index) { return transitions_.getByteString(index); } - public static final int ACTIONS_FIELD_NUMBER = 20; + public static final int ACTIONSPRESENTIFEMPTY_FIELD_NUMBER = 21; + private boolean actionsPresentIfEmpty_; + /** + * <code>optional bool actionsPresentIfEmpty = 21;</code> + * + * <pre> + * the actions allowed for the requesting user. + * </pre> + */ + public boolean hasActionsPresentIfEmpty() { + return ((bitField0_ & 0x00040000) == 0x00040000); + } + /** + * <code>optional bool actionsPresentIfEmpty = 21;</code> + * + * <pre> + * the actions allowed for the requesting user. + * </pre> + */ + public boolean getActionsPresentIfEmpty() { + return actionsPresentIfEmpty_; + } + + public static final int ACTIONS_FIELD_NUMBER = 22; private com.google.protobuf.LazyStringList actions_; /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public com.google.protobuf.ProtocolStringList getActionsList() { return actions_; } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public int getActionsCount() { return actions_.size(); } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public java.lang.String getActions(int index) { return actions_.get(index); } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public com.google.protobuf.ByteString getActionsBytes(int index) { return actions_.getByteString(index); } - public static final int COMMENTS_FIELD_NUMBER = 21; + public static final int COMMENTSPRESENTIFEMPTY_FIELD_NUMBER = 23; + private boolean commentsPresentIfEmpty_; + /** + * <code>optional bool commentsPresentIfEmpty = 23;</code> + */ + public boolean hasCommentsPresentIfEmpty() { + return ((bitField0_ & 0x00080000) == 0x00080000); + } + /** + * <code>optional bool commentsPresentIfEmpty = 23;</code> + */ + public boolean getCommentsPresentIfEmpty() { + return commentsPresentIfEmpty_; + } + + public static final int COMMENTS_FIELD_NUMBER = 24; private java.util.List<org.sonarqube.ws.Issues.Comment> comments_; /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public java.util.List<org.sonarqube.ws.Issues.Comment> getCommentsList() { return comments_; } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public java.util.List<? extends org.sonarqube.ws.Issues.CommentOrBuilder> getCommentsOrBuilderList() { return comments_; } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public int getCommentsCount() { return comments_.size(); } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public org.sonarqube.ws.Issues.Comment getComments(int index) { return comments_.get(index); } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public org.sonarqube.ws.Issues.CommentOrBuilder getCommentsOrBuilder( int index) { return comments_.get(index); } - public static final int CREATIONDATE_FIELD_NUMBER = 22; + public static final int CREATIONDATE_FIELD_NUMBER = 25; private java.lang.Object creationDate_; /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ public boolean hasCreationDate() { - return ((bitField0_ & 0x00020000) == 0x00020000); + return ((bitField0_ & 0x00100000) == 0x00100000); } /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ public java.lang.String getCreationDate() { java.lang.Object ref = creationDate_; @@ -4184,7 +5850,7 @@ public final class Issues { } } /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ public com.google.protobuf.ByteString getCreationDateBytes() { @@ -4200,16 +5866,16 @@ public final class Issues { } } - public static final int UPDATEDATE_FIELD_NUMBER = 23; + public static final int UPDATEDATE_FIELD_NUMBER = 26; private java.lang.Object updateDate_; /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ public boolean hasUpdateDate() { - return ((bitField0_ & 0x00040000) == 0x00040000); + return ((bitField0_ & 0x00200000) == 0x00200000); } /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ public java.lang.String getUpdateDate() { java.lang.Object ref = updateDate_; @@ -4226,7 +5892,7 @@ public final class Issues { } } /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ public com.google.protobuf.ByteString getUpdateDateBytes() { @@ -4242,16 +5908,16 @@ public final class Issues { } } - public static final int FUPDATEAGE_FIELD_NUMBER = 24; + public static final int FUPDATEAGE_FIELD_NUMBER = 27; private java.lang.Object fUpdateAge_; /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ public boolean hasFUpdateAge() { - return ((bitField0_ & 0x00080000) == 0x00080000); + return ((bitField0_ & 0x00400000) == 0x00400000); } /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ public java.lang.String getFUpdateAge() { java.lang.Object ref = fUpdateAge_; @@ -4268,7 +5934,7 @@ public final class Issues { } } /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ public com.google.protobuf.ByteString getFUpdateAgeBytes() { @@ -4284,16 +5950,16 @@ public final class Issues { } } - public static final int CLOSEDATE_FIELD_NUMBER = 25; + public static final int CLOSEDATE_FIELD_NUMBER = 28; private java.lang.Object closeDate_; /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ public boolean hasCloseDate() { - return ((bitField0_ & 0x00100000) == 0x00100000); + return ((bitField0_ & 0x00800000) == 0x00800000); } /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ public java.lang.String getCloseDate() { java.lang.Object ref = closeDate_; @@ -4310,7 +5976,7 @@ public final class Issues { } } /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ public com.google.protobuf.ByteString getCloseDateBytes() { @@ -4329,10 +5995,10 @@ public final class Issues { private void initFields() { key_ = ""; rule_ = ""; + severity_ = org.sonarqube.ws.Common.Severity.INFO; component_ = ""; - componentId_ = 0; + componentId_ = 0L; project_ = ""; - subProject_ = ""; line_ = 0; resolution_ = ""; status_ = ""; @@ -4340,13 +6006,16 @@ public final class Issues { debt_ = ""; assignee_ = ""; reporter_ = ""; - scmAuthor_ = ""; + author_ = ""; actionPlan_ = ""; actionPlanName_ = ""; attr_ = ""; tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + transitionsPresentIfEmpty_ = false; transitions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + actionsPresentIfEmpty_ = false; actions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + commentsPresentIfEmpty_ = false; comments_ = java.util.Collections.emptyList(); creationDate_ = ""; updateDate_ = ""; @@ -4373,16 +6042,16 @@ public final class Issues { output.writeBytes(2, getRuleBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, getComponentBytes()); + output.writeEnum(3, severity_.getNumber()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(4, componentId_); + output.writeBytes(4, getComponentBytes()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(5, getProjectBytes()); + output.writeInt64(5, componentId_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBytes(6, getSubProjectBytes()); + output.writeBytes(6, getProjectBytes()); } if (((bitField0_ & 0x00000040) == 0x00000040)) { output.writeInt32(7, line_); @@ -4406,7 +6075,7 @@ public final class Issues { output.writeBytes(13, getReporterBytes()); } if (((bitField0_ & 0x00002000) == 0x00002000)) { - output.writeBytes(14, getScmAuthorBytes()); + output.writeBytes(14, getAuthorBytes()); } if (((bitField0_ & 0x00004000) == 0x00004000)) { output.writeBytes(15, getActionPlanBytes()); @@ -4420,26 +6089,35 @@ public final class Issues { for (int i = 0; i < tags_.size(); i++) { output.writeBytes(18, tags_.getByteString(i)); } + if (((bitField0_ & 0x00020000) == 0x00020000)) { + output.writeBool(19, transitionsPresentIfEmpty_); + } for (int i = 0; i < transitions_.size(); i++) { - output.writeBytes(19, transitions_.getByteString(i)); + output.writeBytes(20, transitions_.getByteString(i)); + } + if (((bitField0_ & 0x00040000) == 0x00040000)) { + output.writeBool(21, actionsPresentIfEmpty_); } for (int i = 0; i < actions_.size(); i++) { - output.writeBytes(20, actions_.getByteString(i)); + output.writeBytes(22, actions_.getByteString(i)); + } + if (((bitField0_ & 0x00080000) == 0x00080000)) { + output.writeBool(23, commentsPresentIfEmpty_); } for (int i = 0; i < comments_.size(); i++) { - output.writeMessage(21, comments_.get(i)); + output.writeMessage(24, comments_.get(i)); } - if (((bitField0_ & 0x00020000) == 0x00020000)) { - output.writeBytes(22, getCreationDateBytes()); + if (((bitField0_ & 0x00100000) == 0x00100000)) { + output.writeBytes(25, getCreationDateBytes()); } - if (((bitField0_ & 0x00040000) == 0x00040000)) { - output.writeBytes(23, getUpdateDateBytes()); + if (((bitField0_ & 0x00200000) == 0x00200000)) { + output.writeBytes(26, getUpdateDateBytes()); } - if (((bitField0_ & 0x00080000) == 0x00080000)) { - output.writeBytes(24, getFUpdateAgeBytes()); + if (((bitField0_ & 0x00400000) == 0x00400000)) { + output.writeBytes(27, getFUpdateAgeBytes()); } - if (((bitField0_ & 0x00100000) == 0x00100000)) { - output.writeBytes(25, getCloseDateBytes()); + if (((bitField0_ & 0x00800000) == 0x00800000)) { + output.writeBytes(28, getCloseDateBytes()); } getUnknownFields().writeTo(output); } @@ -4460,19 +6138,19 @@ public final class Issues { } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, getComponentBytes()); + .computeEnumSize(3, severity_.getNumber()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, componentId_); + .computeBytesSize(4, getComponentBytes()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, getProjectBytes()); + .computeInt64Size(5, componentId_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(6, getSubProjectBytes()); + .computeBytesSize(6, getProjectBytes()); } if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream @@ -4504,7 +6182,7 @@ public final class Issues { } if (((bitField0_ & 0x00002000) == 0x00002000)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(14, getScmAuthorBytes()); + .computeBytesSize(14, getAuthorBytes()); } if (((bitField0_ & 0x00004000) == 0x00004000)) { size += com.google.protobuf.CodedOutputStream @@ -4527,6 +6205,10 @@ public final class Issues { size += dataSize; size += 2 * getTagsList().size(); } + if (((bitField0_ & 0x00020000) == 0x00020000)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(19, transitionsPresentIfEmpty_); + } { int dataSize = 0; for (int i = 0; i < transitions_.size(); i++) { @@ -4536,6 +6218,10 @@ public final class Issues { size += dataSize; size += 2 * getTransitionsList().size(); } + if (((bitField0_ & 0x00040000) == 0x00040000)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(21, actionsPresentIfEmpty_); + } { int dataSize = 0; for (int i = 0; i < actions_.size(); i++) { @@ -4545,25 +6231,29 @@ public final class Issues { size += dataSize; size += 2 * getActionsList().size(); } + if (((bitField0_ & 0x00080000) == 0x00080000)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(23, commentsPresentIfEmpty_); + } for (int i = 0; i < comments_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(21, comments_.get(i)); + .computeMessageSize(24, comments_.get(i)); } - if (((bitField0_ & 0x00020000) == 0x00020000)) { + if (((bitField0_ & 0x00100000) == 0x00100000)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(22, getCreationDateBytes()); + .computeBytesSize(25, getCreationDateBytes()); } - if (((bitField0_ & 0x00040000) == 0x00040000)) { + if (((bitField0_ & 0x00200000) == 0x00200000)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(23, getUpdateDateBytes()); + .computeBytesSize(26, getUpdateDateBytes()); } - if (((bitField0_ & 0x00080000) == 0x00080000)) { + if (((bitField0_ & 0x00400000) == 0x00400000)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(24, getFUpdateAgeBytes()); + .computeBytesSize(27, getFUpdateAgeBytes()); } - if (((bitField0_ & 0x00100000) == 0x00100000)) { + if (((bitField0_ & 0x00800000) == 0x00800000)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(25, getCloseDateBytes()); + .computeBytesSize(28, getCloseDateBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -4687,13 +6377,13 @@ public final class Issues { bitField0_ = (bitField0_ & ~0x00000001); rule_ = ""; bitField0_ = (bitField0_ & ~0x00000002); - component_ = ""; + severity_ = org.sonarqube.ws.Common.Severity.INFO; bitField0_ = (bitField0_ & ~0x00000004); - componentId_ = 0; + component_ = ""; bitField0_ = (bitField0_ & ~0x00000008); - project_ = ""; + componentId_ = 0L; bitField0_ = (bitField0_ & ~0x00000010); - subProject_ = ""; + project_ = ""; bitField0_ = (bitField0_ & ~0x00000020); line_ = 0; bitField0_ = (bitField0_ & ~0x00000040); @@ -4709,7 +6399,7 @@ public final class Issues { bitField0_ = (bitField0_ & ~0x00000800); reporter_ = ""; bitField0_ = (bitField0_ & ~0x00001000); - scmAuthor_ = ""; + author_ = ""; bitField0_ = (bitField0_ & ~0x00002000); actionPlan_ = ""; bitField0_ = (bitField0_ & ~0x00004000); @@ -4719,24 +6409,30 @@ public final class Issues { bitField0_ = (bitField0_ & ~0x00010000); tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00020000); - transitions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + transitionsPresentIfEmpty_ = false; bitField0_ = (bitField0_ & ~0x00040000); - actions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + transitions_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00080000); + actionsPresentIfEmpty_ = false; + bitField0_ = (bitField0_ & ~0x00100000); + actions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00200000); + commentsPresentIfEmpty_ = false; + bitField0_ = (bitField0_ & ~0x00400000); if (commentsBuilder_ == null) { comments_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00800000); } else { commentsBuilder_.clear(); } creationDate_ = ""; - bitField0_ = (bitField0_ & ~0x00200000); + bitField0_ = (bitField0_ & ~0x01000000); updateDate_ = ""; - bitField0_ = (bitField0_ & ~0x00400000); + bitField0_ = (bitField0_ & ~0x02000000); fUpdateAge_ = ""; - bitField0_ = (bitField0_ & ~0x00800000); + bitField0_ = (bitField0_ & ~0x04000000); closeDate_ = ""; - bitField0_ = (bitField0_ & ~0x01000000); + bitField0_ = (bitField0_ & ~0x08000000); return this; } @@ -4776,19 +6472,19 @@ public final class Issues { if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } - result.component_ = component_; + result.severity_ = severity_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } - result.componentId_ = componentId_; + result.component_ = component_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } - result.project_ = project_; + result.componentId_ = componentId_; if (((from_bitField0_ & 0x00000020) == 0x00000020)) { to_bitField0_ |= 0x00000020; } - result.subProject_ = subProject_; + result.project_ = project_; if (((from_bitField0_ & 0x00000040) == 0x00000040)) { to_bitField0_ |= 0x00000040; } @@ -4820,7 +6516,7 @@ public final class Issues { if (((from_bitField0_ & 0x00002000) == 0x00002000)) { to_bitField0_ |= 0x00002000; } - result.scmAuthor_ = scmAuthor_; + result.author_ = author_; if (((from_bitField0_ & 0x00004000) == 0x00004000)) { to_bitField0_ |= 0x00004000; } @@ -4838,39 +6534,51 @@ public final class Issues { bitField0_ = (bitField0_ & ~0x00020000); } result.tags_ = tags_; - if (((bitField0_ & 0x00040000) == 0x00040000)) { + if (((from_bitField0_ & 0x00040000) == 0x00040000)) { + to_bitField0_ |= 0x00020000; + } + result.transitionsPresentIfEmpty_ = transitionsPresentIfEmpty_; + if (((bitField0_ & 0x00080000) == 0x00080000)) { transitions_ = transitions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00040000); + bitField0_ = (bitField0_ & ~0x00080000); } result.transitions_ = transitions_; - if (((bitField0_ & 0x00080000) == 0x00080000)) { + if (((from_bitField0_ & 0x00100000) == 0x00100000)) { + to_bitField0_ |= 0x00040000; + } + result.actionsPresentIfEmpty_ = actionsPresentIfEmpty_; + if (((bitField0_ & 0x00200000) == 0x00200000)) { actions_ = actions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00080000); + bitField0_ = (bitField0_ & ~0x00200000); } result.actions_ = actions_; + if (((from_bitField0_ & 0x00400000) == 0x00400000)) { + to_bitField0_ |= 0x00080000; + } + result.commentsPresentIfEmpty_ = commentsPresentIfEmpty_; if (commentsBuilder_ == null) { - if (((bitField0_ & 0x00100000) == 0x00100000)) { + if (((bitField0_ & 0x00800000) == 0x00800000)) { comments_ = java.util.Collections.unmodifiableList(comments_); - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00800000); } result.comments_ = comments_; } else { result.comments_ = commentsBuilder_.build(); } - if (((from_bitField0_ & 0x00200000) == 0x00200000)) { - to_bitField0_ |= 0x00020000; + if (((from_bitField0_ & 0x01000000) == 0x01000000)) { + to_bitField0_ |= 0x00100000; } result.creationDate_ = creationDate_; - if (((from_bitField0_ & 0x00400000) == 0x00400000)) { - to_bitField0_ |= 0x00040000; + if (((from_bitField0_ & 0x02000000) == 0x02000000)) { + to_bitField0_ |= 0x00200000; } result.updateDate_ = updateDate_; - if (((from_bitField0_ & 0x00800000) == 0x00800000)) { - to_bitField0_ |= 0x00080000; + if (((from_bitField0_ & 0x04000000) == 0x04000000)) { + to_bitField0_ |= 0x00400000; } result.fUpdateAge_ = fUpdateAge_; - if (((from_bitField0_ & 0x01000000) == 0x01000000)) { - to_bitField0_ |= 0x00100000; + if (((from_bitField0_ & 0x08000000) == 0x08000000)) { + to_bitField0_ |= 0x00800000; } result.closeDate_ = closeDate_; result.bitField0_ = to_bitField0_; @@ -4899,8 +6607,11 @@ public final class Issues { rule_ = other.rule_; onChanged(); } + if (other.hasSeverity()) { + setSeverity(other.getSeverity()); + } if (other.hasComponent()) { - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; component_ = other.component_; onChanged(); } @@ -4908,13 +6619,8 @@ public final class Issues { setComponentId(other.getComponentId()); } if (other.hasProject()) { - bitField0_ |= 0x00000010; - project_ = other.project_; - onChanged(); - } - if (other.hasSubProject()) { bitField0_ |= 0x00000020; - subProject_ = other.subProject_; + project_ = other.project_; onChanged(); } if (other.hasLine()) { @@ -4950,9 +6656,9 @@ public final class Issues { reporter_ = other.reporter_; onChanged(); } - if (other.hasScmAuthor()) { + if (other.hasAuthor()) { bitField0_ |= 0x00002000; - scmAuthor_ = other.scmAuthor_; + author_ = other.author_; onChanged(); } if (other.hasActionPlan()) { @@ -4980,31 +6686,40 @@ public final class Issues { } onChanged(); } + if (other.hasTransitionsPresentIfEmpty()) { + setTransitionsPresentIfEmpty(other.getTransitionsPresentIfEmpty()); + } if (!other.transitions_.isEmpty()) { if (transitions_.isEmpty()) { transitions_ = other.transitions_; - bitField0_ = (bitField0_ & ~0x00040000); + bitField0_ = (bitField0_ & ~0x00080000); } else { ensureTransitionsIsMutable(); transitions_.addAll(other.transitions_); } onChanged(); } + if (other.hasActionsPresentIfEmpty()) { + setActionsPresentIfEmpty(other.getActionsPresentIfEmpty()); + } if (!other.actions_.isEmpty()) { if (actions_.isEmpty()) { actions_ = other.actions_; - bitField0_ = (bitField0_ & ~0x00080000); + bitField0_ = (bitField0_ & ~0x00200000); } else { ensureActionsIsMutable(); actions_.addAll(other.actions_); } onChanged(); } + if (other.hasCommentsPresentIfEmpty()) { + setCommentsPresentIfEmpty(other.getCommentsPresentIfEmpty()); + } if (commentsBuilder_ == null) { if (!other.comments_.isEmpty()) { if (comments_.isEmpty()) { comments_ = other.comments_; - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00800000); } else { ensureCommentsIsMutable(); comments_.addAll(other.comments_); @@ -5017,7 +6732,7 @@ public final class Issues { commentsBuilder_.dispose(); commentsBuilder_ = null; comments_ = other.comments_; - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00800000); commentsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getCommentsFieldBuilder() : null; @@ -5027,22 +6742,22 @@ public final class Issues { } } if (other.hasCreationDate()) { - bitField0_ |= 0x00200000; + bitField0_ |= 0x01000000; creationDate_ = other.creationDate_; onChanged(); } if (other.hasUpdateDate()) { - bitField0_ |= 0x00400000; + bitField0_ |= 0x02000000; updateDate_ = other.updateDate_; onChanged(); } if (other.hasFUpdateAge()) { - bitField0_ |= 0x00800000; + bitField0_ |= 0x04000000; fUpdateAge_ = other.fUpdateAge_; onChanged(); } if (other.hasCloseDate()) { - bitField0_ |= 0x01000000; + bitField0_ |= 0x08000000; closeDate_ = other.closeDate_; onChanged(); } @@ -5225,15 +6940,50 @@ public final class Issues { return this; } + private org.sonarqube.ws.Common.Severity severity_ = org.sonarqube.ws.Common.Severity.INFO; + /** + * <code>optional .sonarqube.ws.Severity severity = 3;</code> + */ + public boolean hasSeverity() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional .sonarqube.ws.Severity severity = 3;</code> + */ + public org.sonarqube.ws.Common.Severity getSeverity() { + return severity_; + } + /** + * <code>optional .sonarqube.ws.Severity severity = 3;</code> + */ + public Builder setSeverity(org.sonarqube.ws.Common.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + severity_ = value; + onChanged(); + return this; + } + /** + * <code>optional .sonarqube.ws.Severity severity = 3;</code> + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000004); + severity_ = org.sonarqube.ws.Common.Severity.INFO; + onChanged(); + return this; + } + private java.lang.Object component_ = ""; /** - * <code>optional string component = 3;</code> + * <code>optional string component = 4;</code> */ public boolean hasComponent() { - return ((bitField0_ & 0x00000004) == 0x00000004); + return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * <code>optional string component = 3;</code> + * <code>optional string component = 4;</code> */ public java.lang.String getComponent() { java.lang.Object ref = component_; @@ -5250,7 +7000,7 @@ public final class Issues { } } /** - * <code>optional string component = 3;</code> + * <code>optional string component = 4;</code> */ public com.google.protobuf.ByteString getComponentBytes() { @@ -5266,82 +7016,82 @@ public final class Issues { } } /** - * <code>optional string component = 3;</code> + * <code>optional string component = 4;</code> */ public Builder setComponent( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; component_ = value; onChanged(); return this; } /** - * <code>optional string component = 3;</code> + * <code>optional string component = 4;</code> */ public Builder clearComponent() { - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); component_ = getDefaultInstance().getComponent(); onChanged(); return this; } /** - * <code>optional string component = 3;</code> + * <code>optional string component = 4;</code> */ public Builder setComponentBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; component_ = value; onChanged(); return this; } - private int componentId_ ; + private long componentId_ ; /** - * <code>optional int32 componentId = 4;</code> + * <code>optional int64 componentId = 5;</code> */ public boolean hasComponentId() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * <code>optional int32 componentId = 4;</code> + * <code>optional int64 componentId = 5;</code> */ - public int getComponentId() { + public long getComponentId() { return componentId_; } /** - * <code>optional int32 componentId = 4;</code> + * <code>optional int64 componentId = 5;</code> */ - public Builder setComponentId(int value) { - bitField0_ |= 0x00000008; + public Builder setComponentId(long value) { + bitField0_ |= 0x00000010; componentId_ = value; onChanged(); return this; } /** - * <code>optional int32 componentId = 4;</code> + * <code>optional int64 componentId = 5;</code> */ public Builder clearComponentId() { - bitField0_ = (bitField0_ & ~0x00000008); - componentId_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + componentId_ = 0L; onChanged(); return this; } private java.lang.Object project_ = ""; /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ public boolean hasProject() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ public java.lang.String getProject() { java.lang.Object ref = project_; @@ -5358,7 +7108,7 @@ public final class Issues { } } /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ public com.google.protobuf.ByteString getProjectBytes() { @@ -5374,113 +7124,37 @@ public final class Issues { } } /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ public Builder setProject( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; project_ = value; onChanged(); return this; } /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ public Builder clearProject() { - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000020); project_ = getDefaultInstance().getProject(); onChanged(); return this; } /** - * <code>optional string project = 5;</code> + * <code>optional string project = 6;</code> */ public Builder setProjectBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; - project_ = value; - onChanged(); - return this; - } - - private java.lang.Object subProject_ = ""; - /** - * <code>optional string subProject = 6;</code> - */ - public boolean hasSubProject() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * <code>optional string subProject = 6;</code> - */ - public java.lang.String getSubProject() { - java.lang.Object ref = subProject_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - subProject_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * <code>optional string subProject = 6;</code> - */ - public com.google.protobuf.ByteString - getSubProjectBytes() { - java.lang.Object ref = subProject_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - subProject_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * <code>optional string subProject = 6;</code> - */ - public Builder setSubProject( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000020; - subProject_ = value; - onChanged(); - return this; - } - /** - * <code>optional string subProject = 6;</code> - */ - public Builder clearSubProject() { - bitField0_ = (bitField0_ & ~0x00000020); - subProject_ = getDefaultInstance().getSubProject(); - onChanged(); - return this; - } - /** - * <code>optional string subProject = 6;</code> - */ - public Builder setSubProjectBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } bitField0_ |= 0x00000020; - subProject_ = value; + project_ = value; onChanged(); return this; } @@ -5973,24 +7647,32 @@ public final class Issues { return this; } - private java.lang.Object scmAuthor_ = ""; + private java.lang.Object author_ = ""; /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ - public boolean hasScmAuthor() { + public boolean hasAuthor() { return ((bitField0_ & 0x00002000) == 0x00002000); } /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ - public java.lang.String getScmAuthor() { - java.lang.Object ref = scmAuthor_; + public java.lang.String getAuthor() { + java.lang.Object ref = author_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { - scmAuthor_ = s; + author_ = s; } return s; } else { @@ -5998,53 +7680,69 @@ public final class Issues { } } /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ public com.google.protobuf.ByteString - getScmAuthorBytes() { - java.lang.Object ref = scmAuthor_; + getAuthorBytes() { + java.lang.Object ref = author_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - scmAuthor_ = b; + author_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ - public Builder setScmAuthor( + public Builder setAuthor( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00002000; - scmAuthor_ = value; + author_ = value; onChanged(); return this; } /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ - public Builder clearScmAuthor() { + public Builder clearAuthor() { bitField0_ = (bitField0_ & ~0x00002000); - scmAuthor_ = getDefaultInstance().getScmAuthor(); + author_ = getDefaultInstance().getAuthor(); onChanged(); return this; } /** - * <code>optional string scmAuthor = 14;</code> + * <code>optional string author = 14;</code> + * + * <pre> + * SCM login of the committer who introduced the issue + * </pre> */ - public Builder setScmAuthorBytes( + public Builder setAuthorBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00002000; - scmAuthor_ = value; + author_ = value; onChanged(); return this; } @@ -6370,41 +8068,89 @@ public final class Issues { return this; } + private boolean transitionsPresentIfEmpty_ ; + /** + * <code>optional bool transitionsPresentIfEmpty = 19;</code> + * + * <pre> + * the transitions allowed for the requesting user. + * </pre> + */ + public boolean hasTransitionsPresentIfEmpty() { + return ((bitField0_ & 0x00040000) == 0x00040000); + } + /** + * <code>optional bool transitionsPresentIfEmpty = 19;</code> + * + * <pre> + * the transitions allowed for the requesting user. + * </pre> + */ + public boolean getTransitionsPresentIfEmpty() { + return transitionsPresentIfEmpty_; + } + /** + * <code>optional bool transitionsPresentIfEmpty = 19;</code> + * + * <pre> + * the transitions allowed for the requesting user. + * </pre> + */ + public Builder setTransitionsPresentIfEmpty(boolean value) { + bitField0_ |= 0x00040000; + transitionsPresentIfEmpty_ = value; + onChanged(); + return this; + } + /** + * <code>optional bool transitionsPresentIfEmpty = 19;</code> + * + * <pre> + * the transitions allowed for the requesting user. + * </pre> + */ + public Builder clearTransitionsPresentIfEmpty() { + bitField0_ = (bitField0_ & ~0x00040000); + transitionsPresentIfEmpty_ = false; + onChanged(); + return this; + } + private com.google.protobuf.LazyStringList transitions_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureTransitionsIsMutable() { - if (!((bitField0_ & 0x00040000) == 0x00040000)) { + if (!((bitField0_ & 0x00080000) == 0x00080000)) { transitions_ = new com.google.protobuf.LazyStringArrayList(transitions_); - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; } } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public com.google.protobuf.ProtocolStringList getTransitionsList() { return transitions_.getUnmodifiableView(); } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public int getTransitionsCount() { return transitions_.size(); } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public java.lang.String getTransitions(int index) { return transitions_.get(index); } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public com.google.protobuf.ByteString getTransitionsBytes(int index) { return transitions_.getByteString(index); } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public Builder setTransitions( int index, java.lang.String value) { @@ -6417,7 +8163,7 @@ public final class Issues { return this; } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public Builder addTransitions( java.lang.String value) { @@ -6430,7 +8176,7 @@ public final class Issues { return this; } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public Builder addAllTransitions( java.lang.Iterable<java.lang.String> values) { @@ -6441,16 +8187,16 @@ public final class Issues { return this; } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public Builder clearTransitions() { transitions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00040000); + bitField0_ = (bitField0_ & ~0x00080000); onChanged(); return this; } /** - * <code>repeated string transitions = 19;</code> + * <code>repeated string transitions = 20;</code> */ public Builder addTransitionsBytes( com.google.protobuf.ByteString value) { @@ -6463,41 +8209,89 @@ public final class Issues { return this; } + private boolean actionsPresentIfEmpty_ ; + /** + * <code>optional bool actionsPresentIfEmpty = 21;</code> + * + * <pre> + * the actions allowed for the requesting user. + * </pre> + */ + public boolean hasActionsPresentIfEmpty() { + return ((bitField0_ & 0x00100000) == 0x00100000); + } + /** + * <code>optional bool actionsPresentIfEmpty = 21;</code> + * + * <pre> + * the actions allowed for the requesting user. + * </pre> + */ + public boolean getActionsPresentIfEmpty() { + return actionsPresentIfEmpty_; + } + /** + * <code>optional bool actionsPresentIfEmpty = 21;</code> + * + * <pre> + * the actions allowed for the requesting user. + * </pre> + */ + public Builder setActionsPresentIfEmpty(boolean value) { + bitField0_ |= 0x00100000; + actionsPresentIfEmpty_ = value; + onChanged(); + return this; + } + /** + * <code>optional bool actionsPresentIfEmpty = 21;</code> + * + * <pre> + * the actions allowed for the requesting user. + * </pre> + */ + public Builder clearActionsPresentIfEmpty() { + bitField0_ = (bitField0_ & ~0x00100000); + actionsPresentIfEmpty_ = false; + onChanged(); + return this; + } + private com.google.protobuf.LazyStringList actions_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureActionsIsMutable() { - if (!((bitField0_ & 0x00080000) == 0x00080000)) { + if (!((bitField0_ & 0x00200000) == 0x00200000)) { actions_ = new com.google.protobuf.LazyStringArrayList(actions_); - bitField0_ |= 0x00080000; + bitField0_ |= 0x00200000; } } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public com.google.protobuf.ProtocolStringList getActionsList() { return actions_.getUnmodifiableView(); } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public int getActionsCount() { return actions_.size(); } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public java.lang.String getActions(int index) { return actions_.get(index); } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public com.google.protobuf.ByteString getActionsBytes(int index) { return actions_.getByteString(index); } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public Builder setActions( int index, java.lang.String value) { @@ -6510,7 +8304,7 @@ public final class Issues { return this; } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public Builder addActions( java.lang.String value) { @@ -6523,7 +8317,7 @@ public final class Issues { return this; } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public Builder addAllActions( java.lang.Iterable<java.lang.String> values) { @@ -6534,16 +8328,16 @@ public final class Issues { return this; } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public Builder clearActions() { actions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00080000); + bitField0_ = (bitField0_ & ~0x00200000); onChanged(); return this; } /** - * <code>repeated string actions = 20;</code> + * <code>repeated string actions = 22;</code> */ public Builder addActionsBytes( com.google.protobuf.ByteString value) { @@ -6556,12 +8350,44 @@ public final class Issues { return this; } + private boolean commentsPresentIfEmpty_ ; + /** + * <code>optional bool commentsPresentIfEmpty = 23;</code> + */ + public boolean hasCommentsPresentIfEmpty() { + return ((bitField0_ & 0x00400000) == 0x00400000); + } + /** + * <code>optional bool commentsPresentIfEmpty = 23;</code> + */ + public boolean getCommentsPresentIfEmpty() { + return commentsPresentIfEmpty_; + } + /** + * <code>optional bool commentsPresentIfEmpty = 23;</code> + */ + public Builder setCommentsPresentIfEmpty(boolean value) { + bitField0_ |= 0x00400000; + commentsPresentIfEmpty_ = value; + onChanged(); + return this; + } + /** + * <code>optional bool commentsPresentIfEmpty = 23;</code> + */ + public Builder clearCommentsPresentIfEmpty() { + bitField0_ = (bitField0_ & ~0x00400000); + commentsPresentIfEmpty_ = false; + onChanged(); + return this; + } + private java.util.List<org.sonarqube.ws.Issues.Comment> comments_ = java.util.Collections.emptyList(); private void ensureCommentsIsMutable() { - if (!((bitField0_ & 0x00100000) == 0x00100000)) { + if (!((bitField0_ & 0x00800000) == 0x00800000)) { comments_ = new java.util.ArrayList<org.sonarqube.ws.Issues.Comment>(comments_); - bitField0_ |= 0x00100000; + bitField0_ |= 0x00800000; } } @@ -6569,7 +8395,7 @@ public final class Issues { org.sonarqube.ws.Issues.Comment, org.sonarqube.ws.Issues.Comment.Builder, org.sonarqube.ws.Issues.CommentOrBuilder> commentsBuilder_; /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public java.util.List<org.sonarqube.ws.Issues.Comment> getCommentsList() { if (commentsBuilder_ == null) { @@ -6579,7 +8405,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public int getCommentsCount() { if (commentsBuilder_ == null) { @@ -6589,7 +8415,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public org.sonarqube.ws.Issues.Comment getComments(int index) { if (commentsBuilder_ == null) { @@ -6599,7 +8425,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public Builder setComments( int index, org.sonarqube.ws.Issues.Comment value) { @@ -6616,7 +8442,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public Builder setComments( int index, org.sonarqube.ws.Issues.Comment.Builder builderForValue) { @@ -6630,7 +8456,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public Builder addComments(org.sonarqube.ws.Issues.Comment value) { if (commentsBuilder_ == null) { @@ -6646,7 +8472,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public Builder addComments( int index, org.sonarqube.ws.Issues.Comment value) { @@ -6663,7 +8489,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public Builder addComments( org.sonarqube.ws.Issues.Comment.Builder builderForValue) { @@ -6677,7 +8503,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public Builder addComments( int index, org.sonarqube.ws.Issues.Comment.Builder builderForValue) { @@ -6691,7 +8517,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public Builder addAllComments( java.lang.Iterable<? extends org.sonarqube.ws.Issues.Comment> values) { @@ -6706,12 +8532,12 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public Builder clearComments() { if (commentsBuilder_ == null) { comments_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00800000); onChanged(); } else { commentsBuilder_.clear(); @@ -6719,7 +8545,7 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public Builder removeComments(int index) { if (commentsBuilder_ == null) { @@ -6732,14 +8558,14 @@ public final class Issues { return this; } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public org.sonarqube.ws.Issues.Comment.Builder getCommentsBuilder( int index) { return getCommentsFieldBuilder().getBuilder(index); } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public org.sonarqube.ws.Issues.CommentOrBuilder getCommentsOrBuilder( int index) { @@ -6749,7 +8575,7 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public java.util.List<? extends org.sonarqube.ws.Issues.CommentOrBuilder> getCommentsOrBuilderList() { @@ -6760,14 +8586,14 @@ public final class Issues { } } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public org.sonarqube.ws.Issues.Comment.Builder addCommentsBuilder() { return getCommentsFieldBuilder().addBuilder( org.sonarqube.ws.Issues.Comment.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public org.sonarqube.ws.Issues.Comment.Builder addCommentsBuilder( int index) { @@ -6775,7 +8601,7 @@ public final class Issues { index, org.sonarqube.ws.Issues.Comment.getDefaultInstance()); } /** - * <code>repeated .sonarqube.ws.issues.Comment comments = 21;</code> + * <code>repeated .sonarqube.ws.issues.Comment comments = 24;</code> */ public java.util.List<org.sonarqube.ws.Issues.Comment.Builder> getCommentsBuilderList() { @@ -6788,7 +8614,7 @@ public final class Issues { commentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< org.sonarqube.ws.Issues.Comment, org.sonarqube.ws.Issues.Comment.Builder, org.sonarqube.ws.Issues.CommentOrBuilder>( comments_, - ((bitField0_ & 0x00100000) == 0x00100000), + ((bitField0_ & 0x00800000) == 0x00800000), getParentForChildren(), isClean()); comments_ = null; @@ -6798,13 +8624,13 @@ public final class Issues { private java.lang.Object creationDate_ = ""; /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ public boolean hasCreationDate() { - return ((bitField0_ & 0x00200000) == 0x00200000); + return ((bitField0_ & 0x01000000) == 0x01000000); } /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ public java.lang.String getCreationDate() { java.lang.Object ref = creationDate_; @@ -6821,7 +8647,7 @@ public final class Issues { } } /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ public com.google.protobuf.ByteString getCreationDateBytes() { @@ -6837,36 +8663,36 @@ public final class Issues { } } /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ public Builder setCreationDate( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x01000000; creationDate_ = value; onChanged(); return this; } /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ public Builder clearCreationDate() { - bitField0_ = (bitField0_ & ~0x00200000); + bitField0_ = (bitField0_ & ~0x01000000); creationDate_ = getDefaultInstance().getCreationDate(); onChanged(); return this; } /** - * <code>optional string creationDate = 22;</code> + * <code>optional string creationDate = 25;</code> */ public Builder setCreationDateBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00200000; + bitField0_ |= 0x01000000; creationDate_ = value; onChanged(); return this; @@ -6874,13 +8700,13 @@ public final class Issues { private java.lang.Object updateDate_ = ""; /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ public boolean hasUpdateDate() { - return ((bitField0_ & 0x00400000) == 0x00400000); + return ((bitField0_ & 0x02000000) == 0x02000000); } /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ public java.lang.String getUpdateDate() { java.lang.Object ref = updateDate_; @@ -6897,7 +8723,7 @@ public final class Issues { } } /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ public com.google.protobuf.ByteString getUpdateDateBytes() { @@ -6913,36 +8739,36 @@ public final class Issues { } } /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ public Builder setUpdateDate( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00400000; + bitField0_ |= 0x02000000; updateDate_ = value; onChanged(); return this; } /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ public Builder clearUpdateDate() { - bitField0_ = (bitField0_ & ~0x00400000); + bitField0_ = (bitField0_ & ~0x02000000); updateDate_ = getDefaultInstance().getUpdateDate(); onChanged(); return this; } /** - * <code>optional string updateDate = 23;</code> + * <code>optional string updateDate = 26;</code> */ public Builder setUpdateDateBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00400000; + bitField0_ |= 0x02000000; updateDate_ = value; onChanged(); return this; @@ -6950,13 +8776,13 @@ public final class Issues { private java.lang.Object fUpdateAge_ = ""; /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ public boolean hasFUpdateAge() { - return ((bitField0_ & 0x00800000) == 0x00800000); + return ((bitField0_ & 0x04000000) == 0x04000000); } /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ public java.lang.String getFUpdateAge() { java.lang.Object ref = fUpdateAge_; @@ -6973,7 +8799,7 @@ public final class Issues { } } /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ public com.google.protobuf.ByteString getFUpdateAgeBytes() { @@ -6989,36 +8815,36 @@ public final class Issues { } } /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ public Builder setFUpdateAge( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00800000; + bitField0_ |= 0x04000000; fUpdateAge_ = value; onChanged(); return this; } /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ public Builder clearFUpdateAge() { - bitField0_ = (bitField0_ & ~0x00800000); + bitField0_ = (bitField0_ & ~0x04000000); fUpdateAge_ = getDefaultInstance().getFUpdateAge(); onChanged(); return this; } /** - * <code>optional string fUpdateAge = 24;</code> + * <code>optional string fUpdateAge = 27;</code> */ public Builder setFUpdateAgeBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00800000; + bitField0_ |= 0x04000000; fUpdateAge_ = value; onChanged(); return this; @@ -7026,13 +8852,13 @@ public final class Issues { private java.lang.Object closeDate_ = ""; /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ public boolean hasCloseDate() { - return ((bitField0_ & 0x01000000) == 0x01000000); + return ((bitField0_ & 0x08000000) == 0x08000000); } /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ public java.lang.String getCloseDate() { java.lang.Object ref = closeDate_; @@ -7049,7 +8875,7 @@ public final class Issues { } } /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ public com.google.protobuf.ByteString getCloseDateBytes() { @@ -7065,36 +8891,36 @@ public final class Issues { } } /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ public Builder setCloseDate( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x01000000; + bitField0_ |= 0x08000000; closeDate_ = value; onChanged(); return this; } /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ public Builder clearCloseDate() { - bitField0_ = (bitField0_ & ~0x01000000); + bitField0_ = (bitField0_ & ~0x08000000); closeDate_ = getDefaultInstance().getCloseDate(); onChanged(); return this; } /** - * <code>optional string closeDate = 25;</code> + * <code>optional string closeDate = 28;</code> */ public Builder setCloseDateBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x01000000; + bitField0_ |= 0x08000000; closeDate_ = value; onChanged(); return this; @@ -7145,28 +8971,52 @@ public final class Issues { /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ boolean hasEmail(); /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ java.lang.String getEmail(); /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ com.google.protobuf.ByteString getEmailBytes(); /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ boolean hasUserName(); /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ java.lang.String getUserName(); /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ com.google.protobuf.ByteString getUserNameBytes(); @@ -7187,14 +9037,26 @@ public final class Issues { /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ boolean hasMarkdown(); /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ java.lang.String getMarkdown(); /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ com.google.protobuf.ByteString getMarkdownBytes(); @@ -7449,12 +9311,20 @@ public final class Issues { private java.lang.Object email_; /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public boolean hasEmail() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public java.lang.String getEmail() { java.lang.Object ref = email_; @@ -7472,6 +9342,10 @@ public final class Issues { } /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public com.google.protobuf.ByteString getEmailBytes() { @@ -7491,12 +9365,20 @@ public final class Issues { private java.lang.Object userName_; /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public boolean hasUserName() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public java.lang.String getUserName() { java.lang.Object ref = userName_; @@ -7514,6 +9396,10 @@ public final class Issues { } /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public com.google.protobuf.ByteString getUserNameBytes() { @@ -7575,12 +9461,20 @@ public final class Issues { private java.lang.Object markdown_; /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ public boolean hasMarkdown() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ public java.lang.String getMarkdown() { java.lang.Object ref = markdown_; @@ -7598,6 +9492,10 @@ public final class Issues { } /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ public com.google.protobuf.ByteString getMarkdownBytes() { @@ -8187,12 +10085,20 @@ public final class Issues { private java.lang.Object email_ = ""; /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public boolean hasEmail() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public java.lang.String getEmail() { java.lang.Object ref = email_; @@ -8210,6 +10116,10 @@ public final class Issues { } /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public com.google.protobuf.ByteString getEmailBytes() { @@ -8226,6 +10136,10 @@ public final class Issues { } /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public Builder setEmail( java.lang.String value) { @@ -8239,6 +10153,10 @@ public final class Issues { } /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public Builder clearEmail() { bitField0_ = (bitField0_ & ~0x00000004); @@ -8248,6 +10166,10 @@ public final class Issues { } /** * <code>optional string email = 3;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public Builder setEmailBytes( com.google.protobuf.ByteString value) { @@ -8263,12 +10185,20 @@ public final class Issues { private java.lang.Object userName_ = ""; /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public boolean hasUserName() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public java.lang.String getUserName() { java.lang.Object ref = userName_; @@ -8286,6 +10216,10 @@ public final class Issues { } /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public com.google.protobuf.ByteString getUserNameBytes() { @@ -8302,6 +10236,10 @@ public final class Issues { } /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public Builder setUserName( java.lang.String value) { @@ -8315,6 +10253,10 @@ public final class Issues { } /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public Builder clearUserName() { bitField0_ = (bitField0_ & ~0x00000008); @@ -8324,6 +10266,10 @@ public final class Issues { } /** * <code>optional string userName = 4;</code> + * + * <pre> + * TODO drop, it's already in field "users" + * </pre> */ public Builder setUserNameBytes( com.google.protobuf.ByteString value) { @@ -8415,12 +10361,20 @@ public final class Issues { private java.lang.Object markdown_ = ""; /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ public boolean hasMarkdown() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ public java.lang.String getMarkdown() { java.lang.Object ref = markdown_; @@ -8438,6 +10392,10 @@ public final class Issues { } /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ public com.google.protobuf.ByteString getMarkdownBytes() { @@ -8454,6 +10412,10 @@ public final class Issues { } /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ public Builder setMarkdown( java.lang.String value) { @@ -8467,6 +10429,10 @@ public final class Issues { } /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ public Builder clearMarkdown() { bitField0_ = (bitField0_ & ~0x00000020); @@ -8476,6 +10442,10 @@ public final class Issues { } /** * <code>optional string markdown = 6;</code> + * + * <pre> + * TODO rename markdownText ? + * </pre> */ public Builder setMarkdownBytes( com.google.protobuf.ByteString value) { @@ -8607,6 +10577,1839 @@ public final class Issues { // @@protoc_insertion_point(class_scope:sonarqube.ws.issues.Comment) } + public interface ActionPlanOrBuilder extends + // @@protoc_insertion_point(interface_extends:sonarqube.ws.issues.ActionPlan) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>optional string key = 1;</code> + */ + boolean hasKey(); + /** + * <code>optional string key = 1;</code> + */ + java.lang.String getKey(); + /** + * <code>optional string key = 1;</code> + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * <code>optional string name = 2;</code> + */ + boolean hasName(); + /** + * <code>optional string name = 2;</code> + */ + java.lang.String getName(); + /** + * <code>optional string name = 2;</code> + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + boolean hasStatus(); + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + java.lang.String getStatus(); + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + com.google.protobuf.ByteString + getStatusBytes(); + + /** + * <code>optional string deadLine = 4;</code> + */ + boolean hasDeadLine(); + /** + * <code>optional string deadLine = 4;</code> + */ + java.lang.String getDeadLine(); + /** + * <code>optional string deadLine = 4;</code> + */ + com.google.protobuf.ByteString + getDeadLineBytes(); + + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + boolean hasProject(); + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + java.lang.String getProject(); + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + com.google.protobuf.ByteString + getProjectBytes(); + } + /** + * Protobuf type {@code sonarqube.ws.issues.ActionPlan} + */ + public static final class ActionPlan extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:sonarqube.ws.issues.ActionPlan) + ActionPlanOrBuilder { + // Use ActionPlan.newBuilder() to construct. + private ActionPlan(com.google.protobuf.GeneratedMessage.Builder<?> builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private ActionPlan(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final ActionPlan defaultInstance; + public static ActionPlan getDefaultInstance() { + return defaultInstance; + } + + public ActionPlan getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ActionPlan( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + key_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + name_ = bs; + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + status_ = bs; + break; + } + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + deadLine_ = bs; + break; + } + case 42: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + project_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonarqube.ws.Issues.internal_static_sonarqube_ws_issues_ActionPlan_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonarqube.ws.Issues.internal_static_sonarqube_ws_issues_ActionPlan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonarqube.ws.Issues.ActionPlan.class, org.sonarqube.ws.Issues.ActionPlan.Builder.class); + } + + public static com.google.protobuf.Parser<ActionPlan> PARSER = + new com.google.protobuf.AbstractParser<ActionPlan>() { + public ActionPlan parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ActionPlan(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser<ActionPlan> getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private java.lang.Object key_; + /** + * <code>optional string key = 1;</code> + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional string key = 1;</code> + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } + } + /** + * <code>optional string key = 1;</code> + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + private java.lang.Object name_; + /** + * <code>optional string name = 2;</code> + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional string name = 2;</code> + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * <code>optional string name = 2;</code> + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 3; + private java.lang.Object status_; + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + public java.lang.String getStatus() { + java.lang.Object ref = status_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + status_ = s; + } + return s; + } + } + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + public com.google.protobuf.ByteString + getStatusBytes() { + java.lang.Object ref = status_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + status_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEADLINE_FIELD_NUMBER = 4; + private java.lang.Object deadLine_; + /** + * <code>optional string deadLine = 4;</code> + */ + public boolean hasDeadLine() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional string deadLine = 4;</code> + */ + public java.lang.String getDeadLine() { + java.lang.Object ref = deadLine_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + deadLine_ = s; + } + return s; + } + } + /** + * <code>optional string deadLine = 4;</code> + */ + public com.google.protobuf.ByteString + getDeadLineBytes() { + java.lang.Object ref = deadLine_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deadLine_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 5; + private java.lang.Object project_; + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + public boolean hasProject() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + project_ = s; + } + return s; + } + } + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + public com.google.protobuf.ByteString + getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + key_ = ""; + name_ = ""; + status_ = ""; + deadLine_ = ""; + project_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getNameBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getStatusBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(4, getDeadLineBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, getProjectBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getNameBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, getStatusBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, getDeadLineBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, getProjectBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.sonarqube.ws.Issues.ActionPlan parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonarqube.ws.Issues.ActionPlan parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonarqube.ws.Issues.ActionPlan parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonarqube.ws.Issues.ActionPlan parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonarqube.ws.Issues.ActionPlan parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonarqube.ws.Issues.ActionPlan parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.sonarqube.ws.Issues.ActionPlan parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.sonarqube.ws.Issues.ActionPlan parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.sonarqube.ws.Issues.ActionPlan parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonarqube.ws.Issues.ActionPlan parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.sonarqube.ws.Issues.ActionPlan prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code sonarqube.ws.issues.ActionPlan} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:sonarqube.ws.issues.ActionPlan) + org.sonarqube.ws.Issues.ActionPlanOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonarqube.ws.Issues.internal_static_sonarqube_ws_issues_ActionPlan_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonarqube.ws.Issues.internal_static_sonarqube_ws_issues_ActionPlan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonarqube.ws.Issues.ActionPlan.class, org.sonarqube.ws.Issues.ActionPlan.Builder.class); + } + + // Construct using org.sonarqube.ws.Issues.ActionPlan.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + key_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + status_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + deadLine_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + project_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.sonarqube.ws.Issues.internal_static_sonarqube_ws_issues_ActionPlan_descriptor; + } + + public org.sonarqube.ws.Issues.ActionPlan getDefaultInstanceForType() { + return org.sonarqube.ws.Issues.ActionPlan.getDefaultInstance(); + } + + public org.sonarqube.ws.Issues.ActionPlan build() { + org.sonarqube.ws.Issues.ActionPlan result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.sonarqube.ws.Issues.ActionPlan buildPartial() { + org.sonarqube.ws.Issues.ActionPlan result = new org.sonarqube.ws.Issues.ActionPlan(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.key_ = key_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.status_ = status_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.deadLine_ = deadLine_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.project_ = project_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.sonarqube.ws.Issues.ActionPlan) { + return mergeFrom((org.sonarqube.ws.Issues.ActionPlan)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.sonarqube.ws.Issues.ActionPlan other) { + if (other == org.sonarqube.ws.Issues.ActionPlan.getDefaultInstance()) return this; + if (other.hasKey()) { + bitField0_ |= 0x00000001; + key_ = other.key_; + onChanged(); + } + if (other.hasName()) { + bitField0_ |= 0x00000002; + name_ = other.name_; + onChanged(); + } + if (other.hasStatus()) { + bitField0_ |= 0x00000004; + status_ = other.status_; + onChanged(); + } + if (other.hasDeadLine()) { + bitField0_ |= 0x00000008; + deadLine_ = other.deadLine_; + onChanged(); + } + if (other.hasProject()) { + bitField0_ |= 0x00000010; + project_ = other.project_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.sonarqube.ws.Issues.ActionPlan parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.sonarqube.ws.Issues.ActionPlan) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * <code>optional string key = 1;</code> + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional string key = 1;</code> + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string key = 1;</code> + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string key = 1;</code> + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + /** + * <code>optional string key = 1;</code> + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * <code>optional string key = 1;</code> + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * <code>optional string name = 2;</code> + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional string name = 2;</code> + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string name = 2;</code> + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string name = 2;</code> + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + name_ = value; + onChanged(); + return this; + } + /** + * <code>optional string name = 2;</code> + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000002); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * <code>optional string name = 2;</code> + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object status_ = ""; + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + public java.lang.String getStatus() { + java.lang.Object ref = status_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + status_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + public com.google.protobuf.ByteString + getStatusBytes() { + java.lang.Object ref = status_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + status_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + public Builder setStatus( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + status_ = value; + onChanged(); + return this; + } + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = getDefaultInstance().getStatus(); + onChanged(); + return this; + } + /** + * <code>optional string status = 3;</code> + * + * <pre> + * TODO define enum + * </pre> + */ + public Builder setStatusBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + status_ = value; + onChanged(); + return this; + } + + private java.lang.Object deadLine_ = ""; + /** + * <code>optional string deadLine = 4;</code> + */ + public boolean hasDeadLine() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional string deadLine = 4;</code> + */ + public java.lang.String getDeadLine() { + java.lang.Object ref = deadLine_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + deadLine_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string deadLine = 4;</code> + */ + public com.google.protobuf.ByteString + getDeadLineBytes() { + java.lang.Object ref = deadLine_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deadLine_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string deadLine = 4;</code> + */ + public Builder setDeadLine( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + deadLine_ = value; + onChanged(); + return this; + } + /** + * <code>optional string deadLine = 4;</code> + */ + public Builder clearDeadLine() { + bitField0_ = (bitField0_ & ~0x00000008); + deadLine_ = getDefaultInstance().getDeadLine(); + onChanged(); + return this; + } + /** + * <code>optional string deadLine = 4;</code> + */ + public Builder setDeadLineBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + deadLine_ = value; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + public boolean hasProject() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + project_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + public com.google.protobuf.ByteString + getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + public Builder setProject( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + project_ = value; + onChanged(); + return this; + } + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + public Builder clearProject() { + bitField0_ = (bitField0_ & ~0x00000010); + project_ = getDefaultInstance().getProject(); + onChanged(); + return this; + } + /** + * <code>optional string project = 5;</code> + * + * <pre> + * TODO to be renamed, is it id or key ? + * </pre> + */ + public Builder setProjectBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + project_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:sonarqube.ws.issues.ActionPlan) + } + + static { + defaultInstance = new ActionPlan(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:sonarqube.ws.issues.ActionPlan) + } + + public interface LanguageOrBuilder extends + // @@protoc_insertion_point(interface_extends:sonarqube.ws.issues.Language) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>optional string key = 1;</code> + */ + boolean hasKey(); + /** + * <code>optional string key = 1;</code> + */ + java.lang.String getKey(); + /** + * <code>optional string key = 1;</code> + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * <code>optional string name = 2;</code> + */ + boolean hasName(); + /** + * <code>optional string name = 2;</code> + */ + java.lang.String getName(); + /** + * <code>optional string name = 2;</code> + */ + com.google.protobuf.ByteString + getNameBytes(); + } + /** + * Protobuf type {@code sonarqube.ws.issues.Language} + */ + public static final class Language extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:sonarqube.ws.issues.Language) + LanguageOrBuilder { + // Use Language.newBuilder() to construct. + private Language(com.google.protobuf.GeneratedMessage.Builder<?> builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Language(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Language defaultInstance; + public static Language getDefaultInstance() { + return defaultInstance; + } + + public Language getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Language( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + key_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + name_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonarqube.ws.Issues.internal_static_sonarqube_ws_issues_Language_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonarqube.ws.Issues.internal_static_sonarqube_ws_issues_Language_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonarqube.ws.Issues.Language.class, org.sonarqube.ws.Issues.Language.Builder.class); + } + + public static com.google.protobuf.Parser<Language> PARSER = + new com.google.protobuf.AbstractParser<Language>() { + public Language parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Language(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser<Language> getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private java.lang.Object key_; + /** + * <code>optional string key = 1;</code> + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional string key = 1;</code> + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } + } + /** + * <code>optional string key = 1;</code> + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + private java.lang.Object name_; + /** + * <code>optional string name = 2;</code> + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional string name = 2;</code> + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * <code>optional string name = 2;</code> + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + key_ = ""; + name_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getNameBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getNameBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.sonarqube.ws.Issues.Language parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonarqube.ws.Issues.Language parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonarqube.ws.Issues.Language parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonarqube.ws.Issues.Language parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonarqube.ws.Issues.Language parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonarqube.ws.Issues.Language parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.sonarqube.ws.Issues.Language parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.sonarqube.ws.Issues.Language parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.sonarqube.ws.Issues.Language parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonarqube.ws.Issues.Language parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.sonarqube.ws.Issues.Language prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code sonarqube.ws.issues.Language} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:sonarqube.ws.issues.Language) + org.sonarqube.ws.Issues.LanguageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonarqube.ws.Issues.internal_static_sonarqube_ws_issues_Language_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonarqube.ws.Issues.internal_static_sonarqube_ws_issues_Language_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonarqube.ws.Issues.Language.class, org.sonarqube.ws.Issues.Language.Builder.class); + } + + // Construct using org.sonarqube.ws.Issues.Language.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + key_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.sonarqube.ws.Issues.internal_static_sonarqube_ws_issues_Language_descriptor; + } + + public org.sonarqube.ws.Issues.Language getDefaultInstanceForType() { + return org.sonarqube.ws.Issues.Language.getDefaultInstance(); + } + + public org.sonarqube.ws.Issues.Language build() { + org.sonarqube.ws.Issues.Language result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.sonarqube.ws.Issues.Language buildPartial() { + org.sonarqube.ws.Issues.Language result = new org.sonarqube.ws.Issues.Language(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.key_ = key_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.name_ = name_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.sonarqube.ws.Issues.Language) { + return mergeFrom((org.sonarqube.ws.Issues.Language)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.sonarqube.ws.Issues.Language other) { + if (other == org.sonarqube.ws.Issues.Language.getDefaultInstance()) return this; + if (other.hasKey()) { + bitField0_ |= 0x00000001; + key_ = other.key_; + onChanged(); + } + if (other.hasName()) { + bitField0_ |= 0x00000002; + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.sonarqube.ws.Issues.Language parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.sonarqube.ws.Issues.Language) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * <code>optional string key = 1;</code> + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional string key = 1;</code> + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string key = 1;</code> + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string key = 1;</code> + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + /** + * <code>optional string key = 1;</code> + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * <code>optional string key = 1;</code> + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * <code>optional string name = 2;</code> + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional string name = 2;</code> + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string name = 2;</code> + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string name = 2;</code> + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + name_ = value; + onChanged(); + return this; + } + /** + * <code>optional string name = 2;</code> + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000002); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * <code>optional string name = 2;</code> + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + name_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:sonarqube.ws.issues.Language) + } + + static { + defaultInstance = new Language(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:sonarqube.ws.issues.Language) + } + private static final com.google.protobuf.Descriptors.Descriptor internal_static_sonarqube_ws_issues_Search_descriptor; private static @@ -8622,6 +12425,16 @@ public final class Issues { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_sonarqube_ws_issues_Comment_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_sonarqube_ws_issues_ActionPlan_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_sonarqube_ws_issues_ActionPlan_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_sonarqube_ws_issues_Language_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_sonarqube_ws_issues_Language_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -8632,31 +12445,46 @@ public final class Issues { static { java.lang.String[] descriptorData = { "\n\017ws-issues.proto\022\023sonarqube.ws.issues\032\017" + - "ws-common.proto\"\235\002\n\006Search\022$\n\006paging\030\001 \001" + - "(\0132\024.sonarqube.ws.Paging\022*\n\006issues\030\002 \003(\013" + - "2\032.sonarqube.ws.issues.Issue\022#\n\006facets\030\003" + - " \003(\0132\023.sonarqube.ws.Facet\022)\n\010projects\030\004 " + - "\003(\0132\027.sonarqube.ws.Component\022+\n\ncomponen" + - "ts\030\005 \003(\0132\027.sonarqube.ws.Component\022!\n\005rul" + - "es\030\006 \003(\0132\022.sonarqube.ws.Rule\022!\n\005users\030\007 " + - "\003(\0132\022.sonarqube.ws.User\"\346\003\n\005Issue\022\013\n\003key" + - "\030\001 \001(\t\022\014\n\004rule\030\002 \001(\t\022\021\n\tcomponent\030\003 \001(\t\022", - "\023\n\013componentId\030\004 \001(\005\022\017\n\007project\030\005 \001(\t\022\022\n" + - "\nsubProject\030\006 \001(\t\022\014\n\004line\030\007 \001(\005\022\022\n\nresol" + - "ution\030\010 \001(\t\022\016\n\006status\030\t \001(\t\022\017\n\007message\030\n" + - " \001(\t\022\014\n\004debt\030\013 \001(\t\022\020\n\010assignee\030\014 \001(\t\022\020\n\010" + - "reporter\030\r \001(\t\022\021\n\tscmAuthor\030\016 \001(\t\022\022\n\nact" + - "ionPlan\030\017 \001(\t\022\026\n\016actionPlanName\030\020 \001(\t\022\014\n" + - "\004attr\030\021 \001(\t\022\014\n\004tags\030\022 \003(\t\022\023\n\013transitions" + - "\030\023 \003(\t\022\017\n\007actions\030\024 \003(\t\022.\n\010comments\030\025 \003(" + - "\0132\034.sonarqube.ws.issues.Comment\022\024\n\014creat" + - "ionDate\030\026 \001(\t\022\022\n\nupdateDate\030\027 \001(\t\022\022\n\nfUp", - "dateAge\030\030 \001(\t\022\021\n\tcloseDate\030\031 \001(\t\"\220\001\n\007Com" + - "ment\022\013\n\003key\030\001 \001(\t\022\r\n\005login\030\002 \001(\t\022\r\n\005emai" + - "l\030\003 \001(\t\022\020\n\010userName\030\004 \001(\t\022\020\n\010htmlText\030\005 " + - "\001(\t\022\020\n\010markdown\030\006 \001(\t\022\021\n\tupdatable\030\007 \001(\010" + - "\022\021\n\tcreatedAt\030\010 \001(\tB\034\n\020org.sonarqube.wsB" + - "\006IssuesH\001" + "ws-common.proto\"\234\005\n\006Search\022\r\n\005total\030\001 \001(" + + "\003\022\t\n\001p\030\002 \001(\003\022\n\n\002ps\030\003 \001(\005\022$\n\006paging\030\004 \001(\013" + + "2\024.sonarqube.ws.Paging\022\021\n\tdebtTotal\030\005 \001(" + + "\003\022*\n\006issues\030\006 \003(\0132\032.sonarqube.ws.issues." + + "Issue\022\036\n\026projectsPresentIfEmpty\030\010 \001(\010\022)\n" + + "\010projects\030\t \003(\0132\027.sonarqube.ws.Component" + + "\022 \n\030componentsPresentIfEmpty\030\n \001(\010\022+\n\nco" + + "mponents\030\013 \003(\0132\027.sonarqube.ws.Component\022" + + "\033\n\023rulesPresentIfEmpty\030\014 \001(\010\022!\n\005rules\030\r ", + "\003(\0132\022.sonarqube.ws.Rule\022\033\n\023usersPresentI" + + "fEmpty\030\016 \001(\010\022!\n\005users\030\017 \003(\0132\022.sonarqube." + + "ws.User\022!\n\031actionPlansPresentIfEmpty\030\020 \001" + + "(\010\0224\n\013actionPlans\030\021 \003(\0132\037.sonarqube.ws.i" + + "ssues.ActionPlan\022\037\n\027languagesPresentIfEm" + + "pty\030\022 \001(\010\0220\n\tlanguages\030\023 \003(\0132\035.sonarqube" + + ".ws.issues.Language\022#\n\006facets\030\024 \003(\0132\023.so" + + "narqube.ws.Facet\022\034\n\024facetsPresentIfEmpty" + + "\030\025 \001(\010\"\333\004\n\005Issue\022\013\n\003key\030\001 \001(\t\022\014\n\004rule\030\002 " + + "\001(\t\022(\n\010severity\030\003 \001(\0162\026.sonarqube.ws.Sev", + "erity\022\021\n\tcomponent\030\004 \001(\t\022\023\n\013componentId\030" + + "\005 \001(\003\022\017\n\007project\030\006 \001(\t\022\014\n\004line\030\007 \001(\005\022\022\n\n" + + "resolution\030\010 \001(\t\022\016\n\006status\030\t \001(\t\022\017\n\007mess" + + "age\030\n \001(\t\022\014\n\004debt\030\013 \001(\t\022\020\n\010assignee\030\014 \001(" + + "\t\022\020\n\010reporter\030\r \001(\t\022\016\n\006author\030\016 \001(\t\022\022\n\na" + + "ctionPlan\030\017 \001(\t\022\026\n\016actionPlanName\030\020 \001(\t\022" + + "\014\n\004attr\030\021 \001(\t\022\014\n\004tags\030\022 \003(\t\022!\n\031transitio" + + "nsPresentIfEmpty\030\023 \001(\010\022\023\n\013transitions\030\024 " + + "\003(\t\022\035\n\025actionsPresentIfEmpty\030\025 \001(\010\022\017\n\007ac" + + "tions\030\026 \003(\t\022\036\n\026commentsPresentIfEmpty\030\027 ", + "\001(\010\022.\n\010comments\030\030 \003(\0132\034.sonarqube.ws.iss" + + "ues.Comment\022\024\n\014creationDate\030\031 \001(\t\022\022\n\nupd" + + "ateDate\030\032 \001(\t\022\022\n\nfUpdateAge\030\033 \001(\t\022\021\n\tclo" + + "seDate\030\034 \001(\t\"\220\001\n\007Comment\022\013\n\003key\030\001 \001(\t\022\r\n" + + "\005login\030\002 \001(\t\022\r\n\005email\030\003 \001(\t\022\020\n\010userName\030" + + "\004 \001(\t\022\020\n\010htmlText\030\005 \001(\t\022\020\n\010markdown\030\006 \001(" + + "\t\022\021\n\tupdatable\030\007 \001(\010\022\021\n\tcreatedAt\030\010 \001(\t\"" + + "Z\n\nActionPlan\022\013\n\003key\030\001 \001(\t\022\014\n\004name\030\002 \001(\t" + + "\022\016\n\006status\030\003 \001(\t\022\020\n\010deadLine\030\004 \001(\t\022\017\n\007pr" + + "oject\030\005 \001(\t\"%\n\010Language\022\013\n\003key\030\001 \001(\t\022\014\n\004", + "name\030\002 \001(\tB\034\n\020org.sonarqube.wsB\006IssuesH\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -8676,19 +12504,31 @@ public final class Issues { internal_static_sonarqube_ws_issues_Search_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_sonarqube_ws_issues_Search_descriptor, - new java.lang.String[] { "Paging", "Issues", "Facets", "Projects", "Components", "Rules", "Users", }); + new java.lang.String[] { "Total", "P", "Ps", "Paging", "DebtTotal", "Issues", "ProjectsPresentIfEmpty", "Projects", "ComponentsPresentIfEmpty", "Components", "RulesPresentIfEmpty", "Rules", "UsersPresentIfEmpty", "Users", "ActionPlansPresentIfEmpty", "ActionPlans", "LanguagesPresentIfEmpty", "Languages", "Facets", "FacetsPresentIfEmpty", }); internal_static_sonarqube_ws_issues_Issue_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_sonarqube_ws_issues_Issue_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_sonarqube_ws_issues_Issue_descriptor, - new java.lang.String[] { "Key", "Rule", "Component", "ComponentId", "Project", "SubProject", "Line", "Resolution", "Status", "Message", "Debt", "Assignee", "Reporter", "ScmAuthor", "ActionPlan", "ActionPlanName", "Attr", "Tags", "Transitions", "Actions", "Comments", "CreationDate", "UpdateDate", "FUpdateAge", "CloseDate", }); + new java.lang.String[] { "Key", "Rule", "Severity", "Component", "ComponentId", "Project", "Line", "Resolution", "Status", "Message", "Debt", "Assignee", "Reporter", "Author", "ActionPlan", "ActionPlanName", "Attr", "Tags", "TransitionsPresentIfEmpty", "Transitions", "ActionsPresentIfEmpty", "Actions", "CommentsPresentIfEmpty", "Comments", "CreationDate", "UpdateDate", "FUpdateAge", "CloseDate", }); internal_static_sonarqube_ws_issues_Comment_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_sonarqube_ws_issues_Comment_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_sonarqube_ws_issues_Comment_descriptor, new java.lang.String[] { "Key", "Login", "Email", "UserName", "HtmlText", "Markdown", "Updatable", "CreatedAt", }); + internal_static_sonarqube_ws_issues_ActionPlan_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_sonarqube_ws_issues_ActionPlan_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_sonarqube_ws_issues_ActionPlan_descriptor, + new java.lang.String[] { "Key", "Name", "Status", "DeadLine", "Project", }); + internal_static_sonarqube_ws_issues_Language_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_sonarqube_ws_issues_Language_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_sonarqube_ws_issues_Language_descriptor, + new java.lang.String[] { "Key", "Name", }); org.sonarqube.ws.Common.getDescriptor(); } diff --git a/sonar-ws/src/main/protobuf/ws-common.proto b/sonar-ws/src/main/protobuf/ws-common.proto index ecebd5236e4..a269ff7f4be 100644 --- a/sonar-ws/src/main/protobuf/ws-common.proto +++ b/sonar-ws/src/main/protobuf/ws-common.proto @@ -25,8 +25,8 @@ option java_outer_classname = "Common"; option optimize_for = SPEED; message Paging { - optional int32 page_index = 1; - optional int32 page_size = 2; + optional int32 pageIndex = 1; + optional int32 pageSize = 2; optional int32 total = 3; optional int32 pages = 4; } @@ -42,17 +42,24 @@ message FacetValue { optional int64 count = 2; } +enum Severity { + INFO = 0; + MINOR = 1; + MAJOR = 2; + CRITICAL = 3; + BLOCKER = 4; +} + message Component { - optional string uuid = 1; + optional string id = 1; optional string key = 2; - optional int32 id = 3; - optional bool enabled = 4; - optional string qualifier = 5; - optional string name = 6; - optional string longName = 7; - optional string path = 8; - optional int32 projectId = 9; - optional int32 subProjectId = 10; + optional bool enabled = 3; + optional string qualifier = 4; + optional string name = 5; + optional string longName = 6; + optional string path = 7; + optional string project = 8; + optional string subProject = 9; } message Rule { diff --git a/sonar-ws/src/main/protobuf/ws-issues.proto b/sonar-ws/src/main/protobuf/ws-issues.proto index d8129a3d725..40c9c9daa77 100644 --- a/sonar-ws/src/main/protobuf/ws-issues.proto +++ b/sonar-ws/src/main/protobuf/ws-issues.proto @@ -29,22 +29,39 @@ option optimize_for = SPEED; // Response of URL api/issues/search message Search { // TODO errors - optional Paging paging = 1; - repeated Issue issues = 2; - repeated Facet facets = 3; - repeated Component projects = 4; - repeated Component components = 5; - repeated Rule rules = 6; - repeated User users = 7; + + optional int64 total = 1; + optional int64 p = 2; + optional int32 ps = 3; + optional Paging paging = 4; + + // Total amount of debt, only when the facet "total" is enabled + optional int64 debtTotal = 5; + + repeated Issue issues = 6; + optional bool projectsPresentIfEmpty = 8; + repeated Component projects = 9; + optional bool componentsPresentIfEmpty = 10; + repeated Component components = 11; + optional bool rulesPresentIfEmpty = 12; + repeated Rule rules = 13; + optional bool usersPresentIfEmpty = 14; + repeated User users = 15; + optional bool actionPlansPresentIfEmpty = 16; + repeated ActionPlan actionPlans = 17; + optional bool languagesPresentIfEmpty = 18; + repeated Language languages = 19; + repeated Facet facets = 20; + optional bool facetsPresentIfEmpty = 21; } message Issue { optional string key = 1; optional string rule = 2; - optional string component = 3; - optional int32 componentId = 4; - optional string project = 5; - optional string subProject = 6; + optional Severity severity = 3; + optional string component = 4; + optional int64 componentId = 5; + optional string project = 6; optional int32 line = 7; optional string resolution = 8; optional string status = 9; @@ -52,27 +69,57 @@ message Issue { optional string debt = 11; optional string assignee = 12; optional string reporter = 13; - optional string scmAuthor = 14; + + // SCM login of the committer who introduced the issue + optional string author = 14; + optional string actionPlan = 15; optional string actionPlanName = 16; optional string attr = 17; repeated string tags = 18; - repeated string transitions = 19; - repeated string actions = 20; - repeated Comment comments = 21; - optional string creationDate= 22; - optional string updateDate= 23; - optional string fUpdateAge= 24; - optional string closeDate= 25; + + // the transitions allowed for the requesting user. + optional bool transitionsPresentIfEmpty=19; + repeated string transitions = 20; + + // the actions allowed for the requesting user. + optional bool actionsPresentIfEmpty=21; + repeated string actions = 22; + + optional bool commentsPresentIfEmpty = 23; + repeated Comment comments = 24; + optional string creationDate= 25; + optional string updateDate= 26; + optional string fUpdateAge= 27; + optional string closeDate= 28; } message Comment { optional string key = 1; optional string login = 2; + // TODO drop, it's already in field "users" optional string email = 3; + // TODO drop, it's already in field "users" optional string userName = 4; optional string htmlText = 5; + // TODO rename markdownText ? optional string markdown = 6; optional bool updatable = 7; optional string createdAt = 8; } + +message ActionPlan { + optional string key = 1; + optional string name = 2; + + // TODO define enum + optional string status = 3; + optional string deadLine = 4; + // TODO to be renamed, is it id or key ? + optional string project = 5; +} + +message Language { + optional string key = 1; + optional string name = 2; +} |