#vulnerable code 
                             @Override
	public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
		if (roundEnv.processingOver()) {
			return false;
		}
		Set<? extends Element> jsonAnnotated = roundEnv.getElementsAnnotatedWith(jsonTypeElement);
		if (!jsonAnnotated.isEmpty()) {
			Map<String, StructInfo> structs = new HashMap<String, StructInfo>();
			StringBuilder dsl = new StringBuilder();
			dsl.append("module json {\n");
			for (Element el : jsonAnnotated) {
				findStructs(structs, el, "CompiledJson requires public no argument constructor");
			}
			findRelatedReferences(structs);
			buildDsl(structs, dsl);
			dsl.append("}");

			if (dsl.length() < 20) {
				return false;
			}

			String fullDsl = dsl.toString();
			processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, fullDsl);

			String fileContent;
			try {
				fileContent = AnnotationCompiler.buildExternalJson(fullDsl, namespace, useJodaTime);
			} catch (Exception e) {
				processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "DSL compilation error\n" + e.getMessage());
				return false;
			}
			try {
				JavaFileObject jfo = processingEnv.getFiler().createSourceFile("ExternalSerialization");
				BufferedWriter bw = new BufferedWriter(jfo.openWriter());
				bw.write(fileContent);
				bw.close();
				FileObject rfo = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", "META-INF/services/com.dslplatform.json.Configuration");
				bw = new BufferedWriter(rfo.openWriter());
				bw.write(namespace + ".json.ExternalSerialization");
				bw.close();
			} catch (IOException e) {
				processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Failed saving compiled json serialization files");
			}
		}
		return false;
	} 
                            #location 27 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                             @Override
	public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
		if (roundEnv.processingOver()) {
			return false;
		}
		Set<? extends Element> jsonAnnotated = roundEnv.getElementsAnnotatedWith(jsonTypeElement);
		if (!jsonAnnotated.isEmpty()) {
			Map<String, StructInfo> structs = new HashMap<String, StructInfo>();
			StringBuilder dsl = new StringBuilder();
			dsl.append("module json {\n");
			for (Element el : jsonAnnotated) {
				findStructs(structs, el, "CompiledJson requires public no argument constructor");
			}
			findRelatedReferences(structs);
			DslOptions options = new DslOptions();
			options.namespace = namespace;
			buildDsl(structs, dsl, options);
			dsl.append("}");

			if (dsl.length() < 20) {
				return false;
			}

			String fullDsl = dsl.toString();
			processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, fullDsl);

			String fileContent;
			try {
				fileContent = AnnotationCompiler.buildExternalJson(fullDsl, options.namespace, options.useJodaTime);
			} catch (Exception e) {
				processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "DSL compilation error\n" + e.getMessage());
				return false;
			}
			try {
				JavaFileObject jfo = processingEnv.getFiler().createSourceFile("ExternalSerialization");
				BufferedWriter bw = new BufferedWriter(jfo.openWriter());
				bw.write(fileContent);
				bw.close();
				FileObject rfo = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", "META-INF/services/com.dslplatform.json.Configuration");
				bw = new BufferedWriter(rfo.openWriter());
				bw.write(options.namespace + ".json.ExternalSerialization");
				bw.close();
			} catch (IOException e) {
				processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Failed saving compiled json serialization files");
			}
		}
		return false;
	}