Skip to content

Commit 145aa43

Browse files
committed
Little cosmetic changes
1 parent 208559b commit 145aa43

File tree

5 files changed

+5
-20
lines changed

5 files changed

+5
-20
lines changed

utbot-spring-analyzer/src/main/kotlin/analyzers/PropertiesAnalyzer.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import java.io.FileReader
55
import java.io.IOException
66

77
class PropertiesAnalyzer(private val propertiesFilePath: String) {
8-
9-
@Throws(IOException::class)
108
fun readProperties(): ArrayList<String> {
119
val props = ArrayList<String>()
1210

utbot-spring-analyzer/src/main/kotlin/analyzers/XmlConfigurationAnalyzer.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import org.w3c.dom.Document
44
import org.w3c.dom.Element
55
import utils.ResourceNames
66
import javax.xml.parsers.DocumentBuilderFactory
7-
import javax.xml.transform.Result
8-
import javax.xml.transform.Source
9-
import javax.xml.transform.TransformerException
107
import javax.xml.transform.TransformerFactory
118
import javax.xml.transform.dom.DOMSource
129
import javax.xml.transform.stream.StreamResult
@@ -15,7 +12,6 @@ class XmlConfigurationAnalyzer(private val userXmlFilePath: String) {
1512
private val fakeXmlFilePath = this.javaClass.classLoader.getResource(ResourceNames.fakeApplicationXmlFileName)?.path
1613
?: error("The path must exist")
1714

18-
@Throws(Exception::class)
1915
fun fillFakeApplicationXml() {
2016
val builder = DocumentBuilderFactory.newInstance().newDocumentBuilder()
2117
val doc = builder.parse(userXmlFilePath)
@@ -40,12 +36,11 @@ class XmlConfigurationAnalyzer(private val userXmlFilePath: String) {
4036
doc.normalize()
4137
}
4238

43-
@Throws(TransformerException::class)
4439
private fun writeXmlFile(doc: Document) {
4540
val tFormer = TransformerFactory.newInstance().newTransformer()
46-
val source: Source = DOMSource(doc)
47-
val dest: Result = StreamResult(fakeXmlFilePath)
41+
val source = DOMSource(doc)
42+
val destination = StreamResult(fakeXmlFilePath)
4843

49-
tFormer.transform(source, dest)
44+
tFormer.transform(source, destination)
5045
}
5146
}

utbot-spring-analyzer/src/main/kotlin/application/SpringAnalysisRunner.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ open class SpringAnalysisRunner {
4545
}
4646
}
4747

48-
4948
fun main(args: Array<String>) {
5049
val name = SpringAnalysisRunner()
5150
name.main(args)

utbot-spring-analyzer/src/main/kotlin/post_processors/UtBotBeanFactoryPostProcessor.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import java.util.Arrays
1313

1414
class UtBotBeanFactoryPostProcessor : BeanFactoryPostProcessor, PriorityOrdered {
1515

16-
@Throws(BeansException::class)
1716
override fun postProcessBeanFactory(beanFactory: ConfigurableListableBeanFactory) {
18-
1917
println("Started post-processing bean factory in UtBot")
2018

2119
val beanClassNames = ArrayList<String>()

utbot-spring-analyzer/src/main/kotlin/utils/ConfigurationManager.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,15 @@ import kotlin.reflect.KClass
88

99
class ConfigurationManager(private val classLoader: ClassLoader, private val userConfigurationClass: Class<*>) {
1010

11-
@Throws(Exception::class)
12-
fun patchPropertySourceAnnotation() {
11+
fun patchPropertySourceAnnotation() =
1312
patchAnnotation(PropertySource::class, String.format("classpath:%s", ResourceNames.fakePropertiesFileName))
14-
}
1513

16-
@Throws(Exception::class)
17-
fun patchImportResourceAnnotation() {
14+
fun patchImportResourceAnnotation() =
1815
patchAnnotation(
1916
ImportResource::class,
2017
String.format("classpath:%s", ResourceNames.fakeApplicationXmlFileName)
2118
)
22-
}
2319

24-
@Throws(Exception::class)
2520
private fun patchAnnotation(annotationClass: KClass<*>, newValue: String) {
2621
val proxyClass = classLoader.loadClass("java.lang.reflect.Proxy")
2722
val hField = proxyClass.getDeclaredField("h")

0 commit comments

Comments
 (0)