bug fix de erro na compilacao

This commit is contained in:
Gustavo committed 2026-10-01 10:42:49 -03:00
1 parent 4cc07a3754
commit 67813e4881
16 files changed
+24 -13

No files matched your search

+4 -3
View File
@@ -1,15 +1,16 @@
JAR = ../pitiupi/dist/pitiupi.jar JAR = ../pitiupi/dist/pitiupi.jar
OUT_DIR = /out OUT_DIR = out
META-INF_DIR = src/META-INF META-INF_DIR = src/META-INF
DIST = dist/mpChat.jar DIST = dist/mpChat.jar
SOURCES = $(shell find -name "*.java") SOURCES = $(shell find -name "*.java")
all: all:
mkdir -p $(OUT_DIR) mkdir -p "$(OUT_DIR)"
mkdir -p "$(dir $(DIST))"
javac -cp "$(JAR)" -d "$(OUT_DIR)" $(SOURCES) javac -cp "$(JAR)" -d "$(OUT_DIR)" $(SOURCES)
cp -r "$(META-INF_DIR)" "$(OUT_DIR)" cp -r "$(META-INF_DIR)" "$(OUT_DIR)"
jar cf "$(DIST)" -C "$(OUT_DIR)" . jar cf "$(DIST)" -C "$(OUT_DIR)" .
clean: clean:
rm -rf "$(OUT_DIR)"/* rm -rf "$(OUT_DIR)"/*
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -13,12 +13,12 @@ public class ChatMenu extends JMenu {
this.setText("MP-Chat"); this.setText("MP-Chat");
JMenuItem startPrivateChat = new JMenuItem("start Private Chat"); JMenuItem startPrivateChat = new JMenuItem("start Private Chat");
startPrivateChat.addActionListener(_ -> showPrivateChatDialog()); startPrivateChat.addActionListener(e -> showPrivateChatDialog());
this.add(startPrivateChat); this.add(startPrivateChat);
} }
public void newMenuItem(JMenuItem newMenuItem, ChatWindow chatWindow) { public void newMenuItem(JMenuItem newMenuItem, ChatWindow chatWindow) {
newMenuItem.addActionListener(_ -> chatWindow.setVisible(true)); newMenuItem.addActionListener(e -> chatWindow.setVisible(true));
this.add(newMenuItem); this.add(newMenuItem);
} }
@@ -14,9 +14,8 @@ public class PrivateChatWindow extends ChatWindow {
private final TcpConnection connection; private final TcpConnection connection;
public PrivateChatWindow(ConnectionManager ConnectionManager, TcpConnection connection) { public PrivateChatWindow(ConnectionManager ConnectionManager, TcpConnection connection) {
this.connection = connection;
super(ConnectionManager); super(ConnectionManager);
this.connection = connection;
} }
@Override @Override
@@ -41,4 +40,4 @@ public class PrivateChatWindow extends ChatWindow {
Logger.getLogger(PrivateChatWindow.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(PrivateChatWindow.class.getName()).log(Level.SEVERE, null, ex);
} }
} }
} }
Binary file not shown.
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
+2 -2
View File
@@ -46,8 +46,8 @@ javac.modulepath=
javac.processormodulepath= javac.processormodulepath=
javac.processorpath=\ javac.processorpath=\
${javac.classpath} ${javac.classpath}
javac.source=25 javac.source=17
javac.target=25 javac.target=17
javac.test.classpath=\ javac.test.classpath=\
${javac.classpath}:\ ${javac.classpath}:\
${build.classes.dir} ${build.classes.dir}
+1 -1
View File
@@ -116,7 +116,7 @@ public class MainWindow extends javax.swing.JFrame {
} }
private void updateStatus() { private void updateStatus() {
this.status.setText("Connected on port " + connectionManager.getUserPort() + " name " + connectionManager.getUserName()); this.status.setText("Connected on port " + connectionManager.getPort() + " name " + connectionManager.getUserName());
} }
} }
@@ -56,7 +56,7 @@ public class ConnectionManager {
try { try {
socketUDP.sendMulticast(message); socketUDP.sendMulticast(message);
return true; return true;
} catch (Exception _) { } catch (Exception e) {
System.err.println("Error sending UDP Multicast"); System.err.println("Error sending UDP Multicast");
} }
return false; return false;
@@ -65,7 +65,7 @@ class TcpConnectionManager implements PeerListener {
*/ */
public void addPrivateConnection(TcpConnection connection) { public void addPrivateConnection(TcpConnection connection) {
List<TcpConnection> connections = List<TcpConnection> connections =
privateConnections.computeIfAbsent(connection.getAddress(), _ -> new ArrayList<>()); privateConnections.computeIfAbsent(connection.getAddress(), e -> new ArrayList<>());
synchronized (connections) { synchronized (connections) {
connections.add(connection); connections.add(connection);