input stringlengths 205 73.3k | output stringlengths 64 73.2k | instruction stringclasses 1
value |
|---|---|---|
#vulnerable code
@Override
public Component getTableCellRendererComponent(
JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) {
try {
setBackground(null);
... | #fixed code
@Override
public Component getTableCellRendererComponent(
JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) {
try {
setBackground(null);
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
void ladenHttp(String filmWebsite, String thema, String alter) {
// erst die Nummer suchen
// >25420<4<165<23. Die b
// <http://www.kikaplus.net/clients/kika/mediathek/previewpic/1355302530-f80b463888fd4602d925b2ef2c861928 9.jpg<
final St... | #fixed code
void addToListNormal() {
//<strong style="margin-left:10px;">Sesamstraße präsentiert: Eine Möhre für Zwei</strong><br />
//<a style="margin-left:20px;" href="?programm=168&id=14487&ag=5" title="Sendung vom 10.10.2012" class="overlay_link">42. Ordnung i... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getPfadFlv() {
/////////////////////
if (!Daten.system[Konstanten.SYSTEM_PFAD_FLVSTREAMER_NR].equals("")) {
return Daten.system[Konstanten.SYSTEM_PFAD_FLVSTREAMER_NR];
}
final String PFAD_LINUX_FLV = "/usr... | #fixed code
public static String getPfadFlv() {
if (Daten.system[Konstanten.SYSTEM_PFAD_FLVSTREAMER_NR].equals("")) {
new DialogOk(null, true, new PanelProgrammPfade(), "Pfade Standardprogramme").setVisible(true);
}
return Daten.system[Konstanten.SYSTE... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void starten() {
daten = new Daten(pfad);
Daten.nogui = true;
if (!userAgent.equals("")) {
Daten.setUserAgentManuel(userAgent);
}
// Infos schreiben
Log.startMeldungen(this.getClass().getName());
... | #fixed code
public void starten() {
daten = new Daten(pfad);
Daten.nogui = true;
if (!userAgent.equals("")) {
Daten.setUserAgentManuel(userAgent);
}
// Infos schreiben
Log.startMeldungen(this.getClass().getName());
if (s... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private void metaDatenSchreiben() {
// FilmlisteMetaDaten
listeFilmeNeu.metaDaten = ListeFilme.newMetaDaten();
if (!Daten.filmeLaden.getStop() /* löschen */) {
listeFilmeNeu.metaDaten[ListeFilme.FILMLISTE_DATUM_NR] = DatumZeit.getJetz... | #fixed code
private void metaDatenSchreiben() {
// FilmlisteMetaDaten
listeFilmeNeu.metaDaten = ListeFilme.newMetaDaten();
if (!Daten.filmeLaden.getStop() /* löschen */) {
listeFilmeNeu.metaDaten[ListeFilme.FILMLISTE_DATUM_NR] = DatumZeit.getJetzt_ddMM... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private void downloadLoeschen(boolean dauerhaft) {
int rows[] = tabelle.getSelectedRows();
if (rows.length > 0) {
for (int i = rows.length - 1; i >= 0; --i) {
int delRow = tabelle.convertRowIndexToModel(rows[i]);
... | #fixed code
private void downloadLoeschen(boolean dauerhaft) {
int rows[] = tabelle.getSelectedRows();
if (rows.length > 0) {
String[] urls = new String[rows.length];
for (int i = 0; i < rows.length; ++i) {
urls[i] = tabelle.getMode... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getMusterPfadVlc() {
final String PFAD_LINUX_VLC = "/usr/bin/vlc";
final String PFAD_MAC_VLC = "/Applications/VLC.app/Contents/MacOS/VLC";
String pfad = "";
if (System.getProperty("os.name").toLowerCase().contains("wi... | #fixed code
public static String getMusterPfadVlc() {
final String PFAD_LINUX_VLC = "/usr/bin/vlc";
final String PFAD_MAC_VLC = "/Applications/VLC.app/Contents/MacOS/VLC";
final String PFAD_WIN_DEFAULT = "C:\\Programme\\VideoLAN\\VLC\\vlc.exe";
final Strin... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void meldenFertig(String sender) {
//wird ausgeführt wenn Sender beendet ist
int MAX_SENDER = 25, MAX1 = 22, MAX2 = 15, MAX3 = 20, MAX4 = 30;
Log.systemMeldung("Fertig " + sender + ": " + DatumZeit.getJetzt_HH_MM_SS());
RunSender r... | #fixed code
public void meldenFertig(String sender) {
//wird ausgeführt wenn Sender beendet ist
int MAX_SENDER = 15, MAX1 = 24, MAX2 = 30;
Log.systemMeldung("Fertig " + sender + ": " + DatumZeit.getJetzt_HH_MM_SS());
RunSender run = listeSenderLaufen.sende... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void meldenFertig(String sender) {
//wird ausgeführt wenn Sender beendet ist
int MAX_SENDER = 15, MAX1 = 24, MAX2 = 30;
Log.systemMeldung("Fertig " + sender + ": " + DatumZeit.getJetzt_HH_MM_SS());
RunSender run = listeSenderLaufen... | #fixed code
public void meldenFertig(String sender) {
//wird ausgeführt wenn Sender beendet ist
int MAX_SENDER = 15, MAX1 = 24, MAX2 = 30;
Log.systemMeldung("Fertig " + sender + ": " + DatumZeit.getJetzt_HH_MM_SS());
RunSender run = listeSenderLaufen.sende... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getMusterPfadFlv() {
final String PFAD_LINUX_FLV = "/usr/bin/flvstreamer";
final String PFAD_WINDOWS_FLV = "bin\\flvstreamer_win32_latest.exe";
final String PFAD_MAC_FLV = "bin\\flvstreamer_macosx_intel_32bit_latest";
... | #fixed code
public static String getMusterPfadFlv() {
final String PFAD_LINUX_FLV = "/usr/bin/flvstreamer";
final String PFAD_WINDOWS_FLV = "bin\\flvstreamer_win32_latest.exe";
final String PFAD_MAC_FLV = "bin\\flvstreamer_macosx_intel_32bit_latest";
Strin... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getMusterPfadFlv() {
final String PFAD_LINUX_FLV = "/usr/bin/flvstreamer";
final String PFAD_WINDOWS_FLV = "bin\\flvstreamer_win32_latest.exe";
final String PFAD_MAC_FLV = "bin\\flvstreamer_macosx_intel_32bit_latest";
... | #fixed code
public static String getMusterPfadFlv() {
final String PFAD_LINUX_FLV = "/usr/bin/flvstreamer";
final String PFAD_WINDOWS_FLV = "bin\\flvstreamer_win32_latest.exe";
final String PFAD_MAC_FLV = "bin\\flvstreamer_macosx_intel_32bit_latest";
Strin... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
void ladenHttp(String filmWebsite, String thema, String alter) {
// erst die Nummer suchen
// >25420<4<165<23. Die b
// <http://www.kikaplus.net/clients/kika/mediathek/previewpic/1355302530-f80b463888fd4602d925b2ef2c861928 9.jpg<
final St... | #fixed code
void addToListNormal() {
//<strong style="margin-left:10px;">Sesamstraße präsentiert: Eine Möhre für Zwei</strong><br />
//<a style="margin-left:20px;" href="?programm=168&id=14487&ag=5" title="Sendung vom 10.10.2012" class="overlay_link">42. Ordnung i... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void starten() {
daten = new Daten(pfad);
Daten.nogui = true;
if (!userAgent.equals("")) {
Daten.setUserAgentManuel(userAgent);
}
// Infos schreiben
Log.startMeldungen(this.getClass().getName());
... | #fixed code
public void starten() {
daten = new Daten(pfad);
Daten.nogui = true;
if (!userAgent.equals("")) {
Daten.setUserAgentManuel(userAgent);
}
// Infos schreiben
Log.startMeldungen(this.getClass().getName());
if (s... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private void downloadLoeschen(boolean dauerhaft) {
int rows[] = jTable1.getSelectedRows();
if (rows.length > 0) {
for (int i = rows.length - 1; i >= 0; --i) {
int delRow = jTable1.convertRowIndexToModel(rows[i]);
... | #fixed code
private void downloadLoeschen(boolean dauerhaft) {
int rows[] = tabelle.getSelectedRows();
if (rows.length > 0) {
for (int i = rows.length - 1; i >= 0; --i) {
int delRow = tabelle.convertRowIndexToModel(rows[i]);
Str... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static synchronized void startMeldungen(String classname) {
Log.systemMeldung("###########################################################");
try {
//Version
Log.systemMeldung(Konstanten.PROGRAMMNAME + " " + Konstanten.VERS... | #fixed code
public static synchronized void startMeldungen(String classname) {
versionsMeldungen(classname);
Log.systemMeldung("Programmpfad: " + GuiFunktionenProgramme.getPathJar());
Log.systemMeldung("Verzeichnis Einstellungen: " + Daten.getBasisVerzeichnis());
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getPfadScript() {
String pfadScript;
final String PFAD_LINUX_SCRIPT = "bin/flv.sh";
final String PFAD_WINDOWS_SCRIPT = "bin\\flv.bat";
if (System.getProperty("os.name").toLowerCase().contains("linux")) {
p... | #fixed code
public static String getPfadScript() {
String pfadScript;
final String PFAD_LINUX_SCRIPT = "bin/flv.sh";
final String PFAD_WINDOWS_SCRIPT = "bin\\flv.bat";
switch (getOs()) {
case OS_LINUX:
pfadScript = Funktionen.ge... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public synchronized boolean zeileSchreiben(ArrayList<String[]> list) {
boolean ret = false;
String text;
String zeit = DatumZeit.getHeute_dd_MM_yyyy();
String thema, titel, url;
OutputStreamWriter writer = null;
File f = n... | #fixed code
public synchronized boolean zeileSchreiben(ArrayList<String[]> list) {
boolean ret = false;
String text;
String zeit = DatumZeit.getHeute_dd_MM_yyyy();
String thema, titel, url;
try (OutputStreamWriter writer = new OutputStreamWriter(F... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private synchronized StringBuffer getUri(String sender, String addr, StringBuffer seite, String kodierung, int timeout, String meldung, int versuch, boolean lVersuch) {
int timeo = timeout;
boolean proxyB = false;
char[] zeichen = new char[1];
... | #fixed code
private synchronized StringBuffer getUri(String sender, String addr, StringBuffer seite, String kodierung, int timeout, String meldung, int versuch, boolean lVersuch) {
int timeo = timeout;
boolean proxyB = false;
char[] zeichen = new char[1];
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getCompileDate() {
String ret = "";
try {
Date d = new Date(Main.class.getResource("Main.class").openConnection().getLastModified());
ret = Konstanten.PROGRAMMNAME + " " + Konstanten.VERSION + " [Buildnummer:... | #fixed code
public static String getCompileDate() {
// String ret = "";
// try {
// Date d = new Date(Main.class.getResource("Main.class").openConnection().getLastModified());
// ret = Konstanten.PROGRAMMNAME + " " + Konstanten.VERSION + " [Buildnumme... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
void ladenHttp(String filmWebsite, String thema, String alter) {
// erst die Nummer suchen
// >25420<4<165<23. Die b
// <http://www.kikaplus.net/clients/kika/mediathek/previewpic/1355302530-f80b463888fd4602d925b2ef2c861928 9.jpg<
final St... | #fixed code
void addToListNormal() {
//<strong style="margin-left:10px;">Sesamstraße präsentiert: Eine Möhre für Zwei</strong><br />
//<a style="margin-left:20px;" href="?programm=168&id=14487&ag=5" title="Sendung vom 10.10.2012" class="overlay_link">42. Ordnung i... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void speichern() {
try {
FileOutputStream fstream = new FileOutputStream(datei);
DataOutputStream out = new DataOutputStream(fstream);
BufferedWriter br = new BufferedWriter(new OutputStreamWriter(out));
for... | #fixed code
public void speichern() {
try (BufferedWriter br = new BufferedWriter(new OutputStreamWriter(new DataOutputStream(Files.newOutputStream(historyFilePath)))))
{
for (String h : this)
br.write(h + "\n");
br.flush();
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void updateSender(String nameSenderFilmliste, ListeFilme alteListe) {
// nur für den Mauskontext "Sender aktualisieren"
allesLaden = false;
initStart(alteListe);
MediathekReader reader = getMReaderNameSenderFilmliste(nameSenderFilm... | #fixed code
public void updateSender(String nameSenderFilmliste, ListeFilme alteListe) {
// nur für den Mauskontext "Sender aktualisieren"
// allesLaden = false;
initStart(alteListe);
MediathekReader reader = getMReaderNameSenderFilmliste(nameSenderFilmlist... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static ListePset getStandardprogramme(DDaten ddaten) {
ListePset pSet;
InputStream datei;
if (System.getProperty("os.name").toLowerCase().contains("linux")) {
datei = new GetFile().getPsetVorlageLinux();
} else if (Syst... | #fixed code
public static ListePset getStandardprogramme(DDaten ddaten) {
ListePset pSet;
InputStream datei;
switch (getOs()) {
case OS_LINUX:
datei = new GetFile().getPsetVorlageLinux();
break;
case OS_MAC:
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static boolean isLeopard() {
return isMac() && getOsVersion().startsWith("10.5");
}
#location 2
#vulnerability type NULL_DEREFERENCE | #fixed code
public static boolean isLeopard() {
return SystemInfo.isMacOSX() && SystemInfo.getOSVersion().startsWith("10.5");
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
void ladenHttp(String filmWebsite, String thema, String alter) {
// erst die Nummer suchen
// >25420<4<165<23. Die b
// <http://www.kikaplus.net/clients/kika/mediathek/previewpic/1355302530-f80b463888fd4602d925b2ef2c861928 9.jpg<
final St... | #fixed code
void addToListNormal() {
//<strong style="margin-left:10px;">Sesamstraße präsentiert: Eine Möhre für Zwei</strong><br />
//<a style="margin-left:20px;" href="?programm=168&id=14487&ag=5" title="Sendung vom 10.10.2012" class="overlay_link">42. Ordnung i... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public synchronized boolean zeileSchreiben(String thema, String titel, String url) {
boolean ret = false;
String text;
listeErledigteAbos.add(url);
File f = new File(Daten.getBasisVerzeichnis(true) + Konstanten.LOG_DATEI_DOWNLOAD_ABOS);
... | #fixed code
public synchronized boolean zeileSchreiben(String thema, String titel, String url) {
boolean ret = false;
String text;
listeErledigteAbos.add(url);
//Automatic Resource Management
try (OutputStreamWriter writer = new OutputStreamWriter... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private void downloadLoeschen(boolean dauerhaft) {
int rows[] = jTable1.getSelectedRows();
if (rows.length > 0) {
for (int i = rows.length - 1; i >= 0; --i) {
int delRow = jTable1.convertRowIndexToModel(rows[i]);
... | #fixed code
private void downloadLoeschen(boolean dauerhaft) {
int rows[] = tabelle.getSelectedRows();
if (rows.length > 0) {
for (int i = rows.length - 1; i >= 0; --i) {
int delRow = tabelle.convertRowIndexToModel(rows[i]);
Str... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static synchronized void versionsMeldungen(String classname) {
Log.systemMeldung("###########################################################");
long totalMem = Runtime.getRuntime().totalMemory();
Log.systemMeldung("totalMemory: " + totalM... | #fixed code
public static synchronized void versionsMeldungen(String classname) {
Log.systemMeldung("###########################################################");
long totalMem = Runtime.getRuntime().totalMemory();
Log.systemMeldung("totalMemory: " + totalMem / (... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getMusterPfadMplayer() {
final String PFAD_LINUX = "/usr/bin/mplayer";
final String PFAD_MAC = "/opt/local/bin/mplayer";
String pfad = "";
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
... | #fixed code
public static String getMusterPfadMplayer() {
final String PFAD_LINUX = "/usr/bin/mplayer";
final String PFAD_MAC = "/opt/local/bin/mplayer";
final String PFAD_WIN_DEFAULT = "C:\\Program Files\\SMPlayer\\mplayer\\mplayer.exe";
final String PFAD... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
void addToListHttp() {
//http://www.kikaplus.net/clients/kika/kikaplus/hbbtv/index.php?cmd=az&age=3&page=all
//http://www.kikaplus.net/clients/kika/kikaplus/hbbtv/index.php?cmd=az&age=6&page=all
//http://www.kikaplus.net/clients/kika/kikaplus/hbb... | #fixed code
void addToListNormal() {
//<strong style="margin-left:10px;">Sesamstraße präsentiert: Eine Möhre für Zwei</strong><br />
//<a style="margin-left:20px;" href="?programm=168&id=14487&ag=5" title="Sendung vom 10.10.2012" class="overlay_link">42. Ordnung i... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getPfadScript() {
String pfadScript;
final String PFAD_LINUX_SCRIPT = "bin/flv.sh";
final String PFAD_WINDOWS_SCRIPT = "bin\\flv.bat";
if (System.getProperty("os.name").toLowerCase().contains("linux")) {
p... | #fixed code
public static String getPfadScript() {
String pfadScript;
final String PFAD_LINUX_SCRIPT = "bin/flv.sh";
final String PFAD_WINDOWS_SCRIPT = "bin\\flv.bat";
switch (getOs()) {
case OS_LINUX:
pfadScript = Funktionen.ge... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private void filmStartenWiederholenStoppen(boolean alle, boolean starten /* starten/wiederstarten oder stoppen */) {
// bezieht sich immer auf "alle" oder nur die markierten
// Film der noch keinen Starts hat wird gestartet
// Film dessen Start s... | #fixed code
private void filmStartenWiederholenStoppen(boolean alle, boolean starten /* starten/wiederstarten oder stoppen */) {
// bezieht sich immer auf "alle" oder nur die markierten
// Film der noch keinen Starts hat wird gestartet
// Film dessen Start schon a... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static synchronized void startMeldungen(String classname) {
Log.systemMeldung("###########################################################");
try {
//Version
Log.systemMeldung(Konstanten.PROGRAMMNAME + " " + Konstanten.VERS... | #fixed code
public static synchronized void startMeldungen(String classname) {
versionsMeldungen(classname);
Log.systemMeldung("Programmpfad: " + GuiFunktionenProgramme.getPathJar());
Log.systemMeldung("Verzeichnis Einstellungen: " + Daten.getBasisVerzeichnis());
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getCompileDate() {
String ret = "";
try {
Date d = new Date(Main.class.getResource("Main.class").openConnection().getLastModified());
ret = Konstanten.PROGRAMMNAME + " " + Konstanten.VERSION + " [Buildnummer:... | #fixed code
public static String getCompileDate() {
// String ret = "";
// try {
// Date d = new Date(Main.class.getResource("Main.class").openConnection().getLastModified());
// ret = Konstanten.PROGRAMMNAME + " " + Konstanten.VERSION + " [Buildnumme... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void meldenFertig(String sender) {
//wird ausgeführt wenn Sender beendet ist
int MAX_SENDER = 15, MAX1 = 24, MAX2 = 30;
Log.systemMeldung("Fertig " + sender + ": " + DatumZeit.getJetzt_HH_MM_SS());
RunSender run = listeSenderLaufen... | #fixed code
public void meldenFertig(String sender) {
//wird ausgeführt wenn Sender beendet ist
int MAX_SENDER = 15, MAX1 = 24, MAX2 = 30;
Log.systemMeldung("Fertig " + sender + ": " + DatumZeit.getJetzt_HH_MM_SS());
RunSender run = listeSenderLaufen.sende... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static synchronized void versionsMeldungen(String classname) {
Log.systemMeldung("###########################################################");
long totalMem = Runtime.getRuntime().totalMemory();
Log.systemMeldung("totalMemory: " + totalM... | #fixed code
public static synchronized void versionsMeldungen(String classname) {
Log.systemMeldung("###########################################################");
long totalMem = Runtime.getRuntime().totalMemory();
Log.systemMeldung("totalMemory: " + totalMem / (... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private synchronized StringBuffer getUri(String sender, String addr, StringBuffer seite, String kodierung, int timeout, String meldung, int versuch, boolean lVersuch) {
int timeo = timeout;
boolean proxyB = false;
char[] zeichen = new char[1];
... | #fixed code
private synchronized StringBuffer getUri(String sender, String addr, StringBuffer seite, String kodierung, int timeout, String meldung, int versuch, boolean lVersuch) {
int timeo = timeout;
boolean proxyB = false;
char[] zeichen = new char[1];
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
void ladenHttp(String filmWebsite, String thema, String alter) {
// erst die Nummer suchen
// >25420<4<165<23. Die b
// <http://www.kikaplus.net/clients/kika/mediathek/previewpic/1355302530-f80b463888fd4602d925b2ef2c861928 9.jpg<
final St... | #fixed code
void addToListNormal() {
//<strong style="margin-left:10px;">Sesamstraße präsentiert: Eine Möhre für Zwei</strong><br />
//<a style="margin-left:20px;" href="?programm=168&id=14487&ag=5" title="Sendung vom 10.10.2012" class="overlay_link">42. Ordnung i... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public synchronized void abosSuchen() {
// in der Filmliste nach passenden Filmen suchen und
// in die Liste der Downloads eintragen
boolean gefunden = false;
DatenFilm film;
DatenAbo abo;
boolean checkBlack = !Boolean.pa... | #fixed code
public synchronized void abosSuchen() {
// in der Filmliste nach passenden Filmen suchen und
// in die Liste der Downloads eintragen
boolean gefunden = false;
DatenFilm film;
DatenAbo abo;
boolean checkBlack = !Boolean.parseBoo... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void speichern() {
try {
FileOutputStream fstream = new FileOutputStream(datei);
DataOutputStream out = new DataOutputStream(fstream);
BufferedWriter br = new BufferedWriter(new OutputStreamWriter(out));
for... | #fixed code
public void speichern() {
try (BufferedWriter br = new BufferedWriter(new OutputStreamWriter(new DataOutputStream(Files.newOutputStream(historyFilePath)))))
{
for (String h : this)
br.write(h + "\n");
br.flush();
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
void ladenHttp(String filmWebsite, String thema, String alter) {
// erst die Nummer suchen
// >25420<4<165<23. Die b
// <http://www.kikaplus.net/clients/kika/mediathek/previewpic/1355302530-f80b463888fd4602d925b2ef2c861928 9.jpg<
final St... | #fixed code
void addToListNormal() {
//<strong style="margin-left:10px;">Sesamstraße präsentiert: Eine Möhre für Zwei</strong><br />
//<a style="margin-left:20px;" href="?programm=168&id=14487&ag=5" title="Sendung vom 10.10.2012" class="overlay_link">42. Ordnung i... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private void aktFilmSetzen() {
if (this.isShowing()) {
DatenFilm aktFilm = null;
int selectedTableRow = tabelle.getSelectedRow();
if (selectedTableRow >= 0) {
int selectedModelRow = tabelle.convertRowIndexToMod... | #fixed code
private void aktFilmSetzen() {
if (this.isShowing()) {
DatenFilm aktFilm = null;
int selectedTableRow = tabelle.getSelectedRow();
if (selectedTableRow >= 0) {
int selectedModelRow = tabelle.convertRowIndexToModel(sel... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getMusterPfadVlc() {
final String PFAD_LINUX_VLC = "/usr/bin/vlc";
final String PFAD_MAC_VLC = "/Applications/VLC.app/Contents/MacOS/VLC";
String pfad = "";
if (System.getProperty("os.name").toLowerCase().contains("wi... | #fixed code
public static String getMusterPfadVlc() {
final String PFAD_LINUX_VLC = "/usr/bin/vlc";
final String PFAD_MAC_VLC = "/Applications/VLC.app/Contents/MacOS/VLC";
final String PFAD_WIN_DEFAULT = "C:\\Programme\\VideoLAN\\VLC\\vlc.exe";
final Strin... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private void playerStarten(DatenPset pSet) {
// Url mit Prognr. starten
if (tabelle.getSelectedRow() == -1) {
new HinweisKeineAuswahl().zeigen(parentComponent);
} else if (pSet.istSpeichern()) {
// wenn das pSet zum Speich... | #fixed code
private void playerStarten(DatenPset pSet) {
// Url mit Prognr. starten
if (tabelle.getSelectedRow() == -1) {
new HinweisKeineAuswahl().zeigen(parentComponent);
} else if (pSet.istSpeichern()) {
// wenn das pSet zum Speichern (ü... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void laden() {
clear();
File file = new File(datei);
if (!file.exists()) {
return;
}
try {
FileInputStream fstream = new FileInputStream(datei);
DataInputStream in = new DataInputStream(f... | #fixed code
public void laden() {
clear();
if (Files.notExists(historyFilePath))
return;
try (BufferedReader br = new BufferedReader(new InputStreamReader(new DataInputStream(Files.newInputStream(historyFilePath))))) {
String strLine;
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public boolean filmlisteIstAelter() {
// Filmliste ist älter als: FilmeLaden.ALTER_FILMLISTE_SEKUNDEN_FUER_AUTOUPDATE
int ret = -1;
Date jetzt = new Date(System.currentTimeMillis());
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy... | #fixed code
public boolean filmlisteIstAelter() {
return filmlisteIstAelter(FilmeLaden.ALTER_FILMLISTE_SEKUNDEN_FUER_AUTOUPDATE);
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getMusterPfadFlv() {
final String PFAD_LINUX_FLV = "/usr/bin/flvstreamer";
final String PFAD_WINDOWS_FLV = "bin\\flvstreamer_win32_latest.exe";
final String PFAD_MAC_FLV = "bin\\flvstreamer_macosx_intel_32bit_latest";
... | #fixed code
public static String getMusterPfadFlv() {
final String PFAD_LINUX_FLV = "/usr/bin/flvstreamer";
final String PFAD_WINDOWS_FLV = "bin\\flvstreamer_win32_latest.exe";
final String PFAD_MAC_FLV = "bin\\flvstreamer_macosx_intel_32bit_latest";
Strin... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getPfadVlc() {
///////////////////////
if (!Daten.system[Konstanten.SYSTEM_PFAD_VLC_NR].equals("")) {
return Daten.system[Konstanten.SYSTEM_PFAD_VLC_NR];
}
final String PFAD_LINUX_VLC = "/usr/bin/vlc";
... | #fixed code
public static String getPfadVlc() {
if (Daten.system[Konstanten.SYSTEM_PFAD_VLC_NR].equals("")) {
new DialogOk(null, true, new PanelProgrammPfade(), "Pfade Standardprogramme").setVisible(true);
}
return Daten.system[Konstanten.SYSTEM_PFAD_V... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static ListePset getStandardprogramme(DDaten ddaten) {
ListePset pSet;
InputStream datei;
if (System.getProperty("os.name").toLowerCase().contains("linux")) {
datei = new GetFile().getPsetVorlageLinux();
} else if (Syst... | #fixed code
public static ListePset getStandardprogramme(DDaten ddaten) {
ListePset pSet;
InputStream datei;
switch (getOs()) {
case OS_LINUX:
datei = new GetFile().getPsetVorlageLinux();
break;
case OS_MAC:
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public static String getMusterPfadVlc() {
final String PFAD_LINUX_VLC = "/usr/bin/vlc";
final String PFAD_MAC_VLC = "/Applications/VLC.app/Contents/MacOS/VLC";
String pfad = "";
if (System.getProperty("os.name").toLowerCase().contains("wi... | #fixed code
public static String getMusterPfadVlc() {
final String PFAD_LINUX_VLC = "/usr/bin/vlc";
final String PFAD_MAC_VLC = "/Applications/VLC.app/Contents/MacOS/VLC";
final String PFAD_WIN_DEFAULT = "C:\\Programme\\VideoLAN\\VLC\\vlc.exe";
final Strin... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void stopContainer(String containerId) {
try {
List<Task> tasks = dockerClient.listTasks();
for (Task task : tasks) {
ContainerStatus containerStatus = task.status().containerStatus();
if (containerS... | #fixed code
public void stopContainer(String containerId) {
try {
SwarmUtilities.stopServiceByContainerId(containerId);
} catch (DockerException | InterruptedException e) {
logger.warn(nodeId + " Error while stopping the container", e);
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private String getContainerId(String containerName) {
List<Container> containerList = null;
try {
containerList = dockerClient.listContainers(DockerClient.ListContainersParam.allContainers());
} catch (DockerException | InterruptedExc... | #fixed code
private String getContainerId(String containerName) {
final String containerNameSearch = containerName.contains("/") ?
containerName : String.format("/%s", containerName);
List<Container> containerList = null;
try {
contain... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void executeCommand(String containerId, String[] command, boolean waitForExecution) {
String swarmNodeIp = null;
try {
List<Task> tasks = dockerClient.listTasks();
for (Task task : tasks) {
if (task.status()... | #fixed code
public void executeCommand(String containerId, String[] command, boolean waitForExecution) {
String swarmNodeIp = null;
try {
List<Task> tasks = dockerClient.listTasks();
for (Task task : tasks) {
ContainerStatus contain... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test
public void pollerThreadTearsDownNodeAfterTestIsCompleted() throws IOException {
// Supported desired capability for the test session
Map<String, Object> requestedCapability = getCapabilitySupportedByDockerSelenium();
// Start poller ... | #fixed code
@Test
public void pollerThreadTearsDownNodeAfterTestIsCompleted() throws IOException {
// Supported desired capability for the test session
Map<String, Object> requestedCapability = getCapabilitySupportedByDockerSelenium();
// Start poller thread... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public String getLatestDownloadedImage(String imageName) {
List<Image> images;
try {
images = dockerClient.listImages(DockerClient.ListImagesParam.byName(imageName));
if (images.isEmpty()) {
logger.error(nodeId + "... | #fixed code
public String getLatestDownloadedImage(String imageName) {
// TODO: verify this is handled by docker
return imageName;
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void stopContainer(String containerId) {
try {
List<Task> tasks = dockerClient.listTasks();
for (Task task : tasks) {
if (task.status().containerStatus().containerId().equals(containerId)) {
Stri... | #fixed code
public void stopContainer(String containerId) {
try {
List<Task> tasks = dockerClient.listTasks();
for (Task task : tasks) {
ContainerStatus containerStatus = task.status().containerStatus();
if (containerStatus ... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private String getContainerId(String zaleniumContainerName, URL remoteUrl) {
try {
List<Task> tasks = dockerClient.listTasks();
logger.debug("---------------Size of tasks list : {} ---------------", tasks.size());
for (Task ta... | #fixed code
private String getContainerId(String zaleniumContainerName, URL remoteUrl) {
try {
List<Task> tasks = dockerClient.listTasks();
for (Task task : tasks) {
List<NetworkAttachment> networkAttachments = task.networkAttachments();
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void executeCommand(String containerId, String[] command, boolean waitForExecution) {
try {
List<Task> tasks = dockerClient.listTasks();
pullSwarmExecImage();
for (Task task : CollectionUtils.emptyIfNull(tasks)) {
... | #fixed code
public void executeCommand(String containerId, String[] command, boolean waitForExecution) {
try {
Task task = SwarmUtilities.getTaskByContainerId(containerId);
if (task != null) {
pullSwarmExecImage();
startSwar... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@VisibleForTesting
void copyVideos(final String containerId) {
if (testInformation == null || StringUtils.isEmpty(containerId)) {
// No tests run or container has been removed, nothing to copy and nothing to update.
return;
}
... | #fixed code
@VisibleForTesting
void copyVideos(final String containerId) {
if (testInformation == null || StringUtils.isEmpty(containerId)) {
// No tests run or container has been removed, nothing to copy and nothing to update.
return;
}
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Override
public boolean isTerminated(ContainerCreationStatus container) {
List<String> termStates = Arrays.asList("complete", "failed", "shutdown", "rejected", "orphaned", "removed");
String containerId = container.getContainerId();
try {
... | #fixed code
@Override
public boolean isTerminated(ContainerCreationStatus container) {
List<String> termStates = Arrays.asList("complete", "failed", "shutdown", "rejected", "orphaned", "removed");
String containerId = container.getContainerId();
try {
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Override
public String getContainerIp(String containerName) {
String containerId = this.getContainerId(containerName);
if (containerId == null) {
logger.warn("Failed to get id of container: {} ", containerName);
return null;... | #fixed code
@Override
public String getContainerIp(String containerName) {
String containerId = this.getContainerId(containerName);
if (containerId == null) {
logger.warn("Failed to get id of container: {} ", containerName);
return null;
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@VisibleForTesting
void copyLogs(final String containerId) {
if (SwarmUtilities.isSwarmActive()) {
// Disabling logs in swarm mode
return;
}
if (testInformation == null || StringUtils.isEmpty(containerId)) {
... | #fixed code
@VisibleForTesting
void copyLogs(final String containerId) {
if (SwarmUtilities.isSwarmActive()) {
// Disabling logs in swarm mode
return;
}
if (testInformation == null || StringUtils.isEmpty(containerId)) {
// ... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Override
public boolean isTerminated(ContainerCreationStatus container) {
List<String> termStates = Arrays.asList("complete", "failed", "shutdown", "rejected", "orphaned", "removed");
String containerId = container.getContainerId();
try {
... | #fixed code
@Override
public boolean isTerminated(ContainerCreationStatus container) {
try {
List<String> termStates = Arrays.asList("complete", "failed", "shutdown", "rejected", "orphaned", "removed");
String containerId = container.getContainerId();
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private ContainerCreationStatus getContainerCreationStatus (String serviceId, String nodePort) throws DockerException, InterruptedException {
List<Task> tasks = dockerClient.listTasks();
for (Task task : tasks) {
if (task.serviceId().equals(s... | #fixed code
private ContainerCreationStatus getContainerCreationStatus (String serviceId, String nodePort) throws DockerException, InterruptedException {
List<Task> tasks = dockerClient.listTasks();
for (Task task : tasks) {
if (task.serviceId().equals(service... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@VisibleForTesting
void copyVideos(final String containerId) {
if (testInformation == null || StringUtils.isEmpty(containerId)) {
// No tests run or container has been removed, nothing to copy and nothing to update.
return;
}
... | #fixed code
@VisibleForTesting
void copyVideos(final String containerId) {
if (testInformation == null || StringUtils.isEmpty(containerId)) {
// No tests run or container has been removed, nothing to copy and nothing to update.
return;
}
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Override
public String getContainerIp(String containerName) {
String containerId = this.getContainerId(containerName);
if (containerId == null) {
return null;
}
try {
ContainerInfo containerInfo = dockerClient... | #fixed code
@Override
public String getContainerIp(String containerName) {
String containerId = this.getContainerId(containerName);
if (containerId == null) {
return null;
}
try {
List<Task> tasks = dockerClient.listTasks();
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private void loadMountedFolder(String zaleniumContainerName) {
if (this.mountedFolder == null) {
String containerId = getContainerId(String.format("/%s", zaleniumContainerName));
ContainerInfo containerInfo = null;
try {
... | #fixed code
private void loadMountedFolder(String zaleniumContainerName) {
if (this.mountedFolder == null) {
String containerId = getContainerId(String.format("/%s", zaleniumContainerName));
if (containerId == null) {
return;
}
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
void swapRecordingHistograms() {
final AtomicHistogram tempHistogram = intervalRawDataHistogram;
intervalRawDataHistogram = currentRecordingHistogram;
currentRecordingHistogram = tempHistogram;
}
#location 4
... | #fixed code
void trackRecordingInterval() {
long now = TimeServices.nanoTime();
intervalEstimator.recordInterval(now);
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public <T> List<T> fetch(final JsonObject criteria, final String pojo) {
return this.reader.fetch(criteria, JqFlow.create(this.analyzer, pojo));
}
#location 2
#vulnerability type NULL_DEREFERENCE | #fixed code
public <T> List<T> fetch(final JsonObject criteria, final String pojo) {
return this.reader.fetch(JqFlow.create(this.analyzer, pojo).inputQrJ(criteria));
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
static Future<TermStatus> runAsync(final CommandLine parsed, final List<CommandAtom> commands,
final Function<Commander, Commander> binder) {
/*
* Found command inner run method
*/
final CommandAto... | #fixed code
static Future<TermStatus> runAsync(final CommandLine parsed, final List<CommandAtom> commands,
final Function<Commander, Commander> binder) {
/*
* Found command inner run method, double check for CommandAtom
*/
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
<T> Integer count(final JsonObject filters) {
final DSLContext context = JooqInfix.getDSL();
return null == filters ? context.fetchCount(this.vertxDAO.getTable()) :
context.fetchCount(this.vertxDAO.getTable(), JooqCond.transform(filters, ... | #fixed code
<T> Future<T> fetchOneAsync(final String field, final Object value) {
return JqTool.future(this.vertxDAO.fetchOneAsync(this.analyzer.column(field), value));
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private Resolver<T> getResolver(final RoutingContext context,
final Epsilon<T> income) {
/* 1.Read the resolver first **/
final Annotation annotation = income.getAnnotation();
final Class<?> resolverCls = Ut.in... | #fixed code
private Resolver<T> getResolver(final RoutingContext context,
final Epsilon<T> income) {
/* 1.Read the resolver first **/
final Annotation annotation = income.getAnnotation();
final Class<?> resolverCls = Ut.invoke(a... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public <T> Future<List<T>> fetchAsync(final JsonObject criteria, final String pojo) {
return this.reader.fetchAsync(criteria, JqFlow.create(this.analyzer, pojo));
}
#location 2
#vulnerability type NUL... | #fixed code
public <T> Future<List<T>> fetchAsync(final JsonObject criteria, final String pojo) {
return JqFlow.create(this.analyzer, pojo).inputQrJAsync(criteria).compose(this.reader::fetchAsync);
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
<T> Integer count(final JsonObject filters) {
final DSLContext context = JooqInfix.getDSL();
return null == filters ? context.fetchCount(this.vertxDAO.getTable()) :
context.fetchCount(this.vertxDAO.getTable(), JooqCond.transform(filters, ... | #fixed code
<T> Future<T> fetchOneAsync(final String field, final Object value) {
return JqTool.future(this.vertxDAO.fetchOneAsync(this.analyzer.column(field), value));
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Override
public String unique(final CacheMeta meta) {
final Class<?> entityCls = meta.type();
final TreeMap<String, String> treeMap = new TreeMap<>();
treeMap.put(meta.primaryString(), this.id);
return CacheTool.keyId(entityCls.getNa... | #fixed code
@Override
public String unique(final CacheMeta meta) {
final TreeMap<String, String> treeMap = new TreeMap<>();
treeMap.put(meta.primaryString(), this.id);
return CacheTool.keyId(meta.typeName(), treeMap);
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
void onData(final Cell cell) {
final DyeCell dye;
if (CellType.NUMERIC == cell.getCellType()) {
/*
* Buf for date exporting here
*/
final double cellValue = cell.getNumericCellValue();
if (Dat... | #fixed code
void onTable(final Cell cell) {
final DyeCell dyeCell = Fn.pool(this.stylePool, "TABLE",
() -> DyeCell.create(this.workbook)
.color("FFFFFF", "3EB7FF")
.align(HorizontalAlignment.CENTER)
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
<T> T fetchOne(final JsonObject filters) {
final Condition condition = JooqCond.transform(filters, Operator.AND, this.analyzer::column);
final DSLContext context = JooqInfix.getDSL();
return this.toResult(context.selectFrom(this.vertxDAO.getTable... | #fixed code
<T> Future<JsonObject> searchAsync(final JsonObject params, final JqFlow workflow) {
return this.search.searchAsync(params, workflow);
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Override
public Future<JsonArray> groupAsync(final String sigma) {
/*
* Build condition of `sigma`
*/
final JsonObject condition = new JsonObject();
condition.put(KeField.SIGMA, sigma);
/*
* Permission Grou... | #fixed code
@Override
public Future<JsonArray> groupAsync(final String sigma) {
/*
* Build condition of `sigma`
*/
final JsonObject condition = new JsonObject();
condition.put(KeField.SIGMA, sigma);
/*
* Permission Groups pro... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Address(Addr.Authority.PERMISSION_BY_ROLE)
public Future<JsonArray> fetchAsync(final String roleId) {
if (Ut.notNil(roleId)) {
return Ux.Jooq.on(RRolePermDao.class)
.fetchAsync(KeField.ROLE_ID, roleId)
.co... | #fixed code
@Address(Addr.Authority.PERMISSION_BY_ROLE)
public Future<JsonArray> fetchAsync(final String roleId) {
return Fn.getEmpty(Ux.futureJArray(), () -> Ux.Jooq.on(RRolePermDao.class)
.fetchAsync(KeField.ROLE_ID, roleId)
.compose(Ux::fnJA... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
L1Cache cacheL1() {
L1Cache cache = null;
final Class<?> componentCls = this.l1Config.getComponent();
if (Objects.nonNull(componentCls) && Ut.isImplement(componentCls, L1Cache.class)) {
/*
* L1 cache here
*/
... | #fixed code
L1Cache cacheL1() {
L1Cache cache = null;
final Class<?> componentCls = this.l1Config.getComponent();
if (Objects.nonNull(componentCls) && Ut.isImplement(componentCls, L1Cache.class)) {
/*
* L1 cache here
*/
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Override
public Future<JsonArray> syncPerm(final JsonArray permissions, final String group, final String sigma) {
/*
* Fetch all permissions from database and calculated removed list
*/
final JsonObject condition = new JsonObject()... | #fixed code
@Override
public Future<JsonArray> syncPerm(final JsonArray permissions, final String group, final String sigma) {
/*
* 1. permissions ->
* -- ADD = List
* -- UPDATE = List
* -- DELETE = List
*/
final Set<String... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Override
public Future<JsonObject> fetchModule(final String appId, final String entry) {
final JsonObject filters = new JsonObject()
.put("", Boolean.TRUE)
.put("entry", entry)
.put("appId", appId);
re... | #fixed code
@Override
public Future<JsonObject> fetchModule(final String appId, final String entry) {
final JsonObject filters = new JsonObject()
.put("", Boolean.TRUE)
.put("entry", entry)
.put("appId", appId);
/*
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Override
public void mount(final Router router) {
final Class<?> clazz = ZeroAmbient.getPlugin(KEY_ROUTER);
if (Values.ZERO == LOG_FLAG_START.getAndIncrement()) {
LOGGER.info(Info.DY_DETECT, NAME);
}
if (null != clazz && ... | #fixed code
@Override
public void mount(final Router router) {
final Class<?> clazz = ZeroAmbient.getPlugin(PlugRouter.KEY_ROUTER);
if (Values.ZERO == LOG_FLAG_START.getAndIncrement()) {
LOGGER.info(Info.DY_DETECT, NAME);
}
if (null != claz... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
void onData(final Cell cell) {
final DyeCell dyeCell = Fn.pool(this.stylePool, "DATA",
() -> DyeCell.create(this.workbook)
.border(BorderStyle.THIN)
.align(null, VerticalAlignment.TOP)
... | #fixed code
void onTable(final Cell cell) {
final DyeCell dyeCell = Fn.pool(this.stylePool, "TABLE",
() -> DyeCell.create(this.workbook)
.color("FFFFFF", "3EB7FF")
.align(HorizontalAlignment.CENTER)
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
static Object invokeSingle(final Object proxy,
final Method method,
final Envelop envelop) {
final Class<?> argType = method.getParameterTypes()[Values.IDX];
// One type dynamic here
f... | #fixed code
static Object invokeSingle(final Object proxy,
final Method method,
final Envelop envelop) {
final Class<?> argType = method.getParameterTypes()[Values.IDX];
// Append single argument
final ... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
void onData(final Cell cell) {
final DyeCell dye;
if (CellType.NUMERIC == cell.getCellType()) {
/*
* Buf for date exporting here
*/
final double cellValue = cell.getNumericCellValue();
if (Dat... | #fixed code
void onTable(final Cell cell) {
final DyeCell dyeCell = Fn.pool(this.stylePool, "TABLE",
() -> DyeCell.create(this.workbook)
.color("FFFFFF", "3EB7FF")
.align(HorizontalAlignment.CENTER)
... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
private void mountSession(final Router router) {
if (ZeroHeart.isSession()) {
/*
* Session Global for Authorization, replace old mode with
* SessionClient, this client will get SessionStore
* by configuration in... | #fixed code
private void mountSession(final Router router) {
if (ZeroHeart.isSession()) {
/*
* Session Global for Authorization, replace old mode with
* SessionClient, this client will get SessionStore
* by configuration informat... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
public void register(JsonProvider jsonProvider) {
this.registeredJsonProvider = Objects.requireNonNull(jsonProvider);
logger.debug(() -> "Set json provider to " + jsonProvider.getClass().getName());
}
#location 3
... | #fixed code
public void register(JsonProvider jsonProvider) {
this.registeredJsonProvider = Objects.requireNonNull(jsonProvider);
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test
public void testParse_Map1() {
BEParser parser = new BEParser("d4:spaml1:a1:bee");
assertEquals(BEType.MAP, parser.readType());
Map<String, Object> expected = new HashMap<>();
expected.put("spam", Arrays.asList("a", "b"));
... | #fixed code
@Test
public void testParse_Map1() {
BEParser parser = new BEParser("d4:spaml1:a1:bee".getBytes());
assertEquals(BEType.MAP, parser.readType());
byte[][] expected = new byte[][] {"a".getBytes(charset), "b".getBytes(charset)};
Map<String, ... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test(expected = Exception.class)
public void testParse_Integer_Exception_ZeroLength() {
BEParser parser = new BEParser("ie");
assertEquals(BEType.INTEGER, parser.readType());
parser.readInteger();
}
#location... | #fixed code
@Test(expected = Exception.class)
public void testParse_Integer_Exception_ZeroLength() {
BEParser parser = new BEParser("ie".getBytes());
assertEquals(BEType.INTEGER, parser.readType());
parser.readInteger();
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test
public void testParse_String2() {
BEParser parser = new BEParser("11:!@#$%^&*()_");
assertEquals(BEType.STRING, parser.readType());
assertEquals("!@#$%^&*()_", parser.readString());
}
#location 3
... | #fixed code
@Test
public void testParse_String2() {
BEParser parser = new BEParser("11:!@#$%^&*()_".getBytes());
assertEquals(BEType.STRING, parser.readType());
assertEquals("!@#$%^&*()_", parser.readString(charset));
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test(expected = Exception.class)
public void testParse_String_Exception_EmptyString() {
new BEParser("");
}
#location 3
#vulnerability type RESOURCE_LEAK | #fixed code
@Test(expected = Exception.class)
public void testParse_String_Exception_EmptyString() {
new BEParser("".getBytes());
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test
public void testParse_String1() {
BEParser parser = new BEParser("1:s");
assertEquals(BEType.STRING, parser.readType());
assertEquals("s", parser.readString());
}
#location 3
... | #fixed code
@Test
public void testParse_String1() {
BEParser parser = new BEParser("1:s".getBytes());
assertEquals(BEType.STRING, parser.readType());
assertEquals("s", parser.readString(charset));
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test
public void testParse_Integer_Negative() {
BEParser parser = new BEParser("i-1e");
assertEquals(BEType.INTEGER, parser.readType());
assertEquals(BigInteger.ONE.negate(), parser.readInteger());
}
#locatio... | #fixed code
@Test
public void testParse_Integer_Negative() {
BEParser parser = new BEParser("i-1e".getBytes());
assertEquals(BEType.INTEGER, parser.readType());
assertEquals(BigInteger.ONE.negate(), parser.readInteger());
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test
public void testParse_String2() {
BEParser parser = new BEParser("11:!@#$%^&*()_");
assertEquals(BEType.STRING, parser.readType());
assertEquals("!@#$%^&*()_", parser.readString());
}
#location 5
... | #fixed code
@Test
public void testParse_String2() {
BEParser parser = new BEParser("11:!@#$%^&*()_".getBytes());
assertEquals(BEType.STRING, parser.readType());
assertEquals("!@#$%^&*()_", parser.readString(charset));
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test
public void testParse_Integer_Negative() {
BEParser parser = new BEParser("i-1e");
assertEquals(BEType.INTEGER, parser.readType());
assertEquals(BigInteger.ONE.negate(), parser.readInteger());
}
#locatio... | #fixed code
@Test
public void testParse_Integer_Negative() {
BEParser parser = new BEParser("i-1e".getBytes());
assertEquals(BEType.INTEGER, parser.readType());
assertEquals(BigInteger.ONE.negate(), parser.readInteger());
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test(expected = Exception.class)
public void testParse_Integer_Exception_UnexpectedTokens() {
BEParser parser = new BEParser("i-1-e");
assertEquals(BEType.INTEGER, parser.readType());
parser.readInteger();
}
... | #fixed code
@Test(expected = Exception.class)
public void testParse_Integer_Exception_UnexpectedTokens() {
BEParser parser = new BEParser("i-1-e".getBytes());
assertEquals(BEType.INTEGER, parser.readType());
parser.readInteger();
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test(expected = Exception.class)
public void testParse_Integer_Exception_ZeroLength() {
BEParser parser = new BEParser("ie");
assertEquals(BEType.INTEGER, parser.readType());
parser.readInteger();
}
#location... | #fixed code
@Test(expected = Exception.class)
public void testParse_Integer_Exception_ZeroLength() {
BEParser parser = new BEParser("ie".getBytes());
assertEquals(BEType.INTEGER, parser.readType());
parser.readInteger();
} | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test
public void testDescriptors_WriteMultiFile() {
String torrentName = "xyz-torrent";
File torrentDirectory = new File(rootDirectory, torrentName);
String extension = "-multi.bin";
String fileName1 = 1 + extension,
... | #fixed code
@Test
public void testDescriptors_WriteMultiFile() {
String torrentName = "xyz-torrent";
File torrentDirectory = new File(rootDirectory, torrentName);
String extension = "-multi.bin";
String fileName1 = 1 + extension,
fileN... | Below is the vulnerable code, please generate the patch based on the following information. |
#vulnerable code
@Test
public void testParse_Map1() {
BEParser parser = new BEParser("d4:spaml1:a1:bee");
assertEquals(BEType.MAP, parser.readType());
Map<String, Object> expected = new HashMap<>();
expected.put("spam", Arrays.asList("a", "b"));
... | #fixed code
@Test
public void testParse_Map1() {
BEParser parser = new BEParser("d4:spaml1:a1:bee".getBytes());
assertEquals(BEType.MAP, parser.readType());
byte[][] expected = new byte[][] {"a".getBytes(charset), "b".getBytes(charset)};
Map<String, ... | Below is the vulnerable code, please generate the patch based on the following information. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.