]> juplo.de Git - website/commitdiff
Code-Listings mit einem von ChatGPT erzeugtem akw-Skript korrigiert
authorKai Moritz <kai@juplo.de>
Fri, 6 Feb 2026 18:34:06 +0000 (19:34 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 20 Feb 2026 13:50:41 +0000 (14:50 +0100)
```bash
for i in `find content/blog/archive/ -type f`; do awk 'BEGIN {
    inblock = 0
}

{
    line = $0

    # START eines kaputten Codeblocks:
    # - beginnt (evtl. eingerückt) mit genau einem Backtick
    # - enthält danach KEINEN weiteren Backtick
    if (!inblock && match(line, /^[[:space:]]*`[^`]*$/)) {
        inblock = 1

        # führende Spaces + erstes Backtick entfernen
        sub(/^[[:space:]]*`/, "", line)

        print "```"
        print line
        next
    }

    # ENDE eines kaputten Codeblocks:
    # Zeile enthält nur ein Backtick (evtl. eingerückt)
    if (inblock && match(line, /^[[:space:]]*`[[:space:]]*$/)) {
        inblock = 0
        print "```"
        next
    }

    # Alles andere unverändert ausgeben
    print line
}
' $i | sponge $i; done
```

content/blog/archive/2013/hibernate4-maven-plugin-1-0-1-released.md
content/blog/archive/2013/hibernate4-maven-plugin-1-0-2-release.md
content/blog/archive/2014/hibernate4-maven-plugin-1-0-3-released.md
content/blog/archive/2014/hibernate4-maven-plugin-1-0-4-released.md
content/blog/archive/2015/hibernate4-maven-plugin-1-0-5-released.md
content/blog/archive/2015/hibernate4-maven-plugin-1-1-0-released.md
content/blog/archive/2020/deduplicating-partitioned-data-with-kafka-streams.md
content/blog/archive/2020/how-to-instantiatiate-multiple-beans-dinamically-in-spring-boot-based-on-configuration-properties.md
content/blog/archive/2020/testing-exception-handling-in-spring-mvc.md

index 11ca42a781e7d7237162c4499642995abdf3a131..ea77ee2179fe07f17130830a218c6127e601cf42 100644 (file)
@@ -24,7 +24,8 @@ Appart from two bugfixes, this version includes some minor improvements, which m
 
 ## Release notes:
 
- `
+```
+
 commit 4b507b15b0122ac180e44b8418db8d9143ae9c3a
 Author: Kai Moritz
 Date:   Tue Jan 15 23:09:01 2013 +0100
@@ -126,4 +127,4 @@ commit 2f3807b9fbde5c1230e3a22010932ddec722871b
 Author: Kai Moritz
 Date:   Thu Nov 29 18:23:59 2012 +0100
     Found annotated classes get logged now
-`
+```
index 15f3840328b1c3641e40a08ecc31074a76c69d2c..c76bfabd99f51f5d9608597d98f960725476be4a 100644 (file)
@@ -28,7 +28,8 @@ This release includes:
 
 ## Release notes:
 
- `
+```
+
 commit 4edef457d2b747d939a141de24bec5e32abbc0c7
 Author: Kai Moritz
 Date:   Fri Aug 2 00:37:40 2013 +0200
@@ -63,4 +64,4 @@ Date:   Mon Feb 25 22:35:33 2013 +0100
     Integration of the maven-plugin-plugin for automated helpmojo-generation
 
     Thanks to Adriano Machado, who contributed this patch!
-`
+```
index cccab9cb0334a3e8ca67344aaa0ce9784c828fcb..3b3d35d53dbff90e3e82a3981a7dc4f5ae8c4a6e 100644 (file)
@@ -36,7 +36,8 @@ Many thanks also to Stephen Johnson and Eduard Szente, who pointed out bugs and
 
 ## Release notes:
 
- `
+```
+
 commit adb20bc4da63d4cec663ca68648db0f808e3d181
 Author: Kai Moritz
 Date:   Fri Oct 18 01:52:27 2013 +0200
@@ -163,4 +164,4 @@ Date:   Sat Aug 31 08:51:03 2013 +0200
 
     Best regards,
     Eduard
-`
+```
index bb97a4ba13c03010eb277057ba3977ad8836c115..129d50fbc6107f2b0b46bda9a075b9c84867e1fb 100644 (file)
@@ -27,7 +27,8 @@ If you have some special small-sized (example) use-cases for the plugin, we woul
 
 ## Release notes:
 
- `
+```
+
 commit f3dabc0e6e3676244986b5bbffdb67d427c8383c
 Author: Kai Moritz
 Date:   Mon Jun 2 10:31:12 2014 +0200
@@ -130,4 +131,4 @@ commit e44434257040745e66e0596b262dd0227b085729
 Author: Kai Moritz
 Date:   Fri Oct 18 01:55:11 2013 +0200
     [maven-release-plugin] prepare for next development iteration
-`
+```
index 9626255674057f531bbe685d1605551e14628fff..0c371b99b938e7def2605ab7e265ec4763495410 100644 (file)
@@ -35,7 +35,8 @@ _If you stumble across any problems, please let me know!_
 
 ## Release notes:
 
- `
+```
+
 commit ec30af2068f2d12a9acf65474ca1a4cdc1aa7122
 Author: Kai Moritz
 Date:   Tue Nov 11 15:28:12 2014 +0100
@@ -95,4 +96,4 @@ commit 3dd832edbd50b1499ea6d53e4bcd0ad4c79640ed
 Author: Kai Moritz
 Date:   Mon Jun 2 10:31:13 2014 +0200
     [maven-release-plugin] prepare for next development iteration
-`
+```
index fc535ec44b2b7c395c952525b9293bebedb4f38a..6c23931ed50f451df0f36bb0d14c84aebfcba394 100644 (file)
@@ -37,7 +37,8 @@ This release also fixes a bug, that occured on some platforms, if the path to th
 
 ## Release notes:
 
- `
+```
+
 commit 94e6b2e93fe107e75c9d20aa1eb3126e78a5ed0a
 Author: Kai Moritz
 Date:   Sat May 16 14:14:44 2015 +0200
@@ -196,4 +197,4 @@ Date:   Sun Mar 15 15:42:01 2015 +0100
     Added support for m2e
 
     Thanks to Andreas Khutz
-`
+```
index 9776256eee7c6a3ace1d36a2df905b6883d9d1ac..bca5ca652baa69049b2a60346f6e23f9f203e600 100644 (file)
@@ -28,7 +28,8 @@ The order, in which these messages are send, is crucial with respect to the ince
 Resending the messages in correct order after a failure (or downtime) is no problem.
 But some of the messages may be send twice (or more often), because the producer does not know exactly, which messages were send successful.
 
-`Incident A - { id: 1,  data: "ab583cc8f8" }
+```
+Incident A - { id: 1,  data: "ab583cc8f8" }
 Incident B - { id: 2,  data: "83ccc8f8f8" }
 Incident C - { id: 3,  data: "115tab5b58" }
 Incident C - { id: 4,  data: "83caac564b" }
@@ -44,7 +45,7 @@ Incident A - { id: 8,  data: "930fce58f3" }
 Incident B - { id: 9,  data: "7583ab93ab" }
 Incident C - { id: 10, data: "7583aab583" }
 Incident B - { id: 11, data: "b583075830" }
-`
+```
 
 Since eache message has a unique ID, all messages are inherently idempotent:
 **Deduplication is no problem, if the receiver keeps track of the messages, he has already seen.**
@@ -96,7 +97,8 @@ That is, our message stream is simply a mapping from names to unique sequence nu
 
 In this simplified setup, the implementation effectively boils down to the following method-override:
 
-`@Override
+```
+@Override
 public Iterable<String> transform(String value)
 {
   Integer partition = context.partition();
@@ -109,7 +111,7 @@ public Iterable<String> transform(String value)
   }
   return Collections.emptyList();
 }
-`
+```
 
 - We can get the active partition from the `ProcessorContext`, that is handed to our Instance in the constructor, which is not shown here for brevity.
 - Parsing the `String`-value of the message as `long` corresponds to the extraction of the sequence number from the value of the message in our simplified setup.
@@ -123,7 +125,8 @@ public Iterable<String> transform(String value)
 We can use our `ValueTransformer` with **`flatTransformValues()`**,
 to let Kafka Streams drop the detected duplicate values:
 
-`streamsBuilder
+```
+streamsBuilder
     .stream("input")
     .flatTransformValues(
         new ValueTransformerSupplier()
@@ -136,7 +139,7 @@ to let Kafka Streams drop the detected duplicate values:
         },
         "SequenceNumbers")
     .to("output");
-`
+```
 
 One has to register an appropriate store to the `StreamsBuilder` under the referenced name.
 
index 4fdd5da37cfce544ed276053d3db1d66ce11af77..914fbfe3bbf3d1ba26a93095fc608a575ad2bdc5 100644 (file)
@@ -29,7 +29,8 @@ We will:
 
 Additionally Beans can be added programatically very easy with the help of an `ApplicationContextInitializer`:
 
-`@AllArgsConstructor
+```
+@AllArgsConstructor
 public class MultipleBeansApplicationContextInitializer
     implements
       ApplicationContextInitializer
@@ -48,7 +49,7 @@ public class MultipleBeansApplicationContextInitializer
     }
   }
 }
-`
+```
 
 This simplified example is configured with a list of strings that should be registered as controllers with the `DispatcherServlet`.
 All "sites" are insances of the same controller `SiteController`, which are instanciated and registered dynamically.
@@ -76,7 +77,8 @@ _The initializer cannot be instantiated and autowired by Spring!_
 
 If you write an **`EnvironmentPostProcessor`**, you will get access to an instance of `ConfigurableEnvironment`, that contains a complete list of all `PropertySource`'s, that are configured for your Spring-Boot-App.
 
-`public class MultipleBeansEnvironmentPostProcessor
+```
+public class MultipleBeansEnvironmentPostProcessor
     implements
       EnvironmentPostProcessor
 {
@@ -95,7 +97,7 @@ If you write an **`EnvironmentPostProcessor`**, you will get access to an instan
                 .toArray(size -> new String[size])));
   }
 }
-`
+```
 
 **The Bad News:**
 Unfortunately, you have to scan all property-sources for the parameters, that you are interested in.
@@ -110,9 +112,10 @@ The property names are consistently represented in standard Java-Properties-Nota
 Finally, you have to [register](https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-customize-the-environment-or-application-context "Read more on details and/or alternatives of the mechanism") the `EnvironmentPostProcessor` with your Spring-Boot-App.
 This is done in the **`META-INF/spring.factories`**:
 
-`org.springframework.boot.env.EnvironmentPostProcessor=\
+```
+org.springframework.boot.env.EnvironmentPostProcessor=\
   de.juplo.demos.multiplebeans.MultipleBeansEnvironmentPostProcessor
-`
+```
 
 **That's it, your done!**
 
index ca2a6ca3a38839c50d654a6561fb98ccc4abccab..0d4967cbff9134afee05d489ce5aa68ba8eb1156 100644 (file)
@@ -40,7 +40,8 @@ It enables us, to mock away the other layers of the application and concentrate
 Consider the following controller, that defines a request-handling and an accompanying exception-handler, for an
 `IllegalArgumentException`, that may by thrown in the business-logic:
 
-`@Controller
+```
+@Controller
 public class ExampleController
 {
   @Autowired