Skip to content

842 incomplete trailing escape #894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
import com.magento.idea.magento2plugin.magento.packages.File;
import com.magento.idea.magento2plugin.util.GetFirstClassOfFile;
import com.magento.idea.magento2plugin.util.GetPhpClassByFQN;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import javax.swing.JOptionPane;

public class MessageQueueClassGenerator extends FileGenerator {

private final MessageQueueClassData messageQueueClassDataName;
private final Project project;
private final DirectoryGenerator directoryGenerator;
Expand All @@ -33,6 +36,7 @@ public class MessageQueueClassGenerator extends FileGenerator {
private final CommonBundle commonBundle;
private final String moduleName;
private final GetFirstClassOfFile getFirstClassOfFile;
private final List<String> errors = new ArrayList<>();

/**
* Message queue handler constructor.
Expand Down Expand Up @@ -68,40 +72,34 @@ public PsiFile generate(final String actionName) {
);

if (handler != null) {
final String errorMessage = this.validatorBundle.message(
errors.add(validatorBundle.message(
"validator.file.alreadyExists",
"Handler Class"
);
JOptionPane.showMessageDialog(
null,
errorMessage,
commonBundle.message("common.error"),
JOptionPane.ERROR_MESSAGE
);

));
return;
}

handler = createHandlerClass(actionName);

if (handler == null) {
final String errorMessage = this.validatorBundle.message(
errors.add(validatorBundle.message(
"validator.file.cantBeCreated",
"Handler Class"
);
JOptionPane.showMessageDialog(
null,
errorMessage,
commonBundle.message("common.error"),
JOptionPane.ERROR_MESSAGE
);

));
return;
}

handlerFiles[0] = handler.getContainingFile();
});

for (final String errorMessage : errors) {
JOptionPane.showMessageDialog(
null,
errorMessage,
commonBundle.message("common.error"),
JOptionPane.ERROR_MESSAGE
);
}

return handlerFiles[0];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,22 @@ public static String buildNewBugReportBody(
if (encode(stackTrace).length() <= maxAllowedStackTraceLength) {
return buildTemplate(project, bugDescription, stackTrace);
}
boolean isFound = false;
int step = 1;
String encodedCutStackTrace = "";

while (!isFound) {
final String cutStackTrace = stackTrace.substring(0, maxAllowedStackTraceLength - step);
encodedCutStackTrace = encode(cutStackTrace);

if (encodedCutStackTrace.length() <= maxAllowedStackTraceLength) {
isFound = true;
} else {
step += 10;
}
}

final String cutStackTrace = encode(stackTrace).substring(
0,
maxAllowedStackTraceLength - 1
);

return buildTemplate(project, bugDescription, decode(cutStackTrace));
return buildTemplate(project, bugDescription, decode(encodedCutStackTrace));
}

/**
Expand Down