From 65d3b5a6b8a63deed1997699292bce72396214ba Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Wed, 9 Mar 2016 10:54:05 +0100 Subject: [PATCH] Added license header and fixed sonar issue: Fields and methods should not have conflicting names Signed-off-by: Jonathan Philip Knoblauch --- .../hawkbit/repository/model/Target.java | 18 +++++++++--------- .../hawkbit/repository/model/TargetInfo.java | 14 +++++++------- .../repository/utils/MultipleInvokeHelper.java | 9 ++++++--- .../repository/utils/SuccessCondition.java | 9 ++++++--- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/Target.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/Target.java index bb7781733..07a97ebcf 100644 --- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/Target.java +++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/Target.java @@ -69,7 +69,7 @@ import org.springframework.data.domain.Persistable; @Index(name = "sp_idx_target_03", columnList = "tenant,controller_id,assigned_distribution_set"), @Index(name = "sp_idx_target_04", columnList = "tenant,created_at"), @Index(name = "sp_idx_target_prim", columnList = "tenant,id") }, uniqueConstraints = @UniqueConstraint(columnNames = { - "controller_id", "tenant" }, name = "uk_tenant_controller_id") ) + "controller_id", "tenant" }, name = "uk_tenant_controller_id")) @NamedEntityGraph(name = "Target.detail", attributeNodes = { @NamedAttributeNode("tags"), @NamedAttributeNode(value = "assignedDistributionSet"), @NamedAttributeNode(value = "targetInfo") }) public class Target extends NamedEntity implements Persistable { @@ -81,21 +81,21 @@ public class Target extends NamedEntity implements Persistable { private String controllerId; @Transient - private boolean isNew = false; + private boolean entityNew = false; @ManyToMany(targetEntity = TargetTag.class) @JoinTable(name = "sp_target_target_tag", joinColumns = { - @JoinColumn(name = "target", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_target") ) }, inverseJoinColumns = { - @JoinColumn(name = "tag", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_tag") ) }) + @JoinColumn(name = "target", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_target")) }, inverseJoinColumns = { + @JoinColumn(name = "tag", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_tag")) }) private Set tags = new HashSet<>(); @CascadeOnDelete @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true, cascade = { CascadeType.REMOVE }) - @JoinColumn(name = "target", insertable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_act_hist_targ") ) + @JoinColumn(name = "target", insertable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_act_hist_targ")) private final List actions = new ArrayList<>(); @ManyToOne(optional = true, fetch = FetchType.LAZY, targetEntity = DistributionSet.class) - @JoinColumn(name = "assigned_distribution_set", nullable = true, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_target_assign_ds") ) + @JoinColumn(name = "assigned_distribution_set", nullable = true, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_target_assign_ds")) private DistributionSet assignedDistributionSet; @CascadeOnDelete @@ -217,15 +217,15 @@ public class Target extends NamedEntity implements Persistable { @Override @Transient public boolean isNew() { - return isNew; + return entityNew; } /** * @param isNew * the isNew to set */ - public void setNew(final boolean isNew) { - this.isNew = isNew; + public void setNew(final boolean entityNew) { + this.entityNew = entityNew; } /** diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/TargetInfo.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/TargetInfo.java index d491319fa..e487ee85a 100644 --- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/TargetInfo.java +++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/TargetInfo.java @@ -73,11 +73,11 @@ public class TargetInfo implements Persistable, Serializable { private Long targetId; @Transient - private boolean isNew = false; + private boolean entityNew = false; @CascadeOnDelete @OneToOne(cascade = { CascadeType.MERGE, CascadeType.REMOVE }, fetch = FetchType.LAZY, targetEntity = Target.class) - @JoinColumn(name = "target_id", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_stat_targ") ) + @JoinColumn(name = "target_id", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_stat_targ")) @MapsId // use deprecated annotation until HHH-8862 is fixed // @SuppressWarnings( "deprecation" ) @@ -98,7 +98,7 @@ public class TargetInfo implements Persistable, Serializable { private TargetUpdateStatus updateStatus = TargetUpdateStatus.UNKNOWN; @ManyToOne(optional = true, fetch = FetchType.LAZY) - @JoinColumn(name = "installed_distribution_set", nullable = true, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_target_inst_ds") ) + @JoinColumn(name = "installed_distribution_set", nullable = true, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_target_inst_ds")) private DistributionSet installedDistributionSet; /** @@ -108,7 +108,7 @@ public class TargetInfo implements Persistable, Serializable { @Column(name = "attribute_value", length = 128) @MapKeyColumn(name = "attribute_key", nullable = false, length = 32) @CollectionTable(name = "sp_target_attributes", joinColumns = { - @JoinColumn(name = "target_id") }, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_attrib_target") ) + @JoinColumn(name = "target_id") }, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_attrib_target")) // use deprecated annotation until HHH-8862 is fixed @SuppressWarnings("deprecation") // @org.hibernate.annotations.ForeignKey( name = "fk_targ_attrib_target" ) @@ -154,15 +154,15 @@ public class TargetInfo implements Persistable, Serializable { @Override @Transient public boolean isNew() { - return isNew; + return entityNew; } /** * @param isNew * the isNew to set */ - public void setNew(final boolean isNew) { - this.isNew = isNew; + public void setNew(final boolean entityNew) { + this.entityNew = entityNew; } /** diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/utils/MultipleInvokeHelper.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/utils/MultipleInvokeHelper.java index 362636547..d40fe1fd0 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/utils/MultipleInvokeHelper.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/utils/MultipleInvokeHelper.java @@ -1,5 +1,10 @@ /** - * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + * Copyright (c) 2015 Bosch Software Innovations GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html */ package org.eclipse.hawkbit.repository.utils; @@ -8,8 +13,6 @@ import java.util.concurrent.Callable; /** * Helper to call a request multiple times regarding a given condition until * timeout is reached. - * - * @author Jonathan Knoblauch * */ public final class MultipleInvokeHelper { diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/utils/SuccessCondition.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/utils/SuccessCondition.java index a22cdbdfe..6c9553dc8 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/utils/SuccessCondition.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/utils/SuccessCondition.java @@ -1,12 +1,15 @@ /** - * Copyright (c) 2011-2015 Bosch Software Innovations GmbH, Germany. All rights reserved. + * Copyright (c) 2015 Bosch Software Innovations GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html */ package org.eclipse.hawkbit.repository.utils; /** * SuccessCondition Interface. - * - * @author Dennis Melzer * * @param * type of the value to get verified