#vulnerable code 
                             @ManagedOperation
	public void setProperty(String name, String value) {

		if (!environment.getPropertySources().contains(MANAGER_PROPERTY_SOURCE)) {
			synchronized (map) {
				if (!environment.getPropertySources().contains(MANAGER_PROPERTY_SOURCE)) {
					MapPropertySource source = new MapPropertySource(
							MANAGER_PROPERTY_SOURCE, map);
					environment.getPropertySources().addFirst(source);
				}
			}
		}

		if (!value.equals(environment.getProperty(name))) {
			map.put(name, value);
			publish(new EnvironmentChangeEvent(Collections.singleton(name)));
		}

	} 
                            #location 16 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                             @ManagedOperation
	public void setProperty(String name, String value) {

		if (!environment.getPropertySources().contains(MANAGER_PROPERTY_SOURCE)) {
			synchronized (map) {
				if (!environment.getPropertySources().contains(MANAGER_PROPERTY_SOURCE)) {
					MapPropertySource source = new MapPropertySource(
							MANAGER_PROPERTY_SOURCE, map);
					environment.getPropertySources().addFirst(source);
				}
			}
		}

		if (!value.equals(environment.getProperty(name))) {
			map.put(name, value);
			publish(new EnvironmentChangeEvent(publisher, Collections.singleton(name)));
		}

	}